From e0989d219cfd3898a077f8a84229d94e519ef5c4 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 30 May 2023 22:20:49 -0500 Subject: [PATCH 01/93] chore: rename and cleanup simple examples - use lib in examples via workspace protocol - add examples folder to pnpm workspaces - lib: add dist folder to package.json exports explicitly --- ...st-iife.html => browser-iife-example.html} | 9 + ...test-mjs.html => browser-mjs-example.html} | 11 ++ ...test-umd.html => browser-umd-example.html} | 9 + .../simple-examples/getResponseVariables.mjs | 160 ------------------ examples/simple-examples/nhtsa-test-es.html | 129 -------------- .../simple-examples/nhtsa-test-umd-cjs.js | 17 -- examples/simple-examples/nhtsa-test.cjs | 13 -- examples/simple-examples/nhtsa-test.js | 14 -- examples/simple-examples/nhtsa-test.mjs | 9 - examples/simple-examples/node-cjs-example.cjs | 15 ++ examples/simple-examples/node-mjs-example.mjs | 12 ++ examples/simple-examples/node-umd-example.cjs | 21 +++ examples/simple-examples/node-umd-example.mjs | 24 +++ examples/simple-examples/package.json | 10 ++ package.json | 1 + packages/lib/package.json | 3 +- pnpm-workspace.yaml | 9 +- 17 files changed, 119 insertions(+), 347 deletions(-) rename examples/simple-examples/{nhtsa-test-iife.html => browser-iife-example.html} (79%) rename examples/simple-examples/{nhtsa-test-mjs.html => browser-mjs-example.html} (78%) rename examples/simple-examples/{nhtsa-test-umd.html => browser-umd-example.html} (79%) delete mode 100644 examples/simple-examples/getResponseVariables.mjs delete mode 100644 examples/simple-examples/nhtsa-test-es.html delete mode 100755 examples/simple-examples/nhtsa-test-umd-cjs.js delete mode 100644 examples/simple-examples/nhtsa-test.cjs delete mode 100755 examples/simple-examples/nhtsa-test.js delete mode 100755 examples/simple-examples/nhtsa-test.mjs create mode 100644 examples/simple-examples/node-cjs-example.cjs create mode 100755 examples/simple-examples/node-mjs-example.mjs create mode 100755 examples/simple-examples/node-umd-example.cjs create mode 100755 examples/simple-examples/node-umd-example.mjs create mode 100644 examples/simple-examples/package.json 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..e011e82b 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "workspaces": [ "apps/*", "config/*", + "examples/*", "packages/*" ], "engines": { diff --git a/packages/lib/package.json b/packages/lib/package.json index d15f7cf8..8e42e951 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -53,7 +53,8 @@ }, "require": "./dist/nhtsa-api-wrapper.cjs" }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./dist/*": "./dist/*" }, "publishConfig": { "access": "public" 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/**" From d18e6cde76c116c5233fe529bb49d72e92d02251 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 30 May 2023 22:25:31 -0500 Subject: [PATCH 02/93] chore(deps): update pnpm to v8.6.0 --- package.json | 4 +- pnpm-lock.yaml | 134 +++++++++++++++---------------------------------- 2 files changed, 43 insertions(+), 95 deletions(-) diff --git a/package.json b/package.json index e011e82b..bcd46cb7 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "bugs": { "url": "https://github.com/ShaggyTech/nhtsa-api-wrapper/issues" }, - "packageManager": "pnpm@8.1.0", + "packageManager": "pnpm@8.6.0", "workspaces": [ "apps/*", "config/*", @@ -22,7 +22,7 @@ ], "engines": { "node": ">=18.13.0", - "pnpm": ">=7.27.1" + "pnpm": ">=8.6.0" }, "scripts": { "preinstall": "npx only-allow pnpm", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bae16c76..af34ab57 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,8 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false importers: @@ -73,10 +77,10 @@ importers: version: 5.0.4 vite-plugin-pwa: specifier: 0.15.1 - version: 0.15.1(workbox-window@6.6.0) + version: 0.15.1(vite@4.3.9)(workbox-build@6.6.0)(workbox-window@6.6.0) vitepress: specifier: 1.0.0-beta.1 - version: 1.0.0-beta.1(@types/node@18.13.0)(sass@1.62.1) + version: 1.0.0-beta.1(@algolia/client-search@4.17.1)(@types/node@18.13.0)(sass@1.62.1) workbox-window: specifier: 6.6.0 version: 6.6.0 @@ -133,6 +137,12 @@ importers: specifier: 5.0.4 version: 5.0.4 + examples/simple-examples: + dependencies: + '@shaggytools/nhtsa-api-wrapper': + specifier: workspace:* + version: link:../../packages/lib + packages/lib: devDependencies: '@vitest/coverage-c8': @@ -170,10 +180,10 @@ importers: version: 5.0.4 vite: specifier: 4.3.9 - version: 4.3.9 + version: 4.3.9(@types/node@18.13.0)(sass@1.62.1) vite-plugin-dts: specifier: 2.3.0 - version: 2.3.0(vite@4.3.9) + version: 2.3.0(@types/node@20.2.5)(vite@4.3.9) vite-tsconfig-paths: specifier: 4.2.0 version: 4.2.0(typescript@5.0.4)(vite@4.3.9) @@ -192,13 +202,14 @@ packages: '@algolia/autocomplete-shared': 1.8.2 dev: true - /@algolia/autocomplete-preset-algolia@1.8.2(algoliasearch@4.17.1): + /@algolia/autocomplete-preset-algolia@1.8.2(@algolia/client-search@4.17.1)(algoliasearch@4.17.1): resolution: {integrity: sha512-J0oTx4me6ZM9kIKPuL3lyU3aB8DEvpVvR6xWmHVROx5rOYJGQcZsdG4ozxwcOyiiu3qxMkIbzntnV1S1VWD8yA==} peerDependencies: '@algolia/client-search': '>= 4.9.1 < 6' algoliasearch: '>= 4.9.1 < 6' dependencies: '@algolia/autocomplete-shared': 1.8.2 + '@algolia/client-search': 4.17.1 algoliasearch: 4.17.1 dev: true @@ -1891,10 +1902,10 @@ packages: resolution: {integrity: sha512-Hg8Xfma+rFwRi6Y/pfei4FJoQ1hdVURmmNs/XPoMTCPAImU+d5yxj+M+qdLtNjWRpfWziU4dQcqY94xgFBn2dg==} dev: true - /@docsearch/js@3.4.0: + /@docsearch/js@3.4.0(@algolia/client-search@4.17.1): resolution: {integrity: sha512-uOtOHZJv+5PQmL68+srVzlGhLejnEBJgZl1bR87Zh/uK5RUI7p6el1R8hGTl2F8K2tCloNRxTMtXyYUNbMV+qw==} dependencies: - '@docsearch/react': 3.4.0 + '@docsearch/react': 3.4.0(@algolia/client-search@4.17.1) preact: 10.15.0 transitivePeerDependencies: - '@algolia/client-search' @@ -1903,7 +1914,7 @@ packages: - react-dom dev: true - /@docsearch/react@3.4.0: + /@docsearch/react@3.4.0(@algolia/client-search@4.17.1): resolution: {integrity: sha512-ufrp5879XYGojgS30ZAp8H4qIMbahRHB9M85VDBP36Xgz5QjYM54i1URKj5e219F7gqTtOivfztFTij6itc0MQ==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' @@ -1918,7 +1929,7 @@ packages: optional: true dependencies: '@algolia/autocomplete-core': 1.8.2 - '@algolia/autocomplete-preset-algolia': 1.8.2(algoliasearch@4.17.1) + '@algolia/autocomplete-preset-algolia': 1.8.2(@algolia/client-search@4.17.1)(algoliasearch@4.17.1) '@docsearch/css': 3.4.0 algoliasearch: 4.17.1 transitivePeerDependencies: @@ -2262,24 +2273,24 @@ packages: read-yaml-file: 1.1.0 dev: true - /@microsoft/api-extractor-model@7.27.0: + /@microsoft/api-extractor-model@7.27.0(@types/node@20.2.5): resolution: {integrity: sha512-wHqIMiwSARmiuVLn/zmVpiRncq6hvBfC5GF+sjrN3w4FqVkqFYk7DetvfRNdy/3URdqqmYGrhJlcU9HpLnHOPg==} dependencies: '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.1 + '@rushstack/node-core-library': 3.59.1(@types/node@20.2.5) transitivePeerDependencies: - '@types/node' dev: true - /@microsoft/api-extractor@7.35.0: + /@microsoft/api-extractor@7.35.0(@types/node@20.2.5): resolution: {integrity: sha512-yBGfPJeEtzk8sg2hE2/vOPRvnJBvstbWNGeyGV1jIEUSgytzQ0QPgPEkOsP2n7nBfnyRXmZaBa2vJPGOzVWy+g==} hasBin: true dependencies: - '@microsoft/api-extractor-model': 7.27.0 + '@microsoft/api-extractor-model': 7.27.0(@types/node@20.2.5) '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.1 + '@rushstack/node-core-library': 3.59.1(@types/node@20.2.5) '@rushstack/rig-package': 0.3.19 '@rushstack/ts-command-line': 4.13.3 colors: 1.2.5 @@ -2402,7 +2413,7 @@ packages: picomatch: 2.3.1 dev: true - /@rushstack/node-core-library@3.59.1: + /@rushstack/node-core-library@3.59.1(@types/node@20.2.5): resolution: {integrity: sha512-iy/xaEhXGpX+DY1ZzAtNA+QPw+9+TJh773Im+JxG4R1fu00/vWq470UOEj6upxlUxmp0JxhnmNRxzfptHrn/Uw==} peerDependencies: '@types/node': '*' @@ -2410,6 +2421,7 @@ packages: '@types/node': optional: true dependencies: + '@types/node': 20.2.5 colors: 1.2.5 fs-extra: 7.0.1 import-lazy: 4.0.0 @@ -2705,7 +2717,7 @@ packages: peerDependencies: vite-plugin-pwa: ^0.14.0 dependencies: - vite-plugin-pwa: 0.15.1(workbox-window@6.6.0) + vite-plugin-pwa: 0.15.1(vite@4.3.9)(workbox-build@6.6.0)(workbox-window@6.6.0) dev: true /@vitejs/plugin-vue@4.2.3(vite@4.3.9)(vue@3.3.4): @@ -6571,7 +6583,7 @@ packages: mlly: 1.3.0 pathe: 1.1.0 picocolors: 1.0.0 - vite: 4.3.9(@types/node@20.2.5) + vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) transitivePeerDependencies: - '@types/node' - less @@ -6582,42 +6594,43 @@ packages: - terser dev: true - /vite-plugin-dts@2.3.0(vite@4.3.9): + /vite-plugin-dts@2.3.0(@types/node@20.2.5)(vite@4.3.9): resolution: {integrity: sha512-WbJgGtsStgQhdm3EosYmIdTGbag5YQpZ3HXWUAPCDyoXI5qN6EY0V7NXq0lAmnv9hVQsvh0htbYcg0Or5Db9JQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: '>=2.9.0' dependencies: '@babel/parser': 7.22.0 - '@microsoft/api-extractor': 7.35.0 + '@microsoft/api-extractor': 7.35.0(@types/node@20.2.5) '@rollup/pluginutils': 5.0.2 - '@rushstack/node-core-library': 3.59.1 + '@rushstack/node-core-library': 3.59.1(@types/node@20.2.5) 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 + vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) transitivePeerDependencies: - '@types/node' - rollup - supports-color dev: true - /vite-plugin-pwa@0.15.1(workbox-window@6.6.0): + /vite-plugin-pwa@0.15.1(vite@4.3.9)(workbox-build@6.6.0)(workbox-window@6.6.0): resolution: {integrity: sha512-lJVzEYda/Y9AfwxFzX0rV+QCQ2+WdBoEGtR1RBZKWxvrJ4NWEH1VZaHOMyzvRiYhWQsi7aFhewsp1CDvN/R1Og==} peerDependencies: vite: ^3.1.0 || ^4.0.0 + workbox-build: ^6.5.4 workbox-window: ^6.5.4 dependencies: debug: 4.3.4 fast-glob: 3.2.12 pretty-bytes: 6.1.0 + vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) workbox-build: 6.6.0 workbox-window: 6.6.0 transitivePeerDependencies: - - '@types/babel__core' - supports-color dev: true @@ -6632,44 +6645,12 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.1(typescript@5.0.4) - vite: 4.3.9 + vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.3.9: - 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: - 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} @@ -6704,45 +6685,12 @@ packages: fsevents: 2.3.2 dev: true - /vite@4.3.9(@types/node@20.2.5): - 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: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - 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): + /vitepress@1.0.0-beta.1(@algolia/client-search@4.17.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 + '@docsearch/js': 3.4.0(@algolia/client-search@4.17.1) '@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) @@ -6845,7 +6793,7 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.5.0 - vite: 4.3.9(@types/node@20.2.5) + vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) vite-node: 0.31.1(@types/node@20.2.5) why-is-node-running: 2.2.2 transitivePeerDependencies: From 5369d9967bd219abe990d9188953dca34a2640b4 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Sun, 22 Oct 2023 00:33:46 -0500 Subject: [PATCH 03/93] docs(components): add simple VinDecoder component --- .../theme/components/VinDecoder.vue | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 apps/docs/.vitepress/theme/components/VinDecoder.vue 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 @@ + + + From ca842787c365c77e3bdad5639d6551a41a3363b4 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Sun, 22 Oct 2023 00:43:16 -0500 Subject: [PATCH 04/93] fix(output): fix export file paths in package.json --- packages/lib/package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/lib/package.json b/packages/lib/package.json index 8e42e951..dd2ee063 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" ], From 4a6237ee31f80cc8a5f0446d6c61034ad0281a10 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Oct 2023 17:08:30 +0000 Subject: [PATCH 05/93] chore(deps): update pnpm to v8.9.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bcd46cb7..ad9a3813 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "bugs": { "url": "https://github.com/ShaggyTech/nhtsa-api-wrapper/issues" }, - "packageManager": "pnpm@8.6.0", + "packageManager": "pnpm@8.9.2", "workspaces": [ "apps/*", "config/*", From 571840bb3c8470bed7e17152b100f09e170aa326 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Oct 2023 17:08:32 +0000 Subject: [PATCH 06/93] chore(deps): update pnpm/action-setup action to v2.4.0 --- .github/workflows/setup/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setup/action.yaml b/.github/workflows/setup/action.yaml index 4469f330..4fdcfae1 100644 --- a/.github/workflows/setup/action.yaml +++ b/.github/workflows/setup/action.yaml @@ -5,7 +5,7 @@ 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 From 28ba6569d7593f14b5b7955729b19b49b5b98fe0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Oct 2023 17:09:04 +0000 Subject: [PATCH 07/93] chore(deps): update vitest monorepo --- packages/lib/package.json | 6 +- pnpm-lock.yaml | 306 ++++++++++++++++++-------------------- 2 files changed, 151 insertions(+), 161 deletions(-) diff --git a/packages/lib/package.json b/packages/lib/package.json index dd2ee063..716067d7 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -78,8 +78,8 @@ "clean:all": "pnpm run clean && rimraf node_modules" }, "devDependencies": { - "@vitest/coverage-c8": "0.31.1", - "@vitest/ui": "0.31.1", + "@vitest/coverage-c8": "0.33.0", + "@vitest/ui": "0.34.6", "eslint": "8.41.0", "eslint-config-custom": "workspace:*", "prettier": "2.8.8", @@ -92,7 +92,7 @@ "vite": "4.3.9", "vite-plugin-dts": "2.3.0", "vite-tsconfig-paths": "4.2.0", - "vitest": "0.31.1", + "vitest": "0.34.6", "vitest-fetch-mock": "0.2.2" }, "eslintConfig": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index af34ab57..d80e2211 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -146,11 +146,11 @@ importers: packages/lib: devDependencies: '@vitest/coverage-c8': - specifier: 0.31.1 - version: 0.31.1(vitest@0.31.1) + specifier: 0.33.0 + version: 0.33.0(vitest@0.34.6) '@vitest/ui': - specifier: 0.31.1 - version: 0.31.1(vitest@0.31.1) + specifier: 0.34.6 + version: 0.34.6(vitest@0.34.6) eslint: specifier: 8.41.0 version: 8.41.0 @@ -188,11 +188,11 @@ importers: specifier: 4.2.0 version: 4.2.0(typescript@5.0.4)(vite@4.3.9) vitest: - specifier: 0.31.1 - version: 0.31.1(@vitest/ui@0.31.1) + specifier: 0.34.6 + version: 0.34.6(@vitest/ui@0.34.6) vitest-fetch-mock: specifier: 0.2.2 - version: 0.2.2(vitest@0.31.1) + version: 0.2.2(vitest@0.34.6) packages: @@ -637,6 +637,7 @@ packages: /@babel/plugin-proposal-private-property-in-object@7.21.0(@babel/core@7.22.1): resolution: {integrity: sha512-ha4zfehbJjc5MmXBlHec1igel5TJXXLDDRbuJ4+XT2TJcyD9/V1919BA8gMvsdHcNMBy4WBUBiRb3nw/EQUtBw==} engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead. peerDependencies: '@babel/core': ^7.0.0-0 dependencies: @@ -652,6 +653,7 @@ packages: /@babel/plugin-proposal-unicode-property-regex@7.18.6(@babel/core@7.22.1): resolution: {integrity: sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==} engines: {node: '>=4'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead. peerDependencies: '@babel/core': ^7.0.0-0 dependencies: @@ -2201,6 +2203,13 @@ 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'} @@ -2447,6 +2456,10 @@ 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: @@ -2459,7 +2472,7 @@ packages: /@ts-morph/common@0.19.0: resolution: {integrity: sha512-Unz/WHmd4pGax91rdIKWi51wnVUW11QttMEPpBiBgIewnc9UQIX7UDLxr5vRlqeByXCwhkF6VabSsI0raWcyAQ==} dependencies: - fast-glob: 3.2.12 + fast-glob: 3.3.1 minimatch: 7.4.6 mkdirp: 2.1.6 path-browserify: 1.0.1 @@ -2731,71 +2744,71 @@ packages: vue: 3.3.4 dev: true - /@vitest/coverage-c8@0.31.1(vitest@0.31.1): - resolution: {integrity: sha512-6TkjQpmgYez7e3dbAUoYdRXxWN81BojCmUILJwgCy39uZFG33DsQ0rSRSZC9beAEdCZTpxR63nOvd9hxDQcJ0g==} + /@vitest/coverage-c8@0.33.0(vitest@0.34.6): + resolution: {integrity: sha512-DaF1zJz4dcOZS4k/neiQJokmOWqsGXwhthfmUdPGorXIQHjdPvV6JQSYhQDI41MyI8c+IieQUdIDs5XAMHtDDw==} + deprecated: v8 coverage is moved to @vitest/coverage-v8 package peerDependencies: vitest: '>=0.30.0 <1' dependencies: '@ampproject/remapping': 2.2.1 - c8: 7.13.0 - magic-string: 0.30.0 + c8: 7.14.0 + magic-string: 0.30.5 picocolors: 1.0.0 std-env: 3.3.3 - vitest: 0.31.1(@vitest/ui@0.31.1) + vitest: 0.34.6(@vitest/ui@0.34.6) dev: true - /@vitest/expect@0.31.1: - resolution: {integrity: sha512-BV1LyNvhnX+eNYzJxlHIGPWZpwJFZaCcOIzp2CNG0P+bbetenTupk6EO0LANm4QFt0TTit+yqx7Rxd1qxi/SQA==} + /@vitest/expect@0.34.6: + resolution: {integrity: sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==} dependencies: - '@vitest/spy': 0.31.1 - '@vitest/utils': 0.31.1 - chai: 4.3.7 + '@vitest/spy': 0.34.6 + '@vitest/utils': 0.34.6 + chai: 4.3.10 dev: true - /@vitest/runner@0.31.1: - resolution: {integrity: sha512-imWuc82ngOtxdCUpXwtEzZIuc1KMr+VlQ3Ondph45VhWoQWit5yvG/fFcldbnCi8DUuFi+NmNx5ehMUw/cGLUw==} + /@vitest/runner@0.34.6: + resolution: {integrity: sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==} dependencies: - '@vitest/utils': 0.31.1 - concordance: 5.0.4 + '@vitest/utils': 0.34.6 p-limit: 4.0.0 - pathe: 1.1.0 + pathe: 1.1.1 dev: true - /@vitest/snapshot@0.31.1: - resolution: {integrity: sha512-L3w5uU9bMe6asrNzJ8WZzN+jUTX4KSgCinEJPXyny0o90fG4FPQMV0OWsq7vrCWfQlAilMjDnOF9nP8lidsJ+g==} + /@vitest/snapshot@0.34.6: + resolution: {integrity: sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==} 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@0.34.6: + resolution: {integrity: sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==} 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@0.34.6(vitest@0.34.6): + resolution: {integrity: sha512-/fxnCwGC0Txmr3tF3BwAbo3v6U2SkBTGR9UB8zo0Ztlx0BTOXHucE0gDHY7SjwEktCOHatiGmli9kZD6gYSoWQ==} peerDependencies: vitest: '>=0.30.1 <1' dependencies: - '@vitest/utils': 0.31.1 - fast-glob: 3.2.12 - fflate: 0.7.4 + '@vitest/utils': 0.34.6 + fast-glob: 3.3.1 + fflate: 0.8.1 flatted: 3.2.7 - pathe: 1.1.0 + pathe: 1.1.1 picocolors: 1.0.0 sirv: 2.0.3 - vitest: 0.31.1(@vitest/ui@0.31.1) + vitest: 0.34.6(@vitest/ui@0.34.6) dev: true - /@vitest/utils@0.31.1: - resolution: {integrity: sha512-yFyRD5ilwojsZfo3E0BnH72pSVSuLg2356cN1tCEe/0RtDzxTPYwOomIC+eQbot7m6DRy4tPZw+09mB7NkbMmA==} + /@vitest/utils@0.34.6: + resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==} dependencies: - concordance: 5.0.4 + diff-sequences: 29.6.3 loupe: 2.3.6 - pretty-format: 27.5.1 + pretty-format: 29.7.0 dev: true /@vue/compiler-core@3.3.4: @@ -2822,7 +2835,7 @@ packages: '@vue/reactivity-transform': 3.3.4 '@vue/shared': 3.3.4 estree-walker: 2.0.2 - magic-string: 0.30.0 + magic-string: 0.30.5 postcss: 8.4.23 source-map-js: 1.0.2 @@ -2843,7 +2856,7 @@ packages: '@vue/compiler-core': 3.3.4 '@vue/shared': 3.3.4 estree-walker: 2.0.2 - magic-string: 0.30.0 + magic-string: 0.30.5 /@vue/reactivity@3.3.4: resolution: {integrity: sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==} @@ -2958,22 +2971,28 @@ 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.10.0: + resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} + engines: {node: '>=0.4.0'} + hasBin: true + /acorn@8.8.2: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} hasBin: true + dev: true /ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} @@ -3176,10 +3195,6 @@ packages: 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 @@ -3228,8 +3243,8 @@ packages: engines: {node: '>=6'} dev: true - /c8@7.13.0: - resolution: {integrity: sha512-/NL4hQTv1gBL6J6ei80zu3IiTrmePDKXKXOTLpHvcIWZTVYQlDhVWjjWvkhICylE8EwwnMVzDZugCvdx0/DIIA==} + /c8@7.14.0: + resolution: {integrity: sha512-i04rtkkcNcCf7zsQcSv/T9EbUn4RXQ6mropeMcjFOsQXQ0iGLAr/xT6TImQg4+U9hmNpN9XdvPkjUL1IzbgxJw==} engines: {node: '>=10.12.0'} hasBin: true dependencies: @@ -3281,14 +3296,14 @@ packages: resolution: {integrity: sha512-x1mgZEXK8jHIfAxm+xgdpHpk50IN3z3q3zP261/WS+uvePxW8izXuCu6AHz0lkuYTlATDehiZ/tNyYBdSQsOUQ==} dev: true - /chai@4.3.7: - resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==} + /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 + get-func-name: 2.0.2 loupe: 2.3.6 pathval: 1.1.1 type-detect: 4.0.8 @@ -3326,8 +3341,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: @@ -3434,20 +3451,6 @@ packages: /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'} @@ -3576,13 +3579,6 @@ 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 - dev: true - /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -3641,6 +3637,11 @@ packages: engines: {node: '>=8'} 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'} @@ -3923,8 +3924,8 @@ packages: resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==} 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) + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) eslint-visitor-keys: 3.4.1 /esprima@4.0.1: @@ -4000,10 +4001,6 @@ 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.2.12: resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} engines: {node: '>=8.6.0'} @@ -4013,6 +4010,17 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 + 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-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -4025,8 +4033,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: @@ -4196,6 +4204,10 @@ packages: resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} dev: true + /get-func-name@2.0.2: + resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} + dev: true + /get-intrinsic@1.2.1: resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==} dependencies: @@ -4299,7 +4311,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 @@ -4740,11 +4752,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 @@ -4990,8 +4997,8 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /magic-string@0.30.0: - resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==} + /magic-string@0.30.5: + resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==} engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 @@ -5027,13 +5034,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: @@ -5177,13 +5177,13 @@ packages: 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.10.0 + pathe: 1.1.1 pkg-types: 1.0.3 - ufo: 1.1.2 + ufo: 1.3.1 dev: true /mrmime@1.0.1: @@ -5417,8 +5417,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: @@ -5448,8 +5448,8 @@ 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: @@ -5500,13 +5500,13 @@ packages: 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 /pseudomap@1.0.2: @@ -5536,8 +5536,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: @@ -6101,7 +6101,7 @@ packages: /strip-literal@1.0.1: resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==} dependencies: - acorn: 8.8.2 + acorn: 8.10.0 dev: true /supports-color@5.5.0: @@ -6152,7 +6152,7 @@ packages: hasBin: true dependencies: '@jridgewell/source-map': 0.3.3 - acorn: 8.8.2 + acorn: 8.10.0 commander: 2.20.3 source-map-support: 0.5.21 dev: true @@ -6184,22 +6184,17 @@ 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==} dev: true - /tinypool@0.5.0: - resolution: {integrity: sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==} + /tinypool@0.7.0: + resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==} 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 @@ -6456,8 +6451,8 @@ packages: engines: {node: '>=12.20'} hasBin: true - /ufo@1.1.2: - resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} + /ufo@1.3.1: + resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} dev: true /uglify-js@3.17.4: @@ -6573,15 +6568,15 @@ packages: engines: {node: '>= 0.10'} dev: true - /vite-node@0.31.1(@types/node@20.2.5): - resolution: {integrity: sha512-BajE/IsNQ6JyizPzu9zRgHrBwczkAs0erQf/JRpgTIESpKvNj9/Gd0vxX905klLkb0I0SJVCKbdrl5c6FnqYKA==} + /vite-node@0.34.6(@types/node@18.15.11): + resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} engines: {node: '>=v14.18.0'} hasBin: true dependencies: cac: 6.7.14 debug: 4.3.4 - mlly: 1.3.0 - pathe: 1.1.0 + mlly: 1.4.2 + pathe: 1.1.1 picocolors: 1.0.0 vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) transitivePeerDependencies: @@ -6727,20 +6722,20 @@ packages: - universal-cookie dev: true - /vitest-fetch-mock@0.2.2(vitest@0.31.1): + /vitest-fetch-mock@0.2.2(vitest@0.34.6): 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: 0.34.6(@vitest/ui@0.34.6) transitivePeerDependencies: - encoding dev: true - /vitest@0.31.1(@vitest/ui@0.31.1): - resolution: {integrity: sha512-/dOoOgzoFk/5pTvg1E65WVaobknWREN15+HF+0ucudo3dDG/vCZoXTQrjIfEaWvQXmqScwkRodrTbM/ScMpRcQ==} + /vitest@0.34.6(@vitest/ui@0.34.6): + resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==} engines: {node: '>=v14.18.0'} hasBin: true peerDependencies: @@ -6772,29 +6767,28 @@ packages: 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 + '@types/node': 18.15.11 + '@vitest/expect': 0.34.6 + '@vitest/runner': 0.34.6 + '@vitest/snapshot': 0.34.6 + '@vitest/spy': 0.34.6 + '@vitest/ui': 0.34.6(vitest@0.34.6) + '@vitest/utils': 0.34.6 + acorn: 8.10.0 acorn-walk: 8.2.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 + 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 + tinypool: 0.7.0 vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) - vite-node: 0.31.1(@types/node@20.2.5) + vite-node: 0.34.6(@types/node@18.15.11) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -6851,11 +6845,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: @@ -6997,6 +6986,7 @@ packages: /workbox-cacheable-response@6.6.0: resolution: {integrity: sha512-JfhJUSQDwsF1Xv3EV1vWzSsCOZn4mQ38bWEBR3LdvOxSPgB65gAM6cS2CX8rkkKHRgiLrN7Wxoyu+TuH67kHrw==} + deprecated: workbox-background-sync@6.6.0 dependencies: workbox-core: 6.6.0 dev: true From ccbbecb2871bf659233761aa4ec62a7dcfec0f65 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Oct 2023 17:10:41 +0000 Subject: [PATCH 08/93] fix(deps): update typescript-eslint monorepo to v5.62.0 --- config/eslint-config-custom/package.json | 4 +- pnpm-lock.yaml | 80 +++++++++++++----------- 2 files changed, 44 insertions(+), 40 deletions(-) diff --git a/config/eslint-config-custom/package.json b/config/eslint-config-custom/package.json index ee149fec..9d66f460 100644 --- a/config/eslint-config-custom/package.json +++ b/config/eslint-config-custom/package.json @@ -5,8 +5,8 @@ "private": true, "main": "eslint-config.js", "dependencies": { - "@typescript-eslint/eslint-plugin": "5.59.7", - "@typescript-eslint/parser": "5.59.7", + "@typescript-eslint/eslint-plugin": "5.62.0", + "@typescript-eslint/parser": "5.62.0", "eslint": "8.41.0", "eslint-config-prettier": "8.8.0", "eslint-plugin-markdown": "3.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index af34ab57..49a47225 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -88,11 +88,11 @@ importers: 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: 5.62.0 + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.41.0)(typescript@5.0.4) '@typescript-eslint/parser': - specifier: 5.59.7 - version: 5.59.7(eslint@8.41.0)(typescript@5.0.4) + specifier: 5.62.0 + version: 5.62.0(eslint@8.41.0)(typescript@5.0.4) eslint: specifier: 8.41.0 version: 8.41.0 @@ -637,6 +637,7 @@ packages: /@babel/plugin-proposal-private-property-in-object@7.21.0(@babel/core@7.22.1): resolution: {integrity: sha512-ha4zfehbJjc5MmXBlHec1igel5TJXXLDDRbuJ4+XT2TJcyD9/V1919BA8gMvsdHcNMBy4WBUBiRb3nw/EQUtBw==} engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead. peerDependencies: '@babel/core': ^7.0.0-0 dependencies: @@ -652,6 +653,7 @@ packages: /@babel/plugin-proposal-unicode-property-regex@7.18.6(@babel/core@7.22.1): resolution: {integrity: sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==} engines: {node: '>=4'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead. peerDependencies: '@babel/core': ^7.0.0-0 dependencies: @@ -2582,8 +2584,8 @@ packages: resolution: {integrity: sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==} 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==} + /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.41.0)(typescript@5.0.4): + resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -2594,13 +2596,13 @@ packages: 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) + '@typescript-eslint/parser': 5.62.0(eslint@8.41.0)(typescript@5.0.4) + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/type-utils': 5.62.0(eslint@8.41.0)(typescript@5.0.4) + '@typescript-eslint/utils': 5.62.0(eslint@8.41.0)(typescript@5.0.4) debug: 4.3.4 eslint: 8.41.0 - grapheme-splitter: 1.0.4 + graphemer: 1.4.0 ignore: 5.2.4 natural-compare-lite: 1.4.0 semver: 7.5.1 @@ -2610,8 +2612,8 @@ packages: - 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==} + /@typescript-eslint/parser@5.62.0(eslint@8.41.0)(typescript@5.0.4): + resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -2620,9 +2622,9 @@ packages: 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': 5.62.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.0.4) debug: 4.3.4 eslint: 8.41.0 typescript: 5.0.4 @@ -2630,16 +2632,16 @@ packages: - supports-color dev: false - /@typescript-eslint/scope-manager@5.59.7: - resolution: {integrity: sha512-FL6hkYWK9zBGdxT2wWEd2W8ocXMu3K94i3gvMrjXpx+koFYdYV7KprKfirpgY34vTGzEPPuKoERpP8kD5h7vZQ==} + /@typescript-eslint/scope-manager@5.62.0: + resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.59.7 - '@typescript-eslint/visitor-keys': 5.59.7 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.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==} + /@typescript-eslint/type-utils@5.62.0(eslint@8.41.0)(typescript@5.0.4): + resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -2648,8 +2650,8 @@ packages: 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': 5.62.0(typescript@5.0.4) + '@typescript-eslint/utils': 5.62.0(eslint@8.41.0)(typescript@5.0.4) debug: 4.3.4 eslint: 8.41.0 tsutils: 3.21.0(typescript@5.0.4) @@ -2658,13 +2660,13 @@ packages: - supports-color dev: false - /@typescript-eslint/types@5.59.7: - resolution: {integrity: sha512-UnVS2MRRg6p7xOSATscWkKjlf/NDKuqo5TdbWck6rIRZbmKpVNTLALzNvcjIfHBE7736kZOFc/4Z3VcZwuOM/A==} + /@typescript-eslint/types@5.62.0: + resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: false - /@typescript-eslint/typescript-estree@5.59.7(typescript@5.0.4): - resolution: {integrity: sha512-4A1NtZ1I3wMN2UGDkU9HMBL+TIQfbrh4uS0WDMMpf3xMRursDbqEf1ahh6vAAe3mObt8k3ZATnezwG4pdtWuUQ==} + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.0.4): + resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -2672,8 +2674,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.59.7 - '@typescript-eslint/visitor-keys': 5.59.7 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -2684,8 +2686,8 @@ packages: - supports-color dev: false - /@typescript-eslint/utils@5.59.7(eslint@8.41.0)(typescript@5.0.4): - resolution: {integrity: sha512-yCX9WpdQKaLufz5luG4aJbOpdXf/fjwGMcLFXZVPUz3QqLirG5QcwwnIHNf8cjLjxK4qtzTO8udUtMQSAToQnQ==} + /@typescript-eslint/utils@5.62.0(eslint@8.41.0)(typescript@5.0.4): + resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -2693,9 +2695,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.41.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) + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.0.4) eslint: 8.41.0 eslint-scope: 5.1.1 semver: 7.5.1 @@ -2704,11 +2706,11 @@ packages: - typescript dev: false - /@typescript-eslint/visitor-keys@5.59.7: - resolution: {integrity: sha512-tyN+X2jvMslUszIiYbF0ZleP+RqQsFVpGrKI6e0Eet1w8WmhsAtmzaqm8oM8WJQ1ysLwhnsK/4hYHJjOgJVfQQ==} + /@typescript-eslint/visitor-keys@5.62.0: + resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.59.7 + '@typescript-eslint/types': 5.62.0 eslint-visitor-keys: 3.4.1 dev: false @@ -4320,6 +4322,7 @@ packages: /grapheme-splitter@1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: true /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} @@ -6997,6 +7000,7 @@ packages: /workbox-cacheable-response@6.6.0: resolution: {integrity: sha512-JfhJUSQDwsF1Xv3EV1vWzSsCOZn4mQ38bWEBR3LdvOxSPgB65gAM6cS2CX8rkkKHRgiLrN7Wxoyu+TuH67kHrw==} + deprecated: workbox-background-sync@6.6.0 dependencies: workbox-core: 6.6.0 dev: true From 59df0482e2fc893a02d60fac0d415a67a5b2a72b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Oct 2023 17:10:44 +0000 Subject: [PATCH 09/93] chore(deps): update actions/checkout action to v4 --- .github/workflows/ci.yml | 6 +++--- .github/workflows/coverage.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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..d1befef0 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 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 From 45942d31011d848be65f05c97ea2f9b6187f00eb Mon Sep 17 00:00:00 2001 From: shaggytech Date: Mon, 23 Oct 2023 21:50:52 -0500 Subject: [PATCH 10/93] fix(tests): deprecated coverage-c8, switch to coverage-v8 --- packages/lib/package.json | 2 +- packages/lib/vite.config.ts | 4 +- pnpm-lock.yaml | 135 ++++++++++++++++-------------------- 3 files changed, 60 insertions(+), 81 deletions(-) diff --git a/packages/lib/package.json b/packages/lib/package.json index 716067d7..1d937ff1 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -78,7 +78,7 @@ "clean:all": "pnpm run clean && rimraf node_modules" }, "devDependencies": { - "@vitest/coverage-c8": "0.33.0", + "@vitest/coverage-v8": "0.34.6", "@vitest/ui": "0.34.6", "eslint": "8.41.0", "eslint-config-custom": "workspace:*", diff --git a/packages/lib/vite.config.ts b/packages/lib/vite.config.ts index 0d36e409..31ce60fc 100644 --- a/packages/lib/vite.config.ts +++ b/packages/lib/vite.config.ts @@ -60,9 +60,7 @@ export default defineConfig({ globals: true, watch: false, // turned off for CI/CD runs coverage: { - provider: 'c8', - all: true, - src: ['./src'], + provider: 'v8', exclude: [ '**/*/types.ts', '**/__tests__/**/*', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d80e2211..9edc5a3c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -145,9 +145,9 @@ importers: packages/lib: devDependencies: - '@vitest/coverage-c8': - specifier: 0.33.0 - version: 0.33.0(vitest@0.34.6) + '@vitest/coverage-v8': + specifier: 0.34.6 + version: 0.34.6(vitest@0.34.6) '@vitest/ui': specifier: 0.34.6 version: 0.34.6(vitest@0.34.6) @@ -2522,8 +2522,8 @@ packages: 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: @@ -2690,7 +2690,7 @@ packages: debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.1 + semver: 7.5.4 tsutils: 3.21.0(typescript@5.0.4) typescript: 5.0.4 transitivePeerDependencies: @@ -2711,7 +2711,7 @@ packages: '@typescript-eslint/typescript-estree': 5.59.7(typescript@5.0.4) eslint: 8.41.0 eslint-scope: 5.1.1 - semver: 7.5.1 + semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript @@ -2744,18 +2744,25 @@ packages: vue: 3.3.4 dev: true - /@vitest/coverage-c8@0.33.0(vitest@0.34.6): - resolution: {integrity: sha512-DaF1zJz4dcOZS4k/neiQJokmOWqsGXwhthfmUdPGorXIQHjdPvV6JQSYhQDI41MyI8c+IieQUdIDs5XAMHtDDw==} - deprecated: v8 coverage is moved to @vitest/coverage-v8 package + /@vitest/coverage-v8@0.34.6(vitest@0.34.6): + resolution: {integrity: sha512-fivy/OK2d/EsJFoEoxHFEnNGTg+MmdZBAVK9Ka4qhXR2K3J0DS08vcGVwzDtXSuUMabLv4KtPcpSKkcMXFDViw==} peerDependencies: - vitest: '>=0.30.0 <1' + vitest: '>=0.32.0 <1' dependencies: '@ampproject/remapping': 2.2.1 - c8: 7.14.0 + '@bcoe/v8-coverage': 0.2.3 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.1.6 magic-string: 0.30.5 picocolors: 1.0.0 std-env: 3.3.3 + test-exclude: 6.0.0 + v8-to-istanbul: 9.1.3 vitest: 0.34.6(@vitest/ui@0.34.6) + transitivePeerDependencies: + - supports-color dev: true /@vitest/expect@0.34.6: @@ -3243,25 +3250,6 @@ packages: engines: {node: '>=6'} dev: true - /c8@7.14.0: - resolution: {integrity: sha512-i04rtkkcNcCf7zsQcSv/T9EbUn4RXQ6mropeMcjFOsQXQ0iGLAr/xT6TImQg4+U9hmNpN9XdvPkjUL1IzbgxJw==} - engines: {node: '>=10.12.0'} - hasBin: true - 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 - /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -3375,14 +3363,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'} @@ -3485,6 +3465,10 @@ packages: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} dev: true + /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==} dependencies: @@ -4099,14 +4083,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'} @@ -4702,21 +4678,32 @@ packages: 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 + 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.0 + 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: @@ -5003,11 +4990,11 @@ packages: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 - /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: @@ -5241,7 +5228,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 @@ -5802,6 +5789,14 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 + dev: false + + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 /serialize-javascript@4.0.0: resolution: {integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==} @@ -6547,13 +6542,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.1.3: + resolution: {integrity: sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==} 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 + '@types/istanbul-lib-coverage': 2.0.5 + convert-source-map: 2.0.0 dev: true /validate-npm-package-license@3.0.4: @@ -6986,7 +6981,6 @@ packages: /workbox-cacheable-response@6.6.0: resolution: {integrity: sha512-JfhJUSQDwsF1Xv3EV1vWzSsCOZn4mQ38bWEBR3LdvOxSPgB65gAM6cS2CX8rkkKHRgiLrN7Wxoyu+TuH67kHrw==} - deprecated: workbox-background-sync@6.6.0 dependencies: workbox-core: 6.6.0 dev: true @@ -7157,19 +7151,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'} From f8800bd1e3a8e27a53e922be2c402284a703548d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 02:57:21 +0000 Subject: [PATCH 11/93] chore(deps): update commitlint monorepo to v17.8.1 --- package.json | 4 +- pnpm-lock.yaml | 233 +++++++++++++++++++++++-------------------------- 2 files changed, 110 insertions(+), 127 deletions(-) diff --git a/package.json b/package.json index bcd46cb7..92db247d 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,8 @@ }, "devDependencies": { "@changesets/cli": "2.26.1", - "@commitlint/cli": "17.6.3", - "@commitlint/config-conventional": "17.6.3", + "@commitlint/cli": "17.8.1", + "@commitlint/config-conventional": "17.8.1", "husky": "8.0.3", "rimraf": "5.0.1", "turbo": "1.9.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9edc5a3c..89ffa1c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,11 +12,11 @@ importers: specifier: 2.26.1 version: 2.26.1 '@commitlint/cli': - specifier: 17.6.3 - version: 17.6.3 + specifier: 17.8.1 + version: 17.8.1 '@commitlint/config-conventional': - specifier: 17.6.3 - version: 17.6.3 + specifier: 17.8.1 + version: 17.8.1 husky: specifier: 8.0.3 version: 8.0.3 @@ -183,7 +183,7 @@ importers: version: 4.3.9(@types/node@18.13.0)(sass@1.62.1) vite-plugin-dts: specifier: 2.3.0 - version: 2.3.0(@types/node@20.2.5)(vite@4.3.9) + version: 2.3.0(@types/node@20.5.1)(vite@4.3.9) vite-tsconfig-paths: specifier: 4.2.0 version: 4.2.0(typescript@5.0.4)(vite@4.3.9) @@ -1725,16 +1725,16 @@ packages: prettier: 2.8.8 dev: true - /@commitlint/cli@17.6.3: - resolution: {integrity: sha512-ItSz2fd4F+CujgIbQOfNNerDF1eFlsBGEfp9QcCb1kxTYMuKTYZzA6Nu1YRRrIaaWwe2E7awUGpIMrPoZkOG3A==} + /@commitlint/cli@17.8.1: + resolution: {integrity: sha512-ay+WbzQesE0Rv4EQKfNbSMiJJ12KdKTDzIt0tcK4k11FdsWmtwP0Kp1NWMOUswfIWo6Eb7p7Ln721Nx9FLNBjg==} engines: {node: '>=v14'} 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': 17.8.1 + '@commitlint/lint': 17.8.1 + '@commitlint/load': 17.8.1 + '@commitlint/read': 17.8.1 + '@commitlint/types': 17.8.1 execa: 5.1.1 lodash.isfunction: 3.0.9 resolve-from: 5.0.0 @@ -1745,26 +1745,26 @@ packages: - '@swc/wasm' dev: true - /@commitlint/config-conventional@17.6.3: - resolution: {integrity: sha512-bLyHEjjRWqlLQWIgYFHmUPbEFMOOLXeF3QbUinDIJev/u9e769tkoTH9YPknEywiuIrAgZaVo+OfzAIsJP0fsw==} + /@commitlint/config-conventional@17.8.1: + resolution: {integrity: sha512-NxCOHx1kgneig3VLauWJcDWS40DVjg7nKOpBEEK9E5fjJpQqLCilcnKkIIjdBH98kEO1q3NpE5NSrZ2kl/QGJg==} engines: {node: '>=v14'} dependencies: - conventional-changelog-conventionalcommits: 5.0.0 + conventional-changelog-conventionalcommits: 6.1.0 dev: true - /@commitlint/config-validator@17.4.4: - resolution: {integrity: sha512-bi0+TstqMiqoBAQDvdEP4AFh0GaKyLFlPPEObgI29utoKEYoPQTvF0EYqIwYYLEoJYhj5GfMIhPHJkTJhagfeg==} + /@commitlint/config-validator@17.8.1: + resolution: {integrity: sha512-UUgUC+sNiiMwkyiuIFR7JG2cfd9t/7MV8VB4TZ+q02ZFkHoduUS4tJGsCBWvBOGD9Btev6IecPMvlWUfJorkEA==} engines: {node: '>=v14'} dependencies: - '@commitlint/types': 17.4.4 + '@commitlint/types': 17.8.1 ajv: 8.12.0 dev: true - /@commitlint/ensure@17.4.4: - resolution: {integrity: sha512-AHsFCNh8hbhJiuZ2qHv/m59W/GRE9UeOXbkOqxYMNNg9pJ7qELnFcwj5oYpa6vzTSHtPGKf3C2yUFNy1GGHq6g==} + /@commitlint/ensure@17.8.1: + resolution: {integrity: sha512-xjafwKxid8s1K23NFpL8JNo6JnY/ysetKo8kegVM7c8vs+kWLP8VrQq+NbhgVlmCojhEDbzQKp4eRXSjVOGsow==} engines: {node: '>=v14'} dependencies: - '@commitlint/types': 17.4.4 + '@commitlint/types': 17.8.1 lodash.camelcase: 4.3.0 lodash.kebabcase: 4.1.1 lodash.snakecase: 4.1.1 @@ -1772,122 +1772,122 @@ packages: lodash.upperfirst: 4.3.1 dev: true - /@commitlint/execute-rule@17.4.0: - resolution: {integrity: sha512-LIgYXuCSO5Gvtc0t9bebAMSwd68ewzmqLypqI2Kke1rqOqqDbMpYcYfoPfFlv9eyLIh4jocHWwCK5FS7z9icUA==} + /@commitlint/execute-rule@17.8.1: + resolution: {integrity: sha512-JHVupQeSdNI6xzA9SqMF+p/JjrHTcrJdI02PwesQIDCIGUrv04hicJgCcws5nzaoZbROapPs0s6zeVHoxpMwFQ==} engines: {node: '>=v14'} dev: true - /@commitlint/format@17.4.4: - resolution: {integrity: sha512-+IS7vpC4Gd/x+uyQPTAt3hXs5NxnkqAZ3aqrHd5Bx/R9skyCAWusNlNbw3InDbAK6j166D9asQM8fnmYIa+CXQ==} + /@commitlint/format@17.8.1: + resolution: {integrity: sha512-f3oMTyZ84M9ht7fb93wbCKmWxO5/kKSbwuYvS867duVomoOsgrgljkGGIztmT/srZnaiGbaK8+Wf8Ik2tSr5eg==} engines: {node: '>=v14'} dependencies: - '@commitlint/types': 17.4.4 + '@commitlint/types': 17.8.1 chalk: 4.1.2 dev: true - /@commitlint/is-ignored@17.6.3: - resolution: {integrity: sha512-LQbNdnPbxrpbcrVKR5yf51SvquqktpyZJwqXx3lUMF6+nT9PHB8xn3wLy8pi2EQv5Zwba484JnUwDE1ygVYNQA==} + /@commitlint/is-ignored@17.8.1: + resolution: {integrity: sha512-UshMi4Ltb4ZlNn4F7WtSEugFDZmctzFpmbqvpyxD3la510J+PLcnyhf9chs7EryaRFJMdAKwsEKfNK0jL/QM4g==} engines: {node: '>=v14'} dependencies: - '@commitlint/types': 17.4.4 - semver: 7.5.0 + '@commitlint/types': 17.8.1 + semver: 7.5.4 dev: true - /@commitlint/lint@17.6.3: - resolution: {integrity: sha512-fBlXwt6SHJFgm3Tz+luuo3DkydAx9HNC5y4eBqcKuDuMVqHd2ugMNr+bQtx6riv9mXFiPoKp7nE4Xn/ls3iVDA==} + /@commitlint/lint@17.8.1: + resolution: {integrity: sha512-aQUlwIR1/VMv2D4GXSk7PfL5hIaFSfy6hSHV94O8Y27T5q+DlDEgd/cZ4KmVI+MWKzFfCTiTuWqjfRSfdRllCA==} engines: {node: '>=v14'} 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': 17.8.1 + '@commitlint/parse': 17.8.1 + '@commitlint/rules': 17.8.1 + '@commitlint/types': 17.8.1 dev: true - /@commitlint/load@17.5.0: - resolution: {integrity: sha512-l+4W8Sx4CD5rYFsrhHH8HP01/8jEP7kKf33Xlx2Uk2out/UKoKPYMOIRcDH5ppT8UXLMV+x6Wm5osdRKKgaD1Q==} + /@commitlint/load@17.8.1: + resolution: {integrity: sha512-iF4CL7KDFstP1kpVUkT8K2Wl17h2yx9VaR1ztTc8vzByWWcbO/WaKwxsnCOqow9tVAlzPfo1ywk9m2oJ9ucMqA==} engines: {node: '>=v14'} 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': 17.8.1 + '@commitlint/execute-rule': 17.8.1 + '@commitlint/resolve-extends': 17.8.1 + '@commitlint/types': 17.8.1 + '@types/node': 20.5.1 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@20.5.1)(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@20.5.1)(typescript@5.0.4) + typescript: 5.2.2 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' dev: true - /@commitlint/message@17.4.2: - resolution: {integrity: sha512-3XMNbzB+3bhKA1hSAWPCQA3lNxR4zaeQAQcHj0Hx5sVdO6ryXtgUBGGv+1ZCLMgAPRixuc6en+iNAzZ4NzAa8Q==} + /@commitlint/message@17.8.1: + resolution: {integrity: sha512-6bYL1GUQsD6bLhTH3QQty8pVFoETfFQlMn2Nzmz3AOLqRVfNNtXBaSY0dhZ0dM6A2MEq4+2d7L/2LP8TjqGRkA==} engines: {node: '>=v14'} dev: true - /@commitlint/parse@17.4.4: - resolution: {integrity: sha512-EKzz4f49d3/OU0Fplog7nwz/lAfXMaDxtriidyGF9PtR+SRbgv4FhsfF310tKxs6EPj8Y+aWWuX3beN5s+yqGg==} + /@commitlint/parse@17.8.1: + resolution: {integrity: sha512-/wLUickTo0rNpQgWwLPavTm7WbwkZoBy3X8PpkUmlSmQJyWQTj0m6bDjiykMaDt41qcUbfeFfaCvXfiR4EGnfw==} engines: {node: '>=v14'} dependencies: - '@commitlint/types': 17.4.4 - conventional-changelog-angular: 5.0.13 - conventional-commits-parser: 3.2.4 + '@commitlint/types': 17.8.1 + conventional-changelog-angular: 6.0.0 + conventional-commits-parser: 4.0.0 dev: true - /@commitlint/read@17.5.1: - resolution: {integrity: sha512-7IhfvEvB//p9aYW09YVclHbdf1u7g7QhxeYW9ZHSO8Huzp8Rz7m05aCO1mFG7G8M+7yfFnXB5xOmG18brqQIBg==} + /@commitlint/read@17.8.1: + resolution: {integrity: sha512-Fd55Oaz9irzBESPCdMd8vWWgxsW3OWR99wOntBDHgf9h7Y6OOHjWEdS9Xzen1GFndqgyoaFplQS5y7KZe0kO2w==} engines: {node: '>=v14'} dependencies: - '@commitlint/top-level': 17.4.0 - '@commitlint/types': 17.4.4 + '@commitlint/top-level': 17.8.1 + '@commitlint/types': 17.8.1 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==} + /@commitlint/resolve-extends@17.8.1: + resolution: {integrity: sha512-W/ryRoQ0TSVXqJrx5SGkaYuAaE/BUontL1j1HsKckvM6e5ZaG0M9126zcwL6peKSuIetJi7E87PRQF8O86EW0Q==} engines: {node: '>=v14'} dependencies: - '@commitlint/config-validator': 17.4.4 - '@commitlint/types': 17.4.4 + '@commitlint/config-validator': 17.8.1 + '@commitlint/types': 17.8.1 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==} + /@commitlint/rules@17.8.1: + resolution: {integrity: sha512-2b7OdVbN7MTAt9U0vKOYKCDsOvESVXxQmrvuVUZ0rGFMCrCPJWWP1GJ7f0lAypbDAhaGb8zqtdOr47192LBrIA==} engines: {node: '>=v14'} dependencies: - '@commitlint/ensure': 17.4.4 - '@commitlint/message': 17.4.2 - '@commitlint/to-lines': 17.4.0 - '@commitlint/types': 17.4.4 + '@commitlint/ensure': 17.8.1 + '@commitlint/message': 17.8.1 + '@commitlint/to-lines': 17.8.1 + '@commitlint/types': 17.8.1 execa: 5.1.1 dev: true - /@commitlint/to-lines@17.4.0: - resolution: {integrity: sha512-LcIy/6ZZolsfwDUWfN1mJ+co09soSuNASfKEU5sCmgFCvX5iHwRYLiIuoqXzOVDYOy7E7IcHilr/KS0e5T+0Hg==} + /@commitlint/to-lines@17.8.1: + resolution: {integrity: sha512-LE0jb8CuR/mj6xJyrIk8VLz03OEzXFgLdivBytoooKO5xLt5yalc8Ma5guTWobw998sbR3ogDd+2jed03CFmJA==} engines: {node: '>=v14'} dev: true - /@commitlint/top-level@17.4.0: - resolution: {integrity: sha512-/1loE/g+dTTQgHnjoCy0AexKAEFyHsR2zRB4NWrZ6lZSMIxAhBJnmCqwao7b4H8888PsfoTBCLBYIw8vGnej8g==} + /@commitlint/top-level@17.8.1: + resolution: {integrity: sha512-l6+Z6rrNf5p333SHfEte6r+WkOxGlWK4bLuZKbtf/2TXRN+qhrvn1XE63VhD8Oe9oIHQ7F7W1nG2k/TJFhx2yA==} engines: {node: '>=v14'} dependencies: find-up: 5.0.0 dev: true - /@commitlint/types@17.4.4: - resolution: {integrity: sha512-amRN8tRLYOsxRr6mTnGGGvB5EmW/4DDjLMgiwK3CCVEmN6Sr/6xePGEpWaspKkckILuUORCwe6VfDBw6uj4axQ==} + /@commitlint/types@17.8.1: + resolution: {integrity: sha512-PXDQXkAmiMEG162Bqdh9ChML/GJZo6vU+7F03ALKDK8zYc6SuAr47LjG7hGYRqUOz+WK0dU7bQ0xzuqFMdxzeQ==} engines: {node: '>=v14'} dependencies: chalk: 4.1.2 @@ -2282,24 +2282,24 @@ packages: read-yaml-file: 1.1.0 dev: true - /@microsoft/api-extractor-model@7.27.0(@types/node@20.2.5): + /@microsoft/api-extractor-model@7.27.0(@types/node@20.5.1): resolution: {integrity: sha512-wHqIMiwSARmiuVLn/zmVpiRncq6hvBfC5GF+sjrN3w4FqVkqFYk7DetvfRNdy/3URdqqmYGrhJlcU9HpLnHOPg==} dependencies: '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.1(@types/node@20.2.5) + '@rushstack/node-core-library': 3.59.1(@types/node@20.5.1) transitivePeerDependencies: - '@types/node' dev: true - /@microsoft/api-extractor@7.35.0(@types/node@20.2.5): + /@microsoft/api-extractor@7.35.0(@types/node@20.5.1): resolution: {integrity: sha512-yBGfPJeEtzk8sg2hE2/vOPRvnJBvstbWNGeyGV1jIEUSgytzQ0QPgPEkOsP2n7nBfnyRXmZaBa2vJPGOzVWy+g==} hasBin: true dependencies: - '@microsoft/api-extractor-model': 7.27.0(@types/node@20.2.5) + '@microsoft/api-extractor-model': 7.27.0(@types/node@20.5.1) '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.1(@types/node@20.2.5) + '@rushstack/node-core-library': 3.59.1(@types/node@20.5.1) '@rushstack/rig-package': 0.3.19 '@rushstack/ts-command-line': 4.13.3 colors: 1.2.5 @@ -2422,7 +2422,7 @@ packages: picomatch: 2.3.1 dev: true - /@rushstack/node-core-library@3.59.1(@types/node@20.2.5): + /@rushstack/node-core-library@3.59.1(@types/node@20.5.1): resolution: {integrity: sha512-iy/xaEhXGpX+DY1ZzAtNA+QPw+9+TJh773Im+JxG4R1fu00/vWq470UOEj6upxlUxmp0JxhnmNRxzfptHrn/Uw==} peerDependencies: '@types/node': '*' @@ -2430,7 +2430,7 @@ packages: '@types/node': optional: true dependencies: - '@types/node': 20.2.5 + '@types/node': 20.5.1 colors: 1.2.5 fs-extra: 7.0.1 import-lazy: 4.0.0 @@ -2555,8 +2555,8 @@ packages: /@types/node@18.15.11: resolution: {integrity: sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==} - /@types/node@20.2.5: - resolution: {integrity: sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==} + /@types/node@20.5.1: + resolution: {integrity: sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==} dev: true /@types/normalize-package-data@2.4.1: @@ -2995,12 +2995,6 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - /acorn@8.8.2: - resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: true - /ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} dependencies: @@ -3431,34 +3425,29 @@ packages: /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - /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@6.1.0: + resolution: {integrity: sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw==} + engines: {node: '>=14'} 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@4.0.0: + resolution: {integrity: sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg==} + engines: {node: '>=14'} 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 dev: true /convert-source-map@1.9.0: @@ -3475,7 +3464,7 @@ packages: browserslist: 4.21.5 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@20.5.1)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.2.2): resolution: {integrity: sha512-NTxV1MFfZDLPiBMjxbHRwSh5LaLcPMwNdCutmnHJCKoVnlvldPWlllonKwrsRJ5pYZBIBGRWWU2tfvzxgeSW5Q==} engines: {node: '>=12', npm: '>=6'} peerDependencies: @@ -3484,10 +3473,10 @@ packages: ts-node: '>=10' typescript: '>=3' dependencies: - '@types/node': 20.2.5 + '@types/node': 20.5.1 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@20.5.1)(typescript@5.0.4) + typescript: 5.2.2 dev: true /cosmiconfig@8.1.3: @@ -5504,11 +5493,6 @@ 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'} - dev: true - /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -5775,14 +5759,6 @@ packages: 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'} - hasBin: true - dependencies: - lru-cache: 6.0.0 - dev: true - /semver@7.5.1: resolution: {integrity: sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==} engines: {node: '>=10'} @@ -6237,7 +6213,7 @@ packages: code-block-writer: 12.0.0 dev: true - /ts-node@10.9.1(@types/node@20.2.5)(typescript@5.0.4): + /ts-node@10.9.1(@types/node@20.5.1)(typescript@5.0.4): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -6256,8 +6232,8 @@ 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': 20.5.1 + acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 @@ -6446,6 +6422,12 @@ packages: engines: {node: '>=12.20'} hasBin: true + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + /ufo@1.3.1: resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} dev: true @@ -6584,16 +6566,16 @@ packages: - terser dev: true - /vite-plugin-dts@2.3.0(@types/node@20.2.5)(vite@4.3.9): + /vite-plugin-dts@2.3.0(@types/node@20.5.1)(vite@4.3.9): resolution: {integrity: sha512-WbJgGtsStgQhdm3EosYmIdTGbag5YQpZ3HXWUAPCDyoXI5qN6EY0V7NXq0lAmnv9hVQsvh0htbYcg0Or5Db9JQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: '>=2.9.0' dependencies: '@babel/parser': 7.22.0 - '@microsoft/api-extractor': 7.35.0(@types/node@20.2.5) + '@microsoft/api-extractor': 7.35.0(@types/node@20.5.1) '@rollup/pluginutils': 5.0.2 - '@rushstack/node-core-library': 3.59.1(@types/node@20.2.5) + '@rushstack/node-core-library': 3.59.1(@types/node@20.5.1) debug: 4.3.4 fast-glob: 3.2.12 fs-extra: 10.1.0 @@ -6981,6 +6963,7 @@ packages: /workbox-cacheable-response@6.6.0: resolution: {integrity: sha512-JfhJUSQDwsF1Xv3EV1vWzSsCOZn4mQ38bWEBR3LdvOxSPgB65gAM6cS2CX8rkkKHRgiLrN7Wxoyu+TuH67kHrw==} + deprecated: workbox-background-sync@6.6.0 dependencies: workbox-core: 6.6.0 dev: true From e1d23a9e8dd241923dc78d75b0864ff36719fa46 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 03:02:40 +0000 Subject: [PATCH 12/93] chore(deps): update actions/setup-node action to v4 --- .github/workflows/setup/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setup/action.yaml b/.github/workflows/setup/action.yaml index 4469f330..64590191 100644 --- a/.github/workflows/setup/action.yaml +++ b/.github/workflows/setup/action.yaml @@ -8,7 +8,7 @@ runs: uses: pnpm/action-setup@v2.2.4 - name: Setup Node.js environment - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 cache: "pnpm" From 8f2ad57109bead7bee914bfe36ac4ae684d3fc64 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 03:56:12 +0000 Subject: [PATCH 13/93] chore(deps): update dependency @changesets/cli to v2.26.2 --- package.json | 2 +- pnpm-lock.yaml | 63 +++++++++++++++++++++++--------------------------- 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 92db247d..93b578b1 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "ci:publish": "pnpm run build && pnpm publish -r" }, "devDependencies": { - "@changesets/cli": "2.26.1", + "@changesets/cli": "2.26.2", "@commitlint/cli": "17.8.1", "@commitlint/config-conventional": "17.8.1", "husky": "8.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 89ffa1c6..60d45a6a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: devDependencies: '@changesets/cli': - specifier: 2.26.1 - version: 2.26.1 + specifier: 2.26.2 + version: 2.26.2 '@commitlint/cli': specifier: 17.8.1 version: 17.8.1 @@ -1541,11 +1541,11 @@ packages: 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 @@ -1556,18 +1556,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: @@ -1576,18 +1576,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 @@ -1596,7 +1596,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 @@ -1609,17 +1609,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 @@ -1633,22 +1633,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 @@ -2575,13 +2575,8 @@ packages: '@types/node': 18.15.11 dev: true - /@types/semver@6.2.3: - resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} - 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==} From 51e03ab9922ed2c72f4e2a1eaab260fcb657372f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 03:58:31 +0000 Subject: [PATCH 14/93] chore(deps): update dependency vite-plugin-pwa to v0.16.5 --- apps/docs/package.json | 2 +- pnpm-lock.yaml | 175 ++++++++++++++++++++++------------------- 2 files changed, 94 insertions(+), 83 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index ed859a2f..050a5dbf 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -33,7 +33,7 @@ "sitemap": "7.1.1", "tsconfig": "workspace:*", "typescript": "5.0.4", - "vite-plugin-pwa": "0.15.1", + "vite-plugin-pwa": "0.16.5", "vitepress": "1.0.0-beta.1", "workbox-window": "6.6.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 89ffa1c6..5c0b8f71 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -44,7 +44,7 @@ importers: version: 18.13.0 '@vite-pwa/vitepress': specifier: 0.0.5 - version: 0.0.5(vite-plugin-pwa@0.15.1) + version: 0.0.5(vite-plugin-pwa@0.16.5) dotenv: specifier: 16.0.3 version: 16.0.3 @@ -76,8 +76,8 @@ importers: specifier: 5.0.4 version: 5.0.4 vite-plugin-pwa: - specifier: 0.15.1 - version: 0.15.1(vite@4.3.9)(workbox-build@6.6.0)(workbox-window@6.6.0) + specifier: 0.16.5 + version: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@6.6.0) vitepress: specifier: 1.0.0-beta.1 version: 1.0.0-beta.1(@algolia/client-search@4.17.1)(@types/node@18.13.0)(sass@1.62.1) @@ -2725,12 +2725,12 @@ packages: eslint-visitor-keys: 3.4.1 dev: false - /@vite-pwa/vitepress@0.0.5(vite-plugin-pwa@0.15.1): + /@vite-pwa/vitepress@0.0.5(vite-plugin-pwa@0.16.5): resolution: {integrity: sha512-B6xy9wxi9fen+/AnRkY2+XCrbhqh2b/TsVTka6qFQ3zJ8zHSoEUHUucYT3KHMcY5I124G0ZmPKNW+UF9Jx1k4w==} peerDependencies: vite-plugin-pwa: ^0.14.0 dependencies: - vite-plugin-pwa: 0.15.1(vite@4.3.9)(workbox-build@6.6.0)(workbox-window@6.6.0) + vite-plugin-pwa: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@6.6.0) dev: true /@vitejs/plugin-vue@4.2.3(vite@4.3.9)(vue@3.3.4): @@ -5471,8 +5471,8 @@ packages: 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 @@ -6589,18 +6589,19 @@ packages: - supports-color dev: true - /vite-plugin-pwa@0.15.1(vite@4.3.9)(workbox-build@6.6.0)(workbox-window@6.6.0): - resolution: {integrity: sha512-lJVzEYda/Y9AfwxFzX0rV+QCQ2+WdBoEGtR1RBZKWxvrJ4NWEH1VZaHOMyzvRiYhWQsi7aFhewsp1CDvN/R1Og==} + /vite-plugin-pwa@0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@6.6.0): + resolution: {integrity: sha512-Ahol4dwhMP2UHPQXkllSlXbihOaDFnvBIDPmAxoSZ1EObBUJGP4CMRyCyAVkIHjd6/H+//vH0DM2ON+XxHr81g==} + engines: {node: '>=16.0.0'} peerDependencies: vite: ^3.1.0 || ^4.0.0 - workbox-build: ^6.5.4 - workbox-window: ^6.5.4 + 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 + fast-glob: 3.3.1 + pretty-bytes: 6.1.1 vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) - workbox-build: 6.6.0 + workbox-build: 7.0.0 workbox-window: 6.6.0 transitivePeerDependencies: - supports-color @@ -6902,22 +6903,22 @@ packages: 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 @@ -6941,105 +6942,108 @@ 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==} - deprecated: workbox-background-sync@6.6.0 + /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==} dev: true - /workbox-expiration@6.6.0: - resolution: {integrity: sha512-baplYXcDHbe8vAo7GYvyAmlS4f6998Jff513L4XvlzAOxcl8F620O91guoJ5EOf5qeXG4cGdNZHkkVAPouFCpw==} + /workbox-core@7.0.0: + resolution: {integrity: sha512-81JkAAZtfVP8darBpfRTovHg8DGAVrKFgHpOArZbdFd78VqHr5Iw65f2guwjE2NlCFbPFDoez3D3/6ZvhI/rwQ==} + dev: true + + /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: @@ -7049,6 +7053,13 @@ packages: workbox-core: 6.6.0 dev: true + /workbox-window@7.0.0: + resolution: {integrity: sha512-j7P/bsAWE/a7sxqTzXo3P2ALb1reTfZdvVp6OJ/uLr/C2kZAMvjeWGm8V4htQhor7DOvYg0sSbFN2+flT5U0qA==} + dependencies: + '@types/trusted-types': 2.0.3 + workbox-core: 7.0.0 + dev: true + /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} From 1e912bd523add142a6fe4fc3b5e79960556ed19a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:06:27 +0000 Subject: [PATCH 15/93] chore(deps): update dependency dotenv to v16.3.1 --- apps/docs/package.json | 2 +- pnpm-lock.yaml | 86 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 77 insertions(+), 11 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index 050a5dbf..56009251 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -23,7 +23,7 @@ "devDependencies": { "@types/node": "18.13.0", "@vite-pwa/vitepress": "0.0.5", - "dotenv": "16.0.3", + "dotenv": "16.3.1", "eslint": "8.41.0", "eslint-config-custom": "workspace:*", "prettier": "2.8.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13375986..8ab51eae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -46,8 +46,8 @@ importers: specifier: 0.0.5 version: 0.0.5(vite-plugin-pwa@0.16.5) 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 @@ -180,7 +180,7 @@ importers: version: 5.0.4 vite: specifier: 4.3.9 - version: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + version: 4.3.9(@types/node@20.5.1) vite-plugin-dts: specifier: 2.3.0 version: 2.3.0(@types/node@20.5.1)(vite@4.3.9) @@ -3639,8 +3639,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 @@ -6556,7 +6556,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@18.15.11) transitivePeerDependencies: - '@types/node' - less @@ -6583,7 +6583,7 @@ packages: kolorist: 1.8.0 magic-string: 0.29.0 ts-morph: 18.0.0 - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@20.5.1) transitivePeerDependencies: - '@types/node' - rollup @@ -6619,7 +6619,7 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.1(typescript@5.0.4) - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@20.5.1) transitivePeerDependencies: - supports-color - typescript @@ -6659,6 +6659,72 @@ packages: fsevents: 2.3.2 dev: true + /vite@4.3.9(@types/node@18.15.11): + 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: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 18.15.11 + 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@20.5.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: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 20.5.1 + 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(@algolia/client-search@4.17.1)(@types/node@18.13.0)(sass@1.62.1): resolution: {integrity: sha512-V2yyCwQ+v9fh7rbnGDLp8M7vHa9sLElexXf/JHtBOsOwv7ed9wt1QI4WUagYgKR3TeoJT9v2s6f0UaQSne0EvQ==} hasBin: true @@ -6766,7 +6832,7 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.7.0 - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@18.15.11) vite-node: 0.34.6(@types/node@18.15.11) why-is-node-running: 2.2.2 transitivePeerDependencies: From 97b3b1a7e694de5b6213396aad3f9e472b62f065 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:07:44 +0000 Subject: [PATCH 16/93] chore(deps): update dependency turbo to v1.10.16 --- package.json | 2 +- pnpm-lock.yaml | 123 +++++++++++++++++++++++++++++++++++++------------ 2 files changed, 95 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 2760abae..3752e56b 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@commitlint/config-conventional": "17.8.1", "husky": "8.0.3", "rimraf": "5.0.1", - "turbo": "1.9.9", + "turbo": "1.10.16", "typescript": "5.0.4" }, "husky": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13375986..456944c4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -24,8 +24,8 @@ importers: specifier: 5.0.1 version: 5.0.1 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 @@ -180,7 +180,7 @@ importers: version: 5.0.4 vite: specifier: 4.3.9 - version: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + version: 4.3.9(@types/node@20.5.1) vite-plugin-dts: specifier: 2.3.0 version: 2.3.0(@types/node@20.5.1)(vite@4.3.9) @@ -6286,65 +6286,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: @@ -6556,7 +6555,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@18.15.11) transitivePeerDependencies: - '@types/node' - less @@ -6583,7 +6582,7 @@ packages: kolorist: 1.8.0 magic-string: 0.29.0 ts-morph: 18.0.0 - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@20.5.1) transitivePeerDependencies: - '@types/node' - rollup @@ -6619,7 +6618,7 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.1(typescript@5.0.4) - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@20.5.1) transitivePeerDependencies: - supports-color - typescript @@ -6659,6 +6658,72 @@ packages: fsevents: 2.3.2 dev: true + /vite@4.3.9(@types/node@18.15.11): + 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: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 18.15.11 + 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@20.5.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: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 20.5.1 + 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(@algolia/client-search@4.17.1)(@types/node@18.13.0)(sass@1.62.1): resolution: {integrity: sha512-V2yyCwQ+v9fh7rbnGDLp8M7vHa9sLElexXf/JHtBOsOwv7ed9wt1QI4WUagYgKR3TeoJT9v2s6f0UaQSne0EvQ==} hasBin: true @@ -6766,7 +6831,7 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.7.0 - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@18.15.11) vite-node: 0.34.6(@types/node@18.15.11) why-is-node-running: 2.2.2 transitivePeerDependencies: From 78b75988376fde6779e8966349c3bb8f43c2d2ea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:11:07 +0000 Subject: [PATCH 17/93] chore(deps): update dependency workbox-window to v7 --- apps/docs/package.json | 2 +- pnpm-lock.yaml | 101 +++++++++++++++++++++++++++++++---------- 2 files changed, 79 insertions(+), 24 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index 050a5dbf..2ecbf865 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -35,7 +35,7 @@ "typescript": "5.0.4", "vite-plugin-pwa": "0.16.5", "vitepress": "1.0.0-beta.1", - "workbox-window": "6.6.0" + "workbox-window": "7.0.0" }, "eslintConfig": { "extends": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13375986..d2e0ee54 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -77,13 +77,13 @@ importers: version: 5.0.4 vite-plugin-pwa: specifier: 0.16.5 - version: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@6.6.0) + version: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@7.0.0) vitepress: specifier: 1.0.0-beta.1 version: 1.0.0-beta.1(@algolia/client-search@4.17.1)(@types/node@18.13.0)(sass@1.62.1) workbox-window: - specifier: 6.6.0 - version: 6.6.0 + specifier: 7.0.0 + version: 7.0.0 config/eslint-config-custom: dependencies: @@ -180,7 +180,7 @@ importers: version: 5.0.4 vite: specifier: 4.3.9 - version: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + version: 4.3.9(@types/node@20.5.1) vite-plugin-dts: specifier: 2.3.0 version: 2.3.0(@types/node@20.5.1)(vite@4.3.9) @@ -2730,7 +2730,7 @@ packages: peerDependencies: vite-plugin-pwa: ^0.14.0 dependencies: - vite-plugin-pwa: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@6.6.0) + vite-plugin-pwa: 0.16.5(vite@4.3.9)(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): @@ -6556,7 +6556,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@18.15.11) transitivePeerDependencies: - '@types/node' - less @@ -6583,14 +6583,14 @@ packages: kolorist: 1.8.0 magic-string: 0.29.0 ts-morph: 18.0.0 - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@20.5.1) transitivePeerDependencies: - '@types/node' - rollup - supports-color dev: true - /vite-plugin-pwa@0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@6.6.0): + /vite-plugin-pwa@0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@7.0.0): resolution: {integrity: sha512-Ahol4dwhMP2UHPQXkllSlXbihOaDFnvBIDPmAxoSZ1EObBUJGP4CMRyCyAVkIHjd6/H+//vH0DM2ON+XxHr81g==} engines: {node: '>=16.0.0'} peerDependencies: @@ -6603,7 +6603,7 @@ packages: pretty-bytes: 6.1.1 vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) workbox-build: 7.0.0 - workbox-window: 6.6.0 + workbox-window: 7.0.0 transitivePeerDependencies: - supports-color dev: true @@ -6619,7 +6619,7 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.1(typescript@5.0.4) - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@20.5.1) transitivePeerDependencies: - supports-color - typescript @@ -6659,6 +6659,72 @@ packages: fsevents: 2.3.2 dev: true + /vite@4.3.9(@types/node@18.15.11): + 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: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 18.15.11 + 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@20.5.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: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 20.5.1 + 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(@algolia/client-search@4.17.1)(@types/node@18.13.0)(sass@1.62.1): resolution: {integrity: sha512-V2yyCwQ+v9fh7rbnGDLp8M7vHa9sLElexXf/JHtBOsOwv7ed9wt1QI4WUagYgKR3TeoJT9v2s6f0UaQSne0EvQ==} hasBin: true @@ -6766,7 +6832,7 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.7.0 - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@18.15.11) vite-node: 0.34.6(@types/node@18.15.11) why-is-node-running: 2.2.2 transitivePeerDependencies: @@ -6969,10 +7035,6 @@ packages: workbox-core: 7.0.0 dev: true - /workbox-core@6.6.0: - resolution: {integrity: sha512-GDtFRF7Yg3DD859PMbPAYPeJyg5gJYXuBQAC+wyrWuuXgpfoOrIQIvFRZnQ7+czTIQjIr1DhLEGFzZanAT/3bQ==} - dev: true - /workbox-core@7.0.0: resolution: {integrity: sha512-81JkAAZtfVP8darBpfRTovHg8DGAVrKFgHpOArZbdFd78VqHr5Iw65f2guwjE2NlCFbPFDoez3D3/6ZvhI/rwQ==} dev: true @@ -7047,13 +7109,6 @@ packages: resolution: {integrity: sha512-SWfEouQfjRiZ7GNABzHUKUyj8pCoe+RwjfOIajcx6J5mtgKkN+t8UToHnpaJL5UVVOf5YhJh+OHhbVNIHe+LVA==} dev: true - /workbox-window@6.6.0: - resolution: {integrity: sha512-L4N9+vka17d16geaJXXRjENLFldvkWy7JyGxElRD0JvBxvFEd8LOhr+uXCcar/NzAmIBRv9EZ+M+Qr4mOoBITw==} - dependencies: - '@types/trusted-types': 2.0.3 - workbox-core: 6.6.0 - dev: true - /workbox-window@7.0.0: resolution: {integrity: sha512-j7P/bsAWE/a7sxqTzXo3P2ALb1reTfZdvVp6OJ/uLr/C2kZAMvjeWGm8V4htQhor7DOvYg0sSbFN2+flT5U0qA==} dependencies: From caa3e8bb1349070d6c331275c8096f533295b8d5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:13:03 +0000 Subject: [PATCH 18/93] chore(deps): update dependency rimraf to v5.0.5 --- apps/docs/package.json | 2 +- package.json | 2 +- packages/lib/package.json | 2 +- pnpm-lock.yaml | 34 +++++++++++++++++----------------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index 56009251..3295e6bf 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -28,7 +28,7 @@ "eslint-config-custom": "workspace:*", "prettier": "2.8.8", "prettier-config": "workspace:*", - "rimraf": "5.0.1", + "rimraf": "5.0.5", "sass": "1.62.1", "sitemap": "7.1.1", "tsconfig": "workspace:*", diff --git a/package.json b/package.json index 3752e56b..6b94e2fb 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@commitlint/cli": "17.8.1", "@commitlint/config-conventional": "17.8.1", "husky": "8.0.3", - "rimraf": "5.0.1", + "rimraf": "5.0.5", "turbo": "1.10.16", "typescript": "5.0.4" }, diff --git a/packages/lib/package.json b/packages/lib/package.json index 1d937ff1..c11c85cf 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -84,7 +84,7 @@ "eslint-config-custom": "workspace:*", "prettier": "2.8.8", "prettier-config": "workspace:*", - "rimraf": "5.0.1", + "rimraf": "5.0.5", "tsconfig": "workspace:*", "typedoc": "0.24.7", "typedoc-config": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9f7818a7..fbba4432 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,8 +21,8 @@ importers: 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.10.16 version: 1.10.16 @@ -61,8 +61,8 @@ importers: 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 @@ -164,8 +164,8 @@ importers: 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 @@ -4223,16 +4223,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: @@ -4696,8 +4696,8 @@ packages: 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 @@ -5382,8 +5382,8 @@ packages: 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 @@ -5670,12 +5670,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): From a8393f7b5d71c85804f2f3cebc62539b5e37a63f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:15:39 +0000 Subject: [PATCH 19/93] chore(deps): update dependency typescript to v5.2.2 --- apps/docs/package.json | 2 +- config/eslint-config-custom/package.json | 2 +- config/typedoc-config/package.json | 2 +- package.json | 2 +- packages/lib/package.json | 2 +- pnpm-lock.yaml | 96 ++++++++++++------------ 6 files changed, 53 insertions(+), 53 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index 56009251..ff29c08b 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -32,7 +32,7 @@ "sass": "1.62.1", "sitemap": "7.1.1", "tsconfig": "workspace:*", - "typescript": "5.0.4", + "typescript": "5.2.2", "vite-plugin-pwa": "0.16.5", "vitepress": "1.0.0-beta.1", "workbox-window": "6.6.0" diff --git a/config/eslint-config-custom/package.json b/config/eslint-config-custom/package.json index 9d66f460..eaebe364 100644 --- a/config/eslint-config-custom/package.json +++ b/config/eslint-config-custom/package.json @@ -14,6 +14,6 @@ "prettier": "2.8.8" }, "devDependencies": { - "typescript": "5.0.4" + "typescript": "5.2.2" } } diff --git a/config/typedoc-config/package.json b/config/typedoc-config/package.json index b1052f23..2f8da7d3 100644 --- a/config/typedoc-config/package.json +++ b/config/typedoc-config/package.json @@ -7,6 +7,6 @@ "devDependencies": { "typedoc": "0.24.7", "typedoc-plugin-markdown": "3.15.3", - "typescript": "5.0.4" + "typescript": "5.2.2" } } diff --git a/package.json b/package.json index 3752e56b..b3c6814a 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "husky": "8.0.3", "rimraf": "5.0.1", "turbo": "1.10.16", - "typescript": "5.0.4" + "typescript": "5.2.2" }, "husky": { "hooks": { diff --git a/packages/lib/package.json b/packages/lib/package.json index 1d937ff1..04ce0562 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -88,7 +88,7 @@ "tsconfig": "workspace:*", "typedoc": "0.24.7", "typedoc-config": "workspace:*", - "typescript": "5.0.4", + "typescript": "5.2.2", "vite": "4.3.9", "vite-plugin-dts": "2.3.0", "vite-tsconfig-paths": "4.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9f7818a7..c3bd79fd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,8 +27,8 @@ importers: 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: @@ -73,8 +73,8 @@ 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.16.5 version: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@6.6.0) @@ -89,10 +89,10 @@ importers: dependencies: '@typescript-eslint/eslint-plugin': specifier: 5.62.0 - version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.41.0)(typescript@5.0.4) + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.41.0)(typescript@5.2.2) '@typescript-eslint/parser': specifier: 5.62.0 - version: 5.62.0(eslint@8.41.0)(typescript@5.0.4) + version: 5.62.0(eslint@8.41.0)(typescript@5.2.2) eslint: specifier: 8.41.0 version: 8.41.0 @@ -110,8 +110,8 @@ importers: version: 2.8.8 devDependencies: typescript: - specifier: 5.0.4 - version: 5.0.4 + specifier: 5.2.2 + version: 5.2.2 config/prettier-config: devDependencies: @@ -129,13 +129,13 @@ importers: devDependencies: typedoc: specifier: 0.24.7 - version: 0.24.7(typescript@5.0.4) + version: 0.24.7(typescript@5.2.2) typedoc-plugin-markdown: specifier: 3.15.3 version: 3.15.3(typedoc@0.24.7) typescript: - specifier: 5.0.4 - version: 5.0.4 + specifier: 5.2.2 + version: 5.2.2 examples/simple-examples: dependencies: @@ -171,13 +171,13 @@ importers: version: link:../../config/tsconfig typedoc: specifier: 0.24.7 - version: 0.24.7(typescript@5.0.4) + version: 0.24.7(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(@types/node@20.5.1) @@ -186,7 +186,7 @@ importers: version: 2.3.0(@types/node@20.5.1)(vite@4.3.9) vite-tsconfig-paths: specifier: 4.2.0 - version: 4.2.0(typescript@5.0.4)(vite@4.3.9) + version: 4.2.0(typescript@5.2.2)(vite@4.3.9) vitest: specifier: 0.34.6 version: 0.34.6(@vitest/ui@0.34.6) @@ -1819,7 +1819,7 @@ packages: lodash.merge: 4.6.2 lodash.uniq: 4.5.0 resolve-from: 5.0.0 - ts-node: 10.9.1(@types/node@20.5.1)(typescript@5.0.4) + ts-node: 10.9.1(@types/node@20.5.1)(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: - '@swc/core' @@ -2595,7 +2595,7 @@ packages: resolution: {integrity: sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==} dev: true - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.41.0)(typescript@5.0.4): + /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.41.0)(typescript@5.2.2): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2607,23 +2607,23 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.62.0(eslint@8.41.0)(typescript@5.0.4) + '@typescript-eslint/parser': 5.62.0(eslint@8.41.0)(typescript@5.2.2) '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.41.0)(typescript@5.0.4) - '@typescript-eslint/utils': 5.62.0(eslint@8.41.0)(typescript@5.0.4) + '@typescript-eslint/type-utils': 5.62.0(eslint@8.41.0)(typescript@5.2.2) + '@typescript-eslint/utils': 5.62.0(eslint@8.41.0)(typescript@5.2.2) debug: 4.3.4 eslint: 8.41.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 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/parser@5.62.0(eslint@8.41.0)(typescript@5.0.4): + /@typescript-eslint/parser@5.62.0(eslint@8.41.0)(typescript@5.2.2): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2635,10 +2635,10 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.0.4) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) debug: 4.3.4 eslint: 8.41.0 - typescript: 5.0.4 + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false @@ -2651,7 +2651,7 @@ packages: '@typescript-eslint/visitor-keys': 5.62.0 dev: false - /@typescript-eslint/type-utils@5.62.0(eslint@8.41.0)(typescript@5.0.4): + /@typescript-eslint/type-utils@5.62.0(eslint@8.41.0)(typescript@5.2.2): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2661,12 +2661,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.0.4) - '@typescript-eslint/utils': 5.62.0(eslint@8.41.0)(typescript@5.0.4) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) + '@typescript-eslint/utils': 5.62.0(eslint@8.41.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 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false @@ -2676,7 +2676,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: false - /@typescript-eslint/typescript-estree@5.62.0(typescript@5.0.4): + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.2.2): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2691,13 +2691,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/utils@5.62.0(eslint@8.41.0)(typescript@5.0.4): + /@typescript-eslint/utils@5.62.0(eslint@8.41.0)(typescript@5.2.2): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2708,7 +2708,7 @@ packages: '@types/semver': 7.5.0 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.0.4) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) eslint: 8.41.0 eslint-scope: 5.1.1 semver: 7.5.4 @@ -3475,7 +3475,7 @@ packages: dependencies: '@types/node': 20.5.1 cosmiconfig: 8.1.3 - ts-node: 10.9.1(@types/node@20.5.1)(typescript@5.0.4) + ts-node: 10.9.1(@types/node@20.5.1)(typescript@5.2.2) typescript: 5.2.2 dev: true @@ -6214,7 +6214,7 @@ packages: code-block-writer: 12.0.0 dev: true - /ts-node@10.9.1(@types/node@20.5.1)(typescript@5.0.4): + /ts-node@10.9.1(@types/node@20.5.1)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -6240,12 +6240,12 @@ packages: 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 @@ -6255,21 +6255,21 @@ 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): + /tsutils@3.21.0(typescript@5.2.2): 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 + typescript: 5.2.2 dev: false /tty-table@4.2.1: @@ -6400,10 +6400,10 @@ packages: typedoc: '>=0.24.0' dependencies: handlebars: 4.7.7 - typedoc: 0.24.7(typescript@5.0.4) + typedoc: 0.24.7(typescript@5.2.2) dev: true - /typedoc@0.24.7(typescript@5.0.4): + /typedoc@0.24.7(typescript@5.2.2): resolution: {integrity: sha512-zzfKDFIZADA+XRIp2rMzLe9xZ6pt12yQOhCr7cD7/PBTjhPmMyMvGrkZ2lPNJitg3Hj1SeiYFNzCsSDrlpxpKw==} engines: {node: '>= 14.14'} hasBin: true @@ -6414,19 +6414,19 @@ packages: marked: 4.3.0 minimatch: 9.0.1 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 + dev: true /typescript@5.2.2: resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'} hasBin: true - dev: true /ufo@1.3.1: resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} @@ -6607,7 +6607,7 @@ packages: - supports-color dev: true - /vite-tsconfig-paths@4.2.0(typescript@5.0.4)(vite@4.3.9): + /vite-tsconfig-paths@4.2.0(typescript@5.2.2)(vite@4.3.9): resolution: {integrity: sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==} peerDependencies: vite: '*' @@ -6617,7 +6617,7 @@ packages: dependencies: debug: 4.3.4 globrex: 0.1.2 - tsconfck: 2.1.1(typescript@5.0.4) + tsconfck: 2.1.1(typescript@5.2.2) vite: 4.3.9(@types/node@20.5.1) transitivePeerDependencies: - supports-color From 345fded59a2b24789febc183475ba7be2c1911cc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:16:30 +0000 Subject: [PATCH 20/93] fix(deps): update dependency @types/node to v18.18.6 --- apps/docs/package.json | 2 +- config/tsconfig/package.json | 2 +- pnpm-lock.yaml | 52 +++++++++++++++++------------------- 3 files changed, 26 insertions(+), 30 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index 56009251..fbf20feb 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -21,7 +21,7 @@ "vue": "3.3.4" }, "devDependencies": { - "@types/node": "18.13.0", + "@types/node": "18.18.6", "@vite-pwa/vitepress": "0.0.5", "dotenv": "16.3.1", "eslint": "8.41.0", diff --git a/config/tsconfig/package.json b/config/tsconfig/package.json index e0329d68..a38b99b6 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.6" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9f7818a7..96c3bfe9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,8 +40,8 @@ importers: version: 3.3.4 devDependencies: '@types/node': - specifier: 18.13.0 - version: 18.13.0 + specifier: 18.18.6 + version: 18.18.6 '@vite-pwa/vitepress': specifier: 0.0.5 version: 0.0.5(vite-plugin-pwa@0.16.5) @@ -80,7 +80,7 @@ importers: version: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@6.6.0) vitepress: specifier: 1.0.0-beta.1 - version: 1.0.0-beta.1(@algolia/client-search@4.17.1)(@types/node@18.13.0)(sass@1.62.1) + version: 1.0.0-beta.1(@algolia/client-search@4.17.1)(@types/node@18.18.6)(sass@1.62.1) workbox-window: specifier: 6.6.0 version: 6.6.0 @@ -122,8 +122,8 @@ importers: config/tsconfig: dependencies: '@types/node': - specifier: 18.15.11 - version: 18.15.11 + specifier: 18.18.6 + version: 18.18.6 config/typedoc-config: devDependencies: @@ -2548,12 +2548,8 @@ 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@18.18.6: + resolution: {integrity: sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==} /@types/node@20.5.1: resolution: {integrity: sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==} @@ -2566,13 +2562,13 @@ packages: /@types/resolve@1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 18.15.11 + '@types/node': 18.18.6 dev: true /@types/sax@1.2.4: resolution: {integrity: sha512-pSAff4IAxJjfAXUG6tFkO7dsSbTmf8CtUpfhhZ5VhkRpC4628tJhh3+V6H1E+/Gs9piSzYKT5yzHO5M4GG9jkw==} dependencies: - '@types/node': 18.15.11 + '@types/node': 18.18.6 dev: true /@types/semver@6.2.3: @@ -2740,7 +2736,7 @@ packages: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@18.18.6)(sass@1.62.1) vue: 3.3.4 dev: true @@ -4720,7 +4716,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.15.11 + '@types/node': 18.18.6 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -6545,7 +6541,7 @@ packages: engines: {node: '>= 0.10'} dev: true - /vite-node@0.34.6(@types/node@18.15.11): + /vite-node@0.34.6(@types/node@18.18.6): resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} engines: {node: '>=v14.18.0'} hasBin: true @@ -6555,7 +6551,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.3.9(@types/node@18.15.11) + vite: 4.3.9(@types/node@18.18.6) transitivePeerDependencies: - '@types/node' - less @@ -6600,7 +6596,7 @@ packages: debug: 4.3.4 fast-glob: 3.3.1 pretty-bytes: 6.1.1 - vite: 4.3.9(@types/node@18.13.0)(sass@1.62.1) + vite: 4.3.9(@types/node@18.18.6)(sass@1.62.1) workbox-build: 7.0.0 workbox-window: 6.6.0 transitivePeerDependencies: @@ -6624,7 +6620,7 @@ packages: - typescript dev: true - /vite@4.3.9(@types/node@18.13.0)(sass@1.62.1): + /vite@4.3.9(@types/node@18.18.6): resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -6649,16 +6645,15 @@ packages: terser: optional: true dependencies: - '@types/node': 18.13.0 + '@types/node': 18.18.6 esbuild: 0.17.19 postcss: 8.4.23 rollup: 3.23.0 - sass: 1.62.1 optionalDependencies: fsevents: 2.3.2 dev: true - /vite@4.3.9(@types/node@18.15.11): + /vite@4.3.9(@types/node@18.18.6)(sass@1.62.1): resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -6683,10 +6678,11 @@ packages: terser: optional: true dependencies: - '@types/node': 18.15.11 + '@types/node': 18.18.6 esbuild: 0.17.19 postcss: 8.4.23 rollup: 3.23.0 + sass: 1.62.1 optionalDependencies: fsevents: 2.3.2 dev: true @@ -6724,7 +6720,7 @@ packages: fsevents: 2.3.2 dev: true - /vitepress@1.0.0-beta.1(@algolia/client-search@4.17.1)(@types/node@18.13.0)(sass@1.62.1): + /vitepress@1.0.0-beta.1(@algolia/client-search@4.17.1)(@types/node@18.18.6)(sass@1.62.1): resolution: {integrity: sha512-V2yyCwQ+v9fh7rbnGDLp8M7vHa9sLElexXf/JHtBOsOwv7ed9wt1QI4WUagYgKR3TeoJT9v2s6f0UaQSne0EvQ==} hasBin: true dependencies: @@ -6739,7 +6735,7 @@ packages: 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) + vite: 4.3.9(@types/node@18.18.6)(sass@1.62.1) vue: 3.3.4 transitivePeerDependencies: - '@algolia/client-search' @@ -6811,7 +6807,7 @@ packages: dependencies: '@types/chai': 4.3.5 '@types/chai-subset': 1.3.3 - '@types/node': 18.15.11 + '@types/node': 18.18.6 '@vitest/expect': 0.34.6 '@vitest/runner': 0.34.6 '@vitest/snapshot': 0.34.6 @@ -6831,8 +6827,8 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.7.0 - vite: 4.3.9(@types/node@18.15.11) - vite-node: 0.34.6(@types/node@18.15.11) + vite: 4.3.9(@types/node@18.18.6) + vite-node: 0.34.6(@types/node@18.18.6) why-is-node-running: 2.2.2 transitivePeerDependencies: - less From 6ee14780c46a1f93b414ccaaf224b982d3c7dd28 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:19:53 +0000 Subject: [PATCH 21/93] chore(deps): update dependency vite-tsconfig-paths to v4.2.1 --- packages/lib/package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/lib/package.json b/packages/lib/package.json index 04ce0562..54162024 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -91,7 +91,7 @@ "typescript": "5.2.2", "vite": "4.3.9", "vite-plugin-dts": "2.3.0", - "vite-tsconfig-paths": "4.2.0", + "vite-tsconfig-paths": "4.2.1", "vitest": "0.34.6", "vitest-fetch-mock": "0.2.2" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0c659966..64322f03 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -185,8 +185,8 @@ importers: specifier: 2.3.0 version: 2.3.0(@types/node@20.5.1)(vite@4.3.9) vite-tsconfig-paths: - specifier: 4.2.0 - version: 4.2.0(typescript@5.2.2)(vite@4.3.9) + specifier: 4.2.1 + version: 4.2.1(typescript@5.2.2)(vite@4.3.9) vitest: specifier: 0.34.6 version: 0.34.6(@vitest/ui@0.34.6) @@ -6607,8 +6607,8 @@ packages: - supports-color dev: true - /vite-tsconfig-paths@4.2.0(typescript@5.2.2)(vite@4.3.9): - resolution: {integrity: sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==} + /vite-tsconfig-paths@4.2.1(typescript@5.2.2)(vite@4.3.9): + resolution: {integrity: sha512-GNUI6ZgPqT3oervkvzU+qtys83+75N/OuDaQl7HmOqFTb0pjZsuARrRipsyJhJ3enqV8beI1xhGbToR4o78nSQ==} peerDependencies: vite: '*' peerDependenciesMeta: From 95c4a57a04494e1a42f77d3438b76f9e0105c677 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:20:45 +0000 Subject: [PATCH 22/93] chore(deps): update dependency eslint to v8.52.0 --- apps/docs/package.json | 2 +- config/eslint-config-custom/package.json | 2 +- packages/lib/package.json | 2 +- pnpm-lock.yaml | 150 ++++++++++++----------- 4 files changed, 84 insertions(+), 72 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index cd4ea211..bf0fe9b5 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -24,7 +24,7 @@ "@types/node": "18.13.0", "@vite-pwa/vitepress": "0.0.5", "dotenv": "16.3.1", - "eslint": "8.41.0", + "eslint": "8.52.0", "eslint-config-custom": "workspace:*", "prettier": "2.8.8", "prettier-config": "workspace:*", diff --git a/config/eslint-config-custom/package.json b/config/eslint-config-custom/package.json index eaebe364..6079d737 100644 --- a/config/eslint-config-custom/package.json +++ b/config/eslint-config-custom/package.json @@ -7,7 +7,7 @@ "dependencies": { "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", - "eslint": "8.41.0", + "eslint": "8.52.0", "eslint-config-prettier": "8.8.0", "eslint-plugin-markdown": "3.0.0", "eslint-plugin-prettier": "4.2.1", diff --git a/packages/lib/package.json b/packages/lib/package.json index 04ce0562..8d4c05da 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -80,7 +80,7 @@ "devDependencies": { "@vitest/coverage-v8": "0.34.6", "@vitest/ui": "0.34.6", - "eslint": "8.41.0", + "eslint": "8.52.0", "eslint-config-custom": "workspace:*", "prettier": "2.8.8", "prettier-config": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0c659966..4a093cc6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -49,8 +49,8 @@ importers: 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 @@ -89,22 +89,22 @@ importers: dependencies: '@typescript-eslint/eslint-plugin': specifier: 5.62.0 - version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.41.0)(typescript@5.2.2) + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.52.0)(typescript@5.2.2) '@typescript-eslint/parser': specifier: 5.62.0 - version: 5.62.0(eslint@8.41.0)(typescript@5.2.2) + version: 5.62.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) + version: 8.8.0(eslint@8.52.0) eslint-plugin-markdown: specifier: 3.0.0 - version: 3.0.0(eslint@8.41.0) + version: 3.0.0(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) + version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.52.0)(prettier@2.8.8) prettier: specifier: 2.8.8 version: 2.8.8 @@ -152,8 +152,8 @@ importers: specifier: 0.34.6 version: 0.34.6(vitest@0.34.6) 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 @@ -196,6 +196,10 @@ importers: packages: + /@aashutoshrathi/word-wrap@1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + /@algolia/autocomplete-core@1.8.2: resolution: {integrity: sha512-mTeshsyFhAqw/ebqNsQpMtbnjr+qVOSKXArEj4K0d7sqc8It1XD0gkASwecm9mF/jlOQ4Z9RNg1HbdA8JPdRwQ==} dependencies: @@ -2136,26 +2140,31 @@ 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==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: false - /@eslint/eslintrc@2.0.3: - resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==} + /@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.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 @@ -2165,15 +2174,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: @@ -2183,8 +2192,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==} @@ -2595,7 +2604,7 @@ packages: resolution: {integrity: sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==} dev: true - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.41.0)(typescript@5.2.2): + /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.52.0)(typescript@5.2.2): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2607,12 +2616,12 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.62.0(eslint@8.41.0)(typescript@5.2.2) + '@typescript-eslint/parser': 5.62.0(eslint@8.52.0)(typescript@5.2.2) '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.41.0)(typescript@5.2.2) - '@typescript-eslint/utils': 5.62.0(eslint@8.41.0)(typescript@5.2.2) + '@typescript-eslint/type-utils': 5.62.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/utils': 5.62.0(eslint@8.52.0)(typescript@5.2.2) debug: 4.3.4 - eslint: 8.41.0 + eslint: 8.52.0 graphemer: 1.4.0 ignore: 5.2.4 natural-compare-lite: 1.4.0 @@ -2623,7 +2632,7 @@ packages: - supports-color dev: false - /@typescript-eslint/parser@5.62.0(eslint@8.41.0)(typescript@5.2.2): + /@typescript-eslint/parser@5.62.0(eslint@8.52.0)(typescript@5.2.2): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2637,7 +2646,7 @@ packages: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) debug: 4.3.4 - eslint: 8.41.0 + eslint: 8.52.0 typescript: 5.2.2 transitivePeerDependencies: - supports-color @@ -2651,7 +2660,7 @@ packages: '@typescript-eslint/visitor-keys': 5.62.0 dev: false - /@typescript-eslint/type-utils@5.62.0(eslint@8.41.0)(typescript@5.2.2): + /@typescript-eslint/type-utils@5.62.0(eslint@8.52.0)(typescript@5.2.2): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2662,9 +2671,9 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) - '@typescript-eslint/utils': 5.62.0(eslint@8.41.0)(typescript@5.2.2) + '@typescript-eslint/utils': 5.62.0(eslint@8.52.0)(typescript@5.2.2) debug: 4.3.4 - eslint: 8.41.0 + eslint: 8.52.0 tsutils: 3.21.0(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: @@ -2697,19 +2706,19 @@ packages: - supports-color dev: false - /@typescript-eslint/utils@5.62.0(eslint@8.41.0)(typescript@5.2.2): + /@typescript-eslint/utils@5.62.0(eslint@8.52.0)(typescript@5.2.2): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^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.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) - eslint: 8.41.0 + eslint: 8.52.0 eslint-scope: 5.1.1 semver: 7.5.4 transitivePeerDependencies: @@ -2725,6 +2734,9 @@ packages: eslint-visitor-keys: 3.4.1 dev: false + /@ungap/structured-clone@1.2.0: + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + /@vite-pwa/vitepress@0.0.5(vite-plugin-pwa@0.16.5): resolution: {integrity: sha512-B6xy9wxi9fen+/AnRkY2+XCrbhqh2b/TsVTka6qFQ3zJ8zHSoEUHUucYT3KHMcY5I124G0ZmPKNW+UF9Jx1k4w==} peerDependencies: @@ -3789,28 +3801,28 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - /eslint-config-prettier@8.8.0(eslint@8.41.0): + /eslint-config-prettier@8.8.0(eslint@8.52.0): resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} 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): + /eslint-plugin-markdown@3.0.0(eslint@8.52.0): resolution: {integrity: sha512-hRs5RUJGbeHDLfS7ELanT0e29Ocyssf/7kBM+p7KluY5AwngGkDf8Oyu4658/NZSGTTq05FZeWbkxXtbVyHPwg==} 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): + /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.52.0)(prettier@2.8.8): resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -3821,8 +3833,8 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.41.0 - eslint-config-prettier: 8.8.0(eslint@8.41.0) + eslint: 8.52.0 + eslint-config-prettier: 8.8.0(eslint@8.52.0) prettier: 2.8.8 prettier-linter-helpers: 1.0.0 dev: false @@ -3835,8 +3847,8 @@ packages: 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 @@ -3845,28 +3857,34 @@ packages: /eslint-visitor-keys@3.4.1: resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false - /eslint@8.41.0: - resolution: {integrity: sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q==} + /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.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 @@ -3876,7 +3894,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 @@ -3886,20 +3903,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.10.0 acorn-jsx: 5.3.2(acorn@8.10.0) - eslint-visitor-keys: 3.4.1 + eslint-visitor-keys: 3.4.3 /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} @@ -5265,16 +5281,16 @@ packages: mimic-fn: 2.1.0 dev: true - /optionator@0.9.1: - resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} + /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==} @@ -6961,10 +6977,6 @@ 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 From 3ae264f1704b501d3449107d2087ca883357d8fc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:21:13 +0000 Subject: [PATCH 23/93] chore(deps): update dependency typedoc to v0.25.2 --- config/typedoc-config/package.json | 2 +- packages/lib/package.json | 2 +- pnpm-lock.yaml | 31 ++++++++++++++++++------------ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/config/typedoc-config/package.json b/config/typedoc-config/package.json index 2f8da7d3..4b450f12 100644 --- a/config/typedoc-config/package.json +++ b/config/typedoc-config/package.json @@ -5,7 +5,7 @@ "private": true, "main": "typedoc-config.js", "devDependencies": { - "typedoc": "0.24.7", + "typedoc": "0.25.2", "typedoc-plugin-markdown": "3.15.3", "typescript": "5.2.2" } diff --git a/packages/lib/package.json b/packages/lib/package.json index 04ce0562..deae2d49 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -86,7 +86,7 @@ "prettier-config": "workspace:*", "rimraf": "5.0.1", "tsconfig": "workspace:*", - "typedoc": "0.24.7", + "typedoc": "0.25.2", "typedoc-config": "workspace:*", "typescript": "5.2.2", "vite": "4.3.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0c659966..4910710d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,11 +128,11 @@ importers: config/typedoc-config: devDependencies: typedoc: - specifier: 0.24.7 - version: 0.24.7(typescript@5.2.2) + 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) + version: 3.15.3(typedoc@0.25.2) typescript: specifier: 5.2.2 version: 5.2.2 @@ -170,8 +170,8 @@ importers: specifier: workspace:* version: link:../../config/tsconfig typedoc: - specifier: 0.24.7 - version: 0.24.7(typescript@5.2.2) + specifier: 0.25.2 + version: 0.25.2(typescript@5.2.2) typedoc-config: specifier: workspace:* version: link:../../config/typedoc-config @@ -5121,6 +5121,13 @@ packages: brace-expansion: 2.0.1 dev: true + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist-options@4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} engines: {node: '>= 6'} @@ -6394,25 +6401,25 @@ packages: is-typed-array: 1.1.10 dev: true - /typedoc-plugin-markdown@3.15.3(typedoc@0.24.7): + /typedoc-plugin-markdown@3.15.3(typedoc@0.25.2): resolution: {integrity: sha512-idntFYu3vfaY3eaD+w9DeRd0PmNGqGuNLKihPU9poxFGnATJYGn9dPtEhn2QrTdishFMg7jPXAhos+2T6YCWRQ==} peerDependencies: typedoc: '>=0.24.0' dependencies: handlebars: 4.7.7 - typedoc: 0.24.7(typescript@5.2.2) + typedoc: 0.25.2(typescript@5.2.2) dev: true - /typedoc@0.24.7(typescript@5.2.2): - 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.2.2 dev: true From f0da70acea1f699d5f3ab469956baaaa5f95791c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:27:19 +0000 Subject: [PATCH 24/93] fix(deps): update dependency eslint-plugin-markdown to v3.0.1 --- config/eslint-config-custom/package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/eslint-config-custom/package.json b/config/eslint-config-custom/package.json index 6079d737..f4840792 100644 --- a/config/eslint-config-custom/package.json +++ b/config/eslint-config-custom/package.json @@ -9,7 +9,7 @@ "@typescript-eslint/parser": "5.62.0", "eslint": "8.52.0", "eslint-config-prettier": "8.8.0", - "eslint-plugin-markdown": "3.0.0", + "eslint-plugin-markdown": "3.0.1", "eslint-plugin-prettier": "4.2.1", "prettier": "2.8.8" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4a093cc6..f3308b1b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -100,8 +100,8 @@ importers: specifier: 8.8.0 version: 8.8.0(eslint@8.52.0) eslint-plugin-markdown: - specifier: 3.0.0 - version: 3.0.0(eslint@8.52.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.52.0)(prettier@2.8.8) @@ -3810,8 +3810,8 @@ packages: eslint: 8.52.0 dev: false - /eslint-plugin-markdown@3.0.0(eslint@8.52.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 From cdbc582ab9b9fab9281586528da3a6acf99baaae Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:31:07 +0000 Subject: [PATCH 25/93] chore(deps): update dependency vitepress to v1.0.0-rc.23 --- apps/docs/package.json | 2 +- pnpm-lock.yaml | 738 ++++++++++++++++++++++++++++++++++------- 2 files changed, 613 insertions(+), 127 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index 3e0694d7..781530d4 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -34,7 +34,7 @@ "tsconfig": "workspace:*", "typescript": "5.2.2", "vite-plugin-pwa": "0.16.5", - "vitepress": "1.0.0-beta.1", + "vitepress": "1.0.0-rc.23", "workbox-window": "7.0.0" }, "eslintConfig": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index af7d542f..c5aaaf22 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -79,8 +79,8 @@ importers: specifier: 0.16.5 version: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@7.0.0) vitepress: - specifier: 1.0.0-beta.1 - version: 1.0.0-beta.1(@algolia/client-search@4.17.1)(@types/node@18.18.6)(sass@1.62.1) + specifier: 1.0.0-rc.23 + version: 1.0.0-rc.23(@algolia/client-search@4.17.1)(@types/node@18.18.6)(sass@1.62.1)(search-insights@2.9.0)(typescript@5.2.2) workbox-window: specifier: 7.0.0 version: 7.0.0 @@ -200,58 +200,85 @@ packages: resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} engines: {node: '>=0.10.0'} - /@algolia/autocomplete-core@1.8.2: - resolution: {integrity: sha512-mTeshsyFhAqw/ebqNsQpMtbnjr+qVOSKXArEj4K0d7sqc8It1XD0gkASwecm9mF/jlOQ4Z9RNg1HbdA8JPdRwQ==} + /@algolia/autocomplete-core@1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0)(search-insights@2.9.0): + resolution: {integrity: sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==} dependencies: - '@algolia/autocomplete-shared': 1.8.2 + '@algolia/autocomplete-plugin-algolia-insights': 1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0)(search-insights@2.9.0) + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0) + transitivePeerDependencies: + - '@algolia/client-search' + - algoliasearch + - search-insights dev: true - /@algolia/autocomplete-preset-algolia@1.8.2(@algolia/client-search@4.17.1)(algoliasearch@4.17.1): - resolution: {integrity: sha512-J0oTx4me6ZM9kIKPuL3lyU3aB8DEvpVvR6xWmHVROx5rOYJGQcZsdG4ozxwcOyiiu3qxMkIbzntnV1S1VWD8yA==} + /@algolia/autocomplete-plugin-algolia-insights@1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0)(search-insights@2.9.0): + resolution: {integrity: sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg==} + peerDependencies: + search-insights: '>= 1 < 3' + dependencies: + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0) + search-insights: 2.9.0 + transitivePeerDependencies: + - '@algolia/client-search' + - algoliasearch + dev: true + + /@algolia/autocomplete-preset-algolia@1.9.3(@algolia/client-search@4.17.1)(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 + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0) '@algolia/client-search': 4.17.1 - algoliasearch: 4.17.1 + 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.17.1)(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.17.1 + 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==} dev: true - /@algolia/cache-in-memory@4.17.1: - resolution: {integrity: sha512-NbBt6eBWlsXc5geSpfPRC5dkIB/0Ptthw8r0yM5Z7D3sPlYdnTZSO9y9XWXIptRMwmZe4cM8iBMN8y0tzbcBkA==} + /@algolia/cache-common@4.20.0: + resolution: {integrity: sha512-vCfxauaZutL3NImzB2G9LjLt36vKAckc6DhMp05An14kVo8F1Yofb6SIl6U3SaEz8pG2QOB9ptwM5c+zGevwIQ==} + dev: true + + /@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: @@ -261,12 +288,19 @@ packages: '@algolia/transporter': 4.17.1 dev: true - /@algolia/client-personalization@4.17.1: - resolution: {integrity: sha512-gJku9DG/THJpfsSlG/az0a3QIn+VVff9kKh8PG8+7ZfxOHS+C+Y5YSeZVsC+c2cfoKLPo3CuHIiJ/p86erR3bA==} + /@algolia/client-common@4.20.0: + resolution: {integrity: sha512-P3WgMdEss915p+knMMSd/fwiHRHKvDu4DYRrCRaBrsfFw7EQHon+EbRSm4QisS9NYdxbS04kcvNoavVGthyfqQ==} dependencies: - '@algolia/client-common': 4.17.1 - '@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.20.0: + resolution: {integrity: sha512-N9+zx0tWOQsLc3K4PVRDV8GUeOLAY0i445En79Pr3zWB+m67V+n/8w4Kw1C5LlbHDDJcyhMMIlqezh6BEk7xAQ==} + dependencies: + '@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: @@ -277,30 +311,46 @@ packages: '@algolia/transporter': 4.17.1 dev: true + /@algolia/client-search@4.20.0: + resolution: {integrity: sha512-zgwqnMvhWLdpzKTpd3sGmMlr4c+iS7eyyLGiaO51zDZWGMkpgoNVmltkzdBwxOVXz0RsFMznIxB9zuarUv4TZg==} + dependencies: + '@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==} dev: true - /@algolia/logger-console@4.17.1: - resolution: {integrity: sha512-iKGQTpOjHiE64W3JIOu6dmDvn+AfYIElI9jf/Nt6umRPmP/JI9rK+OHUoW4pKrBtdG0DPd62ppeNXzSnLxY6/g==} + /@algolia/logger-common@4.20.0: + resolution: {integrity: sha512-xouigCMB5WJYEwvoWW5XDv7Z9f0A8VoXJc3VKwlHJw/je+3p2RcDXfksLI4G4lIVncFUYMZx30tP/rsdlvvzHQ==} + dev: true + + /@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==} dev: true - /@algolia/requester-node-http@4.17.1: - resolution: {integrity: sha512-NzFWecXT6d0PPsQY9L+/qoK2deF74OLcpvqCH+Vh3mh+QzPsFafcBExdguAjZsAWDn1R6JEeFW7/fo/p0SE57w==} + /@algolia/requester-common@4.20.0: + resolution: {integrity: sha512-9h6ye6RY/BkfmeJp7Z8gyyeMrmmWsMOCRBXQDs4mZKKsyVlfIVICpcSibbeYcuUdurLhIlrOUkH3rQEgZzonng==} + dev: true + + /@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: @@ -311,6 +361,14 @@ packages: '@algolia/requester-common': 4.17.1 dev: true + /@algolia/transporter@4.20.0: + resolution: {integrity: sha512-Lsii1pGWOAISbzeyuf+r/GPhvHMPHSPrTDWNcIzOE1SG1inlJHICaVe2ikuoRjcpgxZNU54Jl+if15SUCsaTUg==} + dependencies: + '@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: resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} engines: {node: '>=6.0.0'} @@ -616,6 +674,14 @@ packages: dependencies: '@babel/types': 7.22.0 + /@babel/parser@7.23.0: + resolution: {integrity: sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.22.0 + dev: true + /@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==} engines: {node: '>=6.9.0'} @@ -1904,28 +1970,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(@algolia/client-search@4.17.1): - resolution: {integrity: sha512-uOtOHZJv+5PQmL68+srVzlGhLejnEBJgZl1bR87Zh/uK5RUI7p6el1R8hGTl2F8K2tCloNRxTMtXyYUNbMV+qw==} + /@docsearch/js@3.5.2(@algolia/client-search@4.17.1)(search-insights@2.9.0): + resolution: {integrity: sha512-p1YFTCDflk8ieHgFJYfmyHBki1D61+U9idwrLh+GQQMrBSP3DLGKpy0XUJtPjAOPltcVbqsTjiPFfH7JImjUNg==} dependencies: - '@docsearch/react': 3.4.0(@algolia/client-search@4.17.1) + '@docsearch/react': 3.5.2(@algolia/client-search@4.17.1)(search-insights@2.9.0) preact: 10.15.0 transitivePeerDependencies: - '@algolia/client-search' - '@types/react' - react - react-dom + - search-insights dev: true - /@docsearch/react@3.4.0(@algolia/client-search@4.17.1): - resolution: {integrity: sha512-ufrp5879XYGojgS30ZAp8H4qIMbahRHB9M85VDBP36Xgz5QjYM54i1URKj5e219F7gqTtOivfztFTij6itc0MQ==} + /@docsearch/react@3.5.2(@algolia/client-search@4.17.1)(search-insights@2.9.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 @@ -1933,11 +2001,14 @@ 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(@algolia/client-search@4.17.1)(algoliasearch@4.17.1) - '@docsearch/css': 3.4.0 - algoliasearch: 4.17.1 + '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0)(search-insights@2.9.0) + '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0) + '@docsearch/css': 3.5.2 + algoliasearch: 4.20.0 + search-insights: 2.9.0 transitivePeerDependencies: - '@algolia/client-search' dev: true @@ -1951,6 +2022,15 @@ packages: dev: true optional: true + /@esbuild/android-arm64@0.18.20: + resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-arm@0.17.19: resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} engines: {node: '>=12'} @@ -1960,6 +2040,15 @@ packages: dev: true optional: true + /@esbuild/android-arm@0.18.20: + resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-x64@0.17.19: resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} engines: {node: '>=12'} @@ -1969,6 +2058,15 @@ packages: dev: true optional: true + /@esbuild/android-x64@0.18.20: + resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/darwin-arm64@0.17.19: resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} engines: {node: '>=12'} @@ -1978,6 +2076,15 @@ packages: dev: true optional: true + /@esbuild/darwin-arm64@0.18.20: + resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@esbuild/darwin-x64@0.17.19: resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} engines: {node: '>=12'} @@ -1987,6 +2094,15 @@ packages: dev: true optional: true + /@esbuild/darwin-x64@0.18.20: + resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@esbuild/freebsd-arm64@0.17.19: resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} engines: {node: '>=12'} @@ -1996,6 +2112,15 @@ packages: dev: true optional: true + /@esbuild/freebsd-arm64@0.18.20: + resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/freebsd-x64@0.17.19: resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} engines: {node: '>=12'} @@ -2005,6 +2130,15 @@ packages: dev: true optional: true + /@esbuild/freebsd-x64@0.18.20: + resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-arm64@0.17.19: resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} engines: {node: '>=12'} @@ -2014,6 +2148,15 @@ packages: dev: true optional: true + /@esbuild/linux-arm64@0.18.20: + resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-arm@0.17.19: resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} engines: {node: '>=12'} @@ -2023,6 +2166,15 @@ packages: dev: true optional: true + /@esbuild/linux-arm@0.18.20: + resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-ia32@0.17.19: resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} engines: {node: '>=12'} @@ -2032,6 +2184,15 @@ packages: dev: true optional: true + /@esbuild/linux-ia32@0.18.20: + resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-loong64@0.17.19: resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==} engines: {node: '>=12'} @@ -2041,6 +2202,15 @@ packages: dev: true optional: true + /@esbuild/linux-loong64@0.18.20: + resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-mips64el@0.17.19: resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} engines: {node: '>=12'} @@ -2050,6 +2220,15 @@ packages: dev: true optional: true + /@esbuild/linux-mips64el@0.18.20: + resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-ppc64@0.17.19: resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} engines: {node: '>=12'} @@ -2059,6 +2238,15 @@ packages: dev: true optional: true + /@esbuild/linux-ppc64@0.18.20: + resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-riscv64@0.17.19: resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} engines: {node: '>=12'} @@ -2068,6 +2256,15 @@ packages: dev: true optional: true + /@esbuild/linux-riscv64@0.18.20: + resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-s390x@0.17.19: resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} engines: {node: '>=12'} @@ -2077,6 +2274,15 @@ packages: dev: true optional: true + /@esbuild/linux-s390x@0.18.20: + resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-x64@0.17.19: resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} engines: {node: '>=12'} @@ -2086,6 +2292,15 @@ packages: dev: true optional: true + /@esbuild/linux-x64@0.18.20: + resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/netbsd-x64@0.17.19: resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} engines: {node: '>=12'} @@ -2095,6 +2310,15 @@ packages: dev: true optional: true + /@esbuild/netbsd-x64@0.18.20: + resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/openbsd-x64@0.17.19: resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} engines: {node: '>=12'} @@ -2104,6 +2328,15 @@ packages: dev: true optional: true + /@esbuild/openbsd-x64@0.18.20: + resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/sunos-x64@0.17.19: resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} engines: {node: '>=12'} @@ -2113,6 +2346,15 @@ packages: dev: true optional: true + /@esbuild/sunos-x64@0.18.20: + resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-arm64@0.17.19: resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} engines: {node: '>=12'} @@ -2122,6 +2364,15 @@ packages: dev: true optional: true + /@esbuild/win32-arm64@0.18.20: + resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-ia32@0.17.19: resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} engines: {node: '>=12'} @@ -2131,6 +2382,15 @@ packages: dev: true optional: true + /@esbuild/win32-ia32@0.18.20: + resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-x64@0.17.19: resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} engines: {node: '>=12'} @@ -2140,6 +2400,15 @@ packages: dev: true optional: true + /@esbuild/win32-x64@0.18.20: + resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@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} @@ -2539,12 +2808,27 @@ packages: 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.5: + resolution: {integrity: sha512-QhJP7hkq3FCrFNx0szMNCT/79CXfcEgUIA3jc5GBfeXqoKsk3R8JZm2wRXJ2DiyjbPE4VMFOSDemLFcUTZmHEQ==} + 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/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 @@ -2596,8 +2880,8 @@ 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/web-bluetooth@0.0.18: + resolution: {integrity: sha512-v/ZHEj9xh82usl8LMR3GarzFY1IrbXJw5L4QfQhokjRV91q+SelFqxQWSep1ucXEZ22+dSTwLFkXeur25sPIbw==} dev: true /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.52.0)(typescript@5.2.2): @@ -2741,17 +3025,6 @@ packages: vite-plugin-pwa: 0.16.5(vite@4.3.9)(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==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - vite: ^4.0.0 - vue: ^3.2.25 - dependencies: - vite: 4.3.9(@types/node@18.18.6)(sass@1.62.1) - vue: 3.3.4 - dev: true - /@vitest/coverage-v8@0.34.6(vitest@0.34.6): resolution: {integrity: sha512-fivy/OK2d/EsJFoEoxHFEnNGTg+MmdZBAVK9Ka4qhXR2K3J0DS08vcGVwzDtXSuUMabLv4KtPcpSKkcMXFDViw==} peerDependencies: @@ -2833,12 +3106,30 @@ packages: '@vue/shared': 3.3.4 estree-walker: 2.0.2 source-map-js: 1.0.2 + dev: false + + /@vue/compiler-core@3.3.6: + resolution: {integrity: sha512-2JNjemwaNwf+MkkatATVZi7oAH1Hx0B04DdPH3ZoZ8vKC1xZVP7nl4HIsk8XYd3r+/52sqqoz9TWzYc3yE9dqA==} + dependencies: + '@babel/parser': 7.23.0 + '@vue/shared': 3.3.6 + estree-walker: 2.0.2 + source-map-js: 1.0.2 + dev: true /@vue/compiler-dom@3.3.4: resolution: {integrity: sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==} dependencies: '@vue/compiler-core': 3.3.4 '@vue/shared': 3.3.4 + dev: false + + /@vue/compiler-dom@3.3.6: + resolution: {integrity: sha512-1MxXcJYMHiTPexjLAJUkNs/Tw2eDf2tY3a0rL+LfuWyiKN2s6jvSwywH3PWD8bKICjfebX3GWx2Os8jkRDq3Ng==} + dependencies: + '@vue/compiler-core': 3.3.6 + '@vue/shared': 3.3.6 + dev: true /@vue/compiler-sfc@3.3.4: resolution: {integrity: sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==} @@ -2853,15 +3144,39 @@ packages: magic-string: 0.30.5 postcss: 8.4.23 source-map-js: 1.0.2 + dev: false + + /@vue/compiler-sfc@3.3.6: + resolution: {integrity: sha512-/Kms6du2h1VrXFreuZmlvQej8B1zenBqIohP0690IUBkJjsFvJxY0crcvVRJ0UhMgSR9dewB+khdR1DfbpArJA==} + dependencies: + '@babel/parser': 7.23.0 + '@vue/compiler-core': 3.3.6 + '@vue/compiler-dom': 3.3.6 + '@vue/compiler-ssr': 3.3.6 + '@vue/reactivity-transform': 3.3.6 + '@vue/shared': 3.3.6 + estree-walker: 2.0.2 + magic-string: 0.30.5 + postcss: 8.4.31 + source-map-js: 1.0.2 + dev: true /@vue/compiler-ssr@3.3.4: resolution: {integrity: sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==} dependencies: '@vue/compiler-dom': 3.3.4 '@vue/shared': 3.3.4 + dev: false - /@vue/devtools-api@6.5.0: - resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==} + /@vue/compiler-ssr@3.3.6: + resolution: {integrity: sha512-QTIHAfDCHhjXlYGkUg5KH7YwYtdUM1vcFl/FxFDlD6d0nXAmnjizka3HITp8DGudzHndv2PjKVS44vqqy0vP4w==} + dependencies: + '@vue/compiler-dom': 3.3.6 + '@vue/shared': 3.3.6 + dev: true + + /@vue/devtools-api@6.5.1: + resolution: {integrity: sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==} dev: true /@vue/reactivity-transform@3.3.4: @@ -2872,17 +3187,43 @@ packages: '@vue/shared': 3.3.4 estree-walker: 2.0.2 magic-string: 0.30.5 + dev: false + + /@vue/reactivity-transform@3.3.6: + resolution: {integrity: sha512-RlJl4dHfeO7EuzU1iJOsrlqWyJfHTkJbvYz/IOJWqu8dlCNWtxWX377WI0VsbAgBizjwD+3ZjdnvSyyFW1YVng==} + dependencies: + '@babel/parser': 7.23.0 + '@vue/compiler-core': 3.3.6 + '@vue/shared': 3.3.6 + estree-walker: 2.0.2 + magic-string: 0.30.5 + dev: true /@vue/reactivity@3.3.4: resolution: {integrity: sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==} dependencies: '@vue/shared': 3.3.4 + dev: false + + /@vue/reactivity@3.3.6: + resolution: {integrity: sha512-gtChAumfQz5lSy5jZXfyXbKrIYPf9XEOrIr6rxwVyeWVjFhJwmwPLtV6Yis+M9onzX++I5AVE9j+iPH60U+B8Q==} + dependencies: + '@vue/shared': 3.3.6 + dev: true /@vue/runtime-core@3.3.4: resolution: {integrity: sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==} dependencies: '@vue/reactivity': 3.3.4 '@vue/shared': 3.3.4 + dev: false + + /@vue/runtime-core@3.3.6: + resolution: {integrity: sha512-qp7HTP1iw1UW2ZGJ8L3zpqlngrBKvLsDAcq5lA6JvEXHmpoEmjKju7ahM9W2p/h51h0OT5F2fGlP/gMhHOmbUA==} + dependencies: + '@vue/reactivity': 3.3.6 + '@vue/shared': 3.3.6 + dev: true /@vue/runtime-dom@3.3.4: resolution: {integrity: sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==} @@ -2890,6 +3231,15 @@ packages: '@vue/runtime-core': 3.3.4 '@vue/shared': 3.3.4 csstype: 3.1.2 + dev: false + + /@vue/runtime-dom@3.3.6: + resolution: {integrity: sha512-AoX3Cp8NqMXjLbIG9YR6n/pPLWE9TiDdk6wTJHFnl2GpHzDFH1HLBC9wlqqQ7RlnvN3bVLpzPGAAH00SAtOxHg==} + dependencies: + '@vue/runtime-core': 3.3.6 + '@vue/shared': 3.3.6 + csstype: 3.1.2 + dev: true /@vue/server-renderer@3.3.4(vue@3.3.4): resolution: {integrity: sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==} @@ -2899,24 +3249,40 @@ packages: '@vue/compiler-ssr': 3.3.4 '@vue/shared': 3.3.4 vue: 3.3.4 + dev: false + + /@vue/server-renderer@3.3.6(vue@3.3.6): + resolution: {integrity: sha512-kgLoN43W4ERdZ6dpyy+gnk2ZHtcOaIr5Uc/WUP5DRwutgvluzu2pudsZGoD2b7AEJHByUVMa9k6Sho5lLRCykw==} + peerDependencies: + vue: 3.3.6 + dependencies: + '@vue/compiler-ssr': 3.3.6 + '@vue/shared': 3.3.6 + vue: 3.3.6(typescript@5.2.2) + dev: true /@vue/shared@3.3.4: resolution: {integrity: sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==} + dev: false - /@vueuse/core@10.1.2(vue@3.3.4): - resolution: {integrity: sha512-roNn8WuerI56A5uiTyF/TEYX0Y+VKlhZAF94unUfdhbDUI+NfwQMn4FUnUscIRUhv3344qvAghopU4bzLPNFlA==} + /@vue/shared@3.3.6: + resolution: {integrity: sha512-Xno5pEqg8SVhomD0kTSmfh30ZEmV/+jZtyh39q6QflrjdJCXah5lrnOLi9KB6a5k5aAHXMXjoMnxlzUkCNfWLQ==} + dev: true + + /@vueuse/core@10.5.0(vue@3.3.6): + resolution: {integrity: sha512-z/tI2eSvxwLRjOhDm0h/SXAjNm8N5ld6/SC/JQs6o6kpJ6Ya50LnEL8g5hoYu005i28L0zqB5L5yAl8Jl26K3A==} 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.18 + '@vueuse/metadata': 10.5.0 + '@vueuse/shared': 10.5.0(vue@3.3.6) + vue-demi: 0.14.6(vue@3.3.6) 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.5.0(focus-trap@7.5.4)(vue@3.3.6): + resolution: {integrity: sha512-fm5sXLCK0Ww3rRnzqnCQRmfjDURaI4xMsx+T+cec0ngQqHx/JgUtm8G0vRjwtonIeTBsH1Q8L3SucE+7K7upJQ==} peerDependencies: async-validator: '*' axios: '*' @@ -2956,23 +3322,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.5.0(vue@3.3.6) + '@vueuse/shared': 10.5.0(vue@3.3.6) + focus-trap: 7.5.4 + vue-demi: 0.14.6(vue@3.3.6) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true - /@vueuse/metadata@10.1.2: - resolution: {integrity: sha512-3mc5BqN9aU2SqBeBuWE7ne4OtXHoHKggNgxZR2K+zIW4YLsy6xoZ4/9vErQs6tvoKDX6QAqm3lvsrv0mczAwIQ==} + /@vueuse/metadata@10.5.0: + resolution: {integrity: sha512-fEbElR+MaIYyCkeM0SzWkdoMtOpIwO72x8WsZHRE7IggiOlILttqttM69AS13nrDxosnDBYdyy3C5mR1LCxHsw==} dev: true - /@vueuse/shared@10.1.2(vue@3.3.4): - resolution: {integrity: sha512-1uoUTPBlgyscK9v6ScGeVYDDzlPSFXBlxuK7SfrDGyUTBiznb3mNceqhwvZHjtDRELZEN79V5uWPTF1VDV8svA==} + /@vueuse/shared@10.5.0(vue@3.3.6): + resolution: {integrity: sha512-18iyxbbHYLst9MqU1X1QNdMHIjks6wC7XTVf0KNOv5es/Ms6gjVFCAAWTVP2JStuGqydg3DT+ExpFORUEi9yhg==} dependencies: - vue-demi: 0.14.5(vue@3.3.4) + vue-demi: 0.14.6(vue@3.3.6) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -3020,23 +3386,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: @@ -3204,10 +3570,6 @@ packages: engines: {node: '>=8'} dev: true - /body-scroll-lock@4.0.0-beta.0: - resolution: {integrity: sha512-a7tP5+0Mw3YlUJcGAKUqIBkYYGlYxk2fnCasq/FUph1hadxlTRjF+gAcZksxANnaMnALjxEddmSi/H3OR8ugcQ==} - dev: true - /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -3783,6 +4145,36 @@ packages: '@esbuild/win32-x64': 0.17.19 dev: true + /esbuild@0.18.20: + resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.18.20 + '@esbuild/android-arm64': 0.18.20 + '@esbuild/android-x64': 0.18.20 + '@esbuild/darwin-arm64': 0.18.20 + '@esbuild/darwin-x64': 0.18.20 + '@esbuild/freebsd-arm64': 0.18.20 + '@esbuild/freebsd-x64': 0.18.20 + '@esbuild/linux-arm': 0.18.20 + '@esbuild/linux-arm64': 0.18.20 + '@esbuild/linux-ia32': 0.18.20 + '@esbuild/linux-loong64': 0.18.20 + '@esbuild/linux-mips64el': 0.18.20 + '@esbuild/linux-ppc64': 0.18.20 + '@esbuild/linux-riscv64': 0.18.20 + '@esbuild/linux-s390x': 0.18.20 + '@esbuild/linux-x64': 0.18.20 + '@esbuild/netbsd-x64': 0.18.20 + '@esbuild/openbsd-x64': 0.18.20 + '@esbuild/sunos-x64': 0.18.20 + '@esbuild/win32-arm64': 0.18.20 + '@esbuild/win32-ia32': 0.18.20 + '@esbuild/win32-x64': 0.18.20 + dev: true + /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} @@ -4072,10 +4464,10 @@ 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==} + /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: @@ -5449,6 +5841,15 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 + /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: true + /preact@10.15.0: resolution: {integrity: sha512-nZSa8M2R2m1n7nJSBlzDpxRJaIsejrTO1vlFbdpFvyC8qM1iU+On2y0otfoUm6SRB5o0lF0CKDFxg6grEFU0iQ==} dev: true @@ -5719,6 +6120,14 @@ packages: fsevents: 2.3.2 dev: true + /rollup@3.29.4: + resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} + engines: {node: '>=14.18.0', npm: '>=8.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: true + /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -5754,6 +6163,10 @@ packages: resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==} dev: true + /search-insights@2.9.0: + resolution: {integrity: sha512-bkWW9nIHOFkLwjQ1xqVaMbjjO5vhP26ERsH9Y3pKr8imthofEFIxlnOabkmGcw6ksRj9jWidcI65vvjJH/nTGg==} + dev: true + /semver@5.7.1: resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} hasBin: true @@ -5828,6 +6241,15 @@ packages: vscode-textmate: 8.0.0 dev: true + /shiki@0.14.5: + resolution: {integrity: sha512-1gCAYOcmCFONmErGTrS1fjzJLA7MGZmKzrBNX7apqSwhyITJg2O102uFzXUeBxNnEkDA9vHIKLyeKq0V083vIw==} + dependencies: + ansi-sequence-parser: 1.1.0 + jsonc-parser: 3.2.0 + vscode-oniguruma: 1.7.0 + vscode-textmate: 8.0.0 + dev: true + /side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: @@ -6106,8 +6528,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /tabbable@6.1.2: - resolution: {integrity: sha512-qCN98uP7i9z0fIS4amQ5zbGBOq+OSigYeGvPy7NDk8Y9yncqDZ9pRPgfsc2PJIVM9RrJj7GIfuRgmjoUU9zTHQ==} + /tabbable@6.2.0: + resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} dev: true /temp-dir@2.0.0: @@ -6736,23 +7158,67 @@ packages: fsevents: 2.3.2 dev: true - /vitepress@1.0.0-beta.1(@algolia/client-search@4.17.1)(@types/node@18.18.6)(sass@1.62.1): - resolution: {integrity: sha512-V2yyCwQ+v9fh7rbnGDLp8M7vHa9sLElexXf/JHtBOsOwv7ed9wt1QI4WUagYgKR3TeoJT9v2s6f0UaQSne0EvQ==} + /vite@4.5.0(@types/node@18.18.6)(sass@1.62.1): + resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} + engines: {node: ^14.18.0 || >=16.0.0} hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true dependencies: - '@docsearch/css': 3.4.0 - '@docsearch/js': 3.4.0(@algolia/client-search@4.17.1) - '@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 + '@types/node': 18.18.6 + esbuild: 0.18.20 + postcss: 8.4.31 + rollup: 3.29.4 + sass: 1.62.1 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /vitepress@1.0.0-rc.23(@algolia/client-search@4.17.1)(@types/node@18.18.6)(sass@1.62.1)(search-insights@2.9.0)(typescript@5.2.2): + resolution: {integrity: sha512-0YoBt8aFgbRt2JtYaCeTqq4W21q5lbGso+g1ZwkYYS35ExJxORssRJunhFuUcby8QeN4BP/88QDgsVSIVLAfXQ==} + hasBin: true + peerDependencies: + markdown-it-mathjax3: ^4.3.2 + postcss: ^8.4.31 + peerDependenciesMeta: + markdown-it-mathjax3: + optional: true + postcss: + optional: true + dependencies: + '@docsearch/css': 3.5.2 + '@docsearch/js': 3.5.2(@algolia/client-search@4.17.1)(search-insights@2.9.0) + '@types/markdown-it': 13.0.5 + '@vue/devtools-api': 6.5.1 + '@vueuse/core': 10.5.0(vue@3.3.6) + '@vueuse/integrations': 10.5.0(focus-trap@7.5.4)(vue@3.3.6) + 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.18.6)(sass@1.62.1) - vue: 3.3.4 + shiki: 0.14.5 + vite: 4.5.0(@types/node@18.18.6)(sass@1.62.1) + vue: 3.3.6(typescript@5.2.2) transitivePeerDependencies: - '@algolia/client-search' - '@types/node' @@ -6766,15 +7232,18 @@ packages: - idb-keyval - jwt-decode - less + - lightningcss - nprogress - qrcode - react - react-dom - sass + - search-insights - sortablejs - stylus - sugarss - terser + - typescript - universal-cookie dev: true @@ -6863,8 +7332,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.6): + resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} engines: {node: '>=12'} hasBin: true requiresBuild: true @@ -6875,7 +7344,7 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.3.4 + vue: 3.3.6(typescript@5.2.2) dev: true /vue@3.3.4: @@ -6886,6 +7355,23 @@ packages: '@vue/runtime-dom': 3.3.4 '@vue/server-renderer': 3.3.4(vue@3.3.4) '@vue/shared': 3.3.4 + dev: false + + /vue@3.3.6(typescript@5.2.2): + resolution: {integrity: sha512-jJIDETeWJnoY+gfn4ZtMPMS5KtbP4ax+CT4dcQFhTnWEk8xMupFyQ0JxL28nvT/M4+p4a0ptxaV2WY0LiIxvRg==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@vue/compiler-dom': 3.3.6 + '@vue/compiler-sfc': 3.3.6 + '@vue/runtime-dom': 3.3.6 + '@vue/server-renderer': 3.3.6(vue@3.3.6) + '@vue/shared': 3.3.6 + typescript: 5.2.2 + dev: true /wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} From 8569df22021a51027f1890b97d12cf6b756dbb50 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:31:58 +0000 Subject: [PATCH 26/93] chore(deps): update dependency @vite-pwa/vitepress to v0.2.3 --- apps/docs/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index 3e0694d7..d43d45c4 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -22,7 +22,7 @@ }, "devDependencies": { "@types/node": "18.18.6", - "@vite-pwa/vitepress": "0.0.5", + "@vite-pwa/vitepress": "0.2.3", "dotenv": "16.3.1", "eslint": "8.52.0", "eslint-config-custom": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index af7d542f..2d0d0572 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,8 +43,8 @@ importers: specifier: 18.18.6 version: 18.18.6 '@vite-pwa/vitepress': - specifier: 0.0.5 - version: 0.0.5(vite-plugin-pwa@0.16.5) + specifier: 0.2.3 + version: 0.2.3(vite-plugin-pwa@0.16.5) dotenv: specifier: 16.3.1 version: 16.3.1 @@ -2733,10 +2733,10 @@ packages: /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - /@vite-pwa/vitepress@0.0.5(vite-plugin-pwa@0.16.5): - resolution: {integrity: sha512-B6xy9wxi9fen+/AnRkY2+XCrbhqh2b/TsVTka6qFQ3zJ8zHSoEUHUucYT3KHMcY5I124G0ZmPKNW+UF9Jx1k4w==} + /@vite-pwa/vitepress@0.2.3(vite-plugin-pwa@0.16.5): + resolution: {integrity: sha512-6k9151CmILbSJQ88hLEMLL+MOQZDURKg2c4Wo5UcaEaOWU0jv7S+mo8nqyg86sM6ry8Jlnp6Zfv6AE0FqnfEyQ==} peerDependencies: - vite-plugin-pwa: ^0.14.0 + vite-plugin-pwa: '>=0.16.5 <1' dependencies: vite-plugin-pwa: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@7.0.0) dev: true From 430e71067f9954f71538d01fab407f79090a35b5 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Mon, 23 Oct 2023 23:42:35 -0500 Subject: [PATCH 27/93] fix(docs): vitepress broken after update, add type:module to docs pkg.json --- apps/docs/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/docs/package.json b/apps/docs/package.json index 781530d4..e2c4ad06 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -4,6 +4,7 @@ "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", From 0bd8663b97065d97c656e645fb32879da9cb50f6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 03:49:46 +0000 Subject: [PATCH 28/93] fix(deps): update dependency vue to v3.3.7 --- apps/docs/package.json | 2 +- pnpm-lock.yaml | 313 ++++++++++++----------------------------- 2 files changed, 88 insertions(+), 227 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index c550d021..be69e51a 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -19,7 +19,7 @@ }, "dependencies": { "@shaggytools/nhtsa-api-wrapper": "workspace:*", - "vue": "3.3.4" + "vue": "3.3.7" }, "devDependencies": { "@types/node": "18.18.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1cc93fc6..bbf8070e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,8 +36,8 @@ 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.18.6 @@ -80,7 +80,7 @@ importers: version: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@7.0.0) vitepress: specifier: 1.0.0-rc.23 - version: 1.0.0-rc.23(@algolia/client-search@4.17.1)(@types/node@18.18.6)(sass@1.62.1)(search-insights@2.9.0)(typescript@5.2.2) + version: 1.0.0-rc.23(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.62.1)(search-insights@2.9.0)(typescript@5.2.2) workbox-window: specifier: 7.0.0 version: 7.0.0 @@ -200,47 +200,47 @@ packages: resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} engines: {node: '>=0.10.0'} - /@algolia/autocomplete-core@1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0)(search-insights@2.9.0): + /@algolia/autocomplete-core@1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0)(search-insights@2.9.0): resolution: {integrity: sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==} dependencies: - '@algolia/autocomplete-plugin-algolia-insights': 1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0)(search-insights@2.9.0) - '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0) + '@algolia/autocomplete-plugin-algolia-insights': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0)(search-insights@2.9.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.17.1)(algoliasearch@4.20.0)(search-insights@2.9.0): + /@algolia/autocomplete-plugin-algolia-insights@1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0)(search-insights@2.9.0): resolution: {integrity: sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg==} peerDependencies: search-insights: '>= 1 < 3' dependencies: - '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0) + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0) search-insights: 2.9.0 transitivePeerDependencies: - '@algolia/client-search' - algoliasearch dev: true - /@algolia/autocomplete-preset-algolia@1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0): + /@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.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0) - '@algolia/client-search': 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.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0): + /@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.17.1 + '@algolia/client-search': 4.20.0 algoliasearch: 4.20.0 dev: true @@ -250,10 +250,6 @@ packages: '@algolia/cache-common': 4.20.0 dev: true - /@algolia/cache-common@4.17.1: - resolution: {integrity: sha512-fvi1WT8aSiGAKrcTw8Qg3RYgcwW8GZMHcqEm4AyDBEy72JZlFBSY80cTQ75MslINjCHXLDT+9EN8AGI9WVY7uA==} - dev: true - /@algolia/cache-common@4.20.0: resolution: {integrity: sha512-vCfxauaZutL3NImzB2G9LjLt36vKAckc6DhMp05An14kVo8F1Yofb6SIl6U3SaEz8pG2QOB9ptwM5c+zGevwIQ==} dev: true @@ -281,13 +277,6 @@ packages: '@algolia/transporter': 4.20.0 dev: true - /@algolia/client-common@4.17.1: - resolution: {integrity: sha512-+r7kg4EgbFnGsDnoGSVNtXZO8xvZ0vzf1WAOV7sqV9PMf1bp6cpJP/3IuPrSk4t5w2KVl+pC8jfTM7HcFlfBEQ==} - dependencies: - '@algolia/requester-common': 4.17.1 - '@algolia/transporter': 4.17.1 - dev: true - /@algolia/client-common@4.20.0: resolution: {integrity: sha512-P3WgMdEss915p+knMMSd/fwiHRHKvDu4DYRrCRaBrsfFw7EQHon+EbRSm4QisS9NYdxbS04kcvNoavVGthyfqQ==} dependencies: @@ -303,14 +292,6 @@ packages: '@algolia/transporter': 4.20.0 dev: true - /@algolia/client-search@4.17.1: - resolution: {integrity: sha512-Q5YfT5gVkx60PZDQBqp/zH9aUbBdC7HVvxupiHUgnCKqRQsRZjOhLest7AI6FahepuZLBZS62COrO7v+JvKY7w==} - dependencies: - '@algolia/client-common': 4.17.1 - '@algolia/requester-common': 4.17.1 - '@algolia/transporter': 4.17.1 - dev: true - /@algolia/client-search@4.20.0: resolution: {integrity: sha512-zgwqnMvhWLdpzKTpd3sGmMlr4c+iS7eyyLGiaO51zDZWGMkpgoNVmltkzdBwxOVXz0RsFMznIxB9zuarUv4TZg==} dependencies: @@ -319,10 +300,6 @@ packages: '@algolia/transporter': 4.20.0 dev: true - /@algolia/logger-common@4.17.1: - resolution: {integrity: sha512-Us28Ot+fLEmX9M96sa65VZ8EyEEzhYPxfhV9aQyKDjfXbUdJlJxKt6wZpoEg9RAPSdO8IjK9nmuW2P8au3rRsg==} - dev: true - /@algolia/logger-common@4.20.0: resolution: {integrity: sha512-xouigCMB5WJYEwvoWW5XDv7Z9f0A8VoXJc3VKwlHJw/je+3p2RcDXfksLI4G4lIVncFUYMZx30tP/rsdlvvzHQ==} dev: true @@ -339,10 +316,6 @@ packages: '@algolia/requester-common': 4.20.0 dev: true - /@algolia/requester-common@4.17.1: - resolution: {integrity: sha512-HggXdjvVFQR0I5l7hM5WdHgQ1tqcRWeyXZz8apQ7zPWZhirmY2E9D6LVhDh/UnWQNEm7nBtM+eMFONJ3bZccIQ==} - dev: true - /@algolia/requester-common@4.20.0: resolution: {integrity: sha512-9h6ye6RY/BkfmeJp7Z8gyyeMrmmWsMOCRBXQDs4mZKKsyVlfIVICpcSibbeYcuUdurLhIlrOUkH3rQEgZzonng==} dev: true @@ -353,14 +326,6 @@ packages: '@algolia/requester-common': 4.20.0 dev: true - /@algolia/transporter@4.17.1: - resolution: {integrity: sha512-ZM+qhX47Vh46mWH8/U9ihvy98HdTYpYQDSlqBD7IbiUbbyoCMke+qmdSX2MGhR2FCcXBSxejsJKKVAfbpaLVgg==} - dependencies: - '@algolia/cache-common': 4.17.1 - '@algolia/logger-common': 4.17.1 - '@algolia/requester-common': 4.17.1 - dev: true - /@algolia/transporter@4.20.0: resolution: {integrity: sha512-Lsii1pGWOAISbzeyuf+r/GPhvHMPHSPrTDWNcIzOE1SG1inlJHICaVe2ikuoRjcpgxZNU54Jl+if15SUCsaTUg==} dependencies: @@ -411,7 +376,7 @@ packages: '@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/parser': 7.23.0 '@babel/template': 7.21.9 '@babel/traverse': 7.22.1 '@babel/types': 7.22.0 @@ -673,6 +638,7 @@ packages: hasBin: true dependencies: '@babel/types': 7.22.0 + dev: true /@babel/parser@7.23.0: resolution: {integrity: sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==} @@ -680,7 +646,6 @@ packages: hasBin: true dependencies: '@babel/types': 7.22.0 - dev: true /@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==} @@ -1577,7 +1542,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.21.4 - '@babel/parser': 7.22.0 + '@babel/parser': 7.23.0 '@babel/types': 7.22.0 dev: true @@ -1591,7 +1556,7 @@ packages: '@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/parser': 7.23.0 '@babel/types': 7.22.0 debug: 4.3.4 globals: 11.12.0 @@ -1974,10 +1939,10 @@ packages: resolution: {integrity: sha512-SPiDHaWKQZpwR2siD0KQUwlStvIAnEyK6tAE2h2Wuoq8ue9skzhlyVQ1ddzOxX6khULnAALDiR/isSF3bnuciA==} dev: true - /@docsearch/js@3.5.2(@algolia/client-search@4.17.1)(search-insights@2.9.0): + /@docsearch/js@3.5.2(@algolia/client-search@4.20.0)(search-insights@2.9.0): resolution: {integrity: sha512-p1YFTCDflk8ieHgFJYfmyHBki1D61+U9idwrLh+GQQMrBSP3DLGKpy0XUJtPjAOPltcVbqsTjiPFfH7JImjUNg==} dependencies: - '@docsearch/react': 3.5.2(@algolia/client-search@4.17.1)(search-insights@2.9.0) + '@docsearch/react': 3.5.2(@algolia/client-search@4.20.0)(search-insights@2.9.0) preact: 10.15.0 transitivePeerDependencies: - '@algolia/client-search' @@ -1987,7 +1952,7 @@ packages: - search-insights dev: true - /@docsearch/react@3.5.2(@algolia/client-search@4.17.1)(search-insights@2.9.0): + /@docsearch/react@3.5.2(@algolia/client-search@4.20.0)(search-insights@2.9.0): resolution: {integrity: sha512-9Ahcrs5z2jq/DcAvYtvlqEBHImbm4YJI8M9y0x6Tqg598P40HTEkX7hsMcIuThI+hTFxRGZ9hll0Wygm2yEjng==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' @@ -2004,8 +1969,8 @@ packages: search-insights: optional: true dependencies: - '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0)(search-insights@2.9.0) - '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.17.1)(algoliasearch@4.20.0) + '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0)(search-insights@2.9.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.9.0 @@ -3094,189 +3059,96 @@ packages: pretty-format: 29.7.0 dev: true - /@vue/compiler-core@3.3.4: - resolution: {integrity: sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==} - dependencies: - '@babel/parser': 7.22.0 - '@vue/shared': 3.3.4 - estree-walker: 2.0.2 - source-map-js: 1.0.2 - dev: false - - /@vue/compiler-core@3.3.6: - resolution: {integrity: sha512-2JNjemwaNwf+MkkatATVZi7oAH1Hx0B04DdPH3ZoZ8vKC1xZVP7nl4HIsk8XYd3r+/52sqqoz9TWzYc3yE9dqA==} + /@vue/compiler-core@3.3.7: + resolution: {integrity: sha512-pACdY6YnTNVLXsB86YD8OF9ihwpolzhhtdLVHhBL6do/ykr6kKXNYABRtNMGrsQXpEXXyAdwvWWkuTbs4MFtPQ==} dependencies: '@babel/parser': 7.23.0 - '@vue/shared': 3.3.6 + '@vue/shared': 3.3.7 estree-walker: 2.0.2 source-map-js: 1.0.2 - dev: true - /@vue/compiler-dom@3.3.4: - resolution: {integrity: sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==} + /@vue/compiler-dom@3.3.7: + resolution: {integrity: sha512-0LwkyJjnUPssXv/d1vNJ0PKfBlDoQs7n81CbO6Q0zdL7H1EzqYRrTVXDqdBVqro0aJjo/FOa1qBAPVI4PGSHBw==} dependencies: - '@vue/compiler-core': 3.3.4 - '@vue/shared': 3.3.4 - dev: false + '@vue/compiler-core': 3.3.7 + '@vue/shared': 3.3.7 - /@vue/compiler-dom@3.3.6: - resolution: {integrity: sha512-1MxXcJYMHiTPexjLAJUkNs/Tw2eDf2tY3a0rL+LfuWyiKN2s6jvSwywH3PWD8bKICjfebX3GWx2Os8jkRDq3Ng==} - dependencies: - '@vue/compiler-core': 3.3.6 - '@vue/shared': 3.3.6 - dev: true - - /@vue/compiler-sfc@3.3.4: - resolution: {integrity: sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==} - 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 - estree-walker: 2.0.2 - magic-string: 0.30.5 - postcss: 8.4.23 - source-map-js: 1.0.2 - dev: false - - /@vue/compiler-sfc@3.3.6: - resolution: {integrity: sha512-/Kms6du2h1VrXFreuZmlvQej8B1zenBqIohP0690IUBkJjsFvJxY0crcvVRJ0UhMgSR9dewB+khdR1DfbpArJA==} + /@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.6 - '@vue/compiler-dom': 3.3.6 - '@vue/compiler-ssr': 3.3.6 - '@vue/reactivity-transform': 3.3.6 - '@vue/shared': 3.3.6 + '@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.5 postcss: 8.4.31 source-map-js: 1.0.2 - dev: true - /@vue/compiler-ssr@3.3.4: - resolution: {integrity: sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==} + /@vue/compiler-ssr@3.3.7: + resolution: {integrity: sha512-TxOfNVVeH3zgBc82kcUv+emNHo+vKnlRrkv8YvQU5+Y5LJGJwSNzcmLUoxD/dNzv0bhQ/F0s+InlgV0NrApJZg==} dependencies: - '@vue/compiler-dom': 3.3.4 - '@vue/shared': 3.3.4 - dev: false - - /@vue/compiler-ssr@3.3.6: - resolution: {integrity: sha512-QTIHAfDCHhjXlYGkUg5KH7YwYtdUM1vcFl/FxFDlD6d0nXAmnjizka3HITp8DGudzHndv2PjKVS44vqqy0vP4w==} - dependencies: - '@vue/compiler-dom': 3.3.6 - '@vue/shared': 3.3.6 - dev: true + '@vue/compiler-dom': 3.3.7 + '@vue/shared': 3.3.7 /@vue/devtools-api@6.5.1: resolution: {integrity: sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==} dev: true - /@vue/reactivity-transform@3.3.4: - resolution: {integrity: sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==} - dependencies: - '@babel/parser': 7.22.0 - '@vue/compiler-core': 3.3.4 - '@vue/shared': 3.3.4 - estree-walker: 2.0.2 - magic-string: 0.30.5 - dev: false - - /@vue/reactivity-transform@3.3.6: - resolution: {integrity: sha512-RlJl4dHfeO7EuzU1iJOsrlqWyJfHTkJbvYz/IOJWqu8dlCNWtxWX377WI0VsbAgBizjwD+3ZjdnvSyyFW1YVng==} + /@vue/reactivity-transform@3.3.7: + resolution: {integrity: sha512-APhRmLVbgE1VPGtoLQoWBJEaQk4V8JUsqrQihImVqKT+8U6Qi3t5ATcg4Y9wGAPb3kIhetpufyZ1RhwbZCIdDA==} dependencies: '@babel/parser': 7.23.0 - '@vue/compiler-core': 3.3.6 - '@vue/shared': 3.3.6 + '@vue/compiler-core': 3.3.7 + '@vue/shared': 3.3.7 estree-walker: 2.0.2 magic-string: 0.30.5 - dev: true - - /@vue/reactivity@3.3.4: - resolution: {integrity: sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==} - dependencies: - '@vue/shared': 3.3.4 - dev: false - /@vue/reactivity@3.3.6: - resolution: {integrity: sha512-gtChAumfQz5lSy5jZXfyXbKrIYPf9XEOrIr6rxwVyeWVjFhJwmwPLtV6Yis+M9onzX++I5AVE9j+iPH60U+B8Q==} + /@vue/reactivity@3.3.7: + resolution: {integrity: sha512-cZNVjWiw00708WqT0zRpyAgduG79dScKEPYJXq2xj/aMtk3SKvL3FBt2QKUlh6EHBJ1m8RhBY+ikBUzwc7/khg==} dependencies: - '@vue/shared': 3.3.6 - dev: true + '@vue/shared': 3.3.7 - /@vue/runtime-core@3.3.4: - resolution: {integrity: sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==} + /@vue/runtime-core@3.3.7: + resolution: {integrity: sha512-LHq9du3ubLZFdK/BP0Ysy3zhHqRfBn80Uc+T5Hz3maFJBGhci1MafccnL3rpd5/3wVfRHAe6c+PnlO2PAavPTQ==} dependencies: - '@vue/reactivity': 3.3.4 - '@vue/shared': 3.3.4 - dev: false + '@vue/reactivity': 3.3.7 + '@vue/shared': 3.3.7 - /@vue/runtime-core@3.3.6: - resolution: {integrity: sha512-qp7HTP1iw1UW2ZGJ8L3zpqlngrBKvLsDAcq5lA6JvEXHmpoEmjKju7ahM9W2p/h51h0OT5F2fGlP/gMhHOmbUA==} + /@vue/runtime-dom@3.3.7: + resolution: {integrity: sha512-PFQU1oeJxikdDmrfoNQay5nD4tcPNYixUBruZzVX/l0eyZvFKElZUjW4KctCcs52nnpMGO6UDK+jF5oV4GT5Lw==} dependencies: - '@vue/reactivity': 3.3.6 - '@vue/shared': 3.3.6 - dev: true - - /@vue/runtime-dom@3.3.4: - resolution: {integrity: sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==} - dependencies: - '@vue/runtime-core': 3.3.4 - '@vue/shared': 3.3.4 - csstype: 3.1.2 - dev: false - - /@vue/runtime-dom@3.3.6: - resolution: {integrity: sha512-AoX3Cp8NqMXjLbIG9YR6n/pPLWE9TiDdk6wTJHFnl2GpHzDFH1HLBC9wlqqQ7RlnvN3bVLpzPGAAH00SAtOxHg==} - dependencies: - '@vue/runtime-core': 3.3.6 - '@vue/shared': 3.3.6 + '@vue/runtime-core': 3.3.7 + '@vue/shared': 3.3.7 csstype: 3.1.2 - dev: true - - /@vue/server-renderer@3.3.4(vue@3.3.4): - resolution: {integrity: sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==} - peerDependencies: - vue: 3.3.4 - dependencies: - '@vue/compiler-ssr': 3.3.4 - '@vue/shared': 3.3.4 - vue: 3.3.4 - dev: false - /@vue/server-renderer@3.3.6(vue@3.3.6): - resolution: {integrity: sha512-kgLoN43W4ERdZ6dpyy+gnk2ZHtcOaIr5Uc/WUP5DRwutgvluzu2pudsZGoD2b7AEJHByUVMa9k6Sho5lLRCykw==} + /@vue/server-renderer@3.3.7(vue@3.3.7): + resolution: {integrity: sha512-UlpKDInd1hIZiNuVVVvLgxpfnSouxKQOSE2bOfQpBuGwxRV/JqqTCyyjXUWiwtVMyeRaZhOYYqntxElk8FhBhw==} peerDependencies: - vue: 3.3.6 + vue: 3.3.7 dependencies: - '@vue/compiler-ssr': 3.3.6 - '@vue/shared': 3.3.6 - vue: 3.3.6(typescript@5.2.2) - dev: true + '@vue/compiler-ssr': 3.3.7 + '@vue/shared': 3.3.7 + vue: 3.3.7(typescript@5.2.2) - /@vue/shared@3.3.4: - resolution: {integrity: sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==} - dev: false + /@vue/shared@3.3.7: + resolution: {integrity: sha512-N/tbkINRUDExgcPTBvxNkvHGu504k8lzlNQRITVnm6YjOjwa4r0nnbd4Jb01sNpur5hAllyRJzSK5PvB9PPwRg==} - /@vue/shared@3.3.6: - resolution: {integrity: sha512-Xno5pEqg8SVhomD0kTSmfh30ZEmV/+jZtyh39q6QflrjdJCXah5lrnOLi9KB6a5k5aAHXMXjoMnxlzUkCNfWLQ==} - dev: true - - /@vueuse/core@10.5.0(vue@3.3.6): + /@vueuse/core@10.5.0(vue@3.3.7): resolution: {integrity: sha512-z/tI2eSvxwLRjOhDm0h/SXAjNm8N5ld6/SC/JQs6o6kpJ6Ya50LnEL8g5hoYu005i28L0zqB5L5yAl8Jl26K3A==} dependencies: '@types/web-bluetooth': 0.0.18 '@vueuse/metadata': 10.5.0 - '@vueuse/shared': 10.5.0(vue@3.3.6) - vue-demi: 0.14.6(vue@3.3.6) + '@vueuse/shared': 10.5.0(vue@3.3.7) + vue-demi: 0.14.6(vue@3.3.7) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true - /@vueuse/integrations@10.5.0(focus-trap@7.5.4)(vue@3.3.6): + /@vueuse/integrations@10.5.0(focus-trap@7.5.4)(vue@3.3.7): resolution: {integrity: sha512-fm5sXLCK0Ww3rRnzqnCQRmfjDURaI4xMsx+T+cec0ngQqHx/JgUtm8G0vRjwtonIeTBsH1Q8L3SucE+7K7upJQ==} peerDependencies: async-validator: '*' @@ -3317,10 +3189,10 @@ packages: universal-cookie: optional: true dependencies: - '@vueuse/core': 10.5.0(vue@3.3.6) - '@vueuse/shared': 10.5.0(vue@3.3.6) + '@vueuse/core': 10.5.0(vue@3.3.7) + '@vueuse/shared': 10.5.0(vue@3.3.7) focus-trap: 7.5.4 - vue-demi: 0.14.6(vue@3.3.6) + vue-demi: 0.14.6(vue@3.3.7) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -3330,10 +3202,10 @@ packages: resolution: {integrity: sha512-fEbElR+MaIYyCkeM0SzWkdoMtOpIwO72x8WsZHRE7IggiOlILttqttM69AS13nrDxosnDBYdyy3C5mR1LCxHsw==} dev: true - /@vueuse/shared@10.5.0(vue@3.3.6): + /@vueuse/shared@10.5.0(vue@3.3.7): resolution: {integrity: sha512-18iyxbbHYLst9MqU1X1QNdMHIjks6wC7XTVf0KNOv5es/Ms6gjVFCAAWTVP2JStuGqydg3DT+ExpFORUEi9yhg==} dependencies: - vue-demi: 0.14.6(vue@3.3.6) + vue-demi: 0.14.6(vue@3.3.7) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -5842,6 +5714,7 @@ packages: nanoid: 3.3.6 picocolors: 1.0.0 source-map-js: 1.0.2 + dev: true /postcss@8.4.31: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} @@ -5850,7 +5723,6 @@ packages: nanoid: 3.3.6 picocolors: 1.0.0 source-map-js: 1.0.2 - dev: true /preact@10.15.0: resolution: {integrity: sha512-nZSa8M2R2m1n7nJSBlzDpxRJaIsejrTO1vlFbdpFvyC8qM1iU+On2y0otfoUm6SRB5o0lF0CKDFxg6grEFU0iQ==} @@ -7197,7 +7069,7 @@ packages: fsevents: 2.3.2 dev: true - /vitepress@1.0.0-rc.23(@algolia/client-search@4.17.1)(@types/node@18.18.6)(sass@1.62.1)(search-insights@2.9.0)(typescript@5.2.2): + /vitepress@1.0.0-rc.23(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.62.1)(search-insights@2.9.0)(typescript@5.2.2): resolution: {integrity: sha512-0YoBt8aFgbRt2JtYaCeTqq4W21q5lbGso+g1ZwkYYS35ExJxORssRJunhFuUcby8QeN4BP/88QDgsVSIVLAfXQ==} hasBin: true peerDependencies: @@ -7210,17 +7082,17 @@ packages: optional: true dependencies: '@docsearch/css': 3.5.2 - '@docsearch/js': 3.5.2(@algolia/client-search@4.17.1)(search-insights@2.9.0) + '@docsearch/js': 3.5.2(@algolia/client-search@4.20.0)(search-insights@2.9.0) '@types/markdown-it': 13.0.5 '@vue/devtools-api': 6.5.1 - '@vueuse/core': 10.5.0(vue@3.3.6) - '@vueuse/integrations': 10.5.0(focus-trap@7.5.4)(vue@3.3.6) + '@vueuse/core': 10.5.0(vue@3.3.7) + '@vueuse/integrations': 10.5.0(focus-trap@7.5.4)(vue@3.3.7) focus-trap: 7.5.4 mark.js: 8.11.1 minisearch: 6.1.0 shiki: 0.14.5 vite: 4.5.0(@types/node@18.18.6)(sass@1.62.1) - vue: 3.3.6(typescript@5.2.2) + vue: 3.3.7(typescript@5.2.2) transitivePeerDependencies: - '@algolia/client-search' - '@types/node' @@ -7334,7 +7206,7 @@ packages: resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} dev: true - /vue-demi@0.14.6(vue@3.3.6): + /vue-demi@0.14.6(vue@3.3.7): resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} engines: {node: '>=12'} hasBin: true @@ -7346,34 +7218,23 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.3.6(typescript@5.2.2) + vue: 3.3.7(typescript@5.2.2) dev: true - /vue@3.3.4: - resolution: {integrity: sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==} - 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 - dev: false - - /vue@3.3.6(typescript@5.2.2): - resolution: {integrity: sha512-jJIDETeWJnoY+gfn4ZtMPMS5KtbP4ax+CT4dcQFhTnWEk8xMupFyQ0JxL28nvT/M4+p4a0ptxaV2WY0LiIxvRg==} + /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.6 - '@vue/compiler-sfc': 3.3.6 - '@vue/runtime-dom': 3.3.6 - '@vue/server-renderer': 3.3.6(vue@3.3.6) - '@vue/shared': 3.3.6 + '@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: true /wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} From 32b1fd4ed48e2b348653e6c38f9001a234333c16 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 04:35:38 +0000 Subject: [PATCH 29/93] chore(deps): update dependency sass to v1.69.4 --- apps/docs/package.json | 2 +- pnpm-lock.yaml | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index be69e51a..8f3dcd64 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -30,7 +30,7 @@ "prettier": "2.8.8", "prettier-config": "workspace:*", "rimraf": "5.0.5", - "sass": "1.62.1", + "sass": "1.69.4", "sitemap": "7.1.1", "tsconfig": "workspace:*", "typescript": "5.2.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbf8070e..7e445050 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -64,8 +64,8 @@ importers: 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 @@ -80,7 +80,7 @@ importers: version: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@7.0.0) vitepress: specifier: 1.0.0-rc.23 - version: 1.0.0-rc.23(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.62.1)(search-insights@2.9.0)(typescript@5.2.2) + version: 1.0.0-rc.23(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2) workbox-window: specifier: 7.0.0 version: 7.0.0 @@ -6023,8 +6023,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: @@ -6908,7 +6908,7 @@ packages: debug: 4.3.4 fast-glob: 3.3.1 pretty-bytes: 6.1.1 - vite: 4.3.9(@types/node@18.18.6)(sass@1.62.1) + vite: 4.3.9(@types/node@18.18.6)(sass@1.69.4) workbox-build: 7.0.0 workbox-window: 7.0.0 transitivePeerDependencies: @@ -6965,7 +6965,7 @@ packages: fsevents: 2.3.2 dev: true - /vite@4.3.9(@types/node@18.18.6)(sass@1.62.1): + /vite@4.3.9(@types/node@18.18.6)(sass@1.69.4): resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -6994,7 +6994,7 @@ packages: esbuild: 0.17.19 postcss: 8.4.23 rollup: 3.23.0 - sass: 1.62.1 + sass: 1.69.4 optionalDependencies: fsevents: 2.3.2 dev: true @@ -7032,7 +7032,7 @@ packages: fsevents: 2.3.2 dev: true - /vite@4.5.0(@types/node@18.18.6)(sass@1.62.1): + /vite@4.5.0(@types/node@18.18.6)(sass@1.69.4): resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -7064,12 +7064,12 @@ packages: esbuild: 0.18.20 postcss: 8.4.31 rollup: 3.29.4 - sass: 1.62.1 + sass: 1.69.4 optionalDependencies: fsevents: 2.3.2 dev: true - /vitepress@1.0.0-rc.23(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.62.1)(search-insights@2.9.0)(typescript@5.2.2): + /vitepress@1.0.0-rc.23(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2): resolution: {integrity: sha512-0YoBt8aFgbRt2JtYaCeTqq4W21q5lbGso+g1ZwkYYS35ExJxORssRJunhFuUcby8QeN4BP/88QDgsVSIVLAfXQ==} hasBin: true peerDependencies: @@ -7091,7 +7091,7 @@ packages: mark.js: 8.11.1 minisearch: 6.1.0 shiki: 0.14.5 - vite: 4.5.0(@types/node@18.18.6)(sass@1.62.1) + vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) vue: 3.3.7(typescript@5.2.2) transitivePeerDependencies: - '@algolia/client-search' From 7eee458533890ddd296de328b4a9151d1e84c61b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 04:36:04 +0000 Subject: [PATCH 30/93] chore(deps): update dependency typedoc-plugin-markdown to v3.16.0 --- config/typedoc-config/package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/typedoc-config/package.json b/config/typedoc-config/package.json index 4b450f12..29bf4198 100644 --- a/config/typedoc-config/package.json +++ b/config/typedoc-config/package.json @@ -6,7 +6,7 @@ "main": "typedoc-config.js", "devDependencies": { "typedoc": "0.25.2", - "typedoc-plugin-markdown": "3.15.3", + "typedoc-plugin-markdown": "3.16.0", "typescript": "5.2.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbf8070e..c8023b84 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -131,8 +131,8 @@ importers: 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.25.2) + specifier: 3.16.0 + version: 3.16.0(typedoc@0.25.2) typescript: specifier: 5.2.2 version: 5.2.2 @@ -6702,8 +6702,8 @@ packages: is-typed-array: 1.1.10 dev: true - /typedoc-plugin-markdown@3.15.3(typedoc@0.25.2): - resolution: {integrity: sha512-idntFYu3vfaY3eaD+w9DeRd0PmNGqGuNLKihPU9poxFGnATJYGn9dPtEhn2QrTdishFMg7jPXAhos+2T6YCWRQ==} + /typedoc-plugin-markdown@3.16.0(typedoc@0.25.2): + resolution: {integrity: sha512-eeiC78fDNGFwemPIHiwRC+mEC7W5jwt3fceUev2gJ2nFnXpVHo8eRrpC9BLWZDee6ehnz/sPmNjizbXwpfaTBw==} peerDependencies: typedoc: '>=0.24.0' dependencies: From fd5bc252d561ba5568f8fdd94b4ba20d42ce1430 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 04:36:54 +0000 Subject: [PATCH 31/93] fix(deps): update dependency eslint-config-prettier to v8.10.0 --- config/eslint-config-custom/package.json | 2 +- pnpm-lock.yaml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/eslint-config-custom/package.json b/config/eslint-config-custom/package.json index f4840792..73c42a11 100644 --- a/config/eslint-config-custom/package.json +++ b/config/eslint-config-custom/package.json @@ -8,7 +8,7 @@ "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "eslint": "8.52.0", - "eslint-config-prettier": "8.8.0", + "eslint-config-prettier": "8.10.0", "eslint-plugin-markdown": "3.0.1", "eslint-plugin-prettier": "4.2.1", "prettier": "2.8.8" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbf8070e..9d46b8eb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -97,14 +97,14 @@ importers: specifier: 8.52.0 version: 8.52.0 eslint-config-prettier: - specifier: 8.8.0 - version: 8.8.0(eslint@8.52.0) + specifier: 8.10.0 + version: 8.10.0(eslint@8.52.0) eslint-plugin-markdown: 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.52.0)(prettier@2.8.8) + version: 4.2.1(eslint-config-prettier@8.10.0)(eslint@8.52.0)(prettier@2.8.8) prettier: specifier: 2.8.8 version: 2.8.8 @@ -4056,8 +4056,8 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - /eslint-config-prettier@8.8.0(eslint@8.52.0): - resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} + /eslint-config-prettier@8.10.0(eslint@8.52.0): + resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==} hasBin: true peerDependencies: eslint: '>=7.0.0' @@ -4077,7 +4077,7 @@ packages: - supports-color dev: false - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.52.0)(prettier@2.8.8): + /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.10.0)(eslint@8.52.0)(prettier@2.8.8): resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -4089,7 +4089,7 @@ packages: optional: true dependencies: eslint: 8.52.0 - eslint-config-prettier: 8.8.0(eslint@8.52.0) + eslint-config-prettier: 8.10.0(eslint@8.52.0) prettier: 2.8.8 prettier-linter-helpers: 1.0.0 dev: false From 7cf02434fc1a28fb9832560e26008c2ba028d4ac Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 04:39:51 +0000 Subject: [PATCH 32/93] fix(deps): update typescript-eslint monorepo to v6 --- config/eslint-config-custom/package.json | 4 +- pnpm-lock.yaml | 175 +++++++++-------------- 2 files changed, 70 insertions(+), 109 deletions(-) diff --git a/config/eslint-config-custom/package.json b/config/eslint-config-custom/package.json index f4840792..c011d7cf 100644 --- a/config/eslint-config-custom/package.json +++ b/config/eslint-config-custom/package.json @@ -5,8 +5,8 @@ "private": true, "main": "eslint-config.js", "dependencies": { - "@typescript-eslint/eslint-plugin": "5.62.0", - "@typescript-eslint/parser": "5.62.0", + "@typescript-eslint/eslint-plugin": "6.9.0", + "@typescript-eslint/parser": "6.9.0", "eslint": "8.52.0", "eslint-config-prettier": "8.8.0", "eslint-plugin-markdown": "3.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbf8070e..f19a217b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -88,11 +88,11 @@ importers: config/eslint-config-custom: dependencies: '@typescript-eslint/eslint-plugin': - specifier: 5.62.0 - version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.52.0)(typescript@5.2.2) + 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.62.0 - version: 5.62.0(eslint@8.52.0)(typescript@5.2.2) + specifier: 6.9.0 + version: 6.9.0(eslint@8.52.0)(typescript@5.2.2) eslint: specifier: 8.52.0 version: 8.52.0 @@ -2383,11 +2383,6 @@ packages: eslint: 8.52.0 eslint-visitor-keys: 3.4.3 - /@eslint-community/regexpp@4.5.1: - resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - dev: false - /@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} @@ -2844,47 +2839,49 @@ packages: resolution: {integrity: sha512-v/ZHEj9xh82usl8LMR3GarzFY1IrbXJw5L4QfQhokjRV91q+SelFqxQWSep1ucXEZ22+dSTwLFkXeur25sPIbw==} dev: true - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@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.62.0(eslint@8.52.0)(typescript@5.2.2) - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.52.0)(typescript@5.2.2) - '@typescript-eslint/utils': 5.62.0(eslint@8.52.0)(typescript@5.2.2) + '@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.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.2.2) + 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.62.0(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} - 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.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) + '@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.52.0 typescript: 5.2.2 @@ -2892,86 +2889,85 @@ packages: - supports-color dev: false - /@typescript-eslint/scope-manager@5.62.0: - resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} - 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.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 + '@typescript-eslint/types': 6.9.0 + '@typescript-eslint/visitor-keys': 6.9.0 dev: false - /@typescript-eslint/type-utils@5.62.0(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} - 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.62.0(typescript@5.2.2) - '@typescript-eslint/utils': 5.62.0(eslint@8.52.0)(typescript@5.2.2) + '@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.52.0 - tsutils: 3.21.0(typescript@5.2.2) + ts-api-utils: 1.0.3(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/types@5.62.0: - resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} - 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.62.0(typescript@5.2.2): - resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} - 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.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 + '@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.4 - tsutils: 3.21.0(typescript@5.2.2) + ts-api-utils: 1.0.3(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/utils@5.62.0(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} - 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.52.0) '@types/json-schema': 7.0.12 '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) + '@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 - eslint-scope: 5.1.1 semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript dev: false - /@typescript-eslint/visitor-keys@5.62.0: - resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} - 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.62.0 - eslint-visitor-keys: 3.4.1 + '@typescript-eslint/types': 6.9.0 + eslint-visitor-keys: 3.4.3 dev: false /@ungap/structured-clone@1.2.0: @@ -4094,14 +4090,6 @@ packages: prettier-linter-helpers: 1.0.0 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.2: resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -4109,11 +4097,6 @@ packages: esrecurse: 4.3.0 estraverse: 5.3.0 - /eslint-visitor-keys@3.4.1: - resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: false - /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} @@ -4190,11 +4173,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'} @@ -5454,10 +5432,6 @@ packages: 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 - /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -6059,14 +6033,6 @@ packages: lru-cache: 6.0.0 dev: true - /semver@7.5.1: - resolution: {integrity: sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==} - engines: {node: '>=10'} - hasBin: true - dependencies: - lru-cache: 6.0.0 - dev: false - /semver@7.5.4: resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} engines: {node: '>=10'} @@ -6515,6 +6481,15 @@ packages: engines: {node: '>=8'} dev: true + /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: + typescript: 5.2.2 + dev: false + /ts-morph@18.0.0: resolution: {integrity: sha512-Kg5u0mk19PIIe4islUI/HWRvm9bC1lHejK4S0oh1zaZ77TMZAEmQC0sHQYiu2RgCQFZKXz1fMVi/7nOOeirznA==} dependencies: @@ -6566,20 +6541,6 @@ packages: typescript: 5.2.2 dev: true - /tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - dev: false - - /tsutils@3.21.0(typescript@5.2.2): - 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.2.2 - dev: false - /tty-table@4.2.1: resolution: {integrity: sha512-xz0uKo+KakCQ+Dxj1D/tKn2FSyreSYWzdkL/BYhgN6oMW808g8QRMuh1atAV9fjTPbWBjfbkKQpI/5rEcnAc7g==} engines: {node: '>=8.0.0'} From 2bfb171d59b5f1a17d6a3fb089cd2b40f5e29c50 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 04:43:30 +0000 Subject: [PATCH 33/93] chore(deps): update dependency vite to v4.5.0 --- packages/lib/package.json | 2 +- pnpm-lock.yaml | 339 ++++---------------------------------- 2 files changed, 35 insertions(+), 306 deletions(-) diff --git a/packages/lib/package.json b/packages/lib/package.json index b3c72be5..7ae24c15 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -89,7 +89,7 @@ "typedoc": "0.25.2", "typedoc-config": "workspace:*", "typescript": "5.2.2", - "vite": "4.3.9", + "vite": "4.5.0", "vite-plugin-dts": "2.3.0", "vite-tsconfig-paths": "4.2.1", "vitest": "0.34.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e445050..1de7e244 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -77,7 +77,7 @@ importers: version: 5.2.2 vite-plugin-pwa: specifier: 0.16.5 - version: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@7.0.0) + version: 0.16.5(vite@4.5.0)(workbox-build@7.0.0)(workbox-window@7.0.0) vitepress: specifier: 1.0.0-rc.23 version: 1.0.0-rc.23(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2) @@ -179,14 +179,14 @@ importers: specifier: 5.2.2 version: 5.2.2 vite: - specifier: 4.3.9 - version: 4.3.9(@types/node@20.5.1) + specifier: 4.5.0 + version: 4.5.0(@types/node@20.5.1) vite-plugin-dts: specifier: 2.3.0 - version: 2.3.0(@types/node@20.5.1)(vite@4.3.9) + version: 2.3.0(@types/node@20.5.1)(vite@4.5.0) vite-tsconfig-paths: specifier: 4.2.1 - version: 4.2.1(typescript@5.2.2)(vite@4.3.9) + version: 4.2.1(typescript@5.2.2)(vite@4.5.0) vitest: specifier: 0.34.6 version: 0.34.6(@vitest/ui@0.34.6) @@ -1978,15 +1978,6 @@ packages: - '@algolia/client-search' dev: true - /@esbuild/android-arm64@0.17.19: - resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-arm64@0.18.20: resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} @@ -1996,15 +1987,6 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.17.19: - resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-arm@0.18.20: resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} @@ -2014,15 +1996,6 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.17.19: - resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-x64@0.18.20: resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} @@ -2032,15 +2005,6 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.17.19: - resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-arm64@0.18.20: resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} @@ -2050,15 +2014,6 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.17.19: - resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-x64@0.18.20: resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} @@ -2068,15 +2023,6 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.17.19: - resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-arm64@0.18.20: resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} @@ -2086,15 +2032,6 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.17.19: - resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-x64@0.18.20: resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} @@ -2104,15 +2041,6 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.17.19: - resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm64@0.18.20: resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} @@ -2122,15 +2050,6 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.17.19: - resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm@0.18.20: resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} @@ -2140,15 +2059,6 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.17.19: - resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ia32@0.18.20: resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} @@ -2158,15 +2068,6 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.17.19: - resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-loong64@0.18.20: resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} @@ -2176,15 +2077,6 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.17.19: - resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-mips64el@0.18.20: resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} @@ -2194,15 +2086,6 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.17.19: - resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ppc64@0.18.20: resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} @@ -2212,15 +2095,6 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.17.19: - resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-riscv64@0.18.20: resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} @@ -2230,15 +2104,6 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.17.19: - resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-s390x@0.18.20: resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} @@ -2248,15 +2113,6 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.17.19: - resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-x64@0.18.20: resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} @@ -2266,15 +2122,6 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.17.19: - resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/netbsd-x64@0.18.20: resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} @@ -2284,15 +2131,6 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.17.19: - resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/openbsd-x64@0.18.20: resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} @@ -2302,15 +2140,6 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.17.19: - resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - /@esbuild/sunos-x64@0.18.20: resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} @@ -2320,15 +2149,6 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.17.19: - resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-arm64@0.18.20: resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} @@ -2338,15 +2158,6 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.17.19: - resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-ia32@0.18.20: resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} @@ -2356,15 +2167,6 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.17.19: - resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-x64@0.18.20: resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} @@ -2982,7 +2784,7 @@ packages: peerDependencies: vite-plugin-pwa: '>=0.16.5 <1' dependencies: - vite-plugin-pwa: 0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@7.0.0) + vite-plugin-pwa: 0.16.5(vite@4.5.0)(workbox-build@7.0.0)(workbox-window@7.0.0) dev: true /@vitest/coverage-v8@0.34.6(vitest@0.34.6): @@ -3982,36 +3784,6 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild@0.17.19: - resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} - 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 - dev: true - /esbuild@0.18.20: resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} engines: {node: '>=12'} @@ -5707,15 +5479,6 @@ packages: pathe: 1.1.1 dev: true - /postcss@8.4.23: - resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.6 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: true - /postcss@8.4.31: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} engines: {node: ^10 || ^12 || >=14} @@ -5986,14 +5749,6 @@ packages: fsevents: 2.3.2 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'} - hasBin: true - optionalDependencies: - fsevents: 2.3.2 - dev: true - /rollup@3.29.4: resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} @@ -6863,10 +6618,11 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.3.9(@types/node@18.18.6) + vite: 4.5.0(@types/node@18.18.6) transitivePeerDependencies: - '@types/node' - less + - lightningcss - sass - stylus - sugarss @@ -6874,7 +6630,7 @@ packages: - terser dev: true - /vite-plugin-dts@2.3.0(@types/node@20.5.1)(vite@4.3.9): + /vite-plugin-dts@2.3.0(@types/node@20.5.1)(vite@4.5.0): resolution: {integrity: sha512-WbJgGtsStgQhdm3EosYmIdTGbag5YQpZ3HXWUAPCDyoXI5qN6EY0V7NXq0lAmnv9hVQsvh0htbYcg0Or5Db9JQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -6890,14 +6646,14 @@ packages: kolorist: 1.8.0 magic-string: 0.29.0 ts-morph: 18.0.0 - vite: 4.3.9(@types/node@20.5.1) + vite: 4.5.0(@types/node@20.5.1) transitivePeerDependencies: - '@types/node' - rollup - supports-color dev: true - /vite-plugin-pwa@0.16.5(vite@4.3.9)(workbox-build@7.0.0)(workbox-window@7.0.0): + /vite-plugin-pwa@0.16.5(vite@4.5.0)(workbox-build@7.0.0)(workbox-window@7.0.0): resolution: {integrity: sha512-Ahol4dwhMP2UHPQXkllSlXbihOaDFnvBIDPmAxoSZ1EObBUJGP4CMRyCyAVkIHjd6/H+//vH0DM2ON+XxHr81g==} engines: {node: '>=16.0.0'} peerDependencies: @@ -6908,14 +6664,14 @@ packages: debug: 4.3.4 fast-glob: 3.3.1 pretty-bytes: 6.1.1 - vite: 4.3.9(@types/node@18.18.6)(sass@1.69.4) + vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) workbox-build: 7.0.0 workbox-window: 7.0.0 transitivePeerDependencies: - supports-color dev: true - /vite-tsconfig-paths@4.2.1(typescript@5.2.2)(vite@4.3.9): + /vite-tsconfig-paths@4.2.1(typescript@5.2.2)(vite@4.5.0): resolution: {integrity: sha512-GNUI6ZgPqT3oervkvzU+qtys83+75N/OuDaQl7HmOqFTb0pjZsuARrRipsyJhJ3enqV8beI1xhGbToR4o78nSQ==} peerDependencies: vite: '*' @@ -6926,19 +6682,20 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.1(typescript@5.2.2) - vite: 4.3.9(@types/node@20.5.1) + vite: 4.5.0(@types/node@20.5.1) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.3.9(@types/node@18.18.6): - resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} + /vite@4.5.0(@types/node@18.18.6): + resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: '@types/node': '>= 14' less: '*' + lightningcss: ^1.21.0 sass: '*' stylus: '*' sugarss: '*' @@ -6948,6 +6705,8 @@ packages: optional: true less: optional: true + lightningcss: + optional: true sass: optional: true stylus: @@ -6958,20 +6717,21 @@ packages: optional: true dependencies: '@types/node': 18.18.6 - esbuild: 0.17.19 - postcss: 8.4.23 - rollup: 3.23.0 + esbuild: 0.18.20 + postcss: 8.4.31 + rollup: 3.29.4 optionalDependencies: fsevents: 2.3.2 dev: true - /vite@4.3.9(@types/node@18.18.6)(sass@1.69.4): - resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} + /vite@4.5.0(@types/node@18.18.6)(sass@1.69.4): + resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: '@types/node': '>= 14' less: '*' + lightningcss: ^1.21.0 sass: '*' stylus: '*' sugarss: '*' @@ -6981,6 +6741,8 @@ packages: optional: true less: optional: true + lightningcss: + optional: true sass: optional: true stylus: @@ -6991,48 +6753,15 @@ packages: optional: true dependencies: '@types/node': 18.18.6 - esbuild: 0.17.19 - postcss: 8.4.23 - rollup: 3.23.0 + esbuild: 0.18.20 + postcss: 8.4.31 + rollup: 3.29.4 sass: 1.69.4 optionalDependencies: fsevents: 2.3.2 dev: true - /vite@4.3.9(@types/node@20.5.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: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - dependencies: - '@types/node': 20.5.1 - esbuild: 0.17.19 - postcss: 8.4.23 - rollup: 3.23.0 - optionalDependencies: - fsevents: 2.3.2 - dev: true - - /vite@4.5.0(@types/node@18.18.6)(sass@1.69.4): + /vite@4.5.0(@types/node@20.5.1): resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -7060,11 +6789,10 @@ packages: terser: optional: true dependencies: - '@types/node': 18.18.6 + '@types/node': 20.5.1 esbuild: 0.18.20 postcss: 8.4.31 rollup: 3.29.4 - sass: 1.69.4 optionalDependencies: fsevents: 2.3.2 dev: true @@ -7186,11 +6914,12 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.7.0 - vite: 4.3.9(@types/node@18.18.6) + vite: 4.5.0(@types/node@18.18.6) vite-node: 0.34.6(@types/node@18.18.6) why-is-node-running: 2.2.2 transitivePeerDependencies: - less + - lightningcss - sass - stylus - sugarss From aea75136bb645f9977b717440aabca0cd88ad850 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 17:03:21 +0000 Subject: [PATCH 34/93] chore(deps): update commitlint monorepo to v18 --- package.json | 4 +- pnpm-lock.yaml | 332 ++++++++++++++++++++----------------------------- 2 files changed, 135 insertions(+), 201 deletions(-) diff --git a/package.json b/package.json index 014a623d..eb9a088e 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,8 @@ }, "devDependencies": { "@changesets/cli": "2.26.2", - "@commitlint/cli": "17.8.1", - "@commitlint/config-conventional": "17.8.1", + "@commitlint/cli": "18.1.0", + "@commitlint/config-conventional": "18.1.0", "husky": "8.0.3", "rimraf": "5.0.5", "turbo": "1.10.16", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d0047e0..02769e16 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,11 +12,11 @@ importers: specifier: 2.26.2 version: 2.26.2 '@commitlint/cli': - specifier: 17.8.1 - version: 17.8.1 + specifier: 18.1.0 + version: 18.1.0 '@commitlint/config-conventional': - specifier: 17.8.1 - version: 17.8.1 + specifier: 18.1.0 + version: 18.1.0 husky: specifier: 8.0.3 version: 8.0.3 @@ -180,10 +180,10 @@ importers: version: 5.2.2 vite: specifier: 4.5.0 - version: 4.5.0(@types/node@20.5.1) + version: 4.5.0(@types/node@18.18.6)(sass@1.69.4) vite-plugin-dts: specifier: 2.3.0 - version: 2.3.0(@types/node@20.5.1)(vite@4.5.0) + version: 2.3.0(@types/node@18.18.6)(vite@4.5.0) vite-tsconfig-paths: specifier: 4.2.1 version: 4.2.1(typescript@5.2.2)(vite@4.5.0) @@ -1760,16 +1760,16 @@ packages: prettier: 2.8.8 dev: true - /@commitlint/cli@17.8.1: - resolution: {integrity: sha512-ay+WbzQesE0Rv4EQKfNbSMiJJ12KdKTDzIt0tcK4k11FdsWmtwP0Kp1NWMOUswfIWo6Eb7p7Ln721Nx9FLNBjg==} - engines: {node: '>=v14'} + /@commitlint/cli@18.1.0: + resolution: {integrity: sha512-ZT95pRNGD9fEEX1ih0yKyJ65U3Y88vLrJjK6hlSpLrJFioQNXTI4sSoOq7hHnOsJAmTsgEg5zxIY8qTzgEQtWg==} + engines: {node: '>=v18'} hasBin: true dependencies: - '@commitlint/format': 17.8.1 - '@commitlint/lint': 17.8.1 - '@commitlint/load': 17.8.1 - '@commitlint/read': 17.8.1 - '@commitlint/types': 17.8.1 + '@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 @@ -1780,26 +1780,26 @@ packages: - '@swc/wasm' dev: true - /@commitlint/config-conventional@17.8.1: - resolution: {integrity: sha512-NxCOHx1kgneig3VLauWJcDWS40DVjg7nKOpBEEK9E5fjJpQqLCilcnKkIIjdBH98kEO1q3NpE5NSrZ2kl/QGJg==} - engines: {node: '>=v14'} + /@commitlint/config-conventional@18.1.0: + resolution: {integrity: sha512-8vvvtV3GOLEMHeKc8PjRL1lfP1Y4B6BG0WroFd9PJeRiOc3nFX1J0wlJenLURzl9Qus6YXVGWf+a/ZlbCKT3AA==} + engines: {node: '>=v18'} dependencies: - conventional-changelog-conventionalcommits: 6.1.0 + conventional-changelog-conventionalcommits: 7.0.2 dev: true - /@commitlint/config-validator@17.8.1: - resolution: {integrity: sha512-UUgUC+sNiiMwkyiuIFR7JG2cfd9t/7MV8VB4TZ+q02ZFkHoduUS4tJGsCBWvBOGD9Btev6IecPMvlWUfJorkEA==} - engines: {node: '>=v14'} + /@commitlint/config-validator@18.1.0: + resolution: {integrity: sha512-kbHkIuItXn93o2NmTdwi5Mk1ujyuSIysRE/XHtrcps/27GuUKEIqBJp6TdJ4Sq+ze59RlzYSHMKuDKZbfg9+uQ==} + engines: {node: '>=v18'} dependencies: - '@commitlint/types': 17.8.1 + '@commitlint/types': 18.1.0 ajv: 8.12.0 dev: true - /@commitlint/ensure@17.8.1: - resolution: {integrity: sha512-xjafwKxid8s1K23NFpL8JNo6JnY/ysetKo8kegVM7c8vs+kWLP8VrQq+NbhgVlmCojhEDbzQKp4eRXSjVOGsow==} - engines: {node: '>=v14'} + /@commitlint/ensure@18.1.0: + resolution: {integrity: sha512-CkPzJ9UBumIo54VDcpmBlaVX81J++wzEhN3DJH9+6PaLeiIG+gkSx8t7C2gfwG7PaiW4HzQtdQlBN5ab+c4vFQ==} + engines: {node: '>=v18'} dependencies: - '@commitlint/types': 17.8.1 + '@commitlint/types': 18.1.0 lodash.camelcase: 4.3.0 lodash.kebabcase: 4.1.1 lodash.snakecase: 4.1.1 @@ -1807,123 +1807,123 @@ packages: lodash.upperfirst: 4.3.1 dev: true - /@commitlint/execute-rule@17.8.1: - resolution: {integrity: sha512-JHVupQeSdNI6xzA9SqMF+p/JjrHTcrJdI02PwesQIDCIGUrv04hicJgCcws5nzaoZbROapPs0s6zeVHoxpMwFQ==} - 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.8.1: - resolution: {integrity: sha512-f3oMTyZ84M9ht7fb93wbCKmWxO5/kKSbwuYvS867duVomoOsgrgljkGGIztmT/srZnaiGbaK8+Wf8Ik2tSr5eg==} - engines: {node: '>=v14'} + /@commitlint/format@18.1.0: + resolution: {integrity: sha512-So/w217tGWMZZb1yXcUFNF2qFLyYtSVqbnGoMbX8a+JKcG4oB11Gc1adS0ssUOMivtiNpaLtkSHFynyiwtJtiQ==} + engines: {node: '>=v18'} dependencies: - '@commitlint/types': 17.8.1 + '@commitlint/types': 18.1.0 chalk: 4.1.2 dev: true - /@commitlint/is-ignored@17.8.1: - resolution: {integrity: sha512-UshMi4Ltb4ZlNn4F7WtSEugFDZmctzFpmbqvpyxD3la510J+PLcnyhf9chs7EryaRFJMdAKwsEKfNK0jL/QM4g==} - engines: {node: '>=v14'} + /@commitlint/is-ignored@18.1.0: + resolution: {integrity: sha512-fa1fY93J/Nx2GH6r6WOLdBOiL7x9Uc1N7wcpmaJ1C5Qs6P+rPSUTkofe2IOhSJIJoboHfAH6W0ru4xtK689t0Q==} + engines: {node: '>=v18'} dependencies: - '@commitlint/types': 17.8.1 + '@commitlint/types': 18.1.0 semver: 7.5.4 dev: true - /@commitlint/lint@17.8.1: - resolution: {integrity: sha512-aQUlwIR1/VMv2D4GXSk7PfL5hIaFSfy6hSHV94O8Y27T5q+DlDEgd/cZ4KmVI+MWKzFfCTiTuWqjfRSfdRllCA==} - engines: {node: '>=v14'} + /@commitlint/lint@18.1.0: + resolution: {integrity: sha512-LGB3eI5UYu5LLayibNrRM4bSbowr1z9uyqvp0c7+0KaSJi+xHxy/QEhb6fy4bMAtbXEvygY0sUu9HxSWg41rVQ==} + engines: {node: '>=v18'} dependencies: - '@commitlint/is-ignored': 17.8.1 - '@commitlint/parse': 17.8.1 - '@commitlint/rules': 17.8.1 - '@commitlint/types': 17.8.1 + '@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.8.1: - resolution: {integrity: sha512-iF4CL7KDFstP1kpVUkT8K2Wl17h2yx9VaR1ztTc8vzByWWcbO/WaKwxsnCOqow9tVAlzPfo1ywk9m2oJ9ucMqA==} - engines: {node: '>=v14'} + /@commitlint/load@18.1.0: + resolution: {integrity: sha512-oZbAV3wdh4f5EB99y6U1uY1grvU1Oz1EYtWML9Zu4he6sgzVGHuIP81mka8exFp4bGytaUmuIKl+ahck3P4HoQ==} + engines: {node: '>=v18'} dependencies: - '@commitlint/config-validator': 17.8.1 - '@commitlint/execute-rule': 17.8.1 - '@commitlint/resolve-extends': 17.8.1 - '@commitlint/types': 17.8.1 - '@types/node': 20.5.1 + '@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.6 chalk: 4.1.2 cosmiconfig: 8.1.3 - cosmiconfig-typescript-loader: 4.3.0(@types/node@20.5.1)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.2.2) + cosmiconfig-typescript-loader: 4.3.0(@types/node@18.18.6)(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.5.1)(typescript@5.2.2) + ts-node: 10.9.1(@types/node@18.18.6)(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' dev: true - /@commitlint/message@17.8.1: - resolution: {integrity: sha512-6bYL1GUQsD6bLhTH3QQty8pVFoETfFQlMn2Nzmz3AOLqRVfNNtXBaSY0dhZ0dM6A2MEq4+2d7L/2LP8TjqGRkA==} - 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.8.1: - resolution: {integrity: sha512-/wLUickTo0rNpQgWwLPavTm7WbwkZoBy3X8PpkUmlSmQJyWQTj0m6bDjiykMaDt41qcUbfeFfaCvXfiR4EGnfw==} - engines: {node: '>=v14'} + /@commitlint/parse@18.1.0: + resolution: {integrity: sha512-23yv8uBweXWYn8bXk4PjHIsmVA+RkbqPh2h7irupBo2LthVlzMRc4LM6UStasScJ4OlXYYaWOmuP7jcExUF50Q==} + engines: {node: '>=v18'} dependencies: - '@commitlint/types': 17.8.1 + '@commitlint/types': 18.1.0 conventional-changelog-angular: 6.0.0 - conventional-commits-parser: 4.0.0 + conventional-commits-parser: 5.0.0 dev: true - /@commitlint/read@17.8.1: - resolution: {integrity: sha512-Fd55Oaz9irzBESPCdMd8vWWgxsW3OWR99wOntBDHgf9h7Y6OOHjWEdS9Xzen1GFndqgyoaFplQS5y7KZe0kO2w==} - engines: {node: '>=v14'} + /@commitlint/read@18.1.0: + resolution: {integrity: sha512-rzfzoKUwxmvYO81tI5o1371Nwt3vhcQR36oTNfupPdU1jgSL3nzBIS3B93LcZh3IYKbCIMyMPN5WZ10BXdeoUg==} + engines: {node: '>=v18'} dependencies: - '@commitlint/top-level': 17.8.1 - '@commitlint/types': 17.8.1 + '@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.8.1: - resolution: {integrity: sha512-W/ryRoQ0TSVXqJrx5SGkaYuAaE/BUontL1j1HsKckvM6e5ZaG0M9126zcwL6peKSuIetJi7E87PRQF8O86EW0Q==} - engines: {node: '>=v14'} + /@commitlint/resolve-extends@18.1.0: + resolution: {integrity: sha512-3mZpzOEJkELt7BbaZp6+bofJyxViyObebagFn0A7IHaLARhPkWTivXdjvZHS12nAORftv88Yhbh8eCPKfSvB7g==} + engines: {node: '>=v18'} dependencies: - '@commitlint/config-validator': 17.8.1 - '@commitlint/types': 17.8.1 + '@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.8.1: - resolution: {integrity: sha512-2b7OdVbN7MTAt9U0vKOYKCDsOvESVXxQmrvuVUZ0rGFMCrCPJWWP1GJ7f0lAypbDAhaGb8zqtdOr47192LBrIA==} - engines: {node: '>=v14'} + /@commitlint/rules@18.1.0: + resolution: {integrity: sha512-VJNQ674CRv4znI0DbsjZLVnn647J+BTxHGcrDIsYv7c99gW7TUGeIe5kL80G7l8+5+N0se8v9yn+Prr8xEy6Yw==} + engines: {node: '>=v18'} dependencies: - '@commitlint/ensure': 17.8.1 - '@commitlint/message': 17.8.1 - '@commitlint/to-lines': 17.8.1 - '@commitlint/types': 17.8.1 + '@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.8.1: - resolution: {integrity: sha512-LE0jb8CuR/mj6xJyrIk8VLz03OEzXFgLdivBytoooKO5xLt5yalc8Ma5guTWobw998sbR3ogDd+2jed03CFmJA==} - engines: {node: '>=v14'} + /@commitlint/to-lines@18.1.0: + resolution: {integrity: sha512-aHIoSDjG0ckxPLYDpODUeSLbEKmF6Jrs1B5JIssbbE9eemBtXtjm9yzdiAx9ZXcwoHlhbTp2fbndDb3YjlvJag==} + engines: {node: '>=v18'} dev: true - /@commitlint/top-level@17.8.1: - resolution: {integrity: sha512-l6+Z6rrNf5p333SHfEte6r+WkOxGlWK4bLuZKbtf/2TXRN+qhrvn1XE63VhD8Oe9oIHQ7F7W1nG2k/TJFhx2yA==} - 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.8.1: - resolution: {integrity: sha512-PXDQXkAmiMEG162Bqdh9ChML/GJZo6vU+7F03ALKDK8zYc6SuAr47LjG7hGYRqUOz+WK0dU7bQ0xzuqFMdxzeQ==} - engines: {node: '>=v14'} + /@commitlint/types@18.1.0: + resolution: {integrity: sha512-65vGxZmbs+2OVwEItxhp3Ul7X2m2LyLfifYI/NdPwRqblmuES2w2aIRhIjb7cwUIBHHSTT8WXj4ixVHQibmvLQ==} + engines: {node: '>=v18'} dependencies: chalk: 4.1.2 dev: true @@ -2327,24 +2327,24 @@ packages: read-yaml-file: 1.1.0 dev: true - /@microsoft/api-extractor-model@7.27.0(@types/node@20.5.1): + /@microsoft/api-extractor-model@7.27.0(@types/node@18.18.6): resolution: {integrity: sha512-wHqIMiwSARmiuVLn/zmVpiRncq6hvBfC5GF+sjrN3w4FqVkqFYk7DetvfRNdy/3URdqqmYGrhJlcU9HpLnHOPg==} dependencies: '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.1(@types/node@20.5.1) + '@rushstack/node-core-library': 3.59.1(@types/node@18.18.6) transitivePeerDependencies: - '@types/node' dev: true - /@microsoft/api-extractor@7.35.0(@types/node@20.5.1): + /@microsoft/api-extractor@7.35.0(@types/node@18.18.6): resolution: {integrity: sha512-yBGfPJeEtzk8sg2hE2/vOPRvnJBvstbWNGeyGV1jIEUSgytzQ0QPgPEkOsP2n7nBfnyRXmZaBa2vJPGOzVWy+g==} hasBin: true dependencies: - '@microsoft/api-extractor-model': 7.27.0(@types/node@20.5.1) + '@microsoft/api-extractor-model': 7.27.0(@types/node@18.18.6) '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.1(@types/node@20.5.1) + '@rushstack/node-core-library': 3.59.1(@types/node@18.18.6) '@rushstack/rig-package': 0.3.19 '@rushstack/ts-command-line': 4.13.3 colors: 1.2.5 @@ -2467,7 +2467,7 @@ packages: picomatch: 2.3.1 dev: true - /@rushstack/node-core-library@3.59.1(@types/node@20.5.1): + /@rushstack/node-core-library@3.59.1(@types/node@18.18.6): resolution: {integrity: sha512-iy/xaEhXGpX+DY1ZzAtNA+QPw+9+TJh773Im+JxG4R1fu00/vWq470UOEj6upxlUxmp0JxhnmNRxzfptHrn/Uw==} peerDependencies: '@types/node': '*' @@ -2475,7 +2475,7 @@ packages: '@types/node': optional: true dependencies: - '@types/node': 20.5.1 + '@types/node': 18.18.6 colors: 1.2.5 fs-extra: 7.0.1 import-lazy: 4.0.0 @@ -2611,10 +2611,6 @@ packages: /@types/node@18.18.6: resolution: {integrity: sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==} - /@types/node@20.5.1: - resolution: {integrity: sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==} - dev: true - /@types/normalize-package-data@2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true @@ -3471,22 +3467,22 @@ packages: compare-func: 2.0.0 dev: true - /conventional-changelog-conventionalcommits@6.1.0: - resolution: {integrity: sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw==} - engines: {node: '>=14'} + /conventional-changelog-conventionalcommits@7.0.2: + resolution: {integrity: sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==} + engines: {node: '>=16'} dependencies: compare-func: 2.0.0 dev: true - /conventional-commits-parser@4.0.0: - resolution: {integrity: sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg==} - engines: {node: '>=14'} + /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 - meow: 8.1.2 - split2: 3.2.2 + is-text-path: 2.0.0 + meow: 12.1.1 + split2: 4.2.0 dev: true /convert-source-map@1.9.0: @@ -3503,7 +3499,7 @@ packages: browserslist: 4.21.5 dev: true - /cosmiconfig-typescript-loader@4.3.0(@types/node@20.5.1)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.2.2): + /cosmiconfig-typescript-loader@4.3.0(@types/node@18.18.6)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.2.2): resolution: {integrity: sha512-NTxV1MFfZDLPiBMjxbHRwSh5LaLcPMwNdCutmnHJCKoVnlvldPWlllonKwrsRJ5pYZBIBGRWWU2tfvzxgeSW5Q==} engines: {node: '>=12', npm: '>=6'} peerDependencies: @@ -3512,9 +3508,9 @@ packages: ts-node: '>=10' typescript: '>=3' dependencies: - '@types/node': 20.5.1 + '@types/node': 18.18.6 cosmiconfig: 8.1.3 - ts-node: 10.9.1(@types/node@20.5.1)(typescript@5.2.2) + ts-node: 10.9.1(@types/node@18.18.6)(typescript@5.2.2) typescript: 5.2.2 dev: true @@ -4674,11 +4670,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: @@ -5070,6 +5066,11 @@ packages: 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'} @@ -6000,6 +6001,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 @@ -6201,9 +6207,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: @@ -6277,7 +6283,7 @@ packages: code-block-writer: 12.0.0 dev: true - /ts-node@10.9.1(@types/node@20.5.1)(typescript@5.2.2): + /ts-node@10.9.1(@types/node@18.18.6)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -6296,7 +6302,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.5.1 + '@types/node': 18.18.6 acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 @@ -6618,7 +6624,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.5.0(@types/node@18.18.6) + vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) transitivePeerDependencies: - '@types/node' - less @@ -6630,23 +6636,23 @@ packages: - terser dev: true - /vite-plugin-dts@2.3.0(@types/node@20.5.1)(vite@4.5.0): + /vite-plugin-dts@2.3.0(@types/node@18.18.6)(vite@4.5.0): resolution: {integrity: sha512-WbJgGtsStgQhdm3EosYmIdTGbag5YQpZ3HXWUAPCDyoXI5qN6EY0V7NXq0lAmnv9hVQsvh0htbYcg0Or5Db9JQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: '>=2.9.0' dependencies: '@babel/parser': 7.22.0 - '@microsoft/api-extractor': 7.35.0(@types/node@20.5.1) + '@microsoft/api-extractor': 7.35.0(@types/node@18.18.6) '@rollup/pluginutils': 5.0.2 - '@rushstack/node-core-library': 3.59.1(@types/node@20.5.1) + '@rushstack/node-core-library': 3.59.1(@types/node@18.18.6) 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.5.0(@types/node@20.5.1) + vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) transitivePeerDependencies: - '@types/node' - rollup @@ -6682,48 +6688,12 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.1(typescript@5.2.2) - vite: 4.5.0(@types/node@20.5.1) + vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.5.0(@types/node@18.18.6): - resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} - engines: {node: ^14.18.0 || >=16.0.0} - hasBin: true - peerDependencies: - '@types/node': '>= 14' - less: '*' - lightningcss: ^1.21.0 - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - dependencies: - '@types/node': 18.18.6 - esbuild: 0.18.20 - postcss: 8.4.31 - rollup: 3.29.4 - optionalDependencies: - fsevents: 2.3.2 - dev: true - /vite@4.5.0(@types/node@18.18.6)(sass@1.69.4): resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} engines: {node: ^14.18.0 || >=16.0.0} @@ -6761,42 +6731,6 @@ packages: fsevents: 2.3.2 dev: true - /vite@4.5.0(@types/node@20.5.1): - resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} - engines: {node: ^14.18.0 || >=16.0.0} - hasBin: true - peerDependencies: - '@types/node': '>= 14' - less: '*' - lightningcss: ^1.21.0 - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - dependencies: - '@types/node': 20.5.1 - esbuild: 0.18.20 - postcss: 8.4.31 - rollup: 3.29.4 - optionalDependencies: - fsevents: 2.3.2 - dev: true - /vitepress@1.0.0-rc.23(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2): resolution: {integrity: sha512-0YoBt8aFgbRt2JtYaCeTqq4W21q5lbGso+g1ZwkYYS35ExJxORssRJunhFuUcby8QeN4BP/88QDgsVSIVLAfXQ==} hasBin: true @@ -6914,7 +6848,7 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.7.0 - vite: 4.5.0(@types/node@18.18.6) + vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) vite-node: 0.34.6(@types/node@18.18.6) why-is-node-running: 2.2.2 transitivePeerDependencies: From 78b187f2429a09570526ccf88e2f259671dc77fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 17:05:27 +0000 Subject: [PATCH 35/93] fix(deps): update dependency eslint-config-prettier to v9 --- config/eslint-config-custom/package.json | 2 +- pnpm-lock.yaml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/eslint-config-custom/package.json b/config/eslint-config-custom/package.json index 73c42a11..cbe18e0b 100644 --- a/config/eslint-config-custom/package.json +++ b/config/eslint-config-custom/package.json @@ -8,7 +8,7 @@ "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "eslint": "8.52.0", - "eslint-config-prettier": "8.10.0", + "eslint-config-prettier": "9.0.0", "eslint-plugin-markdown": "3.0.1", "eslint-plugin-prettier": "4.2.1", "prettier": "2.8.8" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1e2f7404..4ea13e53 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -97,14 +97,14 @@ importers: specifier: 8.52.0 version: 8.52.0 eslint-config-prettier: - specifier: 8.10.0 - version: 8.10.0(eslint@8.52.0) + specifier: 9.0.0 + version: 9.0.0(eslint@8.52.0) eslint-plugin-markdown: 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.10.0)(eslint@8.52.0)(prettier@2.8.8) + version: 4.2.1(eslint-config-prettier@9.0.0)(eslint@8.52.0)(prettier@2.8.8) prettier: specifier: 2.8.8 version: 2.8.8 @@ -3828,8 +3828,8 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - /eslint-config-prettier@8.10.0(eslint@8.52.0): - resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==} + /eslint-config-prettier@9.0.0(eslint@8.52.0): + resolution: {integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==} hasBin: true peerDependencies: eslint: '>=7.0.0' @@ -3849,7 +3849,7 @@ packages: - supports-color dev: false - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.10.0)(eslint@8.52.0)(prettier@2.8.8): + /eslint-plugin-prettier@4.2.1(eslint-config-prettier@9.0.0)(eslint@8.52.0)(prettier@2.8.8): resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -3861,7 +3861,7 @@ packages: optional: true dependencies: eslint: 8.52.0 - eslint-config-prettier: 8.10.0(eslint@8.52.0) + eslint-config-prettier: 9.0.0(eslint@8.52.0) prettier: 2.8.8 prettier-linter-helpers: 1.0.0 dev: false From ccba2a41e9b8affaf3e38c1ca4bf039801119fa4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 17:08:23 +0000 Subject: [PATCH 36/93] chore(deps): update dependency vitepress to v1.0.0-rc.24 --- apps/docs/package.json | 2 +- pnpm-lock.yaml | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index 8f3dcd64..d726db44 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -35,7 +35,7 @@ "tsconfig": "workspace:*", "typescript": "5.2.2", "vite-plugin-pwa": "0.16.5", - "vitepress": "1.0.0-rc.23", + "vitepress": "1.0.0-rc.24", "workbox-window": "7.0.0" }, "eslintConfig": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3b843f20..674dd8c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -79,8 +79,8 @@ importers: specifier: 0.16.5 version: 0.16.5(vite@4.5.0)(workbox-build@7.0.0)(workbox-window@7.0.0) vitepress: - specifier: 1.0.0-rc.23 - version: 1.0.0-rc.23(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2) + specifier: 1.0.0-rc.24 + version: 1.0.0-rc.24(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2) workbox-window: specifier: 7.0.0 version: 7.0.0 @@ -2779,6 +2779,17 @@ packages: vite-plugin-pwa: 0.16.5(vite@4.5.0)(workbox-build@7.0.0)(workbox-window@7.0.0) dev: true + /@vitejs/plugin-vue@4.3.1(vite@4.5.0)(vue@3.3.7): + resolution: {integrity: sha512-tUBEtWcF7wFtII7ayNiLNDTCE1X1afySEo+XNVMNkFXaThENyCowIEX095QqbJZGTgoOcSVDJGlnde2NG4jtbQ==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + vite: ^4.0.0 + vue: ^3.2.25 + dependencies: + vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) + vue: 3.3.7(typescript@5.2.2) + dev: true + /@vitest/coverage-v8@0.34.6(vitest@0.34.6): resolution: {integrity: sha512-fivy/OK2d/EsJFoEoxHFEnNGTg+MmdZBAVK9Ka4qhXR2K3J0DS08vcGVwzDtXSuUMabLv4KtPcpSKkcMXFDViw==} peerDependencies: @@ -6692,8 +6703,8 @@ packages: fsevents: 2.3.2 dev: true - /vitepress@1.0.0-rc.23(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2): - resolution: {integrity: sha512-0YoBt8aFgbRt2JtYaCeTqq4W21q5lbGso+g1ZwkYYS35ExJxORssRJunhFuUcby8QeN4BP/88QDgsVSIVLAfXQ==} + /vitepress@1.0.0-rc.24(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2): + resolution: {integrity: sha512-RpnL8cnOGwiRlBbrYQUm9sYkJbtyOt/wYXk2diTcokY4yvks/5lq9LuSt+MURWB6ZqwpSNHvTmxgaSfLoG0/OA==} hasBin: true peerDependencies: markdown-it-mathjax3: ^4.3.2 @@ -6707,6 +6718,7 @@ packages: '@docsearch/css': 3.5.2 '@docsearch/js': 3.5.2(@algolia/client-search@4.20.0)(search-insights@2.9.0) '@types/markdown-it': 13.0.5 + '@vitejs/plugin-vue': 4.3.1(vite@4.5.0)(vue@3.3.7) '@vue/devtools-api': 6.5.1 '@vueuse/core': 10.5.0(vue@3.3.7) '@vueuse/integrations': 10.5.0(focus-trap@7.5.4)(vue@3.3.7) From ea870a0864e01d3398d455e65cbc5d87238e23d1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 17:08:50 +0000 Subject: [PATCH 37/93] chore(deps): update dependency vite-plugin-dts to v3 --- packages/lib/package.json | 2 +- pnpm-lock.yaml | 220 ++++++++++++++++++-------------------- 2 files changed, 108 insertions(+), 114 deletions(-) diff --git a/packages/lib/package.json b/packages/lib/package.json index 7ae24c15..cb757f7d 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -90,7 +90,7 @@ "typedoc-config": "workspace:*", "typescript": "5.2.2", "vite": "4.5.0", - "vite-plugin-dts": "2.3.0", + "vite-plugin-dts": "3.6.1", "vite-tsconfig-paths": "4.2.1", "vitest": "0.34.6", "vitest-fetch-mock": "0.2.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3b843f20..856b22af 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -182,8 +182,8 @@ importers: specifier: 4.5.0 version: 4.5.0(@types/node@18.18.6)(sass@1.69.4) vite-plugin-dts: - specifier: 2.3.0 - version: 2.3.0(@types/node@18.18.6)(vite@4.5.0) + specifier: 3.6.1 + version: 3.6.1(@types/node@18.18.6)(typescript@5.2.2)(vite@4.5.0) vite-tsconfig-paths: specifier: 4.2.1 version: 4.2.1(typescript@5.2.2)(vite@4.5.0) @@ -632,14 +632,6 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser@7.22.0: - resolution: {integrity: sha512-DA65VCJRetcFmJnt9/hEmRvXNCwk0V86dxG6p6N13hzDazaLRjGdTGPGgjxZOtLuFgWzOSRX4grybmRXwQ9bSg==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.22.0 - dev: true - /@babel/parser@7.23.0: resolution: {integrity: sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==} engines: {node: '>=6.0.0'} @@ -2322,30 +2314,30 @@ packages: read-yaml-file: 1.1.0 dev: true - /@microsoft/api-extractor-model@7.27.0(@types/node@18.18.6): - resolution: {integrity: sha512-wHqIMiwSARmiuVLn/zmVpiRncq6hvBfC5GF+sjrN3w4FqVkqFYk7DetvfRNdy/3URdqqmYGrhJlcU9HpLnHOPg==} + /@microsoft/api-extractor-model@7.28.2(@types/node@18.18.6): + 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(@types/node@18.18.6) + '@rushstack/node-core-library': 3.61.0(@types/node@18.18.6) transitivePeerDependencies: - '@types/node' dev: true - /@microsoft/api-extractor@7.35.0(@types/node@18.18.6): - resolution: {integrity: sha512-yBGfPJeEtzk8sg2hE2/vOPRvnJBvstbWNGeyGV1jIEUSgytzQ0QPgPEkOsP2n7nBfnyRXmZaBa2vJPGOzVWy+g==} + /@microsoft/api-extractor@7.38.0(@types/node@18.18.6): + resolution: {integrity: sha512-e1LhZYnfw+JEebuY2bzhw0imDCl1nwjSThTrQqBXl40hrVo6xm3j/1EpUr89QyzgjqmAwek2ZkIVZbrhaR+cqg==} hasBin: true dependencies: - '@microsoft/api-extractor-model': 7.27.0(@types/node@18.18.6) + '@microsoft/api-extractor-model': 7.28.2(@types/node@18.18.6) '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.1(@types/node@18.18.6) - '@rushstack/rig-package': 0.3.19 - '@rushstack/ts-command-line': 4.13.3 + '@rushstack/node-core-library': 3.61.0(@types/node@18.18.6) + '@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 + semver: 7.5.4 source-map: 0.6.1 typescript: 5.0.4 transitivePeerDependencies: @@ -2448,11 +2440,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 @@ -2462,8 +2454,8 @@ packages: picomatch: 2.3.1 dev: true - /@rushstack/node-core-library@3.59.1(@types/node@18.18.6): - resolution: {integrity: sha512-iy/xaEhXGpX+DY1ZzAtNA+QPw+9+TJh773Im+JxG4R1fu00/vWq470UOEj6upxlUxmp0JxhnmNRxzfptHrn/Uw==} + /@rushstack/node-core-library@3.61.0(@types/node@18.18.6): + resolution: {integrity: sha512-tdOjdErme+/YOu4gPed3sFS72GhtWCgNV9oDsHDnoLY5oDfwjKUc9Z+JOZZ37uAxcm/OCahDHfuu2ugqrfWAVQ==} peerDependencies: '@types/node': '*' peerDependenciesMeta: @@ -2476,19 +2468,19 @@ packages: import-lazy: 4.0.0 jju: 1.4.0 resolve: 1.22.2 - semver: 7.3.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 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 @@ -2509,15 +2501,6 @@ packages: string.prototype.matchall: 4.0.8 dev: true - /@ts-morph/common@0.19.0: - resolution: {integrity: sha512-Unz/WHmd4pGax91rdIKWi51wnVUW11QttMEPpBiBgIewnc9UQIX7UDLxr5vRlqeByXCwhkF6VabSsI0raWcyAQ==} - dependencies: - fast-glob: 3.3.1 - minimatch: 7.4.6 - mkdirp: 2.1.6 - path-browserify: 1.0.1 - dev: true - /@tsconfig/node10@1.0.9: resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} dev: true @@ -2853,6 +2836,24 @@ packages: pretty-format: 29.7.0 dev: true + /@volar/language-core@1.10.5: + resolution: {integrity: sha512-xD71j4Ee0Ycq8WsiAE6H/aCThGdTobiZZeD+jFD+bvmbopa1Az296pqJysr3Ck8c7n5+GGF+xlKCS3WxRFYgSQ==} + dependencies: + '@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.7: resolution: {integrity: sha512-pACdY6YnTNVLXsB86YD8OF9ihwpolzhhtdLVHhBL6do/ykr6kKXNYABRtNMGrsQXpEXXyAdwvWWkuTbs4MFtPQ==} dependencies: @@ -2891,6 +2892,25 @@ packages: resolution: {integrity: sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==} dev: true + /@vue/language-core@1.8.21(typescript@5.2.2): + resolution: {integrity: sha512-dKQJc1xfWIZfv6BeXyxz3SSNrC7npJpDIN/VOb1rodAm4o247TElrXOHYAJdV9x1KilaEUo3YbnQE+WA3vQwMw==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@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/reactivity-transform@3.3.7: resolution: {integrity: sha512-APhRmLVbgE1VPGtoLQoWBJEaQk4V8JUsqrQihImVqKT+8U6Qi3t5ATcg4Y9wGAPb3kIhetpufyZ1RhwbZCIdDA==} dependencies: @@ -3402,10 +3422,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: @@ -3453,6 +3469,10 @@ 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==} @@ -3583,6 +3603,10 @@ packages: engines: {node: '>=8'} dev: true + /de-indent@1.0.2: + resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} + dev: true + /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -3991,17 +4015,6 @@ packages: resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==} dev: false - /fast-glob@3.2.12: - resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} - 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 - dev: true - /fast-glob@3.3.1: resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} engines: {node: '>=8.6.0'} @@ -4097,15 +4110,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'} @@ -4380,6 +4384,11 @@ packages: function-bind: 1.1.1 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 @@ -4984,13 +4993,6 @@ packages: sourcemap-codec: 1.4.8 dev: true - /magic-string@0.29.0: - resolution: {integrity: sha512-WcfidHrDjMY+eLjlU+8OvwREqHwpgCeKVBUpQ3OhYYuvfaYCUgcbuBzappNzZvg/v8onU3oQj+BYpkOJe9Iw4Q==} - engines: {node: '>=12'} - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - /magic-string@0.30.5: resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==} engines: {node: '>=12'} @@ -5129,13 +5131,6 @@ packages: brace-expansion: 2.0.1 dev: true - /minimatch@7.4.6: - resolution: {integrity: sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==} - engines: {node: '>=10'} - dependencies: - brace-expansion: 2.0.1 - dev: true - /minimatch@9.0.1: resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} engines: {node: '>=16 || 14 >=14.17'} @@ -5177,12 +5172,6 @@ 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.4.2: resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==} dependencies: @@ -5200,6 +5189,10 @@ 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} @@ -5387,10 +5380,6 @@ packages: lines-and-columns: 1.2.4 dev: true - /path-browserify@1.0.1: - resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} - dev: true - /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -5781,14 +5770,6 @@ packages: hasBin: true dev: true - /semver@7.3.8: - resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} - engines: {node: '>=10'} - hasBin: true - dependencies: - lru-cache: 6.0.0 - dev: true - /semver@7.5.4: resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} engines: {node: '>=10'} @@ -6251,13 +6232,6 @@ packages: typescript: 5.2.2 dev: false - /ts-morph@18.0.0: - resolution: {integrity: sha512-Kg5u0mk19PIIe4islUI/HWRvm9bC1lHejK4S0oh1zaZ77TMZAEmQC0sHQYiu2RgCQFZKXz1fMVi/7nOOeirznA==} - dependencies: - '@ts-morph/common': 0.19.0 - code-block-writer: 12.0.0 - dev: true - /ts-node@10.9.1(@types/node@18.18.6)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -6597,23 +6571,24 @@ packages: - terser dev: true - /vite-plugin-dts@2.3.0(@types/node@18.18.6)(vite@4.5.0): - resolution: {integrity: sha512-WbJgGtsStgQhdm3EosYmIdTGbag5YQpZ3HXWUAPCDyoXI5qN6EY0V7NXq0lAmnv9hVQsvh0htbYcg0Or5Db9JQ==} + /vite-plugin-dts@3.6.1(@types/node@18.18.6)(typescript@5.2.2)(vite@4.5.0): + resolution: {integrity: sha512-Juy5qsDVxag9p0seSjkcdXnAkTfI9WtYcP9ccJbxZlavtK5nGY17ViqjuKpj0+qk+003PPcC6j/CIV/KIorlAg==} 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(@types/node@18.18.6) - '@rollup/pluginutils': 5.0.2 - '@rushstack/node-core-library': 3.59.1(@types/node@18.18.6) + '@microsoft/api-extractor': 7.38.0(@types/node@18.18.6) + '@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 + typescript: 5.2.2 vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) + vue-tsc: 1.8.21(typescript@5.2.2) transitivePeerDependencies: - '@types/node' - rollup @@ -6845,6 +6820,25 @@ packages: vue: 3.3.7(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.7(typescript@5.2.2): resolution: {integrity: sha512-YEMDia1ZTv1TeBbnu6VybatmSteGOS3A3YgfINOfraCbf85wdKHzscD6HSS/vB4GAtI7sa1XPX7HcQaJ1l24zA==} peerDependencies: From 3af965ebdbc53653b088a606b49cb32aacf09984 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 17:26:08 +0000 Subject: [PATCH 38/93] chore(deps): update dependency prettier to v3 --- apps/docs/package.json | 2 +- config/eslint-config-custom/package.json | 2 +- config/prettier-config/package.json | 2 +- packages/lib/package.json | 2 +- pnpm-lock.yaml | 28 ++++++++++++++---------- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index d726db44..faf0b05f 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -27,7 +27,7 @@ "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.5", "sass": "1.69.4", diff --git a/config/eslint-config-custom/package.json b/config/eslint-config-custom/package.json index 9aed747e..90278cce 100644 --- a/config/eslint-config-custom/package.json +++ b/config/eslint-config-custom/package.json @@ -11,7 +11,7 @@ "eslint-config-prettier": "9.0.0", "eslint-plugin-markdown": "3.0.1", "eslint-plugin-prettier": "4.2.1", - "prettier": "2.8.8" + "prettier": "3.0.3" }, "devDependencies": { "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/packages/lib/package.json b/packages/lib/package.json index cb757f7d..9defbef7 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -82,7 +82,7 @@ "@vitest/ui": "0.34.6", "eslint": "8.52.0", "eslint-config-custom": "workspace:*", - "prettier": "2.8.8", + "prettier": "3.0.3", "prettier-config": "workspace:*", "rimraf": "5.0.5", "tsconfig": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ff74314f..a26423e9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -55,8 +55,8 @@ importers: 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 @@ -104,10 +104,10 @@ importers: version: 3.0.1(eslint@8.52.0) eslint-plugin-prettier: specifier: 4.2.1 - version: 4.2.1(eslint-config-prettier@9.0.0)(eslint@8.52.0)(prettier@2.8.8) + version: 4.2.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.2.2 @@ -116,8 +116,8 @@ importers: config/prettier-config: devDependencies: prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.0.3 + version: 3.0.3 config/tsconfig: dependencies: @@ -158,8 +158,8 @@ importers: 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 @@ -3876,7 +3876,7 @@ packages: - supports-color dev: false - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@9.0.0)(eslint@8.52.0)(prettier@2.8.8): + /eslint-plugin-prettier@4.2.1(eslint-config-prettier@9.0.0)(eslint@8.52.0)(prettier@3.0.3): resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -3889,7 +3889,7 @@ packages: dependencies: eslint: 8.52.0 eslint-config-prettier: 9.0.0(eslint@8.52.0) - prettier: 2.8.8 + prettier: 3.0.3 prettier-linter-helpers: 1.0.0 dev: false @@ -5491,6 +5491,12 @@ 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==} From e3425cdbf89b30e84eff5f4147f3b9721ead4a7e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 19:17:07 +0000 Subject: [PATCH 39/93] fix(deps): update dependency eslint-plugin-prettier to v5 --- config/eslint-config-custom/package.json | 2 +- pnpm-lock.yaml | 202 +++++++++++++++++++++-- 2 files changed, 186 insertions(+), 18 deletions(-) diff --git a/config/eslint-config-custom/package.json b/config/eslint-config-custom/package.json index 90278cce..29b8499b 100644 --- a/config/eslint-config-custom/package.json +++ b/config/eslint-config-custom/package.json @@ -10,7 +10,7 @@ "eslint": "8.52.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-markdown": "3.0.1", - "eslint-plugin-prettier": "4.2.1", + "eslint-plugin-prettier": "5.0.1", "prettier": "3.0.3" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a26423e9..2c0353aa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -103,8 +103,8 @@ importers: 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@9.0.0)(eslint@8.52.0)(prettier@3.0.3) + specifier: 5.0.1 + version: 5.0.1(eslint-config-prettier@9.0.0)(eslint@8.52.0)(prettier@3.0.3) prettier: specifier: 3.0.3 version: 3.0.3 @@ -2382,6 +2382,18 @@ 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 @@ -3257,11 +3269,23 @@ 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 + /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==} dependencies: @@ -3306,6 +3330,13 @@ packages: engines: {node: '>=6'} dev: true + /bundle-name@3.0.0: + resolution: {integrity: sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==} + engines: {node: '>=12'} + dependencies: + run-applescript: 5.0.0 + dev: false + /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -3657,12 +3688,35 @@ 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-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'} @@ -3876,14 +3930,17 @@ packages: - supports-color dev: false - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@9.0.0)(eslint@8.52.0)(prettier@3.0.3): - 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: @@ -3891,6 +3948,7 @@ packages: 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@7.2.2: @@ -4004,7 +4062,21 @@ packages: onetime: 5.1.2 signal-exit: 3.0.7 strip-final-newline: 2.0.0 - dev: true + + /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 /extendable-error@0.1.7: resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} @@ -4221,7 +4293,6 @@ packages: /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} - dev: true /get-symbol-description@1.0.0: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} @@ -4422,7 +4493,11 @@ packages: /human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} - dev: true + + /human-signals@4.3.1: + resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} + engines: {node: '>=14.18.0'} + dev: false /husky@8.0.3: resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} @@ -4565,6 +4640,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'} @@ -4584,6 +4671,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 @@ -4645,7 +4740,11 @@ 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} + dev: false /is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} @@ -4697,6 +4796,13 @@ 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 + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -5098,7 +5204,6 @@ 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==} @@ -5123,7 +5228,11 @@ 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'} + dev: false /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} @@ -5261,7 +5370,13 @@ 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 + dev: false /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} @@ -5292,7 +5407,23 @@ packages: engines: {node: '>=6'} dependencies: mimic-fn: 2.1.0 - dev: true + + /onetime@6.0.0: + resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} + engines: {node: '>=12'} + dependencies: + mimic-fn: 4.0.0 + dev: false + + /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==} @@ -5403,6 +5534,11 @@ 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'} + dev: false + /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true @@ -5738,6 +5874,13 @@ packages: fsevents: 2.3.2 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: @@ -5858,7 +6001,6 @@ 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==} @@ -6090,7 +6232,11 @@ 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'} + dev: false /strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} @@ -6127,6 +6273,14 @@ packages: engines: {node: '>= 0.4'} dev: true + /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 @@ -6203,6 +6357,11 @@ packages: 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'} @@ -6293,6 +6452,10 @@ packages: typescript: 5.2.2 dev: true + /tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + dev: false + /tty-table@4.2.1: resolution: {integrity: sha512-xz0uKo+KakCQ+Dxj1D/tKn2FSyreSYWzdkL/BYhgN6oMW808g8QRMuh1atAV9fjTPbWBjfbkKQpI/5rEcnAc7g==} engines: {node: '>=8.0.0'} @@ -6516,6 +6679,11 @@ packages: 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'} From 87b5074d4bf8236b79efdd5a25b8e71f3acc6f38 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 21:48:03 +0000 Subject: [PATCH 40/93] fix(deps): update dependency @types/node to v18.18.7 --- apps/docs/package.json | 2 +- config/tsconfig/package.json | 2 +- pnpm-lock.yaml | 89 +++++++++++++++++++----------------- 3 files changed, 49 insertions(+), 44 deletions(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index faf0b05f..eeaf7c6f 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -22,7 +22,7 @@ "vue": "3.3.7" }, "devDependencies": { - "@types/node": "18.18.6", + "@types/node": "18.18.7", "@vite-pwa/vitepress": "0.2.3", "dotenv": "16.3.1", "eslint": "8.52.0", diff --git a/config/tsconfig/package.json b/config/tsconfig/package.json index a38b99b6..32c2ce73 100644 --- a/config/tsconfig/package.json +++ b/config/tsconfig/package.json @@ -12,6 +12,6 @@ "vite-press.json" ], "dependencies": { - "@types/node": "18.18.6" + "@types/node": "18.18.7" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2c0353aa..e2229512 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,8 +40,8 @@ importers: version: 3.3.7(typescript@5.2.2) devDependencies: '@types/node': - specifier: 18.18.6 - version: 18.18.6 + specifier: 18.18.7 + version: 18.18.7 '@vite-pwa/vitepress': specifier: 0.2.3 version: 0.2.3(vite-plugin-pwa@0.16.5) @@ -80,7 +80,7 @@ importers: version: 0.16.5(vite@4.5.0)(workbox-build@7.0.0)(workbox-window@7.0.0) vitepress: specifier: 1.0.0-rc.24 - version: 1.0.0-rc.24(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2) + version: 1.0.0-rc.24(@algolia/client-search@4.20.0)(@types/node@18.18.7)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2) workbox-window: specifier: 7.0.0 version: 7.0.0 @@ -122,8 +122,8 @@ importers: config/tsconfig: dependencies: '@types/node': - specifier: 18.18.6 - version: 18.18.6 + specifier: 18.18.7 + version: 18.18.7 config/typedoc-config: devDependencies: @@ -180,10 +180,10 @@ importers: version: 5.2.2 vite: specifier: 4.5.0 - version: 4.5.0(@types/node@18.18.6)(sass@1.69.4) + version: 4.5.0(@types/node@18.18.7)(sass@1.69.4) vite-plugin-dts: specifier: 3.6.1 - version: 3.6.1(@types/node@18.18.6)(typescript@5.2.2)(vite@4.5.0) + version: 3.6.1(@types/node@18.18.7)(typescript@5.2.2)(vite@4.5.0) vite-tsconfig-paths: specifier: 4.2.1 version: 4.2.1(typescript@5.2.2)(vite@4.5.0) @@ -1838,15 +1838,15 @@ packages: '@commitlint/execute-rule': 18.1.0 '@commitlint/resolve-extends': 18.1.0 '@commitlint/types': 18.1.0 - '@types/node': 18.18.6 + '@types/node': 18.18.7 chalk: 4.1.2 cosmiconfig: 8.1.3 - cosmiconfig-typescript-loader: 4.3.0(@types/node@18.18.6)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.2.2) + 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@18.18.6)(typescript@5.2.2) + ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: - '@swc/core' @@ -2314,24 +2314,24 @@ packages: read-yaml-file: 1.1.0 dev: true - /@microsoft/api-extractor-model@7.28.2(@types/node@18.18.6): + /@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.61.0(@types/node@18.18.6) + '@rushstack/node-core-library': 3.61.0(@types/node@18.18.7) transitivePeerDependencies: - '@types/node' dev: true - /@microsoft/api-extractor@7.38.0(@types/node@18.18.6): + /@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.28.2(@types/node@18.18.6) + '@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.61.0(@types/node@18.18.6) + '@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 @@ -2466,7 +2466,7 @@ packages: picomatch: 2.3.1 dev: true - /@rushstack/node-core-library@3.61.0(@types/node@18.18.6): + /@rushstack/node-core-library@3.61.0(@types/node@18.18.7): resolution: {integrity: sha512-tdOjdErme+/YOu4gPed3sFS72GhtWCgNV9oDsHDnoLY5oDfwjKUc9Z+JOZZ37uAxcm/OCahDHfuu2ugqrfWAVQ==} peerDependencies: '@types/node': '*' @@ -2474,7 +2474,7 @@ packages: '@types/node': optional: true dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 colors: 1.2.5 fs-extra: 7.0.1 import-lazy: 4.0.0 @@ -2598,8 +2598,10 @@ packages: resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} dev: true - /@types/node@18.18.6: - resolution: {integrity: sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==} + /@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==} @@ -2608,13 +2610,13 @@ packages: /@types/resolve@1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 dev: true /@types/sax@1.2.4: resolution: {integrity: sha512-pSAff4IAxJjfAXUG6tFkO7dsSbTmf8CtUpfhhZ5VhkRpC4628tJhh3+V6H1E+/Gs9piSzYKT5yzHO5M4GG9jkw==} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 dev: true /@types/semver@7.5.0: @@ -2781,7 +2783,7 @@ packages: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) + vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) vue: 3.3.7(typescript@5.2.2) dev: true @@ -3557,7 +3559,7 @@ packages: browserslist: 4.21.5 dev: true - /cosmiconfig-typescript-loader@4.3.0(@types/node@18.18.6)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.2.2): + /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: @@ -3566,9 +3568,9 @@ packages: ts-node: '>=10' typescript: '>=3' dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 cosmiconfig: 8.1.3 - ts-node: 10.9.1(@types/node@18.18.6)(typescript@5.2.2) + ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) typescript: 5.2.2 dev: true @@ -4863,7 +4865,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -6408,7 +6410,7 @@ packages: typescript: 5.2.2 dev: false - /ts-node@10.9.1(@types/node@18.18.6)(typescript@5.2.2): + /ts-node@10.9.1(@types/node@18.18.7)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -6427,7 +6429,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 18.18.6 + '@types/node': 18.18.7 acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 @@ -6633,6 +6635,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'} @@ -6734,7 +6739,7 @@ packages: engines: {node: '>= 0.10'} dev: true - /vite-node@0.34.6(@types/node@18.18.6): + /vite-node@0.34.6(@types/node@18.18.7): resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} engines: {node: '>=v14.18.0'} hasBin: true @@ -6744,7 +6749,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) + vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) transitivePeerDependencies: - '@types/node' - less @@ -6756,7 +6761,7 @@ packages: - terser dev: true - /vite-plugin-dts@3.6.1(@types/node@18.18.6)(typescript@5.2.2)(vite@4.5.0): + /vite-plugin-dts@3.6.1(@types/node@18.18.7)(typescript@5.2.2)(vite@4.5.0): resolution: {integrity: sha512-Juy5qsDVxag9p0seSjkcdXnAkTfI9WtYcP9ccJbxZlavtK5nGY17ViqjuKpj0+qk+003PPcC6j/CIV/KIorlAg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -6766,13 +6771,13 @@ packages: vite: optional: true dependencies: - '@microsoft/api-extractor': 7.38.0(@types/node@18.18.6) + '@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 kolorist: 1.8.0 typescript: 5.2.2 - vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) + vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) vue-tsc: 1.8.21(typescript@5.2.2) transitivePeerDependencies: - '@types/node' @@ -6791,7 +6796,7 @@ packages: debug: 4.3.4 fast-glob: 3.3.1 pretty-bytes: 6.1.1 - vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) + vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) workbox-build: 7.0.0 workbox-window: 7.0.0 transitivePeerDependencies: @@ -6809,13 +6814,13 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.1(typescript@5.2.2) - vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) + vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.5.0(@types/node@18.18.6)(sass@1.69.4): + /vite@4.5.0(@types/node@18.18.7)(sass@1.69.4): resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -6843,7 +6848,7 @@ packages: terser: optional: true dependencies: - '@types/node': 18.18.6 + '@types/node': 18.18.7 esbuild: 0.18.20 postcss: 8.4.31 rollup: 3.29.4 @@ -6852,7 +6857,7 @@ packages: fsevents: 2.3.2 dev: true - /vitepress@1.0.0-rc.24(@algolia/client-search@4.20.0)(@types/node@18.18.6)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2): + /vitepress@1.0.0-rc.24(@algolia/client-search@4.20.0)(@types/node@18.18.7)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2): resolution: {integrity: sha512-RpnL8cnOGwiRlBbrYQUm9sYkJbtyOt/wYXk2diTcokY4yvks/5lq9LuSt+MURWB6ZqwpSNHvTmxgaSfLoG0/OA==} hasBin: true peerDependencies: @@ -6875,7 +6880,7 @@ packages: mark.js: 8.11.1 minisearch: 6.1.0 shiki: 0.14.5 - vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) + vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) vue: 3.3.7(typescript@5.2.2) transitivePeerDependencies: - '@algolia/client-search' @@ -6950,7 +6955,7 @@ packages: dependencies: '@types/chai': 4.3.5 '@types/chai-subset': 1.3.3 - '@types/node': 18.18.6 + '@types/node': 18.18.7 '@vitest/expect': 0.34.6 '@vitest/runner': 0.34.6 '@vitest/snapshot': 0.34.6 @@ -6970,8 +6975,8 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.7.0 - vite: 4.5.0(@types/node@18.18.6)(sass@1.69.4) - vite-node: 0.34.6(@types/node@18.18.6) + vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) + vite-node: 0.34.6(@types/node@18.18.7) why-is-node-running: 2.2.2 transitivePeerDependencies: - less From 071b93b2186f5ad1d0ec0b7e6607b5c583b35638 Mon Sep 17 00:00:00 2001 From: Brandon Eichler Date: Wed, 25 Oct 2023 17:48:39 -0500 Subject: [PATCH 41/93] Create hungry-stingrays-promise.md --- .changeset/hungry-stingrays-promise.md | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .changeset/hungry-stingrays-promise.md diff --git a/.changeset/hungry-stingrays-promise.md b/.changeset/hungry-stingrays-promise.md new file mode 100644 index 00000000..520a6944 --- /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` +- 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 `v4.5.0` +- Update dependency `@vite-pwa/vitepress` to `v0.2.3` +- Update dependency `vitepress` to `v1.0.0-rc.24` +- Update dependency `vite-plugin-dts` to `v3.0.0` +- Update dependency `vite-plugin-pwa` to `v0.16.5` +- Update dependency `vite-tsconfig-paths` to `v4.2.1` +- Update dependency `vitest` to `v0.34.6` +- Update dependency `@vitest/ui` to `v0.34.6` +- 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` From 4fb31f80aab018a34c433ca5ebaf33e10ba73f56 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Wed, 25 Oct 2023 23:38:53 -0500 Subject: [PATCH 42/93] chore(format): commit latest prettier output after updating --- apps/docs/src/guide/getting-started.md | 2 +- apps/docs/src/guide/install.md | 6 +++--- apps/docs/src/guide/vin-decoding.md | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/docs/src/guide/getting-started.md b/apps/docs/src/guide/getting-started.md index ab05e101..520252e4 100644 --- a/apps/docs/src/guide/getting-started.md +++ b/apps/docs/src/guide/getting-started.md @@ -72,7 +72,7 @@ The following are simple examples that use the jsDelivr CDN: _~ 4kB (auto minified)_ ```html - + 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/vin-decoding.md b/apps/docs/src/guide/vin-decoding.md index 0b85f6f7..b51ea863 100644 --- a/apps/docs/src/guide/vin-decoding.md +++ b/apps/docs/src/guide/vin-decoding.md @@ -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] From ca86ea72cadbdbde1c4bdb32e68eabb83716f1e9 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Wed, 25 Oct 2023 23:40:45 -0500 Subject: [PATCH 43/93] chore(format): add 'dev-dist' to eslint ignore list --- apps/docs/package.json | 2 +- config/eslint-config-custom/eslint-config.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/docs/package.json b/apps/docs/package.json index eeaf7c6f..f5381bc6 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -11,7 +11,7 @@ "build": "vitepress build", "preview": "vitepress preview", "lint": "eslint .", - "lint:fix": "eslint --fix", + "lint:fix": "eslint . --fix", "format": "prettier --write \"src/**/*.{ts,tsx,md}\"", "format:typedoc": "prettier --write \"src/typedoc/**/*.md\"", "clean": "rimraf .vitepress/dist .vitepress/cache .turbo", 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 From 56f346c979a324c0fe16ca6ea48c87367ee543c1 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Fri, 27 Oct 2023 00:34:43 -0500 Subject: [PATCH 44/93] chore(docs): commit latest typedoc output after dep updates --- apps/docs/src/typedoc/modules.md | 24 +++++-------------- .../src/typedoc/modules/utils_isValidVin.md | 24 +++++++++---------- 2 files changed, 18 insertions(+), 30 deletions(-) diff --git a/apps/docs/src/typedoc/modules.md b/apps/docs/src/typedoc/modules.md index a80f47e9..1eed68bd 100644 --- a/apps/docs/src/typedoc/modules.md +++ b/apps/docs/src/typedoc/modules.md @@ -4,13 +4,9 @@ ## Table of contents -### API Modules +### 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) @@ -36,26 +32,18 @@ - [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 - +- [api/endpoints/types](modules/api_endpoints_types.md) +- [api/types](modules/api_types.md) +- [api/useNHTSA](modules/api_useNHTSA.md) - [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) +- [utils/types](modules/utils_types.md) +- [vite-env](modules/vite_env.md) diff --git a/apps/docs/src/typedoc/modules/utils_isValidVin.md b/apps/docs/src/typedoc/modules/utils_isValidVin.md index 755a09c7..1e2b1200 100644 --- a/apps/docs/src/typedoc/modules/utils_isValidVin.md +++ b/apps/docs/src/typedoc/modules/utils_isValidVin.md @@ -20,6 +20,18 @@ Provides **offline** validation of Vehicle Identification Numbers (VINs) using t 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. +#### Parameters + +| Name | 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 @@ -39,18 +51,6 @@ 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 [utils/isValidVin.ts:66](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/isValidVin.ts#L66) From d2e34028a8266106a744b568fb157be1bcb54034 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Sun, 29 Oct 2023 23:16:40 -0500 Subject: [PATCH 45/93] chore(deps): update typedoc-plugin-markdown to @next version --- apps/docs/.prettierignore | 1 + apps/docs/.vitepress/config.ts | 4 - apps/docs/.vitepress/menu-links.ts | 242 ++++++++---------- apps/docs/package.json | 2 +- .../src/api/endpoints/decode-vin-extended.md | 2 +- .../api/endpoints/decode-vin-values-batch.md | 2 +- .../endpoints/decode-vin-values-extended.md | 2 +- .../src/api/endpoints/decode-vin-values.md | 2 +- apps/docs/src/api/endpoints/decode-vin.md | 2 +- apps/docs/src/api/endpoints/decode-wmi.md | 2 +- apps/docs/src/api/endpoints/get-all-makes.md | 2 +- .../api/endpoints/get-all-manufacturers.md | 2 +- .../get-canadian-vehicle-specifications.md | 2 +- .../endpoints/get-equipment-plant-codes.md | 2 +- .../endpoints/get-make-for-manufacturer.md | 2 +- .../get-makes-for-manufacturer-and-year.md | 2 +- .../endpoints/get-makes-for-vehicle-type.md | 2 +- .../api/endpoints/get-manufacturer-details.md | 2 +- .../endpoints/get-models-for-make-id-year.md | 2 +- .../api/endpoints/get-models-for-make-id.md | 2 +- .../api/endpoints/get-models-for-make-year.md | 2 +- .../src/api/endpoints/get-models-for-make.md | 2 +- apps/docs/src/api/endpoints/get-parts.md | 2 +- .../get-vehicle-types-for-make-id.md | 2 +- .../endpoints/get-vehicle-types-for-make.md | 2 +- .../endpoints/get-vehicle-variable-list.md | 2 +- .../get-vehicle-variable-values-list.md | 2 +- .../endpoints/get-wmis-for-manufacturer.md | 2 +- apps/docs/src/guide/getting-started.md | 2 +- apps/docs/src/guide/typescript.md | 5 +- apps/docs/src/guide/vin-decoding.md | 2 +- apps/docs/src/parts/package-exports-types.md | 2 +- apps/docs/src/utils/use-nhtsa.md | 4 +- config/typedoc-config/package.json | 2 +- packages/lib/.typedoc/typedoc.cjs | 8 +- packages/lib/package.json | 4 +- pnpm-lock.yaml | 40 +-- 37 files changed, 161 insertions(+), 205 deletions(-) create mode 100644 apps/docs/.prettierignore 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..6460baa3 100644 --- a/apps/docs/.vitepress/menu-links.ts +++ b/apps/docs/.vitepress/menu-links.ts @@ -76,168 +76,150 @@ const vpicEndpointLinks = [ const typedocLinks = [ { - text: 'Modules', + text: '/api', collapsed: true, items: [ + { text: 'Index', link: '/typedoc/api' }, { - text: '/api', + text: 'useNHTSA', + link: '/typedoc/api/useNHTSA', + }, + { + 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/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/endpoints/DecodeVinExtended', + }, + { + text: 'DecodeVinValues', + link: '/typedoc/api/endpoints/DecodeVinValues', + }, + { + text: 'DecodeVinValuesBatch', + link: '/typedoc/api/endpoints/DecodeVinValuesBatch', + }, + { + text: 'DecodeVinValuesExtended', + link: '/typedoc/api/endpoints/DecodeVinValuesExtended', + }, + { + text: 'DecodeWMI', + link: '/typedoc/api/endpoints/DecodeWMI', + }, + { + text: 'GetAllMakes', + link: '/typedoc/api/endpoints/GetAllMakes', + }, + { + text: 'GetAllManufacturers', + link: '/typedoc/api/endpoints/GetAllManufacturers', + }, + { + text: 'GetCanadianVehicleSpecifications', + link: '/typedoc/api/endpoints/GetCanadianVehicleSpecifications', + }, + { + text: 'GetEquipmentPlantCodes', + link: '/typedoc/api/endpoints/GetEquipmentPlantCodes', + }, + { + text: 'GetMakeForManufacturer', + link: '/typedoc/api/endpoints/GetMakeForManufacturer', }, - ], - }, - { - text: '/utils', - collapsed: true, - items: [ - { text: 'Index', link: '/typedoc/modules/utils' }, { - text: 'argHandler', - link: '/typedoc/modules/utils_argHandler', + text: 'GetMakesForManufacturerAndYear', + link: '/typedoc/api/endpoints/GetMakesForManufacturerAndYear', }, { - text: 'errorHandler', - link: '/typedoc/modules/utils_errorHandler', + text: 'GetMakesForVehicleType', + link: '/typedoc/api/endpoints/GetMakesForVehicleType', }, { - text: 'getTypeof', - link: '/typedoc/modules/utils_getTypeof', + text: 'GetManufacturerDetails', + link: '/typedoc/api/endpoints/GetManufacturerDetails', }, { - text: 'isValidVin', - link: '/typedoc/modules/utils_isValidVin', + text: 'GetModelsForMake', + link: '/typedoc/api/endpoints/GetModelsForMake', }, { - text: 'queryString', - link: '/typedoc/modules/utils_queryString', + text: 'GetModelsForMakeId', + link: '/typedoc/api/endpoints/GetModelsForMakeId', + }, + { + text: 'GetModelsForMakeIdYear', + link: '/typedoc/api/endpoints/GetModelsForMakeIdYear', + }, + { + text: 'GetModelsForMakeYear', + link: '/typedoc/api/endpoints/GetModelsForMakeYear', + }, + { + text: 'GetParts', + link: '/typedoc/api/endpoints/GetParts', + }, + { + text: 'GetVehicleTypesForMake', + link: '/typedoc/api/endpoints/GetVehicleTypesForMake', + }, + { + text: 'GetVehicleTypesForMakeId', + link: '/typedoc/api/endpoints/GetVehicleTypesForMakeId', + }, + { + text: 'GetVehicleVariableList', + link: '/typedoc/api/endpoints/GetVehicleVariableList', + }, + { + text: 'GetVehicleVariableValuesList', + link: '/typedoc/api/endpoints/GetVehicleVariableValuesList', + }, + { + text: 'GetWMIsForManufacturer', + link: '/typedoc/api/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: '/api/endpoints/types', - link: '/typedoc/modules/api_endpoints_types', + text: 'errorHandler', + link: '/typedoc/utils/errorHandler', }, { - text: '/utils/types', - link: '/typedoc/modules/utils_types', + text: 'getTypeof', + link: '/typedoc/utils/getTypeof', + }, + { + text: 'isValidVin', + link: '/typedoc/utils/isValidVin', + }, + { + text: 'queryString', + link: '/typedoc/utils/queryString', }, ], }, + { + text: 'Types Index', + link: '/typedoc/types', + }, ] export type LinkGroup = 'guide' | 'api' | 'typedocs' diff --git a/apps/docs/package.json b/apps/docs/package.json index f5381bc6..5e58ae90 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -12,7 +12,7 @@ "preview": "vitepress preview", "lint": "eslint .", "lint:fix": "eslint . --fix", - "format": "prettier --write \"src/**/*.{ts,tsx,md}\"", + "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" diff --git a/apps/docs/src/api/endpoints/decode-vin-extended.md b/apps/docs/src/api/endpoints/decode-vin-extended.md index b6a05d32..531db572 100644 --- a/apps/docs/src/api/endpoints/decode-vin-extended.md +++ b/apps/docs/src/api/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/endpoints/DecodeVinExtended) ::: ## Description diff --git a/apps/docs/src/api/endpoints/decode-vin-values-batch.md b/apps/docs/src/api/endpoints/decode-vin-values-batch.md index 40cb3fb3..05b4b8cd 100644 --- a/apps/docs/src/api/endpoints/decode-vin-values-batch.md +++ b/apps/docs/src/api/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/endpoints/DecodeVinValuesBatch) ::: ## Description diff --git a/apps/docs/src/api/endpoints/decode-vin-values-extended.md b/apps/docs/src/api/endpoints/decode-vin-values-extended.md index b59941da..849e86d6 100644 --- a/apps/docs/src/api/endpoints/decode-vin-values-extended.md +++ b/apps/docs/src/api/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/endpoints/DecodeVinValuesExtended) ::: ## Description diff --git a/apps/docs/src/api/endpoints/decode-vin-values.md b/apps/docs/src/api/endpoints/decode-vin-values.md index 5f4551ba..857ab9be 100644 --- a/apps/docs/src/api/endpoints/decode-vin-values.md +++ b/apps/docs/src/api/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/endpoints/DecodeVinValues) ::: ## Description diff --git a/apps/docs/src/api/endpoints/decode-vin.md b/apps/docs/src/api/endpoints/decode-vin.md index 93f611ea..d4408bef 100644 --- a/apps/docs/src/api/endpoints/decode-vin.md +++ b/apps/docs/src/api/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/endpoints/DecodeVin) ::: ## Description diff --git a/apps/docs/src/api/endpoints/decode-wmi.md b/apps/docs/src/api/endpoints/decode-wmi.md index 1a950221..a86ea9ec 100644 --- a/apps/docs/src/api/endpoints/decode-wmi.md +++ b/apps/docs/src/api/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/endpoints/DecodeWMI) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-all-makes.md b/apps/docs/src/api/endpoints/get-all-makes.md index b8157141..7e2d688f 100644 --- a/apps/docs/src/api/endpoints/get-all-makes.md +++ b/apps/docs/src/api/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/endpoints/GetAllMakes) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-all-manufacturers.md b/apps/docs/src/api/endpoints/get-all-manufacturers.md index e63048b1..7b386d55 100644 --- a/apps/docs/src/api/endpoints/get-all-manufacturers.md +++ b/apps/docs/src/api/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/endpoints/GetAllManufacturers) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-canadian-vehicle-specifications.md b/apps/docs/src/api/endpoints/get-canadian-vehicle-specifications.md index d82eb80b..7eb875e3 100644 --- a/apps/docs/src/api/endpoints/get-canadian-vehicle-specifications.md +++ b/apps/docs/src/api/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/endpoints/GetCanadianVehicleSpecifications) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-equipment-plant-codes.md b/apps/docs/src/api/endpoints/get-equipment-plant-codes.md index 14d1ecca..28a48c6a 100644 --- a/apps/docs/src/api/endpoints/get-equipment-plant-codes.md +++ b/apps/docs/src/api/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/endpoints/GetEquipmentPlantCodes) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-make-for-manufacturer.md b/apps/docs/src/api/endpoints/get-make-for-manufacturer.md index 510034c3..b653f8a9 100644 --- a/apps/docs/src/api/endpoints/get-make-for-manufacturer.md +++ b/apps/docs/src/api/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/endpoints/GetMakeForManufacturer) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-makes-for-manufacturer-and-year.md b/apps/docs/src/api/endpoints/get-makes-for-manufacturer-and-year.md index da1bd756..fba6fb80 100644 --- a/apps/docs/src/api/endpoints/get-makes-for-manufacturer-and-year.md +++ b/apps/docs/src/api/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/endpoints/GetMakesForManufacturerAndYear) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-makes-for-vehicle-type.md b/apps/docs/src/api/endpoints/get-makes-for-vehicle-type.md index b8922096..893da219 100644 --- a/apps/docs/src/api/endpoints/get-makes-for-vehicle-type.md +++ b/apps/docs/src/api/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/endpoints/GetMakesForVehicleType) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-manufacturer-details.md b/apps/docs/src/api/endpoints/get-manufacturer-details.md index 7ee32cd6..ffb0addc 100644 --- a/apps/docs/src/api/endpoints/get-manufacturer-details.md +++ b/apps/docs/src/api/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/endpoints/GetManufacturerDetails) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-models-for-make-id-year.md b/apps/docs/src/api/endpoints/get-models-for-make-id-year.md index d92bd214..fef719b9 100644 --- a/apps/docs/src/api/endpoints/get-models-for-make-id-year.md +++ b/apps/docs/src/api/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/endpoints/GetModelsForMakeIdYear) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-models-for-make-id.md b/apps/docs/src/api/endpoints/get-models-for-make-id.md index 84a26573..133bb641 100644 --- a/apps/docs/src/api/endpoints/get-models-for-make-id.md +++ b/apps/docs/src/api/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/endpoints/GetModelsForMakeId) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-models-for-make-year.md b/apps/docs/src/api/endpoints/get-models-for-make-year.md index 004bdd7f..aff0cdfb 100644 --- a/apps/docs/src/api/endpoints/get-models-for-make-year.md +++ b/apps/docs/src/api/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/endpoints/GetModelsForMakeYear) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-models-for-make.md b/apps/docs/src/api/endpoints/get-models-for-make.md index c9eff80f..9d816c83 100644 --- a/apps/docs/src/api/endpoints/get-models-for-make.md +++ b/apps/docs/src/api/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/endpoints/GetModelsForMake) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-parts.md b/apps/docs/src/api/endpoints/get-parts.md index e7a5c9c5..f594c62b 100644 --- a/apps/docs/src/api/endpoints/get-parts.md +++ b/apps/docs/src/api/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/endpoints/GetParts) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-vehicle-types-for-make-id.md b/apps/docs/src/api/endpoints/get-vehicle-types-for-make-id.md index 416ab58b..54826f48 100644 --- a/apps/docs/src/api/endpoints/get-vehicle-types-for-make-id.md +++ b/apps/docs/src/api/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/endpoints/GetVehicleTypesForMakeId) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-vehicle-types-for-make.md b/apps/docs/src/api/endpoints/get-vehicle-types-for-make.md index fa7a2719..96861239 100644 --- a/apps/docs/src/api/endpoints/get-vehicle-types-for-make.md +++ b/apps/docs/src/api/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/endpoints/GetVehicleTypesForMake) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-vehicle-variable-list.md b/apps/docs/src/api/endpoints/get-vehicle-variable-list.md index b59d7376..d4b6225c 100644 --- a/apps/docs/src/api/endpoints/get-vehicle-variable-list.md +++ b/apps/docs/src/api/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/endpoints/GetVehicleVariableList) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-vehicle-variable-values-list.md b/apps/docs/src/api/endpoints/get-vehicle-variable-values-list.md index 978f2f01..eb333c60 100644 --- a/apps/docs/src/api/endpoints/get-vehicle-variable-values-list.md +++ b/apps/docs/src/api/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/endpoints/GetVehicleVariableValuesList) ::: ## Description diff --git a/apps/docs/src/api/endpoints/get-wmis-for-manufacturer.md b/apps/docs/src/api/endpoints/get-wmis-for-manufacturer.md index 4a1bed18..e584f7e0 100644 --- a/apps/docs/src/api/endpoints/get-wmis-for-manufacturer.md +++ b/apps/docs/src/api/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/endpoints/GetWMIsForManufacturer) ::: ## Description diff --git a/apps/docs/src/guide/getting-started.md b/apps/docs/src/guide/getting-started.md index 520252e4..7aebee01 100644 --- a/apps/docs/src/guide/getting-started.md +++ b/apps/docs/src/guide/getting-started.md @@ -58,7 +58,7 @@ Further Reading: 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/endpoints/DecodeVinValues#decodevinvaluesresults) page. --- diff --git a/apps/docs/src/guide/typescript.md b/apps/docs/src/guide/typescript.md index 5010d36c..22ddba1b 100644 --- a/apps/docs/src/guide/typescript.md +++ b/apps/docs/src/guide/typescript.md @@ -58,7 +58,8 @@ function. For example `DecodeVin` has a `DecodeVinResults` type, `GetAllMakes` h `GetAllMakesResults` type, etc. A few endpoints also have other associated types, such as -[`DecodeVinExtendedVariable`](../typedoc/modules/api_endpoints_DecodeVinExtended#decodevinextendedvariable) +typedoc/api/endpoints/DecodeVinValues/type-aliases/DecodeVinValuesResults +[`DecodeVinExtendedVariable`](../typedoc/api/endpoints/DecodeVinExtended#DecodeVinExtendedVariable) that describe possible `Variable` values found in the `Results` array of the `DecodeVinExtended` endpoint. @@ -66,7 +67,7 @@ endpoint. ::: tip :mag: See Also: -The [Typedocs - Types](../typedoc/modules/types) page lists all of the types this +The [Typedocs - Types](../typedoc/types) page lists all of the types this package exports and their structure.
diff --git a/apps/docs/src/guide/vin-decoding.md b/apps/docs/src/guide/vin-decoding.md index b51ea863..d7e319b0 100644 --- a/apps/docs/src/guide/vin-decoding.md +++ b/apps/docs/src/guide/vin-decoding.md @@ -52,7 +52,7 @@ object. This object is the decoded data for the VIN. - [DecodeVinValues](../api/endpoints/decode-vin-values) - [DecodeVinValues Example Response](../api/endpoints/decode-vin-values#returns) -- [Type - DecodeVinValuesResults](../typedoc/modules/api_endpoints_DecodeVinValues#decodevinvaluesresults) +- [Type - DecodeVinValuesResults](../typedoc/api/endpoints/DecodeVinValues#decodevinvaluesresults) ::: diff --git a/apps/docs/src/parts/package-exports-types.md b/apps/docs/src/parts/package-exports-types.md index b368395d..ca951ec9 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 diff --git a/apps/docs/src/utils/use-nhtsa.md b/apps/docs/src/utils/use-nhtsa.md index 95f9af1e..7942c9a0 100644 --- a/apps/docs/src/utils/use-nhtsa.md +++ b/apps/docs/src/utils/use-nhtsa.md @@ -47,7 +47,7 @@ It also contains functions for building and returning the URL string for the VPI ::: 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,7 +159,7 @@ 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) (required) diff --git a/config/typedoc-config/package.json b/config/typedoc-config/package.json index 29bf4198..c54968b8 100644 --- a/config/typedoc-config/package.json +++ b/config/typedoc-config/package.json @@ -6,7 +6,7 @@ "main": "typedoc-config.js", "devDependencies": { "typedoc": "0.25.2", - "typedoc-plugin-markdown": "3.16.0", + "typedoc-plugin-markdown": "4.0.0-next.25", "typescript": "5.2.2" } } 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/package.json b/packages/lib/package.json index 9defbef7..a020912d 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -61,7 +61,7 @@ }, "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:.*/\"", @@ -70,7 +70,7 @@ "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", "coverage": "vitest --coverage", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e2229512..f87ef9de 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -131,8 +131,8 @@ importers: specifier: 0.25.2 version: 0.25.2(typescript@5.2.2) typedoc-plugin-markdown: - specifier: 3.16.0 - version: 3.16.0(typedoc@0.25.2) + specifier: 4.0.0-next.25 + version: 4.0.0-next.25(typedoc@0.25.2) typescript: specifier: 5.2.2 version: 5.2.2 @@ -4407,19 +4407,6 @@ packages: /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'} @@ -5323,10 +5310,6 @@ packages: /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} @@ -6580,12 +6563,11 @@ packages: is-typed-array: 1.1.10 dev: true - /typedoc-plugin-markdown@3.16.0(typedoc@0.25.2): - resolution: {integrity: sha512-eeiC78fDNGFwemPIHiwRC+mEC7W5jwt3fceUev2gJ2nFnXpVHo8eRrpC9BLWZDee6ehnz/sPmNjizbXwpfaTBw==} + /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.25.2(typescript@5.2.2) dev: true @@ -6618,14 +6600,6 @@ packages: resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} dev: true - /uglify-js@3.17.4: - resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} - engines: {node: '>=0.8.0'} - hasBin: true - requiresBuild: true - dev: true - optional: true - /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: @@ -7131,10 +7105,6 @@ packages: stackback: 0.0.2 dev: true - /wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} - dev: true - /workbox-background-sync@7.0.0: resolution: {integrity: sha512-S+m1+84gjdueM+jIKZ+I0Lx0BDHkk5Nu6a3kTVxP4fdj3gKouRNmhO8H290ybnJTOPfBDtTMXSQA/QLTvr7PeA==} dependencies: From 0c62d30ceed0f975ed8e8520e57fe2e7ff401c1a Mon Sep 17 00:00:00 2001 From: shaggytech Date: Sun, 29 Oct 2023 23:17:03 -0500 Subject: [PATCH 46/93] chore(docs): commit latest typedoc output --- apps/docs/src/typedoc/api.md | 138 ++++++ apps/docs/src/typedoc/api/endpoints.md | 133 ++++++ .../src/typedoc/api/endpoints/DecodeVin.md | 181 +++++++ .../api/endpoints/DecodeVinExtended.md | 185 ++++++++ .../typedoc/api/endpoints/DecodeVinValues.md | 325 +++++++++++++ .../api/endpoints/DecodeVinValuesBatch.md | 251 ++++++++++ .../api/endpoints/DecodeVinValuesExtended.md | 310 ++++++++++++ .../src/typedoc/api/endpoints/DecodeWMI.md | 100 ++++ .../src/typedoc/api/endpoints/GetAllMakes.md | 86 ++++ .../api/endpoints/GetAllManufacturers.md | 137 ++++++ .../GetCanadianVehicleSpecifications.md | 108 +++++ .../api/endpoints/GetEquipmentPlantCodes.md | 133 ++++++ .../api/endpoints/GetMakeForManufacturer.md | 93 ++++ .../GetMakesForManufacturerAndYear.md | 108 +++++ .../api/endpoints/GetMakesForVehicleType.md | 90 ++++ .../api/endpoints/GetManufacturerDetails.md | 115 +++++ .../typedoc/api/endpoints/GetModelsForMake.md | 92 ++++ .../api/endpoints/GetModelsForMakeId.md | 104 ++++ .../endpoints/GetModelsForMakeIdYear.md} | 81 ++-- .../endpoints/GetModelsForMakeYear.md} | 78 +-- .../src/typedoc/api/endpoints/GetParts.md | 167 +++++++ .../api/endpoints/GetVehicleTypesForMake.md | 90 ++++ .../api/endpoints/GetVehicleTypesForMakeId.md | 102 ++++ .../api/endpoints/GetVehicleVariableList.md | 86 ++++ .../endpoints/GetVehicleVariableValuesList.md | 91 ++++ .../api/endpoints/GetWMIsForManufacturer.md | 111 +++++ apps/docs/src/typedoc/api/endpoints/types.md | 148 ++++++ apps/docs/src/typedoc/api/types.md | 182 +++++++ apps/docs/src/typedoc/api/useNHTSA.md | 85 ++++ apps/docs/src/typedoc/constants.md | 33 ++ apps/docs/src/typedoc/global.md | 7 + apps/docs/src/typedoc/index.md | 4 +- apps/docs/src/typedoc/module.index.md | 328 +++++++++++++ apps/docs/src/typedoc/modules.md | 114 +++-- apps/docs/src/typedoc/modules/api.md | 183 ------- .../docs/src/typedoc/modules/api_endpoints.md | 176 ------- .../modules/api_endpoints_DecodeVin.md | 172 ------- .../api_endpoints_DecodeVinExtended.md | 176 ------- .../modules/api_endpoints_DecodeVinValues.md | 315 ------------ .../api_endpoints_DecodeVinValuesBatch.md | 247 ---------- .../api_endpoints_DecodeVinValuesExtended.md | 300 ------------ .../modules/api_endpoints_DecodeWMI.md | 96 ---- .../modules/api_endpoints_GetAllMakes.md | 81 ---- .../api_endpoints_GetAllManufacturers.md | 128 ----- ...points_GetCanadianVehicleSpecifications.md | 103 ---- .../api_endpoints_GetEquipmentPlantCodes.md | 131 ----- .../api_endpoints_GetMakeForManufacturer.md | 88 ---- ...ndpoints_GetMakesForManufacturerAndYear.md | 103 ---- .../api_endpoints_GetMakesForVehicleType.md | 85 ---- .../api_endpoints_GetManufacturerDetails.md | 110 ----- .../modules/api_endpoints_GetModelsForMake.md | 87 ---- .../api_endpoints_GetModelsForMakeId.md | 102 ---- .../typedoc/modules/api_endpoints_GetParts.md | 163 ------- .../api_endpoints_GetVehicleTypesForMake.md | 85 ---- .../api_endpoints_GetVehicleTypesForMakeId.md | 100 ---- .../api_endpoints_GetVehicleVariableList.md | 81 ---- ..._endpoints_GetVehicleVariableValuesList.md | 86 ---- .../api_endpoints_GetWMIsForManufacturer.md | 108 ----- .../typedoc/modules/api_endpoints_types.md | 197 -------- apps/docs/src/typedoc/modules/api_types.md | 235 --------- apps/docs/src/typedoc/modules/api_useNHTSA.md | 83 ---- apps/docs/src/typedoc/modules/constants.md | 30 -- apps/docs/src/typedoc/modules/global.md | 3 - apps/docs/src/typedoc/modules/index.md | 449 ------------------ apps/docs/src/typedoc/modules/types.md | 253 ---------- apps/docs/src/typedoc/modules/utils.md | 71 --- apps/docs/src/typedoc/modules/utils_types.md | 81 ---- apps/docs/src/typedoc/modules/vite_env.md | 3 - apps/docs/src/typedoc/types.md | 188 ++++++++ apps/docs/src/typedoc/utils.md | 58 +++ .../argHandler.md} | 80 ++-- .../errorHandler.md} | 55 ++- .../utils_getTypeof.md => utils/getTypeof.md} | 23 +- .../isValidVin.md} | 31 +- .../queryString.md} | 93 ++-- apps/docs/src/typedoc/utils/types.md | 76 +++ apps/docs/src/typedoc/vite-env.md | 7 + 77 files changed, 4751 insertions(+), 4967 deletions(-) create mode 100644 apps/docs/src/typedoc/api.md create mode 100644 apps/docs/src/typedoc/api/endpoints.md create mode 100644 apps/docs/src/typedoc/api/endpoints/DecodeVin.md create mode 100644 apps/docs/src/typedoc/api/endpoints/DecodeVinExtended.md create mode 100644 apps/docs/src/typedoc/api/endpoints/DecodeVinValues.md create mode 100644 apps/docs/src/typedoc/api/endpoints/DecodeVinValuesBatch.md create mode 100644 apps/docs/src/typedoc/api/endpoints/DecodeVinValuesExtended.md create mode 100644 apps/docs/src/typedoc/api/endpoints/DecodeWMI.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetAllMakes.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetAllManufacturers.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetCanadianVehicleSpecifications.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetEquipmentPlantCodes.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetMakeForManufacturer.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetMakesForManufacturerAndYear.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetMakesForVehicleType.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetManufacturerDetails.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetModelsForMake.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetModelsForMakeId.md rename apps/docs/src/typedoc/{modules/api_endpoints_GetModelsForMakeIdYear.md => api/endpoints/GetModelsForMakeIdYear.md} (56%) rename apps/docs/src/typedoc/{modules/api_endpoints_GetModelsForMakeYear.md => api/endpoints/GetModelsForMakeYear.md} (50%) create mode 100644 apps/docs/src/typedoc/api/endpoints/GetParts.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMake.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMakeId.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetVehicleVariableList.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetVehicleVariableValuesList.md create mode 100644 apps/docs/src/typedoc/api/endpoints/GetWMIsForManufacturer.md create mode 100644 apps/docs/src/typedoc/api/endpoints/types.md create mode 100644 apps/docs/src/typedoc/api/types.md create mode 100644 apps/docs/src/typedoc/api/useNHTSA.md create mode 100644 apps/docs/src/typedoc/constants.md create mode 100644 apps/docs/src/typedoc/global.md create mode 100644 apps/docs/src/typedoc/module.index.md delete mode 100644 apps/docs/src/typedoc/modules/api.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_DecodeVin.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_DecodeVinExtended.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_DecodeVinValues.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_DecodeVinValuesBatch.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_DecodeVinValuesExtended.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_DecodeWMI.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetAllMakes.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetAllManufacturers.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetCanadianVehicleSpecifications.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetEquipmentPlantCodes.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetMakeForManufacturer.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetMakesForManufacturerAndYear.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetMakesForVehicleType.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetManufacturerDetails.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMake.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeId.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetParts.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetVehicleTypesForMake.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetVehicleTypesForMakeId.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetVehicleVariableList.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetVehicleVariableValuesList.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_GetWMIsForManufacturer.md delete mode 100644 apps/docs/src/typedoc/modules/api_endpoints_types.md delete mode 100644 apps/docs/src/typedoc/modules/api_types.md delete mode 100644 apps/docs/src/typedoc/modules/api_useNHTSA.md delete mode 100644 apps/docs/src/typedoc/modules/constants.md delete mode 100644 apps/docs/src/typedoc/modules/global.md delete mode 100644 apps/docs/src/typedoc/modules/index.md delete mode 100644 apps/docs/src/typedoc/modules/types.md delete mode 100644 apps/docs/src/typedoc/modules/utils.md delete mode 100644 apps/docs/src/typedoc/modules/utils_types.md delete mode 100644 apps/docs/src/typedoc/modules/vite_env.md create mode 100644 apps/docs/src/typedoc/types.md create mode 100644 apps/docs/src/typedoc/utils.md rename apps/docs/src/typedoc/{modules/utils_argHandler.md => utils/argHandler.md} (57%) rename apps/docs/src/typedoc/{modules/utils_errorHandler.md => utils/errorHandler.md} (53%) rename apps/docs/src/typedoc/{modules/utils_getTypeof.md => utils/getTypeof.md} (61%) rename apps/docs/src/typedoc/{modules/utils_isValidVin.md => utils/isValidVin.md} (60%) rename apps/docs/src/typedoc/{modules/utils_queryString.md => utils/queryString.md} (56%) create mode 100644 apps/docs/src/typedoc/utils/types.md create mode 100644 apps/docs/src/typedoc/vite-env.md diff --git a/apps/docs/src/typedoc/api.md b/apps/docs/src/typedoc/api.md new file mode 100644 index 00000000..204ee303 --- /dev/null +++ b/apps/docs/src/typedoc/api.md @@ -0,0 +1,138 @@ +**@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) + - [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/api/endpoints.md b/apps/docs/src/typedoc/api/endpoints.md new file mode 100644 index 00000000..314f1c8d --- /dev/null +++ b/apps/docs/src/typedoc/api/endpoints.md @@ -0,0 +1,133 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](../modules.md) / api/endpoints + +# api/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/endpoints/DecodeVin.md b/apps/docs/src/typedoc/api/endpoints/DecodeVin.md new file mode 100644 index 00000000..27de8d90 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/DecodeVin + +# api/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/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 + +#### Source + +[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) + +> **DecodeVin**(`vin`): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinResults`](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 + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `vin` | `string` | Vehicle Identification Number (full or partial) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **DecodeVin**(`vin`, `doFetch`, `_dummy`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `true` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> + +##### Source + +[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) + +> **DecodeVin**(`vin`, `doFetch`, `_dummy`?): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `false` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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) + +> **DecodeVin**(`vin`, `params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params` | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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) + +> **DecodeVin**(`vin`, `params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params`? | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> + +##### Source + +[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/api/endpoints/DecodeVinExtended.md b/apps/docs/src/typedoc/api/endpoints/DecodeVinExtended.md new file mode 100644 index 00000000..85d375f5 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/DecodeVinExtended + +# api/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/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 + +#### Source + +[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) + +> **DecodeVinExtended**(`vin`): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinExtendedResults`](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 + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `vin` | `string` | Vehicle Identification Number (full or partial) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` (default: `true`) + +##### Source + +[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) + +> **DecodeVinExtended**(`vin`, `doFetch`, `_dummy`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `true` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> + +##### Source + +[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) + +> **DecodeVinExtended**(`vin`, `doFetch`, `_dummy`?): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `false` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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) + +> **DecodeVinExtended**(`vin`, `params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params` | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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) + +> **DecodeVinExtended**(`vin`, `params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params`? | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> + +##### Source + +[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/api/endpoints/DecodeVinValues.md b/apps/docs/src/typedoc/api/endpoints/DecodeVinValues.md new file mode 100644 index 00000000..0c21fe0a --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/DecodeVinValues + +# api/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/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 + +| 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/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) + +> **DecodeVinValues**(`vin`): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesResults`](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 + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `vin` | `string` | Vehicle Identification Number (full or partial) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **DecodeVinValues**(`vin`, `doFetch`, `_dummy`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `true` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> + +##### Source + +[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) + +> **DecodeVinValues**(`vin`, `doFetch`, `_dummy`?): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `false` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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) + +> **DecodeVinValues**(`vin`, `params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params` | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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) + +> **DecodeVinValues**(`vin`, `params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params`? | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> + +##### Source + +[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/api/endpoints/DecodeVinValuesBatch.md b/apps/docs/src/typedoc/api/endpoints/DecodeVinValuesBatch.md new file mode 100644 index 00000000..bfbd533f --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/DecodeVinValuesBatch + +# api/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/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) + +> **DecodeVinValuesBatch**(`inputString`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesBatchResults`](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 + +| 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#nhtsaresponset)\<[`DecodeVinValuesBatchResults`](DecodeVinValuesBatch.md#decodevinvaluesbatchresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **DecodeVinValuesBatch**(`inputString`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `inputString` | `string` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/DecodeVinValuesExtended.md b/apps/docs/src/typedoc/api/endpoints/DecodeVinValuesExtended.md new file mode 100644 index 00000000..a2d0ccbc --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/DecodeVinValuesExtended + +# api/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/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) + +> **DecodeVinValuesExtended**(`vin`): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](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 + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `vin` | `string` | Vehicle Identification Number (full or partial) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **DecodeVinValuesExtended**(`vin`, `doFetch`, `_dummy`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `true` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> + +##### Source + +[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) + +> **DecodeVinValuesExtended**(`vin`, `doFetch`, `_dummy`?): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `doFetch` | `false` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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) + +> **DecodeVinValuesExtended**(`vin`, `params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params` | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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) + +> **DecodeVinValuesExtended**(`vin`, `params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `vin` | `string` | +| `params`? | `object` | +| `params.modelYear`? | `string` \| `number` | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> + +##### Source + +[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/api/endpoints/DecodeWMI.md b/apps/docs/src/typedoc/api/endpoints/DecodeWMI.md new file mode 100644 index 00000000..b576ded7 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/DecodeWMI + +# api/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/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) + +> **DecodeWMI**(`WMI`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeWMIResults`](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](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#nhtsaresponset)\<[`DecodeWMIResults`](DecodeWMI.md#decodewmiresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` (default: `true`) + +##### Source + +[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) + +> **DecodeWMI**(`WMI`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `WMI` | `string` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/GetAllMakes.md b/apps/docs/src/typedoc/api/endpoints/GetAllMakes.md new file mode 100644 index 00000000..1e7352aa --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetAllMakes + +# api/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/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) + +> **GetAllMakes**(`doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllMakesResults`](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 + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllMakesResults`](GetAllMakes.md#getallmakesresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` (default: `true`) + +##### Source + +[api/endpoints/GetAllMakes.ts:26](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllMakes.ts#L26) + +#### GetAllMakes(doFetch) + +> **GetAllMakes**(`doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/GetAllManufacturers.md b/apps/docs/src/typedoc/api/endpoints/GetAllManufacturers.md new file mode 100644 index 00000000..8a920709 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetAllManufacturers + +# api/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/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) + +> **GetAllManufacturers**(`doFetch`?, `_dummy`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllManufacturersResults`](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 + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | +| `_dummy`? | `undefined` | - | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **GetAllManufacturers**(`doFetch`?, `_dummy`?): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `doFetch`? | `false` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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) + +> **GetAllManufacturers**(`params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params` | `object` | +| `params.manufacturerType`? | `string` | +| `params.page`? | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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) + +> **GetAllManufacturers**(`params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params`? | `object` | +| `params.manufacturerType`? | `string` | +| `params.page`? | `string` \| `number` | +| `doFetch`? | `true` | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> + +##### Source + +[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/api/endpoints/GetCanadianVehicleSpecifications.md b/apps/docs/src/typedoc/api/endpoints/GetCanadianVehicleSpecifications.md new file mode 100644 index 00000000..33f7fcbd --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetCanadianVehicleSpecifications + +# api/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/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) + +> **GetCanadianVehicleSpecifications**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetCanadianVehicleSpecificationsResults`](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 + +| 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#nhtsaresponset)\<[`GetCanadianVehicleSpecificationsResults`](GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults)\>\> + +- Api +Response `object` -or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **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/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/api/endpoints/GetEquipmentPlantCodes.md b/apps/docs/src/typedoc/api/endpoints/GetEquipmentPlantCodes.md new file mode 100644 index 00000000..e1db393b --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetEquipmentPlantCodes + +# api/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/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 + +| 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/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) + +> **GetEquipmentPlantCodes**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetEquipmentPlantCodesResults`](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 + +| 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#nhtsaresponset)\<[`GetEquipmentPlantCodesResults`](GetEquipmentPlantCodes.md#getequipmentplantcodesresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **GetEquipmentPlantCodes**(`params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params` | [`GetEquipmentPlantCodesParams`](GetEquipmentPlantCodes.md#getequipmentplantcodesparams) | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/GetMakeForManufacturer.md b/apps/docs/src/typedoc/api/endpoints/GetMakeForManufacturer.md new file mode 100644 index 00000000..7751060d --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetMakeForManufacturer + +# api/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/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) + +> **GetMakeForManufacturer**(`manufacturer`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetMakeForManufacturerResults`](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 + +| 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#nhtsaresponset)\<[`GetMakeForManufacturerResults`](GetMakeForManufacturer.md#getmakeformanufacturerresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **GetMakeForManufacturer**(`manufacturer`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `manufacturer` | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/GetMakesForManufacturerAndYear.md b/apps/docs/src/typedoc/api/endpoints/GetMakesForManufacturerAndYear.md new file mode 100644 index 00000000..11ad48e9 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetMakesForManufacturerAndYear + +# api/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/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) + +> **GetMakesForManufacturerAndYear**(`manufacturer`, `params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetMakesForManufacturerAndYearResults`](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 + +| 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#nhtsaresponset)\<[`GetMakesForManufacturerAndYearResults`](GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults)\>\> + +- Api +Response `object` -or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **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/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/api/endpoints/GetMakesForVehicleType.md b/apps/docs/src/typedoc/api/endpoints/GetMakesForVehicleType.md new file mode 100644 index 00000000..e9f143bc --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetMakesForVehicleType + +# api/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/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) + +> **GetMakesForVehicleType**(`typeName`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetMakesForVehicleTypeResults`](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 + +| 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#nhtsaresponset)\<[`GetMakesForVehicleTypeResults`](GetMakesForVehicleType.md#getmakesforvehicletyperesults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **GetMakesForVehicleType**(`typeName`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `typeName` | `string` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/GetManufacturerDetails.md b/apps/docs/src/typedoc/api/endpoints/GetManufacturerDetails.md new file mode 100644 index 00000000..6874b151 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetManufacturerDetails + +# api/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/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) + +> **GetManufacturerDetails**(`manufacturer`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetManufacturerDetailsResults`](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 + +| 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#nhtsaresponset)\<[`GetManufacturerDetailsResults`](GetManufacturerDetails.md#getmanufacturerdetailsresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **GetManufacturerDetails**(`manufacturer`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `manufacturer` | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/GetModelsForMake.md b/apps/docs/src/typedoc/api/endpoints/GetModelsForMake.md new file mode 100644 index 00000000..2a152a71 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetModelsForMake + +# api/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/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) + +> **GetModelsForMake**(`makeName`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeResults`](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 + +| 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#nhtsaresponset)\<[`GetModelsForMakeResults`](GetModelsForMake.md#getmodelsformakeresults)\>\> + +- Api Response object + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **GetModelsForMake**(`makeName`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `makeName` | `string` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/GetModelsForMakeId.md b/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeId.md new file mode 100644 index 00000000..58824b93 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetModelsForMakeId + +# api/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/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) + +> **GetModelsForMakeId**(`makeId`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeIdResults`](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 + +| 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#nhtsaresponset)\<[`GetModelsForMakeIdResults`](GetModelsForMakeId.md#getmodelsformakeidresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **GetModelsForMakeId**(`makeId`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `makeId` | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/GetModelsForMakeIdYear.md similarity index 56% rename from apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeIdYear.md rename to apps/docs/src/typedoc/api/endpoints/GetModelsForMakeIdYear.md index 4e799287..cd432faf 100644 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeIdYear.md +++ b/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeIdYear.md @@ -1,43 +1,46 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetModelsForMakeIdYear +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) -# Module: api/endpoints/GetModelsForMakeIdYear +*** -## Table of contents +[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetModelsForMakeIdYear -### Type Aliases +# api/endpoints/GetModelsForMakeIdYear -- [GetModelsForMakeIdYearResults](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) +## Contents -### Functions - -- [GetModelsForMakeIdYear](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyear) +- [Type Aliases](GetModelsForMakeIdYear.md#type-aliases) + - [GetModelsForMakeIdYearResults](GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) +- [Functions](GetModelsForMakeIdYear.md#functions) + - [GetModelsForMakeIdYear()](GetModelsForMakeIdYear.md#getmodelsformakeidyear) ## Type Aliases ### GetModelsForMakeIdYearResults -Ƭ **GetModelsForMakeIdYearResults**: `Object` +> **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` | +| Member | Type | Description | +| :------ | :------ | :------ | +| `Make_ID` | `number` | - | +| `Make_Name` | `string` | - | +| `Model_ID` | `number` | - | +| `Model_Name` | `string` | - | -#### Defined in +#### Source [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() + +#### GetModelsForMakeIdYear(params, doFetch) -▸ **GetModelsForMakeIdYear**(`params`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetModelsForMakeIdYearResults`](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyearresults)\>\> +> **GetModelsForMakeIdYear**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeIdYearResults`](GetModelsForMakeIdYear.md#getmodelsformakeidyearresults)\>\> ::: tip :bulb: More Information See: [GetModelsForMakeIdYear Documentation](/api/endpoints/get-models-for-make-id-year) @@ -49,21 +52,18 @@ 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` @@ -71,7 +71,6 @@ You can get `makeID`s via `ValueId` key in Results objects of the following endp 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` @@ -80,37 +79,39 @@ params are used in the query string and are instead used as part of the URL path 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 +##### 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`) | +| 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 +##### Returns -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetModelsForMakeIdYearResults`](api_endpoints_GetModelsForMakeIdYear.md#getmodelsformakeidyearresults)\>\> +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeIdYearResults`](GetModelsForMakeIdYear.md#getmodelsformakeidyearresults)\>\> - Api Response - `object` -or- url `string` if `doFetch = false` +`object` -or- url `string` if `doFetch = false` -#### Defined in +##### Source [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`\> +#### GetModelsForMakeIdYear(params, doFetch) + +> **GetModelsForMakeIdYear**(`params`, `doFetch`): `Promise`\<`string`\> -#### Parameters +##### Parameters -| Name | Type | -| :-------- | :------- | -| `params` | `Object` | -| `doFetch` | `false` | +| Parameter | Type | +| :------ | :------ | +| `params` | `Object` | +| `doFetch` | `false` | -#### Returns +##### Returns -`Promise`<`string`\> +`Promise`\<`string`\> -#### Defined in +##### Source [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/api/endpoints/GetModelsForMakeYear.md similarity index 50% rename from apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeYear.md rename to apps/docs/src/typedoc/api/endpoints/GetModelsForMakeYear.md index e0c01795..f1d87357 100644 --- a/apps/docs/src/typedoc/modules/api_endpoints_GetModelsForMakeYear.md +++ b/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeYear.md @@ -1,43 +1,46 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / api/endpoints/GetModelsForMakeYear +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) -# Module: api/endpoints/GetModelsForMakeYear +*** -## Table of contents +[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetModelsForMakeYear -### Type Aliases +# api/endpoints/GetModelsForMakeYear -- [GetModelsForMakeYearResults](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyearresults) +## Contents -### Functions - -- [GetModelsForMakeYear](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyear) +- [Type Aliases](GetModelsForMakeYear.md#type-aliases) + - [GetModelsForMakeYearResults](GetModelsForMakeYear.md#getmodelsformakeyearresults) +- [Functions](GetModelsForMakeYear.md#functions) + - [GetModelsForMakeYear()](GetModelsForMakeYear.md#getmodelsformakeyear) ## Type Aliases ### GetModelsForMakeYearResults -Ƭ **GetModelsForMakeYearResults**: `Object` +> **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` | +| Member | Type | Description | +| :------ | :------ | :------ | +| `Make_ID` | `number` | - | +| `Make_Name` | `string` | - | +| `Model_ID` | `number` | - | +| `Model_Name` | `string` | - | -#### Defined in +#### Source [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() + +#### GetModelsForMakeYear(params, doFetch) -▸ **GetModelsForMakeYear**(`params`, `doFetch?`): `Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetModelsForMakeYearResults`](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyearresults)\>\> +> **GetModelsForMakeYear**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeYearResults`](GetModelsForMakeYear.md#getmodelsformakeyearresults)\>\> ::: tip :bulb: More Information See: [GetModelsForMakeYear Documentation](/api/endpoints/get-models-for-make-year) @@ -50,7 +53,6 @@ Make whose name is LIKE the Make in the vPIC Dataset. "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., @@ -61,37 +63,39 @@ params are used in the query string and are instead used as part of the URL path 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 +##### 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`) | +| 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 +##### Returns -`Promise`<[`NhtsaResponse`](api_types.md#nhtsaresponse)<[`GetModelsForMakeYearResults`](api_endpoints_GetModelsForMakeYear.md#getmodelsformakeyearresults)\>\> +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeYearResults`](GetModelsForMakeYear.md#getmodelsformakeyearresults)\>\> - Api Response `object` - -or- url `string` if `doFetch = false` +-or- url `string` if `doFetch = false` -#### Defined in +##### Source [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`\> +#### GetModelsForMakeYear(params, doFetch) + +> **GetModelsForMakeYear**(`params`, `doFetch`): `Promise`\<`string`\> -#### Parameters +##### Parameters -| Name | Type | -| :-------- | :------- | -| `params` | `Object` | -| `doFetch` | `false` | +| Parameter | Type | +| :------ | :------ | +| `params` | `Object` | +| `doFetch` | `false` | -#### Returns +##### Returns -`Promise`<`string`\> +`Promise`\<`string`\> -#### Defined in +##### Source [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/api/endpoints/GetParts.md b/apps/docs/src/typedoc/api/endpoints/GetParts.md new file mode 100644 index 00000000..95a62555 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetParts + +# api/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/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) + +> **GetParts**(`doFetch`?, `_dummy`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetPartsResults`](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 + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | +| `_dummy`? | `undefined` | - | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> + +- Api Response `object` +-or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **GetParts**(`doFetch`?, `_dummy`?): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `doFetch`? | `false` | +| `_dummy`? | `undefined` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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) + +> **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/endpoints/GetParts.ts:67](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetParts.ts#L67) + +#### GetParts(params, doFetch) + +> **GetParts**(`params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`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#nhtsaresponset)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> + +##### Source + +[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/api/endpoints/GetVehicleTypesForMake.md b/apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMake.md new file mode 100644 index 00000000..44160e05 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetVehicleTypesForMake + +# api/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/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) + +> **GetVehicleTypesForMake**(`makeName`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleTypesForMakeResults`](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 + +| 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#nhtsaresponset)\<[`GetVehicleTypesForMakeResults`](GetVehicleTypesForMake.md#getvehicletypesformakeresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **GetVehicleTypesForMake**(`makeName`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `makeName` | `string` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/GetVehicleTypesForMakeId.md b/apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMakeId.md new file mode 100644 index 00000000..0ef1a8a9 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetVehicleTypesForMakeId + +# api/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/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) + +> **GetVehicleTypesForMakeId**(`makeId`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleTypesForMakeIdResults`](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 + +| 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#nhtsaresponset)\<[`GetVehicleTypesForMakeIdResults`](GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **GetVehicleTypesForMakeId**(`makeId`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `makeId` | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/GetVehicleVariableList.md b/apps/docs/src/typedoc/api/endpoints/GetVehicleVariableList.md new file mode 100644 index 00000000..badbffa6 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetVehicleVariableList + +# api/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/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) + +> **GetVehicleVariableList**(`doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleVariableListResults`](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 + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `doFetch`? | `true` | Whether to fetch the data or just return the URL
(default: `true`) | + +##### Returns + +`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleVariableListResults`](GetVehicleVariableList.md#getvehiclevariablelistresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[api/endpoints/GetVehicleVariableList.ts:23](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableList.ts#L23) + +#### GetVehicleVariableList(doFetch) + +> **GetVehicleVariableList**(`doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/GetVehicleVariableValuesList.md b/apps/docs/src/typedoc/api/endpoints/GetVehicleVariableValuesList.md new file mode 100644 index 00000000..ff730409 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetVehicleVariableValuesList + +# api/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/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) + +> **GetVehicleVariableValuesList**(`variableValue`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleVariableValuesListResults`](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 + +| 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#nhtsaresponset)\<[`GetVehicleVariableValuesListResults`](GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **GetVehicleVariableValuesList**(`variableValue`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `variableValue` | `string` \| `number` | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/GetWMIsForManufacturer.md b/apps/docs/src/typedoc/api/endpoints/GetWMIsForManufacturer.md new file mode 100644 index 00000000..045861b4 --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/GetWMIsForManufacturer + +# api/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/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) + +> **GetWMIsForManufacturer**(`params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetWMIsForManufacturerResults`](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 + +| 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#nhtsaresponset)\<[`GetWMIsForManufacturerResults`](GetWMIsForManufacturer.md#getwmisformanufacturerresults)\>\> + +- Api Response +`object` -or- url `string` if `doFetch = false` + +##### Source + +[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) + +> **GetWMIsForManufacturer**(`params`, `doFetch`): `Promise`\<`string`\> + +##### Parameters + +| Parameter | Type | +| :------ | :------ | +| `params` | [`AtLeastOne`](../../utils/types.md#atleastonet-r)\<`object`\> | +| `doFetch` | `false` | + +##### Returns + +`Promise`\<`string`\> + +##### Source + +[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/api/endpoints/types.md b/apps/docs/src/typedoc/api/endpoints/types.md new file mode 100644 index 00000000..fa00b9de --- /dev/null +++ b/apps/docs/src/typedoc/api/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/endpoints/types + +# api/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/types.md b/apps/docs/src/typedoc/api/types.md new file mode 100644 index 00000000..e981f99f --- /dev/null +++ b/apps/docs/src/typedoc/api/types.md @@ -0,0 +1,182 @@ +**@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) +- [Type Aliases](types.md#type-aliases) + - [NhtsaResponse``](types.md#nhtsaresponset) + +## References + +### CreateUrlOptions + +Re-exports [CreateUrlOptions](useNHTSA.md#createurloptions) + +### 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) + +## 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 + +| Parameter | +| :------ | +| `T` | + +#### Type declaration + +| Member | 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. | + +#### Source + +[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/api/useNHTSA.md b/apps/docs/src/typedoc/api/useNHTSA.md new file mode 100644 index 00000000..e2d96b35 --- /dev/null +++ b/apps/docs/src/typedoc/api/useNHTSA.md @@ -0,0 +1,85 @@ +**@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` | - | +| `endpointName` | `string` | - | +| `includeQueryString` | `boolean` | - | +| `params` | [`QueryStringParams`](../utils/queryString.md#querystringparams) | - | +| `path` | `string` | - | +| `saveUrl` | `boolean` | - | + +#### Source + +[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` + +> | Member | Type | Description | +> | :------ | :------ | :------ | +> | `clearCachedUrl` | () => `string` | - | +> | `createCachedUrl` | (`input`) => `string` | - | +> | `createPostBody` | (`data`) => `string` | - | +> | `createUrl` | (`options`) => `string` | - | +> | `get` | \<`T`\>(`url`?, `options`?) => `Promise`\<[`NhtsaResponse`](types.md#nhtsaresponset)\<`T`\>\> | - | +> | `getCachedUrl` | () => `string` | - | +> | `post` | \<`T`\>(`url`?, `options`?) => `Promise`\<[`NhtsaResponse`](types.md#nhtsaresponset)\<`T`\>\> | - | +> | `setCachedUrl` | (`url`) => `string` | - | +> + +#### Source + +[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/constants.md b/apps/docs/src/typedoc/constants.md new file mode 100644 index 00000000..80540363 --- /dev/null +++ b/apps/docs/src/typedoc/constants.md @@ -0,0 +1,33 @@ +**@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\_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"` = `'https://vpic.nhtsa.dot.gov/api/vehicles'` + +#### Source + +[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"` = `'json'` + +#### Source + +[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/global.md b/apps/docs/src/typedoc/global.md new file mode 100644 index 00000000..31360811 --- /dev/null +++ b/apps/docs/src/typedoc/global.md @@ -0,0 +1,7 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](modules.md) / global + +# global 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/module.index.md b/apps/docs/src/typedoc/module.index.md new file mode 100644 index 00000000..c2045277 --- /dev/null +++ b/apps/docs/src/typedoc/module.index.md @@ -0,0 +1,328 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](modules.md) / index + +# index + +## Contents + +- [References](module.index.md#references) + - [AtLeastOne](module.index.md#atleastone) + - [CreateUrlOptions](module.index.md#createurloptions) + - [DecodeVin](module.index.md#decodevin) + - [DecodeVinExtended](module.index.md#decodevinextended) + - [DecodeVinExtendedResults](module.index.md#decodevinextendedresults) + - [DecodeVinExtendedVariable](module.index.md#decodevinextendedvariable) + - [DecodeVinResults](module.index.md#decodevinresults) + - [DecodeVinValues](module.index.md#decodevinvalues) + - [DecodeVinValuesBatch](module.index.md#decodevinvaluesbatch) + - [DecodeVinValuesBatchResults](module.index.md#decodevinvaluesbatchresults) + - [DecodeVinValuesExtended](module.index.md#decodevinvaluesextended) + - [DecodeVinValuesExtendedResults](module.index.md#decodevinvaluesextendedresults) + - [DecodeVinValuesResults](module.index.md#decodevinvaluesresults) + - [DecodeVinVariable](module.index.md#decodevinvariable) + - [DecodeWMI](module.index.md#decodewmi) + - [DecodeWMIResults](module.index.md#decodewmiresults) + - [GetAllMakes](module.index.md#getallmakes) + - [GetAllMakesResults](module.index.md#getallmakesresults) + - [GetAllManufacturers](module.index.md#getallmanufacturers) + - [GetAllManufacturersResults](module.index.md#getallmanufacturersresults) + - [GetCanadianVehicleSpecifications](module.index.md#getcanadianvehiclespecifications) + - [GetCanadianVehicleSpecificationsResults](module.index.md#getcanadianvehiclespecificationsresults) + - [GetEquipmentPlantCodes](module.index.md#getequipmentplantcodes) + - [GetEquipmentPlantCodesParams](module.index.md#getequipmentplantcodesparams) + - [GetEquipmentPlantCodesResults](module.index.md#getequipmentplantcodesresults) + - [GetMakeForManufacturer](module.index.md#getmakeformanufacturer) + - [GetMakeForManufacturerResults](module.index.md#getmakeformanufacturerresults) + - [GetMakesForManufacturerAndYear](module.index.md#getmakesformanufacturerandyear) + - [GetMakesForManufacturerAndYearResults](module.index.md#getmakesformanufacturerandyearresults) + - [GetMakesForVehicleType](module.index.md#getmakesforvehicletype) + - [GetMakesForVehicleTypeResults](module.index.md#getmakesforvehicletyperesults) + - [GetManufacturerDetails](module.index.md#getmanufacturerdetails) + - [GetManufacturerDetailsResults](module.index.md#getmanufacturerdetailsresults) + - [GetModelsForMake](module.index.md#getmodelsformake) + - [GetModelsForMakeId](module.index.md#getmodelsformakeid) + - [GetModelsForMakeIdResults](module.index.md#getmodelsformakeidresults) + - [GetModelsForMakeIdYear](module.index.md#getmodelsformakeidyear) + - [GetModelsForMakeIdYearResults](module.index.md#getmodelsformakeidyearresults) + - [GetModelsForMakeResults](module.index.md#getmodelsformakeresults) + - [GetModelsForMakeYear](module.index.md#getmodelsformakeyear) + - [GetModelsForMakeYearResults](module.index.md#getmodelsformakeyearresults) + - [GetParts](module.index.md#getparts) + - [GetPartsResults](module.index.md#getpartsresults) + - [GetVehicleTypesForMake](module.index.md#getvehicletypesformake) + - [GetVehicleTypesForMakeId](module.index.md#getvehicletypesformakeid) + - [GetVehicleTypesForMakeIdResults](module.index.md#getvehicletypesformakeidresults) + - [GetVehicleTypesForMakeResults](module.index.md#getvehicletypesformakeresults) + - [GetVehicleVariableList](module.index.md#getvehiclevariablelist) + - [GetVehicleVariableListResults](module.index.md#getvehiclevariablelistresults) + - [GetVehicleVariableValuesList](module.index.md#getvehiclevariablevalueslist) + - [GetVehicleVariableValuesListResults](module.index.md#getvehiclevariablevalueslistresults) + - [GetWMIsForManufacturer](module.index.md#getwmisformanufacturer) + - [GetWMIsForManufacturerResults](module.index.md#getwmisformanufacturerresults) + - [IArgToValidate](module.index.md#iargtovalidate) + - [NhtsaResponse](module.index.md#nhtsaresponse) + - [QueryStringParams](module.index.md#querystringparams) + - [QueryStringParamsEncoded](module.index.md#querystringparamsencoded) + - [QueryStringTypes](module.index.md#querystringtypes) + - [RequireOnlyOne](module.index.md#requireonlyone) + - [createQueryString](module.index.md#createquerystring) + - [encodeQueryStringParams](module.index.md#encodequerystringparams) + - [isValidVin](module.index.md#isvalidvin) + - [useNHTSA](module.index.md#usenhtsa) + +## References + +### AtLeastOne + +Re-exports [AtLeastOne](utils/types.md#atleastonet-r) + +### 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#nhtsaresponset) + +### 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) + +### 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.md b/apps/docs/src/typedoc/modules.md index 1eed68bd..f3d1615a 100644 --- a/apps/docs/src/typedoc/modules.md +++ b/apps/docs/src/typedoc/modules.md @@ -1,49 +1,71 @@ -[@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 - -### Modules - -- [api](modules/api.md) -- [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) -- [api/endpoints/types](modules/api_endpoints_types.md) -- [api/types](modules/api_types.md) -- [api/useNHTSA](modules/api_useNHTSA.md) -- [constants](modules/constants.md) -- [global](modules/global.md) -- [index](modules/index.md) -- [types](modules/types.md) -- [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) -- [utils/types](modules/utils_types.md) -- [vite-env](modules/vite_env.md) +## API + +| Module | Description | +| :------ | :------ | +| [api](api.md) | - | +| [api/useNHTSA](api/useNHTSA.md) | - | + +## API Endpoints + +| Module | Description | +| :------ | :------ | +| [api/endpoints](api/endpoints.md) | - | +| [api/endpoints/DecodeVin](api/endpoints/DecodeVin.md) | - | +| [api/endpoints/DecodeVinExtended](api/endpoints/DecodeVinExtended.md) | - | +| [api/endpoints/DecodeVinValues](api/endpoints/DecodeVinValues.md) | - | +| [api/endpoints/DecodeVinValuesBatch](api/endpoints/DecodeVinValuesBatch.md) | - | +| [api/endpoints/DecodeVinValuesExtended](api/endpoints/DecodeVinValuesExtended.md) | - | +| [api/endpoints/DecodeWMI](api/endpoints/DecodeWMI.md) | - | +| [api/endpoints/GetAllMakes](api/endpoints/GetAllMakes.md) | - | +| [api/endpoints/GetAllManufacturers](api/endpoints/GetAllManufacturers.md) | - | +| [api/endpoints/GetCanadianVehicleSpecifications](api/endpoints/GetCanadianVehicleSpecifications.md) | - | +| [api/endpoints/GetEquipmentPlantCodes](api/endpoints/GetEquipmentPlantCodes.md) | - | +| [api/endpoints/GetMakeForManufacturer](api/endpoints/GetMakeForManufacturer.md) | - | +| [api/endpoints/GetMakesForManufacturerAndYear](api/endpoints/GetMakesForManufacturerAndYear.md) | - | +| [api/endpoints/GetMakesForVehicleType](api/endpoints/GetMakesForVehicleType.md) | - | +| [api/endpoints/GetManufacturerDetails](api/endpoints/GetManufacturerDetails.md) | - | +| [api/endpoints/GetModelsForMake](api/endpoints/GetModelsForMake.md) | - | +| [api/endpoints/GetModelsForMakeId](api/endpoints/GetModelsForMakeId.md) | - | +| [api/endpoints/GetModelsForMakeIdYear](api/endpoints/GetModelsForMakeIdYear.md) | - | +| [api/endpoints/GetModelsForMakeYear](api/endpoints/GetModelsForMakeYear.md) | - | +| [api/endpoints/GetParts](api/endpoints/GetParts.md) | - | +| [api/endpoints/GetVehicleTypesForMake](api/endpoints/GetVehicleTypesForMake.md) | - | +| [api/endpoints/GetVehicleTypesForMakeId](api/endpoints/GetVehicleTypesForMakeId.md) | - | +| [api/endpoints/GetVehicleVariableList](api/endpoints/GetVehicleVariableList.md) | - | +| [api/endpoints/GetVehicleVariableValuesList](api/endpoints/GetVehicleVariableValuesList.md) | - | +| [api/endpoints/GetWMIsForManufacturer](api/endpoints/GetWMIsForManufacturer.md) | - | + +## Other + +| Module | Description | +| :------ | :------ | +| [constants](constants.md) | - | +| [global](global.md) | - | +| [index](module.index.md) | - | +| [vite-env](vite-env.md) | - | + +## Types + +| Module | Description | +| :------ | :------ | +| [api/endpoints/types](api/endpoints/types.md) | - | +| [api/types](api/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_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_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..996d813d --- /dev/null +++ b/apps/docs/src/typedoc/types.md @@ -0,0 +1,188 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](modules.md) / types + +# types + +## Contents + +- [References](types.md#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#atleastonet-r) + +### 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#nhtsaresponset) + +### 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) 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/modules/utils_argHandler.md b/apps/docs/src/typedoc/utils/argHandler.md similarity index 57% rename from apps/docs/src/typedoc/modules/utils_argHandler.md rename to apps/docs/src/typedoc/utils/argHandler.md index 84529275..ee92d3de 100644 --- a/apps/docs/src/typedoc/modules/utils_argHandler.md +++ b/apps/docs/src/typedoc/utils/argHandler.md @@ -1,33 +1,44 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / utils/argHandler +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) -# Module: utils/argHandler +*** -## Table of contents +[@shaggytools/nhtsa-api-wrapper](../modules.md) / utils/argHandler -### Type Aliases +# utils/argHandler -- [IArgToValidate](utils_argHandler.md#iargtovalidate) +## Contents -### Functions - -- [catchInvalidArguments](utils_argHandler.md#catchinvalidarguments) -- [validateArgument](utils_argHandler.md#validateargument) +- [Type Aliases](argHandler.md#type-aliases) + - [IArgToValidate](argHandler.md#iargtovalidate) +- [Functions](argHandler.md#functions) + - [catchInvalidArguments()](argHandler.md#catchinvalidarguments) + - [validateArgument()](argHandler.md#validateargument) + - [Options](argHandler.md#options) + - [Validation Logic](argHandler.md#validation-logic) ## Type Aliases ### IArgToValidate -Ƭ **IArgToValidate**: { `errorMode?`: `"error"` \| `"boolean"` ; `name`: `string` ; `value`: `unknown` } & [`AtLeastOne`](utils_types.md#atleastone)<{ `required?`: `boolean` ; `types?`: `string`[] }\> +> **IArgToValidate**: `object` & [`AtLeastOne`](types.md#atleastonet-r)\<`object`\> + +#### Type declaration -#### Defined in +| Member | Type | Description | +| :------ | :------ | :------ | +| `errorMode` | `"error"` \| `"boolean"` | - | +| `name` | `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() -▸ **catchInvalidArguments**(`options`): `boolean` +> **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. @@ -42,11 +53,11 @@ 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 | +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `options` | `object` | options object | +| `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 @@ -54,21 +65,20 @@ validation logic works and how to override the default error throwing behavior. - true if validation passes, throws error in the case of validation failure -#### Defined in +#### Source [utils/argHandler.ts:148](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/argHandler.ts#L148) ---- +*** -### validateArgument +### validateArgument() -▸ **validateArgument**(`options`): `boolean` +> **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. @@ -93,8 +103,8 @@ In default mode, it uses the `options.name` and `options.types` array (if provid 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. +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. @@ -111,27 +121,27 @@ 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. +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. +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. +simply return true. #### Parameters -| Name | Type | Description | -| :-------- | :----------------------------------------------------- | :------------- | -| `options` | [`IArgToValidate`](utils_argHandler.md#iargtovalidate) | options object | +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `options` | [`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 +validation failure, mode 'boolean' returns false in the case of validation failure -#### Defined in +#### Source [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_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/modules/utils_getTypeof.md b/apps/docs/src/typedoc/utils/getTypeof.md similarity index 61% rename from apps/docs/src/typedoc/modules/utils_getTypeof.md rename to apps/docs/src/typedoc/utils/getTypeof.md index d477a5c2..cd1a141e 100644 --- a/apps/docs/src/typedoc/modules/utils_getTypeof.md +++ b/apps/docs/src/typedoc/utils/getTypeof.md @@ -1,18 +1,21 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / utils/getTypeof +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) -# Module: utils/getTypeof +*** -## Table of contents +[@shaggytools/nhtsa-api-wrapper](../modules.md) / utils/getTypeof -### Functions +# utils/getTypeof -- [getTypeof](utils_getTypeof.md#gettypeof) +## Contents + +- [Functions](getTypeof.md#functions) + - [getTypeof()](getTypeof.md#gettypeof) ## Functions -### getTypeof +### getTypeof() -▸ **getTypeof**(`value`): `string` +> **getTypeof**(`value`): `string` Gets type of `value` using `Object.prototype.toString.call(value)`. @@ -24,8 +27,8 @@ It will also accurately recognize any Error types, Error, TypeError, etc., as 'e #### Parameters -| Name | Type | Description | -| :------ | :-------- | :-------------------------------------------------------- | +| Parameter | Type | Description | +| :------ | :------ | :------ | | `value` | `unknown` | Any kind of value (string, object, array, function, etc). | #### Returns @@ -34,6 +37,6 @@ It will also accurately recognize any Error types, Error, TypeError, etc., as 'e - Type of value, normalized to a lowercase string. -#### Defined in +#### Source [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_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 1e2b1200..8cf846cc 100644 --- a/apps/docs/src/typedoc/modules/utils_isValidVin.md +++ b/apps/docs/src/typedoc/utils/isValidVin.md @@ -1,29 +1,32 @@ -[@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. #### Parameters -| Name | Type | Description | -| :---- | :------- | :----------------------------- | +| Parameter | Type | Description | +| :------ | :------ | :------ | | `vin` | `string` | Vehicle Identification Number. | #### Returns @@ -32,25 +35,23 @@ the VIN and it should return `true` as the result. True for a valid VIN, false for an invalid VIN. -**`Example`** +#### 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 ``` -#### 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/modules/utils_queryString.md b/apps/docs/src/typedoc/utils/queryString.md similarity index 56% rename from apps/docs/src/typedoc/modules/utils_queryString.md rename to apps/docs/src/typedoc/utils/queryString.md index 4c3d7ec6..7191aae3 100644 --- a/apps/docs/src/typedoc/modules/utils_queryString.md +++ b/apps/docs/src/typedoc/utils/queryString.md @@ -1,67 +1,68 @@ -[@shaggytools/nhtsa-api-wrapper - v3.0.4](../index.md) / [Exports](../modules.md) / utils/queryString +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) -# Module: utils/queryString +*** -## Table of contents +[@shaggytools/nhtsa-api-wrapper](../modules.md) / utils/queryString -### Type Aliases +# utils/queryString -- [QueryStringParams](utils_queryString.md#querystringparams) -- [QueryStringParamsEncoded](utils_queryString.md#querystringparamsencoded) -- [QueryStringTypes](utils_queryString.md#querystringtypes) +## Contents -### Functions - -- [createQueryString](utils_queryString.md#createquerystring) -- [encodeQueryStringParams](utils_queryString.md#encodequerystringparams) +- [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`](utils_queryString.md#querystringtypes)\> +> **QueryStringParams**: `Record`\<`string`, [`QueryStringTypes`](queryString.md#querystringtypes)\> Object to build the query string with -#### Defined in +#### Source [utils/queryString.ts:13](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L13) ---- +*** -### QueryStringParamsEncoded +### QueryStringParamsEncoded`` -Ƭ **QueryStringParamsEncoded**<`T`\>: { [key in keyof T]: string } +> **QueryStringParamsEncoded**\<`T`\>: `{ [key in keyof T]: string }` Object returned by encodeQueryStringParams() #### Type parameters -| Name | -| :--- | -| `T` | +| Parameter | +| :------ | +| `T` | -#### Defined in +#### 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` +> **QueryStringTypes**: `string` \| `number` \| `boolean` Valid URI component types -#### Defined in +#### Source [utils/queryString.ts:10](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L10) ## Functions -### createQueryString +### createQueryString() -▸ **createQueryString**<`T`\>(`params?`, `allowEmptyParams?`): `string` +> **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. @@ -85,16 +86,16 @@ formats at this time. This means the default query string will be `"?format=json #### Type parameters -| Name | Type | -| :--- | :-------------------------------------------------------------------- | -| `T` | extends [`QueryStringParams`](utils_queryString.md#querystringparams) | +| Parameter | +| :------ | +| `T` extends [`QueryStringParams`](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='. | +| 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 @@ -102,15 +103,15 @@ formats at this time. This means the default query string will be `"?format=json - A query string of search parameters for use in a final fetch URL. -#### Defined in +#### Source [utils/queryString.ts:100](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L100) ---- +*** -### encodeQueryStringParams +### encodeQueryStringParams() -▸ **encodeQueryStringParams**<`T`\>(`params`): [`QueryStringParamsEncoded`](utils_queryString.md#querystringparamsencoded)<`T`\> +> **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. @@ -134,24 +135,24 @@ functions. However, it _is_ exported by the package as part of the composable fu #### Type parameters -| Name | Type | -| :--- | :-------------------------------------------------------------------- | -| `T` | extends [`QueryStringParams`](utils_queryString.md#querystringparams) | +| Parameter | +| :------ | +| `T` extends [`QueryStringParams`](queryString.md#querystringparams) | #### Parameters -| Name | Type | Description | -| :------- | :--- | :-------------------------------------------- | -| `params` | `T` | An object of search parameters to be encoded. | +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `params` | `T` | An object of search parameters to be encoded. | #### Returns -[`QueryStringParamsEncoded`](utils_queryString.md#querystringparamsencoded)<`T`\> +[`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. +values converted to URI component strings. Any keys with values not a string, number, or +boolean are filtered out of final object. -#### Defined in +#### Source [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/utils/types.md b/apps/docs/src/typedoc/utils/types.md new file mode 100644 index 00000000..27caf991 --- /dev/null +++ b/apps/docs/src/typedoc/utils/types.md @@ -0,0 +1,76 @@ +**@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) + - [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) + +*** + +### 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/typedoc/vite-env.md b/apps/docs/src/typedoc/vite-env.md new file mode 100644 index 00000000..615c4ed2 --- /dev/null +++ b/apps/docs/src/typedoc/vite-env.md @@ -0,0 +1,7 @@ +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) + +*** + +[@shaggytools/nhtsa-api-wrapper](modules.md) / vite-env + +# vite-env From bb494aa639f0ebc9f2bbb5e4013699ffc9695367 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 7 Nov 2023 22:08:38 -0600 Subject: [PATCH 47/93] docs: rename /api to /guide/vpic, update all links --- README.md | 6 +- apps/docs/.vitepress/menu-links.ts | 108 ++++++++------- apps/docs/.vitepress/menu.ts | 2 - apps/docs/src/api/index.md | 39 ------ apps/docs/src/guide/getting-started.md | 6 +- apps/docs/src/guide/index.md | 6 +- apps/docs/src/guide/typescript.md | 130 +++++++++--------- apps/docs/src/guide/vin-decoding.md | 8 +- .../vpic}/endpoints/decode-vin-extended.md | 8 +- .../endpoints/decode-vin-values-batch.md | 10 +- .../endpoints/decode-vin-values-extended.md | 8 +- .../vpic}/endpoints/decode-vin-values.md | 8 +- .../vpic}/endpoints/decode-vin.md | 8 +- .../vpic}/endpoints/decode-wmi.md | 8 +- .../vpic}/endpoints/get-all-makes.md | 8 +- .../vpic}/endpoints/get-all-manufacturers.md | 8 +- .../get-canadian-vehicle-specifications.md | 8 +- .../endpoints/get-equipment-plant-codes.md | 8 +- .../endpoints/get-make-for-manufacturer.md | 8 +- .../get-makes-for-manufacturer-and-year.md | 8 +- .../endpoints/get-makes-for-vehicle-type.md | 8 +- .../endpoints/get-manufacturer-details.md | 8 +- .../endpoints/get-models-for-make-id-year.md | 8 +- .../vpic}/endpoints/get-models-for-make-id.md | 8 +- .../endpoints/get-models-for-make-year.md | 8 +- .../vpic}/endpoints/get-models-for-make.md | 8 +- .../vpic}/endpoints/get-parts.md | 8 +- .../get-vehicle-types-for-make-id.md | 8 +- .../endpoints/get-vehicle-types-for-make.md | 8 +- .../endpoints/get-vehicle-variable-list.md | 8 +- .../get-vehicle-variable-values-list.md | 8 +- .../endpoints/get-wmis-for-manufacturer.md | 8 +- .../{api => guide/vpic}/endpoints/index.md | 0 apps/docs/src/guide/vpic/index.md | 39 ++++++ .../{api => guide/vpic}/vpic-api-response.md | 8 +- apps/docs/src/index.md | 2 +- apps/docs/src/parts/package-exports-types.md | 2 +- .../src/typedoc/api/endpoints/DecodeVin.md | 2 +- .../api/endpoints/DecodeVinExtended.md | 2 +- .../typedoc/api/endpoints/DecodeVinValues.md | 2 +- .../api/endpoints/DecodeVinValuesBatch.md | 2 +- .../api/endpoints/DecodeVinValuesExtended.md | 2 +- .../src/typedoc/api/endpoints/DecodeWMI.md | 2 +- .../src/typedoc/api/endpoints/GetAllMakes.md | 2 +- .../api/endpoints/GetAllManufacturers.md | 2 +- .../GetCanadianVehicleSpecifications.md | 2 +- .../api/endpoints/GetEquipmentPlantCodes.md | 2 +- .../api/endpoints/GetMakeForManufacturer.md | 2 +- .../GetMakesForManufacturerAndYear.md | 2 +- .../api/endpoints/GetMakesForVehicleType.md | 2 +- .../api/endpoints/GetManufacturerDetails.md | 2 +- .../typedoc/api/endpoints/GetModelsForMake.md | 2 +- .../api/endpoints/GetModelsForMakeId.md | 2 +- .../api/endpoints/GetModelsForMakeIdYear.md | 2 +- .../api/endpoints/GetModelsForMakeYear.md | 2 +- .../src/typedoc/api/endpoints/GetParts.md | 2 +- .../api/endpoints/GetVehicleTypesForMake.md | 2 +- .../api/endpoints/GetVehicleTypesForMakeId.md | 2 +- .../api/endpoints/GetVehicleVariableList.md | 2 +- .../endpoints/GetVehicleVariableValuesList.md | 2 +- .../api/endpoints/GetWMIsForManufacturer.md | 2 +- apps/docs/src/utils/use-nhtsa.md | 4 +- packages/lib/README.md | 6 +- packages/lib/src/api/endpoints/DecodeVin.ts | 2 +- .../src/api/endpoints/DecodeVinExtended.ts | 2 +- .../lib/src/api/endpoints/DecodeVinValues.ts | 2 +- .../src/api/endpoints/DecodeVinValuesBatch.ts | 2 +- .../api/endpoints/DecodeVinValuesExtended.ts | 2 +- packages/lib/src/api/endpoints/DecodeWMI.ts | 2 +- packages/lib/src/api/endpoints/GetAllMakes.ts | 2 +- .../src/api/endpoints/GetAllManufacturers.ts | 2 +- .../GetCanadianVehicleSpecifications.ts | 2 +- .../api/endpoints/GetEquipmentPlantCodes.ts | 2 +- .../api/endpoints/GetMakeForManufacturer.ts | 2 +- .../GetMakesForManufacturerAndYear.ts | 2 +- .../api/endpoints/GetMakesForVehicleType.ts | 2 +- .../api/endpoints/GetManufacturerDetails.ts | 2 +- .../lib/src/api/endpoints/GetModelsForMake.ts | 2 +- .../src/api/endpoints/GetModelsForMakeId.ts | 2 +- .../api/endpoints/GetModelsForMakeIdYear.ts | 2 +- .../src/api/endpoints/GetModelsForMakeYear.ts | 2 +- packages/lib/src/api/endpoints/GetParts.ts | 2 +- .../api/endpoints/GetVehicleTypesForMake.ts | 2 +- .../api/endpoints/GetVehicleTypesForMakeId.ts | 2 +- .../api/endpoints/GetVehicleVariableList.ts | 2 +- .../endpoints/GetVehicleVariableValuesList.ts | 2 +- .../api/endpoints/GetWMIsForManufacturer.ts | 2 +- 87 files changed, 333 insertions(+), 323 deletions(-) delete mode 100644 apps/docs/src/api/index.md rename apps/docs/src/{api => guide/vpic}/endpoints/decode-vin-extended.md (93%) rename apps/docs/src/{api => guide/vpic}/endpoints/decode-vin-values-batch.md (91%) rename apps/docs/src/{api => guide/vpic}/endpoints/decode-vin-values-extended.md (93%) rename apps/docs/src/{api => guide/vpic}/endpoints/decode-vin-values.md (93%) rename apps/docs/src/{api => guide/vpic}/endpoints/decode-vin.md (92%) rename apps/docs/src/{api => guide/vpic}/endpoints/decode-wmi.md (89%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-all-makes.md (87%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-all-manufacturers.md (92%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-canadian-vehicle-specifications.md (93%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-equipment-plant-codes.md (93%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-make-for-manufacturer.md (90%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-makes-for-manufacturer-and-year.md (92%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-makes-for-vehicle-type.md (88%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-manufacturer-details.md (90%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-models-for-make-id-year.md (94%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-models-for-make-id.md (89%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-models-for-make-year.md (93%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-models-for-make.md (87%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-parts.md (93%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-vehicle-types-for-make-id.md (89%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-vehicle-types-for-make.md (87%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-vehicle-variable-list.md (87%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-vehicle-variable-values-list.md (90%) rename apps/docs/src/{api => guide/vpic}/endpoints/get-wmis-for-manufacturer.md (93%) rename apps/docs/src/{api => guide/vpic}/endpoints/index.md (100%) create mode 100644 apps/docs/src/guide/vpic/index.md rename apps/docs/src/{api => guide/vpic}/vpic-api-response.md (94%) 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/.vitepress/menu-links.ts b/apps/docs/.vitepress/menu-links.ts index 6460baa3..99657fbc 100644 --- a/apps/docs/.vitepress/menu-links.ts +++ b/apps/docs/.vitepress/menu-links.ts @@ -3,74 +3,86 @@ 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', }, ] @@ -217,12 +229,12 @@ const typedocLinks = [ ], }, { - text: 'Types Index', + text: 'Types', link: '/typedoc/types', }, ] -export type LinkGroup = 'guide' | 'api' | 'typedocs' +export type LinkGroup = 'guide' | 'typedocs' const groupLinks: Record = { guide: [ @@ -231,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', @@ -256,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], @@ -277,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/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 7aebee01..64d05393 100644 --- a/apps/docs/src/guide/getting-started.md +++ b/apps/docs/src/guide/getting-started.md @@ -54,7 +54,7 @@ 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 @@ -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/typescript.md b/apps/docs/src/guide/typescript.md index 22ddba1b..1bf4c76f 100644 --- a/apps/docs/src/guide/typescript.md +++ b/apps/docs/src/guide/typescript.md @@ -5,82 +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 -typedoc/api/endpoints/DecodeVinValues/type-aliases/DecodeVinValuesResults -[`DecodeVinExtendedVariable`](../typedoc/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/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 @@ -99,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: @@ -139,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/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. @@ -216,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 d7e319b0..e0cdaa0c 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,8 +50,8 @@ 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) +- [DecodeVinValues](../guide/vpic/endpoints/decode-vin-values) +- [DecodeVinValues Example Response](../guide/vpic/endpoints/decode-vin-values#returns) - [Type - DecodeVinValuesResults](../typedoc/api/endpoints/DecodeVinValues#decodevinvaluesresults) ::: @@ -100,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 531db572..98421d2e 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/api/endpoints/DecodeVinExtended) +See: [Package Reference](../../../typedoc/api/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 05b4b8cd..c3ea5313 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/api/endpoints/DecodeVinValuesBatch) +See: [Package Reference](../../../typedoc/api/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 849e86d6..83e5be05 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/api/endpoints/DecodeVinValuesExtended) +See: [Package Reference](../../../typedoc/api/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 857ab9be..cd69c68f 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/api/endpoints/DecodeVinValues) +See: [Package Reference](../../../typedoc/api/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 d4408bef..a536b368 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/api/endpoints/DecodeVin) +See: [Package Reference](../../../typedoc/api/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 a86ea9ec..db88cb90 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/api/endpoints/DecodeWMI) +See: [Package Reference](../../../typedoc/api/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 7e2d688f..1e46288d 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/api/endpoints/GetAllMakes) +See: [Package Reference](../../../typedoc/api/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 7b386d55..03c5b087 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/api/endpoints/GetAllManufacturers) +See: [Package Reference](../../../typedoc/api/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 7eb875e3..29b2ff46 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/api/endpoints/GetCanadianVehicleSpecifications) +See: [Package Reference](../../../typedoc/api/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 28a48c6a..1c880484 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/api/endpoints/GetEquipmentPlantCodes) +See: [Package Reference](../../../typedoc/api/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 b653f8a9..c85e2af0 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/api/endpoints/GetMakeForManufacturer) +See: [Package Reference](../../../typedoc/api/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 fba6fb80..40ba7fe1 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/api/endpoints/GetMakesForManufacturerAndYear) +See: [Package Reference](../../../typedoc/api/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 893da219..74f50b3f 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/api/endpoints/GetMakesForVehicleType) +See: [Package Reference](../../../typedoc/api/endpoints/GetMakesForVehicleType) ::: ## Description @@ -32,7 +32,7 @@ See: [Package Reference](../../typedoc/api/endpoints/GetMakesForVehicleType) 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 ffb0addc..1c5dff16 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/api/endpoints/GetManufacturerDetails) +See: [Package Reference](../../../typedoc/api/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 fef719b9..2aeb4b28 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/api/endpoints/GetModelsForMakeIdYear) +See: [Package Reference](../../../typedoc/api/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 133bb641..5b9cbe3e 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/api/endpoints/GetModelsForMakeId) +See: [Package Reference](../../../typedoc/api/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 aff0cdfb..e12315cb 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/api/endpoints/GetModelsForMakeYear) +See: [Package Reference](../../../typedoc/api/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 9d816c83..bcd6294a 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/api/endpoints/GetModelsForMake) +See: [Package Reference](../../../typedoc/api/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 f594c62b..e0ae0591 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/api/endpoints/GetParts) +See: [Package Reference](../../../typedoc/api/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 89% 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 54826f48..eaf35aa9 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/api/endpoints/GetVehicleTypesForMakeId) +See: [Package Reference](../../../typedoc/api/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 87% 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 96861239..669c26da 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/api/endpoints/GetVehicleTypesForMake) +See: [Package Reference](../../../typedoc/api/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 d4b6225c..a32b3f64 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/api/endpoints/GetVehicleVariableList) +See: [Package Reference](../../../typedoc/api/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 eb333c60..fa7f9a1f 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/api/endpoints/GetVehicleVariableValuesList) +See: [Package Reference](../../../typedoc/api/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 e584f7e0..641ccf1c 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/api/endpoints/GetWMIsForManufacturer) +See: [Package Reference](../../../typedoc/api/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 ca951ec9..0b5bb828 100644 --- a/apps/docs/src/parts/package-exports-types.md +++ b/apps/docs/src/parts/package-exports-types.md @@ -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/endpoints/DecodeVin.md b/apps/docs/src/typedoc/api/endpoints/DecodeVin.md index 27de8d90..2414d85c 100644 --- a/apps/docs/src/typedoc/api/endpoints/DecodeVin.md +++ b/apps/docs/src/typedoc/api/endpoints/DecodeVin.md @@ -65,7 +65,7 @@ Last Updated: 02/14/2023 > **DecodeVin**(`vin`): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/DecodeVinExtended.md b/apps/docs/src/typedoc/api/endpoints/DecodeVinExtended.md index 85d375f5..64faf0de 100644 --- a/apps/docs/src/typedoc/api/endpoints/DecodeVinExtended.md +++ b/apps/docs/src/typedoc/api/endpoints/DecodeVinExtended.md @@ -65,7 +65,7 @@ Last Updated: 02/14/2023 > **DecodeVinExtended**(`vin`): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/DecodeVinValues.md b/apps/docs/src/typedoc/api/endpoints/DecodeVinValues.md index 0c21fe0a..7b246893 100644 --- a/apps/docs/src/typedoc/api/endpoints/DecodeVinValues.md +++ b/apps/docs/src/typedoc/api/endpoints/DecodeVinValues.md @@ -208,7 +208,7 @@ Single object found in the `Results` array of `DecodeVinValues` endpoint respons > **DecodeVinValues**(`vin`): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/DecodeVinValuesBatch.md b/apps/docs/src/typedoc/api/endpoints/DecodeVinValuesBatch.md index bfbd533f..d8f067a4 100644 --- a/apps/docs/src/typedoc/api/endpoints/DecodeVinValuesBatch.md +++ b/apps/docs/src/typedoc/api/endpoints/DecodeVinValuesBatch.md @@ -189,7 +189,7 @@ Objects found in the `Results` array of `DecodeVinValuesBatch` endpoint response > **DecodeVinValuesBatch**(`inputString`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesBatchResults`](DecodeVinValuesBatch.md#decodevinvaluesbatchresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/DecodeVinValuesExtended.md b/apps/docs/src/typedoc/api/endpoints/DecodeVinValuesExtended.md index a2d0ccbc..51d7499e 100644 --- a/apps/docs/src/typedoc/api/endpoints/DecodeVinValuesExtended.md +++ b/apps/docs/src/typedoc/api/endpoints/DecodeVinValuesExtended.md @@ -189,7 +189,7 @@ Single object found in the `Results` array of `DecodeVinValuesExtended` endpoint > **DecodeVinValuesExtended**(`vin`): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/DecodeWMI.md b/apps/docs/src/typedoc/api/endpoints/DecodeWMI.md index b576ded7..14b17907 100644 --- a/apps/docs/src/typedoc/api/endpoints/DecodeWMI.md +++ b/apps/docs/src/typedoc/api/endpoints/DecodeWMI.md @@ -48,7 +48,7 @@ Objects found in the `Results` array of `DecodeWMI` endpoint response. > **DecodeWMI**(`WMI`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeWMIResults`](DecodeWMI.md#decodewmiresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetAllMakes.md b/apps/docs/src/typedoc/api/endpoints/GetAllMakes.md index 1e7352aa..23148fa7 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetAllMakes.md +++ b/apps/docs/src/typedoc/api/endpoints/GetAllMakes.md @@ -41,7 +41,7 @@ Objects found in the `Results` array of `GetAllMakes` endpoint response. > **GetAllMakes**(`doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllMakesResults`](GetAllMakes.md#getallmakesresults)\>\> ::: 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. diff --git a/apps/docs/src/typedoc/api/endpoints/GetAllManufacturers.md b/apps/docs/src/typedoc/api/endpoints/GetAllManufacturers.md index 8a920709..d45b4d74 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetAllManufacturers.md +++ b/apps/docs/src/typedoc/api/endpoints/GetAllManufacturers.md @@ -44,7 +44,7 @@ Objects found in the `Results` array of `GetAllManufacturers` endpoint response. > **GetAllManufacturers**(`doFetch`?, `_dummy`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetCanadianVehicleSpecifications.md b/apps/docs/src/typedoc/api/endpoints/GetCanadianVehicleSpecifications.md index 33f7fcbd..64e934fb 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetCanadianVehicleSpecifications.md +++ b/apps/docs/src/typedoc/api/endpoints/GetCanadianVehicleSpecifications.md @@ -40,7 +40,7 @@ Objects found in the `Results` array of `GetCanadianVehicleSpecifications` endpo > **GetCanadianVehicleSpecifications**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetCanadianVehicleSpecificationsResults`](GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetEquipmentPlantCodes.md b/apps/docs/src/typedoc/api/endpoints/GetEquipmentPlantCodes.md index e1db393b..4e098355 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetEquipmentPlantCodes.md +++ b/apps/docs/src/typedoc/api/endpoints/GetEquipmentPlantCodes.md @@ -69,7 +69,7 @@ Objects found in the `Results` array of `GetEquipmentPlantCodes` endpoint respon > **GetEquipmentPlantCodes**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetEquipmentPlantCodesResults`](GetEquipmentPlantCodes.md#getequipmentplantcodesresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetMakeForManufacturer.md b/apps/docs/src/typedoc/api/endpoints/GetMakeForManufacturer.md index 7751060d..fa20bee6 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetMakeForManufacturer.md +++ b/apps/docs/src/typedoc/api/endpoints/GetMakeForManufacturer.md @@ -42,7 +42,7 @@ Objects found in the `Results` array of `GetMakeForManufacturer` endpoint respon > **GetMakeForManufacturer**(`manufacturer`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetMakeForManufacturerResults`](GetMakeForManufacturer.md#getmakeformanufacturerresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetMakesForManufacturerAndYear.md b/apps/docs/src/typedoc/api/endpoints/GetMakesForManufacturerAndYear.md index 11ad48e9..0cd67de8 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetMakesForManufacturerAndYear.md +++ b/apps/docs/src/typedoc/api/endpoints/GetMakesForManufacturerAndYear.md @@ -43,7 +43,7 @@ Objects found in the `Results` array of `GetMakesForManufacturerAndYear` endpoin > **GetMakesForManufacturerAndYear**(`manufacturer`, `params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetMakesForManufacturerAndYearResults`](GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetMakesForVehicleType.md b/apps/docs/src/typedoc/api/endpoints/GetMakesForVehicleType.md index e9f143bc..62b89b43 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetMakesForVehicleType.md +++ b/apps/docs/src/typedoc/api/endpoints/GetMakesForVehicleType.md @@ -43,7 +43,7 @@ Objects found in the `Results` array of `GetMakesForVehicleType` endpoint respon > **GetMakesForVehicleType**(`typeName`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetMakesForVehicleTypeResults`](GetMakesForVehicleType.md#getmakesforvehicletyperesults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetManufacturerDetails.md b/apps/docs/src/typedoc/api/endpoints/GetManufacturerDetails.md index 6874b151..f7585bd9 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetManufacturerDetails.md +++ b/apps/docs/src/typedoc/api/endpoints/GetManufacturerDetails.md @@ -64,7 +64,7 @@ Objects found in the `Results` array of `GetManufacturerDetails` endpoint respon > **GetManufacturerDetails**(`manufacturer`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetManufacturerDetailsResults`](GetManufacturerDetails.md#getmanufacturerdetailsresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetModelsForMake.md b/apps/docs/src/typedoc/api/endpoints/GetModelsForMake.md index 2a152a71..7940d3a2 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetModelsForMake.md +++ b/apps/docs/src/typedoc/api/endpoints/GetModelsForMake.md @@ -43,7 +43,7 @@ Objects found in the `Results` array of `GetModelsForMake` endpoint response. > **GetModelsForMake**(`makeName`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeResults`](GetModelsForMake.md#getmodelsformakeresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeId.md b/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeId.md index 58824b93..4e1c5682 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeId.md +++ b/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeId.md @@ -43,7 +43,7 @@ Objects found in the `Results` array of `GetModelsForMakeId` endpoint response. > **GetModelsForMakeId**(`makeId`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeIdResults`](GetModelsForMakeId.md#getmodelsformakeidresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeIdYear.md b/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeIdYear.md index cd432faf..eb1901a0 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeIdYear.md +++ b/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeIdYear.md @@ -43,7 +43,7 @@ Objects found in the `Results` array of `GetModelsForMakeIdYear` endpoint respon > **GetModelsForMakeIdYear**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeIdYearResults`](GetModelsForMakeIdYear.md#getmodelsformakeidyearresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeYear.md b/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeYear.md index f1d87357..6442e78a 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeYear.md +++ b/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeYear.md @@ -43,7 +43,7 @@ Objects found in the `Results` array of `GetModelsForMakeYear` endpoint response > **GetModelsForMakeYear**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeYearResults`](GetModelsForMakeYear.md#getmodelsformakeyearresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetParts.md b/apps/docs/src/typedoc/api/endpoints/GetParts.md index 95a62555..8fa85ce1 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetParts.md +++ b/apps/docs/src/typedoc/api/endpoints/GetParts.md @@ -48,7 +48,7 @@ Objects found in the `Results` array of `GetParts` endpoint response. > **GetParts**(`doFetch`?, `_dummy`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMake.md b/apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMake.md index 44160e05..1780c7e1 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMake.md +++ b/apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMake.md @@ -43,7 +43,7 @@ Objects found in the `Results` array of `GetVehicleTypesForMake` endpoint respon > **GetVehicleTypesForMake**(`makeName`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleTypesForMakeResults`](GetVehicleTypesForMake.md#getvehicletypesformakeresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMakeId.md b/apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMakeId.md index 0ef1a8a9..f17538c5 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMakeId.md +++ b/apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMakeId.md @@ -41,7 +41,7 @@ Objects found in the `Results` array of `GetVehicleTypesForMakeId` endpoint resp > **GetVehicleTypesForMakeId**(`makeId`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleTypesForMakeIdResults`](GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetVehicleVariableList.md b/apps/docs/src/typedoc/api/endpoints/GetVehicleVariableList.md index badbffa6..1c94d9ca 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetVehicleVariableList.md +++ b/apps/docs/src/typedoc/api/endpoints/GetVehicleVariableList.md @@ -44,7 +44,7 @@ Objects found in the `Results` array of `GetVehicleVariableList` endpoint respon > **GetVehicleVariableList**(`doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleVariableListResults`](GetVehicleVariableList.md#getvehiclevariablelistresults)\>\> ::: 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 diff --git a/apps/docs/src/typedoc/api/endpoints/GetVehicleVariableValuesList.md b/apps/docs/src/typedoc/api/endpoints/GetVehicleVariableValuesList.md index ff730409..9b0e8785 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetVehicleVariableValuesList.md +++ b/apps/docs/src/typedoc/api/endpoints/GetVehicleVariableValuesList.md @@ -42,7 +42,7 @@ Objects found in the `Results` array of `GetVehicleVariableValuesList` endpoint > **GetVehicleVariableValuesList**(`variableValue`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleVariableValuesListResults`](GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults)\>\> ::: 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/apps/docs/src/typedoc/api/endpoints/GetWMIsForManufacturer.md b/apps/docs/src/typedoc/api/endpoints/GetWMIsForManufacturer.md index 045861b4..2c81f096 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetWMIsForManufacturer.md +++ b/apps/docs/src/typedoc/api/endpoints/GetWMIsForManufacturer.md @@ -47,7 +47,7 @@ Objects found in the `Results` array of `GetWMIsForManufacturer` endpoint respon > **GetWMIsForManufacturer**(`params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetWMIsForManufacturerResults`](GetWMIsForManufacturer.md#getwmisformanufacturerresults)\>\> ::: 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/apps/docs/src/utils/use-nhtsa.md b/apps/docs/src/utils/use-nhtsa.md index 7942c9a0..32568775 100644 --- a/apps/docs/src/utils/use-nhtsa.md +++ b/apps/docs/src/utils/use-nhtsa.md @@ -40,7 +40,7 @@ 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. @@ -161,7 +161,7 @@ get() [`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/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/src/api/endpoints/DecodeVin.ts b/packages/lib/src/api/endpoints/DecodeVin.ts index 764f6fbc..102df463 100644 --- a/packages/lib/src/api/endpoints/DecodeVin.ts +++ b/packages/lib/src/api/endpoints/DecodeVin.ts @@ -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/endpoints/DecodeVinExtended.ts index edfe61fb..7ee80078 100644 --- a/packages/lib/src/api/endpoints/DecodeVinExtended.ts +++ b/packages/lib/src/api/endpoints/DecodeVinExtended.ts @@ -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/endpoints/DecodeVinValues.ts index 3c38def6..581a2863 100644 --- a/packages/lib/src/api/endpoints/DecodeVinValues.ts +++ b/packages/lib/src/api/endpoints/DecodeVinValues.ts @@ -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/endpoints/DecodeVinValuesBatch.ts index 47f4ad47..5391a73c 100644 --- a/packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts +++ b/packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts @@ -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/endpoints/DecodeVinValuesExtended.ts index f91b622a..3b3a084e 100644 --- a/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts +++ b/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts @@ -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/endpoints/DecodeWMI.ts index 3c988c4d..6cf20e0c 100644 --- a/packages/lib/src/api/endpoints/DecodeWMI.ts +++ b/packages/lib/src/api/endpoints/DecodeWMI.ts @@ -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/endpoints/GetAllMakes.ts index b1aae13a..88bc3bba 100644 --- a/packages/lib/src/api/endpoints/GetAllMakes.ts +++ b/packages/lib/src/api/endpoints/GetAllMakes.ts @@ -9,7 +9,7 @@ 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. diff --git a/packages/lib/src/api/endpoints/GetAllManufacturers.ts b/packages/lib/src/api/endpoints/GetAllManufacturers.ts index 1ef6de48..828d43ad 100644 --- a/packages/lib/src/api/endpoints/GetAllManufacturers.ts +++ b/packages/lib/src/api/endpoints/GetAllManufacturers.ts @@ -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/endpoints/GetCanadianVehicleSpecifications.ts index 7813e970..e7162123 100644 --- a/packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts +++ b/packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts @@ -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/endpoints/GetEquipmentPlantCodes.ts index 8542bffd..912ffb81 100644 --- a/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts +++ b/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts @@ -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/endpoints/GetMakeForManufacturer.ts index 3acf0c84..f0bba5be 100644 --- a/packages/lib/src/api/endpoints/GetMakeForManufacturer.ts +++ b/packages/lib/src/api/endpoints/GetMakeForManufacturer.ts @@ -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/endpoints/GetMakesForManufacturerAndYear.ts index 99f9a3de..952fd2f4 100644 --- a/packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts +++ b/packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts @@ -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/endpoints/GetMakesForVehicleType.ts index af1cd3b4..c6acf0d7 100644 --- a/packages/lib/src/api/endpoints/GetMakesForVehicleType.ts +++ b/packages/lib/src/api/endpoints/GetMakesForVehicleType.ts @@ -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/endpoints/GetManufacturerDetails.ts index 3864bd2b..c0138823 100644 --- a/packages/lib/src/api/endpoints/GetManufacturerDetails.ts +++ b/packages/lib/src/api/endpoints/GetManufacturerDetails.ts @@ -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/endpoints/GetModelsForMake.ts index 2c0ca311..f8b57c07 100644 --- a/packages/lib/src/api/endpoints/GetModelsForMake.ts +++ b/packages/lib/src/api/endpoints/GetModelsForMake.ts @@ -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/endpoints/GetModelsForMakeId.ts index a9470d0b..096be823 100644 --- a/packages/lib/src/api/endpoints/GetModelsForMakeId.ts +++ b/packages/lib/src/api/endpoints/GetModelsForMakeId.ts @@ -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/endpoints/GetModelsForMakeIdYear.ts index 78a174bd..7b6b9536 100644 --- a/packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts +++ b/packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts @@ -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/endpoints/GetModelsForMakeYear.ts index 2ec51f5b..8e250d65 100644 --- a/packages/lib/src/api/endpoints/GetModelsForMakeYear.ts +++ b/packages/lib/src/api/endpoints/GetModelsForMakeYear.ts @@ -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/endpoints/GetParts.ts index 7d857a32..7142abca 100644 --- a/packages/lib/src/api/endpoints/GetParts.ts +++ b/packages/lib/src/api/endpoints/GetParts.ts @@ -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/endpoints/GetVehicleTypesForMake.ts index 846dae1f..108bf948 100644 --- a/packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts +++ b/packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts @@ -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/endpoints/GetVehicleTypesForMakeId.ts index bf27a14d..e52e64a5 100644 --- a/packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts +++ b/packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts @@ -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/endpoints/GetVehicleVariableList.ts index a8b57a1a..85d75855 100644 --- a/packages/lib/src/api/endpoints/GetVehicleVariableList.ts +++ b/packages/lib/src/api/endpoints/GetVehicleVariableList.ts @@ -9,7 +9,7 @@ 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 diff --git a/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts b/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts index 08349d61..88d985fc 100644 --- a/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts +++ b/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts @@ -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/endpoints/GetWMIsForManufacturer.ts index e31e4184..8f91b807 100644 --- a/packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts +++ b/packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts @@ -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 From d8191c734d07ecae55d3183bbb77c2a825bb3289 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Mon, 20 Nov 2023 20:14:11 -0600 Subject: [PATCH 48/93] refactor(lib): move VPIC endpoints from /api/endpoints to /api/vpic --- packages/lib/src/api/README.md | 12 +- packages/lib/src/api/index.ts | 2 +- packages/lib/src/api/vpic/README.md | 13 ++ .../lib/src/api/vpic/__tests__/index.test.ts | 149 ++++++++++++++++++ .../src/api/{ => vpic}/endpoints/DecodeVin.ts | 0 .../{ => vpic}/endpoints/DecodeVinExtended.ts | 0 .../{ => vpic}/endpoints/DecodeVinValues.ts | 0 .../endpoints/DecodeVinValuesBatch.ts | 0 .../endpoints/DecodeVinValuesExtended.ts | 0 .../src/api/{ => vpic}/endpoints/DecodeWMI.ts | 0 .../api/{ => vpic}/endpoints/GetAllMakes.ts | 0 .../endpoints/GetAllManufacturers.ts | 0 .../GetCanadianVehicleSpecifications.ts | 0 .../endpoints/GetEquipmentPlantCodes.ts | 0 .../endpoints/GetMakeForManufacturer.ts | 0 .../GetMakesForManufacturerAndYear.ts | 0 .../endpoints/GetMakesForVehicleType.ts | 0 .../endpoints/GetManufacturerDetails.ts | 0 .../{ => vpic}/endpoints/GetModelsForMake.ts | 0 .../endpoints/GetModelsForMakeId.ts | 0 .../endpoints/GetModelsForMakeIdYear.ts | 0 .../endpoints/GetModelsForMakeYear.ts | 0 .../src/api/{ => vpic}/endpoints/GetParts.ts | 0 .../endpoints/GetVehicleTypesForMake.ts | 0 .../endpoints/GetVehicleTypesForMakeId.ts | 0 .../endpoints/GetVehicleVariableList.ts | 0 .../endpoints/GetVehicleVariableValuesList.ts | 0 .../endpoints/GetWMIsForManufacturer.ts | 0 .../endpoints/__tests__/DecodeVin.test.ts | 0 .../__tests__/DecodeVinExtended.test.ts | 0 .../__tests__/DecodeVinValues.test.ts | 0 .../__tests__/DecodeVinValuesBatch.test.ts | 0 .../__tests__/DecodeVinValuesExtended.test.ts | 0 .../endpoints/__tests__/DecodeWMI.test.ts | 0 .../endpoints/__tests__/GetAllMakes.test.ts | 0 .../__tests__/GetAllManufacturers.test.ts | 0 .../GetCanadianVehicleSpecifications.test.ts | 0 .../__tests__/GetEquipmentPlantCodes.test.ts | 0 .../__tests__/GetMakeForManufacturer.test.ts | 0 .../GetMakesForManufacturerAndYear.test.ts | 0 .../__tests__/GetMakesForVehicleType.test.ts | 0 .../__tests__/GetManufacturerDetails.test.ts | 0 .../__tests__/GetModelsForMake.test.ts | 0 .../__tests__/GetModelsForMakeId.test.ts | 0 .../__tests__/GetModelsForMakeIdYear.test.ts | 0 .../__tests__/GetModelsForMakeYear.test.ts | 0 .../endpoints/__tests__/GetParts.test.ts | 0 .../__tests__/GetVehicleTypesForMake.test.ts | 0 .../GetVehicleTypesForMakeId.test.ts | 0 .../__tests__/GetVehicleVariableList.test.ts | 0 .../GetVehicleVariableValuesList.test.ts | 0 .../__tests__/GetWMIsForManufacturer.test.ts | 0 .../lib/src/api/{ => vpic}/endpoints/index.ts | 2 +- .../lib/src/api/{ => vpic}/endpoints/types.ts | 2 +- packages/lib/src/api/vpic/index.ts | 6 + packages/lib/src/api/vpic/types.ts | 8 + 56 files changed, 181 insertions(+), 13 deletions(-) create mode 100644 packages/lib/src/api/vpic/README.md create mode 100644 packages/lib/src/api/vpic/__tests__/index.test.ts rename packages/lib/src/api/{ => vpic}/endpoints/DecodeVin.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/DecodeVinExtended.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/DecodeVinValues.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/DecodeVinValuesBatch.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/DecodeVinValuesExtended.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/DecodeWMI.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetAllMakes.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetAllManufacturers.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetCanadianVehicleSpecifications.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetEquipmentPlantCodes.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetMakeForManufacturer.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetMakesForManufacturerAndYear.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetMakesForVehicleType.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetManufacturerDetails.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetModelsForMake.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetModelsForMakeId.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetModelsForMakeIdYear.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetModelsForMakeYear.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetParts.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetVehicleTypesForMake.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetVehicleTypesForMakeId.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetVehicleVariableList.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetVehicleVariableValuesList.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/GetWMIsForManufacturer.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/DecodeVin.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/DecodeVinExtended.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/DecodeVinValues.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/DecodeVinValuesBatch.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/DecodeVinValuesExtended.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/DecodeWMI.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetAllMakes.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetAllManufacturers.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetCanadianVehicleSpecifications.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetEquipmentPlantCodes.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetMakeForManufacturer.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetMakesForManufacturerAndYear.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetMakesForVehicleType.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetManufacturerDetails.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetModelsForMake.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetModelsForMakeId.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetModelsForMakeIdYear.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetModelsForMakeYear.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetParts.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetVehicleTypesForMake.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetVehicleTypesForMakeId.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetVehicleVariableList.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetVehicleVariableValuesList.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/__tests__/GetWMIsForManufacturer.test.ts (100%) rename packages/lib/src/api/{ => vpic}/endpoints/index.ts (98%) rename packages/lib/src/api/{ => vpic}/endpoints/types.ts (98%) create mode 100644 packages/lib/src/api/vpic/index.ts create mode 100644 packages/lib/src/api/vpic/types.ts 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/index.ts b/packages/lib/src/api/index.ts index 72d27c04..adcaee91 100644 --- a/packages/lib/src/api/index.ts +++ b/packages/lib/src/api/index.ts @@ -3,5 +3,5 @@ * @category API */ -export * from './endpoints' +export * from './vpic' export { useNHTSA } from './useNHTSA' 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__/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/endpoints/DecodeVin.ts b/packages/lib/src/api/vpic/endpoints/DecodeVin.ts similarity index 100% rename from packages/lib/src/api/endpoints/DecodeVin.ts rename to packages/lib/src/api/vpic/endpoints/DecodeVin.ts diff --git a/packages/lib/src/api/endpoints/DecodeVinExtended.ts b/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts similarity index 100% rename from packages/lib/src/api/endpoints/DecodeVinExtended.ts rename to packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts diff --git a/packages/lib/src/api/endpoints/DecodeVinValues.ts b/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts similarity index 100% rename from packages/lib/src/api/endpoints/DecodeVinValues.ts rename to packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts diff --git a/packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts b/packages/lib/src/api/vpic/endpoints/DecodeVinValuesBatch.ts similarity index 100% rename from packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts rename to packages/lib/src/api/vpic/endpoints/DecodeVinValuesBatch.ts diff --git a/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts b/packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts similarity index 100% rename from packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts rename to packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts diff --git a/packages/lib/src/api/endpoints/DecodeWMI.ts b/packages/lib/src/api/vpic/endpoints/DecodeWMI.ts similarity index 100% rename from packages/lib/src/api/endpoints/DecodeWMI.ts rename to packages/lib/src/api/vpic/endpoints/DecodeWMI.ts diff --git a/packages/lib/src/api/endpoints/GetAllMakes.ts b/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetAllMakes.ts rename to packages/lib/src/api/vpic/endpoints/GetAllMakes.ts diff --git a/packages/lib/src/api/endpoints/GetAllManufacturers.ts b/packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetAllManufacturers.ts rename to packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts diff --git a/packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts b/packages/lib/src/api/vpic/endpoints/GetCanadianVehicleSpecifications.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts rename to packages/lib/src/api/vpic/endpoints/GetCanadianVehicleSpecifications.ts diff --git a/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts b/packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts rename to packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts diff --git a/packages/lib/src/api/endpoints/GetMakeForManufacturer.ts b/packages/lib/src/api/vpic/endpoints/GetMakeForManufacturer.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetMakeForManufacturer.ts rename to packages/lib/src/api/vpic/endpoints/GetMakeForManufacturer.ts diff --git a/packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts b/packages/lib/src/api/vpic/endpoints/GetMakesForManufacturerAndYear.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts rename to packages/lib/src/api/vpic/endpoints/GetMakesForManufacturerAndYear.ts diff --git a/packages/lib/src/api/endpoints/GetMakesForVehicleType.ts b/packages/lib/src/api/vpic/endpoints/GetMakesForVehicleType.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetMakesForVehicleType.ts rename to packages/lib/src/api/vpic/endpoints/GetMakesForVehicleType.ts diff --git a/packages/lib/src/api/endpoints/GetManufacturerDetails.ts b/packages/lib/src/api/vpic/endpoints/GetManufacturerDetails.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetManufacturerDetails.ts rename to packages/lib/src/api/vpic/endpoints/GetManufacturerDetails.ts diff --git a/packages/lib/src/api/endpoints/GetModelsForMake.ts b/packages/lib/src/api/vpic/endpoints/GetModelsForMake.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetModelsForMake.ts rename to packages/lib/src/api/vpic/endpoints/GetModelsForMake.ts diff --git a/packages/lib/src/api/endpoints/GetModelsForMakeId.ts b/packages/lib/src/api/vpic/endpoints/GetModelsForMakeId.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetModelsForMakeId.ts rename to packages/lib/src/api/vpic/endpoints/GetModelsForMakeId.ts diff --git a/packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts b/packages/lib/src/api/vpic/endpoints/GetModelsForMakeIdYear.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts rename to packages/lib/src/api/vpic/endpoints/GetModelsForMakeIdYear.ts diff --git a/packages/lib/src/api/endpoints/GetModelsForMakeYear.ts b/packages/lib/src/api/vpic/endpoints/GetModelsForMakeYear.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetModelsForMakeYear.ts rename to packages/lib/src/api/vpic/endpoints/GetModelsForMakeYear.ts diff --git a/packages/lib/src/api/endpoints/GetParts.ts b/packages/lib/src/api/vpic/endpoints/GetParts.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetParts.ts rename to packages/lib/src/api/vpic/endpoints/GetParts.ts diff --git a/packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMake.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts rename to packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMake.ts diff --git a/packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMakeId.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts rename to packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMakeId.ts diff --git a/packages/lib/src/api/endpoints/GetVehicleVariableList.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetVehicleVariableList.ts rename to packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts diff --git a/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleVariableValuesList.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts rename to packages/lib/src/api/vpic/endpoints/GetVehicleVariableValuesList.ts diff --git a/packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts b/packages/lib/src/api/vpic/endpoints/GetWMIsForManufacturer.ts similarity index 100% rename from packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts rename to packages/lib/src/api/vpic/endpoints/GetWMIsForManufacturer.ts 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 100% rename from packages/lib/src/api/endpoints/__tests__/GetAllMakes.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetAllMakes.test.ts 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 100% rename from packages/lib/src/api/endpoints/__tests__/GetVehicleVariableList.test.ts rename to packages/lib/src/api/vpic/endpoints/__tests__/GetVehicleVariableList.test.ts 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 98% rename from packages/lib/src/api/endpoints/index.ts rename to packages/lib/src/api/vpic/endpoints/index.ts index 6eef2226..850094ec 100644 --- a/packages/lib/src/api/endpoints/index.ts +++ b/packages/lib/src/api/vpic/endpoints/index.ts @@ -1,5 +1,5 @@ /** - * @module api/endpoints + * @module api/vpic/endpoints * @category API Endpoints */ 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..f65cbee4 --- /dev/null +++ b/packages/lib/src/api/vpic/index.ts @@ -0,0 +1,6 @@ +/** + * @module api/vpic + * @category VPIC API (VIN decoding) + */ + +export * 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..1c5ba718 --- /dev/null +++ b/packages/lib/src/api/vpic/types.ts @@ -0,0 +1,8 @@ +/** + * @module api/vpic/types + * @category Types + */ + +export * from './endpoints/types' + +export {} From 1d855d3e5a9d609e9cf323da7cf254a77c00072c Mon Sep 17 00:00:00 2001 From: shaggytech Date: Mon, 20 Nov 2023 21:32:43 -0600 Subject: [PATCH 49/93] refactor(vpic): add missing invalid arguments check to some VPIC endpoints --- .../lib/src/api/vpic/endpoints/GetAllMakes.ts | 8 +++++++- .../api/vpic/endpoints/GetVehicleVariableList.ts | 8 +++++++- .../vpic/endpoints/__tests__/GetAllMakes.test.ts | 16 ++++++++++++++++ .../__tests__/GetVehicleVariableList.test.ts | 16 ++++++++++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) diff --git a/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts b/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts index 88bc3bba..f9eed495 100644 --- a/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts +++ b/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts @@ -4,7 +4,7 @@ */ import { useNHTSA } from '@/api' -import { rejectWithError } from '@/utils' +import { rejectWithError, validateArgument } from '@/utils' import type { NhtsaResponse } from '@/types' /** @@ -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/vpic/endpoints/GetVehicleVariableList.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts index 85d75855..ccffc90d 100644 --- a/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts +++ b/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts @@ -4,7 +4,7 @@ */ import { useNHTSA } from '@/api' -import { rejectWithError } from '@/utils' +import { rejectWithError, validateArgument } from '@/utils' import type { NhtsaResponse } from '@/types' /** @@ -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/vpic/endpoints/__tests__/GetAllMakes.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetAllMakes.test.ts index d25512b6..1d91604c 100644 --- a/packages/lib/src/api/vpic/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/vpic/endpoints/__tests__/GetVehicleVariableList.test.ts b/packages/lib/src/api/vpic/endpoints/__tests__/GetVehicleVariableList.test.ts index 8c5f52a7..ad3008ac 100644 --- a/packages/lib/src/api/vpic/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) + } + ) }) From 49a9f572b8a75cfb4d569f5ce6edfb86351b6005 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Mon, 20 Nov 2023 21:34:08 -0600 Subject: [PATCH 50/93] test: add tests for src/index.ts exports --- packages/lib/src/__tests__/index.test.ts | 175 +++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 packages/lib/src/__tests__/index.test.ts diff --git a/packages/lib/src/__tests__/index.test.ts b/packages/lib/src/__tests__/index.test.ts new file mode 100644 index 00000000..8c1231a8 --- /dev/null +++ b/packages/lib/src/__tests__/index.test.ts @@ -0,0 +1,175 @@ +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, + 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 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) + }) +}) From f89f32957c0aa3bfe4d35f259ef625e6e3f50b56 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 00:06:25 -0600 Subject: [PATCH 51/93] docs: fix dead links to vpic endpoints in typedocs --- apps/docs/.vitepress/menu-links.ts | 48 +++++++++---------- apps/docs/src/guide/getting-started.md | 2 +- apps/docs/src/guide/typescript.md | 2 +- apps/docs/src/guide/vin-decoding.md | 2 +- .../vpic/endpoints/decode-vin-extended.md | 2 +- .../vpic/endpoints/decode-vin-values-batch.md | 2 +- .../endpoints/decode-vin-values-extended.md | 2 +- .../guide/vpic/endpoints/decode-vin-values.md | 2 +- .../src/guide/vpic/endpoints/decode-vin.md | 2 +- .../src/guide/vpic/endpoints/decode-wmi.md | 2 +- .../src/guide/vpic/endpoints/get-all-makes.md | 2 +- .../vpic/endpoints/get-all-manufacturers.md | 2 +- .../get-canadian-vehicle-specifications.md | 2 +- .../endpoints/get-equipment-plant-codes.md | 2 +- .../endpoints/get-make-for-manufacturer.md | 2 +- .../get-makes-for-manufacturer-and-year.md | 2 +- .../endpoints/get-makes-for-vehicle-type.md | 2 +- .../endpoints/get-manufacturer-details.md | 2 +- .../endpoints/get-models-for-make-id-year.md | 2 +- .../vpic/endpoints/get-models-for-make-id.md | 2 +- .../endpoints/get-models-for-make-year.md | 2 +- .../vpic/endpoints/get-models-for-make.md | 2 +- .../src/guide/vpic/endpoints/get-parts.md | 2 +- .../get-vehicle-types-for-make-id.md | 2 +- .../endpoints/get-vehicle-types-for-make.md | 2 +- .../endpoints/get-vehicle-variable-list.md | 2 +- .../get-vehicle-variable-values-list.md | 2 +- .../endpoints/get-wmis-for-manufacturer.md | 2 +- 28 files changed, 51 insertions(+), 51 deletions(-) diff --git a/apps/docs/.vitepress/menu-links.ts b/apps/docs/.vitepress/menu-links.ts index 99657fbc..70250a2c 100644 --- a/apps/docs/.vitepress/menu-links.ts +++ b/apps/docs/.vitepress/menu-links.ts @@ -103,99 +103,99 @@ const typedocLinks = [ { text: 'Index', link: '/typedoc/api/endpoints' }, { text: 'DecodeVin', - link: '/typedoc/api/endpoints/DecodeVin', + link: '/typedoc/api/vpic/endpoints/DecodeVin', }, { text: 'DecodeVinExtended', - link: '/typedoc/api/endpoints/DecodeVinExtended', + link: '/typedoc/api/vpic/endpoints/DecodeVinExtended', }, { text: 'DecodeVinValues', - link: '/typedoc/api/endpoints/DecodeVinValues', + link: '/typedoc/api/vpic/endpoints/DecodeVinValues', }, { text: 'DecodeVinValuesBatch', - link: '/typedoc/api/endpoints/DecodeVinValuesBatch', + link: '/typedoc/api/vpic/endpoints/DecodeVinValuesBatch', }, { text: 'DecodeVinValuesExtended', - link: '/typedoc/api/endpoints/DecodeVinValuesExtended', + link: '/typedoc/api/vpic/endpoints/DecodeVinValuesExtended', }, { text: 'DecodeWMI', - link: '/typedoc/api/endpoints/DecodeWMI', + link: '/typedoc/api/vpic/endpoints/DecodeWMI', }, { text: 'GetAllMakes', - link: '/typedoc/api/endpoints/GetAllMakes', + link: '/typedoc/api/vpic/endpoints/GetAllMakes', }, { text: 'GetAllManufacturers', - link: '/typedoc/api/endpoints/GetAllManufacturers', + link: '/typedoc/api/vpic/endpoints/GetAllManufacturers', }, { text: 'GetCanadianVehicleSpecifications', - link: '/typedoc/api/endpoints/GetCanadianVehicleSpecifications', + link: '/typedoc/api/vpic/endpoints/GetCanadianVehicleSpecifications', }, { text: 'GetEquipmentPlantCodes', - link: '/typedoc/api/endpoints/GetEquipmentPlantCodes', + link: '/typedoc/api/vpic/endpoints/GetEquipmentPlantCodes', }, { text: 'GetMakeForManufacturer', - link: '/typedoc/api/endpoints/GetMakeForManufacturer', + link: '/typedoc/api/vpic/endpoints/GetMakeForManufacturer', }, { text: 'GetMakesForManufacturerAndYear', - link: '/typedoc/api/endpoints/GetMakesForManufacturerAndYear', + link: '/typedoc/api/vpic/endpoints/GetMakesForManufacturerAndYear', }, { text: 'GetMakesForVehicleType', - link: '/typedoc/api/endpoints/GetMakesForVehicleType', + link: '/typedoc/api/vpic/endpoints/GetMakesForVehicleType', }, { text: 'GetManufacturerDetails', - link: '/typedoc/api/endpoints/GetManufacturerDetails', + link: '/typedoc/api/vpic/endpoints/GetManufacturerDetails', }, { text: 'GetModelsForMake', - link: '/typedoc/api/endpoints/GetModelsForMake', + link: '/typedoc/api/vpic/endpoints/GetModelsForMake', }, { text: 'GetModelsForMakeId', - link: '/typedoc/api/endpoints/GetModelsForMakeId', + link: '/typedoc/api/vpic/endpoints/GetModelsForMakeId', }, { text: 'GetModelsForMakeIdYear', - link: '/typedoc/api/endpoints/GetModelsForMakeIdYear', + link: '/typedoc/api/vpic/endpoints/GetModelsForMakeIdYear', }, { text: 'GetModelsForMakeYear', - link: '/typedoc/api/endpoints/GetModelsForMakeYear', + link: '/typedoc/api/vpic/endpoints/GetModelsForMakeYear', }, { text: 'GetParts', - link: '/typedoc/api/endpoints/GetParts', + link: '/typedoc/api/vpic/endpoints/GetParts', }, { text: 'GetVehicleTypesForMake', - link: '/typedoc/api/endpoints/GetVehicleTypesForMake', + link: '/typedoc/api/vpic/endpoints/GetVehicleTypesForMake', }, { text: 'GetVehicleTypesForMakeId', - link: '/typedoc/api/endpoints/GetVehicleTypesForMakeId', + link: '/typedoc/api/vpic/endpoints/GetVehicleTypesForMakeId', }, { text: 'GetVehicleVariableList', - link: '/typedoc/api/endpoints/GetVehicleVariableList', + link: '/typedoc/api/vpic/endpoints/GetVehicleVariableList', }, { text: 'GetVehicleVariableValuesList', - link: '/typedoc/api/endpoints/GetVehicleVariableValuesList', + link: '/typedoc/api/vpic/endpoints/GetVehicleVariableValuesList', }, { text: 'GetWMIsForManufacturer', - link: '/typedoc/api/endpoints/GetWMIsForManufacturer', + link: '/typedoc/api/vpic/endpoints/GetWMIsForManufacturer', }, ], }, diff --git a/apps/docs/src/guide/getting-started.md b/apps/docs/src/guide/getting-started.md index 64d05393..710cebec 100644 --- a/apps/docs/src/guide/getting-started.md +++ b/apps/docs/src/guide/getting-started.md @@ -58,7 +58,7 @@ Further Reading: documentation. - The structure of `Results[0]` in the above example can be seen on the - [Typedocs - DecodeVinValuesResults](../typedoc/api/endpoints/DecodeVinValues#decodevinvaluesresults) + [Typedocs - DecodeVinValuesResults](../typedoc/api/vpic/endpoints/DecodeVinValues#decodevinvaluesresults) page. --- diff --git a/apps/docs/src/guide/typescript.md b/apps/docs/src/guide/typescript.md index 1bf4c76f..7a039ff1 100644 --- a/apps/docs/src/guide/typescript.md +++ b/apps/docs/src/guide/typescript.md @@ -136,7 +136,7 @@ function. For example `DecodeVin` has a `DecodeVinResults` type, `GetAllMakes` h `GetAllMakesResults` type, etc. A few endpoints also have other associated types, such as -[`DecodeVinExtendedVariable`](../typedoc/api/endpoints/DecodeVinExtended#DecodeVinExtendedVariable) +[`DecodeVinExtendedVariable`](../typedoc/api/vpic/endpoints/DecodeVinExtended#DecodeVinExtendedVariable) that describe possible `Variable` values found in the `Results` array of the `DecodeVinExtended` endpoint. diff --git a/apps/docs/src/guide/vin-decoding.md b/apps/docs/src/guide/vin-decoding.md index e0cdaa0c..92de67f1 100644 --- a/apps/docs/src/guide/vin-decoding.md +++ b/apps/docs/src/guide/vin-decoding.md @@ -52,7 +52,7 @@ object. This object is the decoded data for the VIN. - [DecodeVinValues](../guide/vpic/endpoints/decode-vin-values) - [DecodeVinValues Example Response](../guide/vpic/endpoints/decode-vin-values#returns) -- [Type - DecodeVinValuesResults](../typedoc/api/endpoints/DecodeVinValues#decodevinvaluesresults) +- [Type - DecodeVinValuesResults](../typedoc/api/vpic/endpoints/DecodeVinValues#decodevinvaluesresults) ::: diff --git a/apps/docs/src/guide/vpic/endpoints/decode-vin-extended.md b/apps/docs/src/guide/vpic/endpoints/decode-vin-extended.md index 98421d2e..f3cb3a41 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/DecodeVinExtended) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/DecodeVinExtended) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/decode-vin-values-batch.md b/apps/docs/src/guide/vpic/endpoints/decode-vin-values-batch.md index c3ea5313..e0fab586 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/DecodeVinValuesBatch) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/DecodeVinValuesBatch) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/decode-vin-values-extended.md b/apps/docs/src/guide/vpic/endpoints/decode-vin-values-extended.md index 83e5be05..65e4f4b2 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/DecodeVinValuesExtended) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/DecodeVinValuesExtended) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/decode-vin-values.md b/apps/docs/src/guide/vpic/endpoints/decode-vin-values.md index cd69c68f..b8c2d944 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/DecodeVinValues) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/DecodeVinValues) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/decode-vin.md b/apps/docs/src/guide/vpic/endpoints/decode-vin.md index a536b368..60661413 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/DecodeVin) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/DecodeVin) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/decode-wmi.md b/apps/docs/src/guide/vpic/endpoints/decode-wmi.md index db88cb90..5e7ed793 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/DecodeWMI) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/DecodeWMI) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-all-makes.md b/apps/docs/src/guide/vpic/endpoints/get-all-makes.md index 1e46288d..de2fe507 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetAllMakes) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetAllMakes) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-all-manufacturers.md b/apps/docs/src/guide/vpic/endpoints/get-all-manufacturers.md index 03c5b087..5d2fcb7c 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetAllManufacturers) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetAllManufacturers) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-canadian-vehicle-specifications.md b/apps/docs/src/guide/vpic/endpoints/get-canadian-vehicle-specifications.md index 29b2ff46..551e3351 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetCanadianVehicleSpecifications) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetCanadianVehicleSpecifications) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-equipment-plant-codes.md b/apps/docs/src/guide/vpic/endpoints/get-equipment-plant-codes.md index 1c880484..d217de72 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetEquipmentPlantCodes) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetEquipmentPlantCodes) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-make-for-manufacturer.md b/apps/docs/src/guide/vpic/endpoints/get-make-for-manufacturer.md index c85e2af0..0ab11490 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetMakeForManufacturer) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetMakeForManufacturer) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-makes-for-manufacturer-and-year.md b/apps/docs/src/guide/vpic/endpoints/get-makes-for-manufacturer-and-year.md index 40ba7fe1..45b87001 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetMakesForManufacturerAndYear) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetMakesForManufacturerAndYear) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-makes-for-vehicle-type.md b/apps/docs/src/guide/vpic/endpoints/get-makes-for-vehicle-type.md index 74f50b3f..817fec25 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetMakesForVehicleType) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetMakesForVehicleType) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-manufacturer-details.md b/apps/docs/src/guide/vpic/endpoints/get-manufacturer-details.md index 1c5dff16..1bcbbadc 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetManufacturerDetails) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetManufacturerDetails) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-models-for-make-id-year.md b/apps/docs/src/guide/vpic/endpoints/get-models-for-make-id-year.md index 2aeb4b28..a06d51ea 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetModelsForMakeIdYear) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetModelsForMakeIdYear) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-models-for-make-id.md b/apps/docs/src/guide/vpic/endpoints/get-models-for-make-id.md index 5b9cbe3e..8ba40ad0 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetModelsForMakeId) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetModelsForMakeId) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-models-for-make-year.md b/apps/docs/src/guide/vpic/endpoints/get-models-for-make-year.md index e12315cb..d6571a43 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetModelsForMakeYear) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetModelsForMakeYear) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-models-for-make.md b/apps/docs/src/guide/vpic/endpoints/get-models-for-make.md index bcd6294a..cf3a8009 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetModelsForMake) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetModelsForMake) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-parts.md b/apps/docs/src/guide/vpic/endpoints/get-parts.md index e0ae0591..26062b9c 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetParts) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetParts) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-vehicle-types-for-make-id.md b/apps/docs/src/guide/vpic/endpoints/get-vehicle-types-for-make-id.md index eaf35aa9..b14ffac1 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetVehicleTypesForMakeId) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetVehicleTypesForMakeId) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-vehicle-types-for-make.md b/apps/docs/src/guide/vpic/endpoints/get-vehicle-types-for-make.md index 669c26da..e60268bf 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetVehicleTypesForMake) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetVehicleTypesForMake) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-vehicle-variable-list.md b/apps/docs/src/guide/vpic/endpoints/get-vehicle-variable-list.md index a32b3f64..a80927b8 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetVehicleVariableList) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetVehicleVariableList) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-vehicle-variable-values-list.md b/apps/docs/src/guide/vpic/endpoints/get-vehicle-variable-values-list.md index fa7f9a1f..b786e8e8 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetVehicleVariableValuesList) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetVehicleVariableValuesList) ::: ## Description diff --git a/apps/docs/src/guide/vpic/endpoints/get-wmis-for-manufacturer.md b/apps/docs/src/guide/vpic/endpoints/get-wmis-for-manufacturer.md index 641ccf1c..66ccf0b4 100644 --- a/apps/docs/src/guide/vpic/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/api/endpoints/GetWMIsForManufacturer) +See: [Package Reference](../../../typedoc/api/vpic/endpoints/GetWMIsForManufacturer) ::: ## Description From 183bbd1551279333d3c5e2acb8ea590779d35b53 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 00:07:29 -0600 Subject: [PATCH 52/93] docs: commit latest typedocs output --- apps/docs/src/typedoc/api.md | 128 ++- apps/docs/src/typedoc/api/safetyRatings.md | 730 ++++++++++++++++++ .../src/typedoc/api/safetyRatings/types.md | 78 ++ apps/docs/src/typedoc/api/types.md | 180 +++-- apps/docs/src/typedoc/api/useNHTSA.md | 11 +- apps/docs/src/typedoc/api/vpic.md | 133 ++++ .../src/typedoc/api/{ => vpic}/endpoints.md | 6 +- .../api/{ => vpic}/endpoints/DecodeVin.md | 32 +- .../{ => vpic}/endpoints/DecodeVinExtended.md | 32 +- .../{ => vpic}/endpoints/DecodeVinValues.md | 32 +- .../endpoints/DecodeVinValuesBatch.md | 16 +- .../endpoints/DecodeVinValuesExtended.md | 30 +- .../api/{ => vpic}/endpoints/DecodeWMI.md | 16 +- .../api/{ => vpic}/endpoints/GetAllMakes.md | 16 +- .../endpoints/GetAllManufacturers.md | 24 +- .../GetCanadianVehicleSpecifications.md | 16 +- .../endpoints/GetEquipmentPlantCodes.md | 18 +- .../endpoints/GetMakeForManufacturer.md | 16 +- .../GetMakesForManufacturerAndYear.md | 16 +- .../endpoints/GetMakesForVehicleType.md | 16 +- .../endpoints/GetManufacturerDetails.md | 16 +- .../{ => vpic}/endpoints/GetModelsForMake.md | 16 +- .../endpoints/GetModelsForMakeId.md | 16 +- .../endpoints/GetModelsForMakeIdYear.md | 16 +- .../endpoints/GetModelsForMakeYear.md | 16 +- .../api/{ => vpic}/endpoints/GetParts.md | 24 +- .../endpoints/GetVehicleTypesForMake.md | 16 +- .../endpoints/GetVehicleTypesForMakeId.md | 16 +- .../endpoints/GetVehicleVariableList.md | 16 +- .../endpoints/GetVehicleVariableValuesList.md | 16 +- .../endpoints/GetWMIsForManufacturer.md | 20 +- .../typedoc/api/{ => vpic}/endpoints/types.md | 6 +- apps/docs/src/typedoc/api/vpic/types.md | 148 ++++ apps/docs/src/typedoc/constants.md | 43 +- apps/docs/src/typedoc/exports.md | 419 ++++++++++ apps/docs/src/typedoc/global.md | 7 - apps/docs/src/typedoc/module.index.md | 328 -------- apps/docs/src/typedoc/modules.md | 76 +- apps/docs/src/typedoc/types.md | 136 +++- apps/docs/src/typedoc/utils/argHandler.md | 36 +- apps/docs/src/typedoc/utils/getTypeof.md | 9 +- apps/docs/src/typedoc/utils/queryString.md | 10 +- apps/docs/src/typedoc/utils/types.md | 44 ++ apps/docs/src/typedoc/vite-env.md | 7 - 44 files changed, 2260 insertions(+), 743 deletions(-) create mode 100644 apps/docs/src/typedoc/api/safetyRatings.md create mode 100644 apps/docs/src/typedoc/api/safetyRatings/types.md create mode 100644 apps/docs/src/typedoc/api/vpic.md rename apps/docs/src/typedoc/api/{ => vpic}/endpoints.md (96%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/DecodeVin.md (78%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/DecodeVinExtended.md (78%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/DecodeVinValues.md (79%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/DecodeVinValuesBatch.md (88%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/DecodeVinValuesExtended.md (79%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/DecodeWMI.md (70%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetAllMakes.md (60%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetAllManufacturers.md (62%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetCanadianVehicleSpecifications.md (73%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetEquipmentPlantCodes.md (72%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetMakeForManufacturer.md (66%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetMakesForManufacturerAndYear.md (71%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetMakesForVehicleType.md (63%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetManufacturerDetails.md (74%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetModelsForMake.md (63%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetModelsForMakeId.md (69%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetModelsForMakeIdYear.md (74%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetModelsForMakeYear.md (70%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetParts.md (72%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetVehicleTypesForMake.md (63%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetVehicleTypesForMakeId.md (68%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetVehicleVariableList.md (62%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetVehicleVariableValuesList.md (63%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/GetWMIsForManufacturer.md (69%) rename apps/docs/src/typedoc/api/{ => vpic}/endpoints/types.md (96%) create mode 100644 apps/docs/src/typedoc/api/vpic/types.md create mode 100644 apps/docs/src/typedoc/exports.md delete mode 100644 apps/docs/src/typedoc/global.md delete mode 100644 apps/docs/src/typedoc/module.index.md delete mode 100644 apps/docs/src/typedoc/vite-env.md diff --git a/apps/docs/src/typedoc/api.md b/apps/docs/src/typedoc/api.md index 204ee303..2e2961fa 100644 --- a/apps/docs/src/typedoc/api.md +++ b/apps/docs/src/typedoc/api.md @@ -33,105 +33,185 @@ - [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/endpoints/DecodeVin.md#decodevin) +Re-exports [DecodeVin](api/vpic/endpoints/DecodeVin.md#decodevin) ### DecodeVinExtended -Re-exports [DecodeVinExtended](api/endpoints/DecodeVinExtended.md#decodevinextended) +Re-exports [DecodeVinExtended](api/vpic/endpoints/DecodeVinExtended.md#decodevinextended) ### DecodeVinValues -Re-exports [DecodeVinValues](api/endpoints/DecodeVinValues.md#decodevinvalues) +Re-exports [DecodeVinValues](api/vpic/endpoints/DecodeVinValues.md#decodevinvalues) ### DecodeVinValuesBatch -Re-exports [DecodeVinValuesBatch](api/endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatch) +Re-exports [DecodeVinValuesBatch](api/vpic/endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatch) ### DecodeVinValuesExtended -Re-exports [DecodeVinValuesExtended](api/endpoints/DecodeVinValuesExtended.md#decodevinvaluesextended) +Re-exports [DecodeVinValuesExtended](api/vpic/endpoints/DecodeVinValuesExtended.md#decodevinvaluesextended) ### DecodeWMI -Re-exports [DecodeWMI](api/endpoints/DecodeWMI.md#decodewmi) +Re-exports [DecodeWMI](api/vpic/endpoints/DecodeWMI.md#decodewmi) ### GetAllMakes -Re-exports [GetAllMakes](api/endpoints/GetAllMakes.md#getallmakes) +Re-exports [GetAllMakes](api/vpic/endpoints/GetAllMakes.md#getallmakes) ### GetAllManufacturers -Re-exports [GetAllManufacturers](api/endpoints/GetAllManufacturers.md#getallmanufacturers) +Re-exports [GetAllManufacturers](api/vpic/endpoints/GetAllManufacturers.md#getallmanufacturers) ### GetCanadianVehicleSpecifications -Re-exports [GetCanadianVehicleSpecifications](api/endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecifications) +Re-exports [GetCanadianVehicleSpecifications](api/vpic/endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecifications) ### GetEquipmentPlantCodes -Re-exports [GetEquipmentPlantCodes](api/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodes) +Re-exports [GetEquipmentPlantCodes](api/vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodes) ### GetMakeForManufacturer -Re-exports [GetMakeForManufacturer](api/endpoints/GetMakeForManufacturer.md#getmakeformanufacturer) +Re-exports [GetMakeForManufacturer](api/vpic/endpoints/GetMakeForManufacturer.md#getmakeformanufacturer) ### GetMakesForManufacturerAndYear -Re-exports [GetMakesForManufacturerAndYear](api/endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyear) +Re-exports [GetMakesForManufacturerAndYear](api/vpic/endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyear) ### GetMakesForVehicleType -Re-exports [GetMakesForVehicleType](api/endpoints/GetMakesForVehicleType.md#getmakesforvehicletype) +Re-exports [GetMakesForVehicleType](api/vpic/endpoints/GetMakesForVehicleType.md#getmakesforvehicletype) ### GetManufacturerDetails -Re-exports [GetManufacturerDetails](api/endpoints/GetManufacturerDetails.md#getmanufacturerdetails) +Re-exports [GetManufacturerDetails](api/vpic/endpoints/GetManufacturerDetails.md#getmanufacturerdetails) ### GetModelsForMake -Re-exports [GetModelsForMake](api/endpoints/GetModelsForMake.md#getmodelsformake) +Re-exports [GetModelsForMake](api/vpic/endpoints/GetModelsForMake.md#getmodelsformake) ### GetModelsForMakeId -Re-exports [GetModelsForMakeId](api/endpoints/GetModelsForMakeId.md#getmodelsformakeid) +Re-exports [GetModelsForMakeId](api/vpic/endpoints/GetModelsForMakeId.md#getmodelsformakeid) ### GetModelsForMakeIdYear -Re-exports [GetModelsForMakeIdYear](api/endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyear) +Re-exports [GetModelsForMakeIdYear](api/vpic/endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyear) ### GetModelsForMakeYear -Re-exports [GetModelsForMakeYear](api/endpoints/GetModelsForMakeYear.md#getmodelsformakeyear) +Re-exports [GetModelsForMakeYear](api/vpic/endpoints/GetModelsForMakeYear.md#getmodelsformakeyear) ### GetParts -Re-exports [GetParts](api/endpoints/GetParts.md#getparts) +Re-exports [GetParts](api/vpic/endpoints/GetParts.md#getparts) ### GetVehicleTypesForMake -Re-exports [GetVehicleTypesForMake](api/endpoints/GetVehicleTypesForMake.md#getvehicletypesformake) +Re-exports [GetVehicleTypesForMake](api/vpic/endpoints/GetVehicleTypesForMake.md#getvehicletypesformake) ### GetVehicleTypesForMakeId -Re-exports [GetVehicleTypesForMakeId](api/endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeid) +Re-exports [GetVehicleTypesForMakeId](api/vpic/endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeid) ### GetVehicleVariableList -Re-exports [GetVehicleVariableList](api/endpoints/GetVehicleVariableList.md#getvehiclevariablelist) +Re-exports [GetVehicleVariableList](api/vpic/endpoints/GetVehicleVariableList.md#getvehiclevariablelist) ### GetVehicleVariableValuesList -Re-exports [GetVehicleVariableValuesList](api/endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslist) +Re-exports [GetVehicleVariableValuesList](api/vpic/endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslist) ### GetWMIsForManufacturer -Re-exports [GetWMIsForManufacturer](api/endpoints/GetWMIsForManufacturer.md#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 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 index e981f99f..33347d56 100644 --- a/apps/docs/src/typedoc/api/types.md +++ b/apps/docs/src/typedoc/api/types.md @@ -37,8 +37,22 @@ - [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) - - [NhtsaResponse``](types.md#nhtsaresponset) + - [ApiTypes](types.md#apitypes) + - [NhtsaResponse``](types.md#nhtsaresponseresultstype-apitype) ## References @@ -48,135 +62,215 @@ Re-exports [CreateUrlOptions](useNHTSA.md#createurloptions) ### DecodeVinExtendedResults -Re-exports [DecodeVinExtendedResults](endpoints/DecodeVinExtended.md#decodevinextendedresults) +Re-exports [DecodeVinExtendedResults](vpic/endpoints/DecodeVinExtended.md#decodevinextendedresults) ### DecodeVinExtendedVariable -Re-exports [DecodeVinExtendedVariable](endpoints/DecodeVinExtended.md#decodevinextendedvariable) +Re-exports [DecodeVinExtendedVariable](vpic/endpoints/DecodeVinExtended.md#decodevinextendedvariable) ### DecodeVinResults -Re-exports [DecodeVinResults](endpoints/DecodeVin.md#decodevinresults) +Re-exports [DecodeVinResults](vpic/endpoints/DecodeVin.md#decodevinresults) ### DecodeVinValuesBatchResults -Re-exports [DecodeVinValuesBatchResults](endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatchresults) +Re-exports [DecodeVinValuesBatchResults](vpic/endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatchresults) ### DecodeVinValuesExtendedResults -Re-exports [DecodeVinValuesExtendedResults](endpoints/DecodeVinValuesExtended.md#decodevinvaluesextendedresults) +Re-exports [DecodeVinValuesExtendedResults](vpic/endpoints/DecodeVinValuesExtended.md#decodevinvaluesextendedresults) ### DecodeVinValuesResults -Re-exports [DecodeVinValuesResults](endpoints/DecodeVinValues.md#decodevinvaluesresults) +Re-exports [DecodeVinValuesResults](vpic/endpoints/DecodeVinValues.md#decodevinvaluesresults) ### DecodeVinVariable -Re-exports [DecodeVinVariable](endpoints/DecodeVin.md#decodevinvariable) +Re-exports [DecodeVinVariable](vpic/endpoints/DecodeVin.md#decodevinvariable) ### DecodeWMIResults -Re-exports [DecodeWMIResults](endpoints/DecodeWMI.md#decodewmiresults) +Re-exports [DecodeWMIResults](vpic/endpoints/DecodeWMI.md#decodewmiresults) ### GetAllMakesResults -Re-exports [GetAllMakesResults](endpoints/GetAllMakes.md#getallmakesresults) +Re-exports [GetAllMakesResults](vpic/endpoints/GetAllMakes.md#getallmakesresults) ### GetAllManufacturersResults -Re-exports [GetAllManufacturersResults](endpoints/GetAllManufacturers.md#getallmanufacturersresults) +Re-exports [GetAllManufacturersResults](vpic/endpoints/GetAllManufacturers.md#getallmanufacturersresults) ### GetCanadianVehicleSpecificationsResults -Re-exports [GetCanadianVehicleSpecificationsResults](endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) +Re-exports [GetCanadianVehicleSpecificationsResults](vpic/endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) ### GetEquipmentPlantCodesParams -Re-exports [GetEquipmentPlantCodesParams](endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesparams) +Re-exports [GetEquipmentPlantCodesParams](vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesparams) ### GetEquipmentPlantCodesResults -Re-exports [GetEquipmentPlantCodesResults](endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesresults) +Re-exports [GetEquipmentPlantCodesResults](vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesresults) ### GetMakeForManufacturerResults -Re-exports [GetMakeForManufacturerResults](endpoints/GetMakeForManufacturer.md#getmakeformanufacturerresults) +Re-exports [GetMakeForManufacturerResults](vpic/endpoints/GetMakeForManufacturer.md#getmakeformanufacturerresults) ### GetMakesForManufacturerAndYearResults -Re-exports [GetMakesForManufacturerAndYearResults](endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) +Re-exports [GetMakesForManufacturerAndYearResults](vpic/endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) ### GetMakesForVehicleTypeResults -Re-exports [GetMakesForVehicleTypeResults](endpoints/GetMakesForVehicleType.md#getmakesforvehicletyperesults) +Re-exports [GetMakesForVehicleTypeResults](vpic/endpoints/GetMakesForVehicleType.md#getmakesforvehicletyperesults) ### GetManufacturerDetailsResults -Re-exports [GetManufacturerDetailsResults](endpoints/GetManufacturerDetails.md#getmanufacturerdetailsresults) +Re-exports [GetManufacturerDetailsResults](vpic/endpoints/GetManufacturerDetails.md#getmanufacturerdetailsresults) ### GetModelsForMakeIdResults -Re-exports [GetModelsForMakeIdResults](endpoints/GetModelsForMakeId.md#getmodelsformakeidresults) +Re-exports [GetModelsForMakeIdResults](vpic/endpoints/GetModelsForMakeId.md#getmodelsformakeidresults) ### GetModelsForMakeIdYearResults -Re-exports [GetModelsForMakeIdYearResults](endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) +Re-exports [GetModelsForMakeIdYearResults](vpic/endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) ### GetModelsForMakeResults -Re-exports [GetModelsForMakeResults](endpoints/GetModelsForMake.md#getmodelsformakeresults) +Re-exports [GetModelsForMakeResults](vpic/endpoints/GetModelsForMake.md#getmodelsformakeresults) ### GetModelsForMakeYearResults -Re-exports [GetModelsForMakeYearResults](endpoints/GetModelsForMakeYear.md#getmodelsformakeyearresults) +Re-exports [GetModelsForMakeYearResults](vpic/endpoints/GetModelsForMakeYear.md#getmodelsformakeyearresults) ### GetPartsResults -Re-exports [GetPartsResults](endpoints/GetParts.md#getpartsresults) +Re-exports [GetPartsResults](vpic/endpoints/GetParts.md#getpartsresults) ### GetVehicleTypesForMakeIdResults -Re-exports [GetVehicleTypesForMakeIdResults](endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) +Re-exports [GetVehicleTypesForMakeIdResults](vpic/endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) ### GetVehicleTypesForMakeResults -Re-exports [GetVehicleTypesForMakeResults](endpoints/GetVehicleTypesForMake.md#getvehicletypesformakeresults) +Re-exports [GetVehicleTypesForMakeResults](vpic/endpoints/GetVehicleTypesForMake.md#getvehicletypesformakeresults) ### GetVehicleVariableListResults -Re-exports [GetVehicleVariableListResults](endpoints/GetVehicleVariableList.md#getvehiclevariablelistresults) +Re-exports [GetVehicleVariableListResults](vpic/endpoints/GetVehicleVariableList.md#getvehiclevariablelistresults) ### GetVehicleVariableValuesListResults -Re-exports [GetVehicleVariableValuesListResults](endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) +Re-exports [GetVehicleVariableValuesListResults](vpic/endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) ### GetWMIsForManufacturerResults -Re-exports [GetWMIsForManufacturerResults](endpoints/GetWMIsForManufacturer.md#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 -### NhtsaResponse`` +### ApiTypes -> **NhtsaResponse**\<`T`\>: `object` +> **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" +#### Source -#### Type parameters +[api/types.ts:11](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/types.ts#L11) + +*** -| Parameter | -| :------ | -| `T` | +### NhtsaResponse`` -#### Type declaration +> **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 -| Member | 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. | +| Parameter | Default | +| :------ | :------ | +| `ResultsType` | - | +| `ApiType` extends [`ApiTypes`](types.md#apitypes) | `"vpic"` | #### Source -[api/types.ts:12](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/types.ts#L12) +[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 index e2d96b35..8937cef1 100644 --- a/apps/docs/src/typedoc/api/useNHTSA.md +++ b/apps/docs/src/typedoc/api/useNHTSA.md @@ -24,6 +24,7 @@ | Member | Type | Description | | :------ | :------ | :------ | | `allowEmptyParams` | `boolean` | - | +| `apiType` | [`ApiTypes`](types.md#apitypes) | - | | `endpointName` | `string` | - | | `includeQueryString` | `boolean` | - | | `params` | [`QueryStringParams`](../utils/queryString.md#querystringparams) | - | @@ -32,7 +33,7 @@ #### Source -[api/useNHTSA.ts:15](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/useNHTSA.ts#L15) +[api/useNHTSA.ts:20](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/useNHTSA.ts#L20) ## Functions @@ -71,15 +72,15 @@ The functions returned by the composable are: > | Member | Type | Description | > | :------ | :------ | :------ | > | `clearCachedUrl` | () => `string` | - | -> | `createCachedUrl` | (`input`) => `string` | - | +> | `createCachedUrl` | (`options`) => `string` | - | > | `createPostBody` | (`data`) => `string` | - | > | `createUrl` | (`options`) => `string` | - | -> | `get` | \<`T`\>(`url`?, `options`?) => `Promise`\<[`NhtsaResponse`](types.md#nhtsaresponset)\<`T`\>\> | - | +> | `get` | \<`ResultsType`, `ApiType`\>(`url`?, `options`?) => `Promise`\<[`NhtsaResponse`](types.md#nhtsaresponseresultstype-apitype)\<`ResultsType`, `ApiType`\>\> | - | > | `getCachedUrl` | () => `string` | - | -> | `post` | \<`T`\>(`url`?, `options`?) => `Promise`\<[`NhtsaResponse`](types.md#nhtsaresponset)\<`T`\>\> | - | +> | `post` | \<`ResultsType`, `ApiType`\>(`url`?, `options`?) => `Promise`\<[`NhtsaResponse`](types.md#nhtsaresponseresultstype-apitype)\<`ResultsType`, `ApiType`\>\> | - | > | `setCachedUrl` | (`url`) => `string` | - | > #### Source -[api/useNHTSA.ts:50](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/useNHTSA.ts#L50) +[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/endpoints.md b/apps/docs/src/typedoc/api/vpic/endpoints.md similarity index 96% rename from apps/docs/src/typedoc/api/endpoints.md rename to apps/docs/src/typedoc/api/vpic/endpoints.md index 314f1c8d..ac9954ec 100644 --- a/apps/docs/src/typedoc/api/endpoints.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../modules.md) / api/endpoints +[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/vpic/endpoints -# api/endpoints +# api/vpic/endpoints ## Contents diff --git a/apps/docs/src/typedoc/api/endpoints/DecodeVin.md b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVin.md similarity index 78% rename from apps/docs/src/typedoc/api/endpoints/DecodeVin.md rename to apps/docs/src/typedoc/api/vpic/endpoints/DecodeVin.md index 2414d85c..4bccbe00 100644 --- a/apps/docs/src/typedoc/api/endpoints/DecodeVin.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVin.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/DecodeVin +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/DecodeVin -# api/endpoints/DecodeVin +# api/vpic/endpoints/DecodeVin ## Contents @@ -33,7 +33,7 @@ Objects in the `Results` array of `DecodeVin` endpoint response. #### Source -[api/endpoints/DecodeVin.ts:110](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L110) +[api/vpic/endpoints/DecodeVin.ts:110](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVin.ts#L110) *** @@ -54,7 +54,7 @@ Last Updated: 02/14/2023 #### Source -[api/endpoints/DecodeVin.ts:129](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L129) +[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 @@ -62,7 +62,7 @@ Last Updated: 02/14/2023 #### DecodeVin(vin) -> **DecodeVin**(`vin`): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> +> **DecodeVin**(`vin`): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> ::: tip :bulb: More Information See: [DecodeVin Documentation](/guide/vpic/endpoints/decode-vin) @@ -89,18 +89,18 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/DecodeVin.ts:36](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L36) +[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#nhtsaresponset)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> +> **DecodeVin**(`vin`, `doFetch`, `_dummy`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> ##### Parameters @@ -112,11 +112,11 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> ##### Source -[api/endpoints/DecodeVin.ts:38](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L38) +[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) @@ -136,7 +136,7 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Source -[api/endpoints/DecodeVin.ts:44](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L44) +[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) @@ -157,11 +157,11 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Source -[api/endpoints/DecodeVin.ts:50](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L50) +[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#nhtsaresponset)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> +> **DecodeVin**(`vin`, `params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> ##### Parameters @@ -174,8 +174,8 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinResults`](DecodeVin.md#decodevinresults)\>\> ##### Source -[api/endpoints/DecodeVin.ts:56](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVin.ts#L56) +[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/endpoints/DecodeVinExtended.md b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinExtended.md similarity index 78% rename from apps/docs/src/typedoc/api/endpoints/DecodeVinExtended.md rename to apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinExtended.md index 64faf0de..e373179e 100644 --- a/apps/docs/src/typedoc/api/endpoints/DecodeVinExtended.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinExtended.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/DecodeVinExtended +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/DecodeVinExtended -# api/endpoints/DecodeVinExtended +# api/vpic/endpoints/DecodeVinExtended ## Contents @@ -33,7 +33,7 @@ Objects in the `Results` array of `DecodeVinExtended` endpoint response. #### Source -[api/endpoints/DecodeVinExtended.ts:116](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L116) +[api/vpic/endpoints/DecodeVinExtended.ts:116](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts#L116) *** @@ -54,7 +54,7 @@ Last Updated: 02/14/2023 #### Source -[api/endpoints/DecodeVinExtended.ts:135](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L135) +[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 @@ -62,7 +62,7 @@ Last Updated: 02/14/2023 #### DecodeVinExtended(vin) -> **DecodeVinExtended**(`vin`): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> +> **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) @@ -93,18 +93,18 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` (default: `true`) ##### Source -[api/endpoints/DecodeVinExtended.ts:40](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L40) +[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#nhtsaresponset)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> +> **DecodeVinExtended**(`vin`, `doFetch`, `_dummy`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> ##### Parameters @@ -116,11 +116,11 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> ##### Source -[api/endpoints/DecodeVinExtended.ts:44](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L44) +[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) @@ -140,7 +140,7 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Source -[api/endpoints/DecodeVinExtended.ts:50](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L50) +[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) @@ -161,11 +161,11 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Source -[api/endpoints/DecodeVinExtended.ts:56](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L56) +[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#nhtsaresponset)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> +> **DecodeVinExtended**(`vin`, `params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> ##### Parameters @@ -178,8 +178,8 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinExtendedResults`](DecodeVinExtended.md#decodevinextendedresults)\>\> ##### Source -[api/endpoints/DecodeVinExtended.ts:62](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinExtended.ts#L62) +[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/endpoints/DecodeVinValues.md b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValues.md similarity index 79% rename from apps/docs/src/typedoc/api/endpoints/DecodeVinValues.md rename to apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValues.md index 7b246893..f2e4edb2 100644 --- a/apps/docs/src/typedoc/api/endpoints/DecodeVinValues.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValues.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/DecodeVinValues +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/DecodeVinValues -# api/endpoints/DecodeVinValues +# api/vpic/endpoints/DecodeVinValues ## Contents @@ -30,7 +30,7 @@ Query String Parameters for this endpoint #### Source -[api/endpoints/DecodeVinValues.ts:111](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L111) +[api/vpic/endpoints/DecodeVinValues.ts:111](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts#L111) *** @@ -197,7 +197,7 @@ Single object found in the `Results` array of `DecodeVinValues` endpoint respons #### Source -[api/endpoints/DecodeVinValues.ts:118](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L118) +[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 @@ -205,7 +205,7 @@ Single object found in the `Results` array of `DecodeVinValues` endpoint respons #### DecodeVinValues(vin) -> **DecodeVinValues**(`vin`): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> +> **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) @@ -233,18 +233,18 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/DecodeVinValues.ts:37](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L37) +[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#nhtsaresponset)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> +> **DecodeVinValues**(`vin`, `doFetch`, `_dummy`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> ##### Parameters @@ -256,11 +256,11 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> ##### Source -[api/endpoints/DecodeVinValues.ts:41](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L41) +[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) @@ -280,7 +280,7 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Source -[api/endpoints/DecodeVinValues.ts:47](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L47) +[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) @@ -301,11 +301,11 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Source -[api/endpoints/DecodeVinValues.ts:53](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L53) +[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#nhtsaresponset)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> +> **DecodeVinValues**(`vin`, `params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> ##### Parameters @@ -318,8 +318,8 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesResults`](DecodeVinValues.md#decodevinvaluesresults)\>\> ##### Source -[api/endpoints/DecodeVinValues.ts:59](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValues.ts#L59) +[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/endpoints/DecodeVinValuesBatch.md b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValuesBatch.md similarity index 88% rename from apps/docs/src/typedoc/api/endpoints/DecodeVinValuesBatch.md rename to apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValuesBatch.md index d8f067a4..c371f7e3 100644 --- a/apps/docs/src/typedoc/api/endpoints/DecodeVinValuesBatch.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValuesBatch.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/DecodeVinValuesBatch +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/DecodeVinValuesBatch -# api/endpoints/DecodeVinValuesBatch +# api/vpic/endpoints/DecodeVinValuesBatch ## Contents @@ -178,7 +178,7 @@ Objects found in the `Results` array of `DecodeVinValuesBatch` endpoint response #### Source -[api/endpoints/DecodeVinValuesBatch.ts:90](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts#L90) +[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 @@ -186,7 +186,7 @@ Objects found in the `Results` array of `DecodeVinValuesBatch` endpoint response #### DecodeVinValuesBatch(inputString, doFetch) -> **DecodeVinValuesBatch**(`inputString`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesBatchResults`](DecodeVinValuesBatch.md#decodevinvaluesbatchresults)\>\> +> **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) @@ -222,14 +222,14 @@ the model year if it is known at the time of decoding, but it is not required. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesBatchResults`](DecodeVinValuesBatch.md#decodevinvaluesbatchresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesBatchResults`](DecodeVinValuesBatch.md#decodevinvaluesbatchresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/DecodeVinValuesBatch.ts:43](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts#L43) +[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) @@ -248,4 +248,4 @@ the model year if it is known at the time of decoding, but it is not required. ##### Source -[api/endpoints/DecodeVinValuesBatch.ts:48](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesBatch.ts#L48) +[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/endpoints/DecodeVinValuesExtended.md b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValuesExtended.md similarity index 79% rename from apps/docs/src/typedoc/api/endpoints/DecodeVinValuesExtended.md rename to apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValuesExtended.md index 51d7499e..13477182 100644 --- a/apps/docs/src/typedoc/api/endpoints/DecodeVinValuesExtended.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeVinValuesExtended.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/DecodeVinValuesExtended +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/DecodeVinValuesExtended -# api/endpoints/DecodeVinValuesExtended +# api/vpic/endpoints/DecodeVinValuesExtended ## Contents @@ -178,7 +178,7 @@ Single object found in the `Results` array of `DecodeVinValuesExtended` endpoint #### Source -[api/endpoints/DecodeVinValuesExtended.ts:117](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts#L117) +[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 @@ -186,7 +186,7 @@ Single object found in the `Results` array of `DecodeVinValuesExtended` endpoint #### DecodeVinValuesExtended(vin) -> **DecodeVinValuesExtended**(`vin`): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> +> **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) @@ -218,18 +218,18 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/DecodeVinValuesExtended.ts:41](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts#L41) +[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#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> +> **DecodeVinValuesExtended**(`vin`, `doFetch`, `_dummy`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> ##### Parameters @@ -241,11 +241,11 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> ##### Source -[api/endpoints/DecodeVinValuesExtended.ts:45](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts#L45) +[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) @@ -265,7 +265,7 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Source -[api/endpoints/DecodeVinValuesExtended.ts:51](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts#L51) +[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) @@ -286,11 +286,11 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Source -[api/endpoints/DecodeVinValuesExtended.ts:57](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts#L57) +[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#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> +> **DecodeVinValuesExtended**(`vin`, `params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> ##### Parameters @@ -303,8 +303,8 @@ This endpoint also supports partial VIN decoding (VINs that are less than 17 cha ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeVinValuesExtendedResults`](DecodeVinValuesExtended.md#decodevinvaluesextendedresults)\>\> ##### Source -[api/endpoints/DecodeVinValuesExtended.ts:63](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeVinValuesExtended.ts#L63) +[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/endpoints/DecodeWMI.md b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeWMI.md similarity index 70% rename from apps/docs/src/typedoc/api/endpoints/DecodeWMI.md rename to apps/docs/src/typedoc/api/vpic/endpoints/DecodeWMI.md index 14b17907..a028da1e 100644 --- a/apps/docs/src/typedoc/api/endpoints/DecodeWMI.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/DecodeWMI.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/DecodeWMI +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/DecodeWMI -# api/endpoints/DecodeWMI +# api/vpic/endpoints/DecodeWMI ## Contents @@ -37,7 +37,7 @@ Objects found in the `Results` array of `DecodeWMI` endpoint response. #### Source -[api/endpoints/DecodeWMI.ts:76](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeWMI.ts#L76) +[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 @@ -45,7 +45,7 @@ Objects found in the `Results` array of `DecodeWMI` endpoint response. #### DecodeWMI(WMI, doFetch) -> **DecodeWMI**(`WMI`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeWMIResults`](DecodeWMI.md#decodewmiresults)\>\> +> **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) @@ -71,14 +71,14 @@ be available in VPIC data sets. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`DecodeWMIResults`](DecodeWMI.md#decodewmiresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`DecodeWMIResults`](DecodeWMI.md#decodewmiresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` (default: `true`) ##### Source -[api/endpoints/DecodeWMI.ts:32](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeWMI.ts#L32) +[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) @@ -97,4 +97,4 @@ be available in VPIC data sets. ##### Source -[api/endpoints/DecodeWMI.ts:37](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/DecodeWMI.ts#L37) +[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/endpoints/GetAllMakes.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetAllMakes.md similarity index 60% rename from apps/docs/src/typedoc/api/endpoints/GetAllMakes.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetAllMakes.md index 23148fa7..72616f64 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetAllMakes.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetAllMakes.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetAllMakes +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetAllMakes -# api/endpoints/GetAllMakes +# api/vpic/endpoints/GetAllMakes ## Contents @@ -30,7 +30,7 @@ Objects found in the `Results` array of `GetAllMakes` endpoint response. #### Source -[api/endpoints/GetAllMakes.ts:56](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllMakes.ts#L56) +[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 @@ -38,7 +38,7 @@ Objects found in the `Results` array of `GetAllMakes` endpoint response. #### GetAllMakes(doFetch) -> **GetAllMakes**(`doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllMakesResults`](GetAllMakes.md#getallmakesresults)\>\> +> **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) @@ -58,14 +58,14 @@ an individual vehicle Make. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllMakesResults`](GetAllMakes.md#getallmakesresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetAllMakesResults`](GetAllMakes.md#getallmakesresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` (default: `true`) ##### Source -[api/endpoints/GetAllMakes.ts:26](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllMakes.ts#L26) +[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) @@ -83,4 +83,4 @@ an individual vehicle Make. ##### Source -[api/endpoints/GetAllMakes.ts:28](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllMakes.ts#L28) +[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/endpoints/GetAllManufacturers.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetAllManufacturers.md similarity index 62% rename from apps/docs/src/typedoc/api/endpoints/GetAllManufacturers.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetAllManufacturers.md index d45b4d74..83bcb401 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetAllManufacturers.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetAllManufacturers.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetAllManufacturers +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetAllManufacturers -# api/endpoints/GetAllManufacturers +# api/vpic/endpoints/GetAllManufacturers ## Contents @@ -33,7 +33,7 @@ Objects found in the `Results` array of `GetAllManufacturers` endpoint response. #### Source -[api/endpoints/GetAllManufacturers.ts:111](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllManufacturers.ts#L111) +[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 @@ -41,7 +41,7 @@ Objects found in the `Results` array of `GetAllManufacturers` endpoint response. #### GetAllManufacturers(doFetch, _dummy) -> **GetAllManufacturers**(`doFetch`?, `_dummy`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> +> **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) @@ -66,14 +66,14 @@ pages of 100 items. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetAllManufacturers.ts:33](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllManufacturers.ts#L33) +[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) @@ -92,7 +92,7 @@ pages of 100 items. ##### Source -[api/endpoints/GetAllManufacturers.ts:38](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllManufacturers.ts#L38) +[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) @@ -113,11 +113,11 @@ pages of 100 items. ##### Source -[api/endpoints/GetAllManufacturers.ts:43](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllManufacturers.ts#L43) +[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#nhtsaresponset)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> +> **GetAllManufacturers**(`params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> ##### Parameters @@ -130,8 +130,8 @@ pages of 100 items. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetAllManufacturersResults`](GetAllManufacturers.md#getallmanufacturersresults)\>\> ##### Source -[api/endpoints/GetAllManufacturers.ts:51](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetAllManufacturers.ts#L51) +[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/endpoints/GetCanadianVehicleSpecifications.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetCanadianVehicleSpecifications.md similarity index 73% rename from apps/docs/src/typedoc/api/endpoints/GetCanadianVehicleSpecifications.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetCanadianVehicleSpecifications.md index 64e934fb..5d5c896e 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetCanadianVehicleSpecifications.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetCanadianVehicleSpecifications.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetCanadianVehicleSpecifications +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetCanadianVehicleSpecifications -# api/endpoints/GetCanadianVehicleSpecifications +# api/vpic/endpoints/GetCanadianVehicleSpecifications ## Contents @@ -29,7 +29,7 @@ Objects found in the `Results` array of `GetCanadianVehicleSpecifications` endpo #### Source -[api/endpoints/GetCanadianVehicleSpecifications.ts:120](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts#L120) +[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 @@ -37,7 +37,7 @@ Objects found in the `Results` array of `GetCanadianVehicleSpecifications` endpo #### GetCanadianVehicleSpecifications(params, doFetch) -> **GetCanadianVehicleSpecifications**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetCanadianVehicleSpecificationsResults`](GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults)\>\> +> **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) @@ -75,14 +75,14 @@ no default value is set for it so that an error will be thrown if not provided b ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetCanadianVehicleSpecificationsResults`](GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetCanadianVehicleSpecificationsResults`](GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetCanadianVehicleSpecifications.ts:45](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts#L45) +[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) @@ -105,4 +105,4 @@ Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetCanadianVehicleSpecifications.ts:55](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetCanadianVehicleSpecifications.ts#L55) +[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/endpoints/GetEquipmentPlantCodes.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetEquipmentPlantCodes.md similarity index 72% rename from apps/docs/src/typedoc/api/endpoints/GetEquipmentPlantCodes.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetEquipmentPlantCodes.md index 4e098355..1cf1a211 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetEquipmentPlantCodes.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetEquipmentPlantCodes.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetEquipmentPlantCodes +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetEquipmentPlantCodes -# api/endpoints/GetEquipmentPlantCodes +# api/vpic/endpoints/GetEquipmentPlantCodes ## Contents @@ -32,7 +32,7 @@ Query String Parameters for this endpoint #### Source -[api/endpoints/GetEquipmentPlantCodes.ts:105](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts#L105) +[api/vpic/endpoints/GetEquipmentPlantCodes.ts:105](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts#L105) *** @@ -58,7 +58,7 @@ Objects found in the `Results` array of `GetEquipmentPlantCodes` endpoint respon #### Source -[api/endpoints/GetEquipmentPlantCodes.ts:122](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts#L122) +[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 @@ -66,7 +66,7 @@ Objects found in the `Results` array of `GetEquipmentPlantCodes` endpoint respon #### GetEquipmentPlantCodes(params, doFetch) -> **GetEquipmentPlantCodes**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetEquipmentPlantCodesResults`](GetEquipmentPlantCodes.md#getequipmentplantcodesresults)\>\> +> **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) @@ -104,14 +104,14 @@ values in the query string. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetEquipmentPlantCodesResults`](GetEquipmentPlantCodes.md#getequipmentplantcodesresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetEquipmentPlantCodesResults`](GetEquipmentPlantCodes.md#getequipmentplantcodesresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetEquipmentPlantCodes.ts:47](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts#L47) +[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) @@ -130,4 +130,4 @@ values in the query string. ##### Source -[api/endpoints/GetEquipmentPlantCodes.ts:52](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetEquipmentPlantCodes.ts#L52) +[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/endpoints/GetMakeForManufacturer.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetMakeForManufacturer.md similarity index 66% rename from apps/docs/src/typedoc/api/endpoints/GetMakeForManufacturer.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetMakeForManufacturer.md index fa20bee6..493f655a 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetMakeForManufacturer.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetMakeForManufacturer.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetMakeForManufacturer +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetMakeForManufacturer -# api/endpoints/GetMakeForManufacturer +# api/vpic/endpoints/GetMakeForManufacturer ## Contents @@ -31,7 +31,7 @@ Objects found in the `Results` array of `GetMakeForManufacturer` endpoint respon #### Source -[api/endpoints/GetMakeForManufacturer.ts:77](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakeForManufacturer.ts#L77) +[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 @@ -39,7 +39,7 @@ Objects found in the `Results` array of `GetMakeForManufacturer` endpoint respon #### GetMakeForManufacturer(manufacturer, doFetch) -> **GetMakeForManufacturer**(`manufacturer`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetMakeForManufacturerResults`](GetMakeForManufacturer.md#getmakeformanufacturerresults)\>\> +> **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) @@ -64,14 +64,14 @@ that is requested. Multiple results are returned in case of multiple matches. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetMakeForManufacturerResults`](GetMakeForManufacturer.md#getmakeformanufacturerresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetMakeForManufacturerResults`](GetMakeForManufacturer.md#getmakeformanufacturerresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetMakeForManufacturer.ts:31](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakeForManufacturer.ts#L31) +[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) @@ -90,4 +90,4 @@ that is requested. Multiple results are returned in case of multiple matches. ##### Source -[api/endpoints/GetMakeForManufacturer.ts:36](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakeForManufacturer.ts#L36) +[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/endpoints/GetMakesForManufacturerAndYear.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetMakesForManufacturerAndYear.md similarity index 71% rename from apps/docs/src/typedoc/api/endpoints/GetMakesForManufacturerAndYear.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetMakesForManufacturerAndYear.md index 0cd67de8..dc475e40 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetMakesForManufacturerAndYear.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetMakesForManufacturerAndYear.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetMakesForManufacturerAndYear +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetMakesForManufacturerAndYear -# api/endpoints/GetMakesForManufacturerAndYear +# api/vpic/endpoints/GetMakesForManufacturerAndYear ## Contents @@ -32,7 +32,7 @@ Objects found in the `Results` array of `GetMakesForManufacturerAndYear` endpoin #### Source -[api/endpoints/GetMakesForManufacturerAndYear.ts:105](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts#L105) +[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 @@ -40,7 +40,7 @@ Objects found in the `Results` array of `GetMakesForManufacturerAndYear` endpoin #### GetMakesForManufacturerAndYear(manufacturer, params, doFetch) -> **GetMakesForManufacturerAndYear**(`manufacturer`, `params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetMakesForManufacturerAndYearResults`](GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults)\>\> +> **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) @@ -77,14 +77,14 @@ Both `manufacturer` and `params.year` are required. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetMakesForManufacturerAndYearResults`](GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetMakesForManufacturerAndYearResults`](GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetMakesForManufacturerAndYear.ts:43](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts#L43) +[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) @@ -105,4 +105,4 @@ Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetMakesForManufacturerAndYear.ts:49](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakesForManufacturerAndYear.ts#L49) +[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/endpoints/GetMakesForVehicleType.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetMakesForVehicleType.md similarity index 63% rename from apps/docs/src/typedoc/api/endpoints/GetMakesForVehicleType.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetMakesForVehicleType.md index 62b89b43..72558e58 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetMakesForVehicleType.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetMakesForVehicleType.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetMakesForVehicleType +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetMakesForVehicleType -# api/endpoints/GetMakesForVehicleType +# api/vpic/endpoints/GetMakesForVehicleType ## Contents @@ -32,7 +32,7 @@ Objects found in the `Results` array of `GetMakesForVehicleType` endpoint respon #### Source -[api/endpoints/GetMakesForVehicleType.ts:73](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakesForVehicleType.ts#L73) +[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 @@ -40,7 +40,7 @@ Objects found in the `Results` array of `GetMakesForVehicleType` endpoint respon #### GetMakesForVehicleType(typeName, doFetch) -> **GetMakesForVehicleType**(`typeName`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetMakesForVehicleTypeResults`](GetMakesForVehicleType.md#getmakesforvehicletyperesults)\>\> +> **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) @@ -61,14 +61,14 @@ See: [GetMakesForVehicleType Documentation](/guide/vpic/endpoints/get-makes-for- ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetMakesForVehicleTypeResults`](GetMakesForVehicleType.md#getmakesforvehicletyperesults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetMakesForVehicleTypeResults`](GetMakesForVehicleType.md#getmakesforvehicletyperesults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetMakesForVehicleType.ts:27](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakesForVehicleType.ts#L27) +[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) @@ -87,4 +87,4 @@ See: [GetMakesForVehicleType Documentation](/guide/vpic/endpoints/get-makes-for- ##### Source -[api/endpoints/GetMakesForVehicleType.ts:32](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetMakesForVehicleType.ts#L32) +[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/endpoints/GetManufacturerDetails.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetManufacturerDetails.md similarity index 74% rename from apps/docs/src/typedoc/api/endpoints/GetManufacturerDetails.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetManufacturerDetails.md index f7585bd9..a73d1962 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetManufacturerDetails.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetManufacturerDetails.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetManufacturerDetails +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetManufacturerDetails -# api/endpoints/GetManufacturerDetails +# api/vpic/endpoints/GetManufacturerDetails ## Contents @@ -53,7 +53,7 @@ Objects found in the `Results` array of `GetManufacturerDetails` endpoint respon #### Source -[api/endpoints/GetManufacturerDetails.ts:77](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetManufacturerDetails.ts#L77) +[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 @@ -61,7 +61,7 @@ Objects found in the `Results` array of `GetManufacturerDetails` endpoint respon #### GetManufacturerDetails(manufacturer, doFetch) -> **GetManufacturerDetails**(`manufacturer`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetManufacturerDetailsResults`](GetManufacturerDetails.md#getmanufacturerdetailsresults)\>\> +> **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) @@ -86,14 +86,14 @@ Multiple results are returned in case of multiple matches. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetManufacturerDetailsResults`](GetManufacturerDetails.md#getmanufacturerdetailsresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetManufacturerDetailsResults`](GetManufacturerDetails.md#getmanufacturerdetailsresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetManufacturerDetails.ts:31](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetManufacturerDetails.ts#L31) +[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) @@ -112,4 +112,4 @@ Multiple results are returned in case of multiple matches. ##### Source -[api/endpoints/GetManufacturerDetails.ts:36](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetManufacturerDetails.ts#L36) +[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/endpoints/GetModelsForMake.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMake.md similarity index 63% rename from apps/docs/src/typedoc/api/endpoints/GetModelsForMake.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMake.md index 7940d3a2..670dfc6c 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetModelsForMake.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMake.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetModelsForMake +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetModelsForMake -# api/endpoints/GetModelsForMake +# api/vpic/endpoints/GetModelsForMake ## Contents @@ -32,7 +32,7 @@ Objects found in the `Results` array of `GetModelsForMake` endpoint response. #### Source -[api/endpoints/GetModelsForMake.ts:71](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMake.ts#L71) +[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 @@ -40,7 +40,7 @@ Objects found in the `Results` array of `GetModelsForMake` endpoint response. #### GetModelsForMake(makeName, doFetch) -> **GetModelsForMake**(`makeName`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeResults`](GetModelsForMake.md#getmodelsformakeresults)\>\> +> **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) @@ -61,7 +61,7 @@ whose Name is LIKE the Make in vPIC Dataset. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeResults`](GetModelsForMake.md#getmodelsformakeresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetModelsForMakeResults`](GetModelsForMake.md#getmodelsformakeresults)\>\> - Api Response object @@ -70,7 +70,7 @@ whose Name is LIKE the Make in vPIC Dataset. ##### Source -[api/endpoints/GetModelsForMake.ts:28](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMake.ts#L28) +[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) @@ -89,4 +89,4 @@ whose Name is LIKE the Make in vPIC Dataset. ##### Source -[api/endpoints/GetModelsForMake.ts:33](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMake.ts#L33) +[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/endpoints/GetModelsForMakeId.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeId.md similarity index 69% rename from apps/docs/src/typedoc/api/endpoints/GetModelsForMakeId.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeId.md index 4e1c5682..599f536f 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeId.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeId.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetModelsForMakeId +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetModelsForMakeId -# api/endpoints/GetModelsForMakeId +# api/vpic/endpoints/GetModelsForMakeId ## Contents @@ -32,7 +32,7 @@ Objects found in the `Results` array of `GetModelsForMakeId` endpoint response. #### Source -[api/endpoints/GetModelsForMakeId.ts:87](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeId.ts#L87) +[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 @@ -40,7 +40,7 @@ Objects found in the `Results` array of `GetModelsForMakeId` endpoint response. #### GetModelsForMakeId(makeId, doFetch) -> **GetModelsForMakeId**(`makeId`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeIdResults`](GetModelsForMakeId.md#getmodelsformakeidresults)\>\> +> **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) @@ -75,14 +75,14 @@ endpoint. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeIdResults`](GetModelsForMakeId.md#getmodelsformakeidresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetModelsForMakeIdResults`](GetModelsForMakeId.md#getmodelsformakeidresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetModelsForMakeId.ts:41](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeId.ts#L41) +[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) @@ -101,4 +101,4 @@ endpoint. ##### Source -[api/endpoints/GetModelsForMakeId.ts:46](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeId.ts#L46) +[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/endpoints/GetModelsForMakeIdYear.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeIdYear.md similarity index 74% rename from apps/docs/src/typedoc/api/endpoints/GetModelsForMakeIdYear.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeIdYear.md index eb1901a0..af45f707 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeIdYear.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeIdYear.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetModelsForMakeIdYear +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetModelsForMakeIdYear -# api/endpoints/GetModelsForMakeIdYear +# api/vpic/endpoints/GetModelsForMakeIdYear ## Contents @@ -32,7 +32,7 @@ Objects found in the `Results` array of `GetModelsForMakeIdYear` endpoint respon #### Source -[api/endpoints/GetModelsForMakeIdYear.ts:152](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts#L152) +[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 @@ -40,7 +40,7 @@ Objects found in the `Results` array of `GetModelsForMakeIdYear` endpoint respon #### GetModelsForMakeIdYear(params, doFetch) -> **GetModelsForMakeIdYear**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeIdYearResults`](GetModelsForMakeIdYear.md#getmodelsformakeidyearresults)\>\> +> **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) @@ -88,14 +88,14 @@ endpoint. To account for this, we pass the params object to the `createUrl` func ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeIdYearResults`](GetModelsForMakeIdYear.md#getmodelsformakeidyearresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetModelsForMakeIdYearResults`](GetModelsForMakeIdYear.md#getmodelsformakeidyearresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetModelsForMakeIdYear.ts:61](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts#L61) +[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) @@ -114,4 +114,4 @@ endpoint. To account for this, we pass the params object to the `createUrl` func ##### Source -[api/endpoints/GetModelsForMakeIdYear.ts:71](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeIdYear.ts#L71) +[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/endpoints/GetModelsForMakeYear.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeYear.md similarity index 70% rename from apps/docs/src/typedoc/api/endpoints/GetModelsForMakeYear.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeYear.md index 6442e78a..2f48cecf 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetModelsForMakeYear.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetModelsForMakeYear.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetModelsForMakeYear +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetModelsForMakeYear -# api/endpoints/GetModelsForMakeYear +# api/vpic/endpoints/GetModelsForMakeYear ## Contents @@ -32,7 +32,7 @@ Objects found in the `Results` array of `GetModelsForMakeYear` endpoint response #### Source -[api/endpoints/GetModelsForMakeYear.ts:133](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeYear.ts#L133) +[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 @@ -40,7 +40,7 @@ Objects found in the `Results` array of `GetModelsForMakeYear` endpoint response #### GetModelsForMakeYear(params, doFetch) -> **GetModelsForMakeYear**(`params`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeYearResults`](GetModelsForMakeYear.md#getmodelsformakeyearresults)\>\> +> **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) @@ -72,14 +72,14 @@ endpoint. To account for this, we pass the params object to the `createUrl` func ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetModelsForMakeYearResults`](GetModelsForMakeYear.md#getmodelsformakeyearresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetModelsForMakeYearResults`](GetModelsForMakeYear.md#getmodelsformakeyearresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetModelsForMakeYear.ts:47](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeYear.ts#L47) +[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) @@ -98,4 +98,4 @@ endpoint. To account for this, we pass the params object to the `createUrl` func ##### Source -[api/endpoints/GetModelsForMakeYear.ts:57](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetModelsForMakeYear.ts#L57) +[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/endpoints/GetParts.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetParts.md similarity index 72% rename from apps/docs/src/typedoc/api/endpoints/GetParts.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetParts.md index 8fa85ce1..0375beae 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetParts.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetParts.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetParts +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetParts -# api/endpoints/GetParts +# api/vpic/endpoints/GetParts ## Contents @@ -37,7 +37,7 @@ Objects found in the `Results` array of `GetParts` endpoint response. #### Source -[api/endpoints/GetParts.ts:143](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetParts.ts#L143) +[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 @@ -45,7 +45,7 @@ Objects found in the `Results` array of `GetParts` endpoint response. #### GetParts(doFetch, _dummy) -> **GetParts**(`doFetch`?, `_dummy`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> +> **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) @@ -90,14 +90,14 @@ All query `params` are optional. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetParts.ts:60](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetParts.ts#L60) +[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) @@ -116,7 +116,7 @@ All query `params` are optional. ##### Source -[api/endpoints/GetParts.ts:65](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetParts.ts#L65) +[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) @@ -140,11 +140,11 @@ All query `params` are optional. ##### Source -[api/endpoints/GetParts.ts:67](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetParts.ts#L67) +[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#nhtsaresponset)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> +> **GetParts**(`params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> ##### Parameters @@ -160,8 +160,8 @@ All query `params` are optional. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetPartsResults`](GetParts.md#getpartsresults)\>\> ##### Source -[api/endpoints/GetParts.ts:78](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetParts.ts#L78) +[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/endpoints/GetVehicleTypesForMake.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleTypesForMake.md similarity index 63% rename from apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMake.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleTypesForMake.md index 1780c7e1..5a9fd713 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMake.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleTypesForMake.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetVehicleTypesForMake +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetVehicleTypesForMake -# api/endpoints/GetVehicleTypesForMake +# api/vpic/endpoints/GetVehicleTypesForMake ## Contents @@ -32,7 +32,7 @@ Objects found in the `Results` array of `GetVehicleTypesForMake` endpoint respon #### Source -[api/endpoints/GetVehicleTypesForMake.ts:73](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts#L73) +[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 @@ -40,7 +40,7 @@ Objects found in the `Results` array of `GetVehicleTypesForMake` endpoint respon #### GetVehicleTypesForMake(makeName, doFetch) -> **GetVehicleTypesForMake**(`makeName`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleTypesForMakeResults`](GetVehicleTypesForMake.md#getvehicletypesformakeresults)\>\> +> **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) @@ -61,14 +61,14 @@ whose name is LIKE the make name in the vPIC Dataset. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleTypesForMakeResults`](GetVehicleTypesForMake.md#getvehicletypesformakeresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetVehicleTypesForMakeResults`](GetVehicleTypesForMake.md#getvehicletypesformakeresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetVehicleTypesForMake.ts:27](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts#L27) +[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) @@ -87,4 +87,4 @@ whose name is LIKE the make name in the vPIC Dataset. ##### Source -[api/endpoints/GetVehicleTypesForMake.ts:32](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleTypesForMake.ts#L32) +[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/endpoints/GetVehicleTypesForMakeId.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleTypesForMakeId.md similarity index 68% rename from apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMakeId.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleTypesForMakeId.md index f17538c5..e1a7d975 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetVehicleTypesForMakeId.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleTypesForMakeId.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetVehicleTypesForMakeId +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetVehicleTypesForMakeId -# api/endpoints/GetVehicleTypesForMakeId +# api/vpic/endpoints/GetVehicleTypesForMakeId ## Contents @@ -30,7 +30,7 @@ Objects found in the `Results` array of `GetVehicleTypesForMakeId` endpoint resp #### Source -[api/endpoints/GetVehicleTypesForMakeId.ts:87](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts#L87) +[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 @@ -38,7 +38,7 @@ Objects found in the `Results` array of `GetVehicleTypesForMakeId` endpoint resp #### GetVehicleTypesForMakeId(makeId, doFetch) -> **GetVehicleTypesForMakeId**(`makeId`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleTypesForMakeIdResults`](GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults)\>\> +> **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) @@ -73,14 +73,14 @@ endpoint. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleTypesForMakeIdResults`](GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetVehicleTypesForMakeIdResults`](GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetVehicleTypesForMakeId.ts:41](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts#L41) +[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) @@ -99,4 +99,4 @@ endpoint. ##### Source -[api/endpoints/GetVehicleTypesForMakeId.ts:46](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleTypesForMakeId.ts#L46) +[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/endpoints/GetVehicleVariableList.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleVariableList.md similarity index 62% rename from apps/docs/src/typedoc/api/endpoints/GetVehicleVariableList.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleVariableList.md index 1c94d9ca..1c3e30da 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetVehicleVariableList.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleVariableList.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetVehicleVariableList +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetVehicleVariableList -# api/endpoints/GetVehicleVariableList +# api/vpic/endpoints/GetVehicleVariableList ## Contents @@ -33,7 +33,7 @@ Objects found in the `Results` array of `GetVehicleVariableList` endpoint respon #### Source -[api/endpoints/GetVehicleVariableList.ts:54](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableList.ts#L54) +[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 @@ -41,7 +41,7 @@ Objects found in the `Results` array of `GetVehicleVariableList` endpoint respon #### GetVehicleVariableList(doFetch) -> **GetVehicleVariableList**(`doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleVariableListResults`](GetVehicleVariableList.md#getvehiclevariablelistresults)\>\> +> **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) @@ -58,14 +58,14 @@ vPIC dataset. Information on the name, description and the type of the variable ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleVariableListResults`](GetVehicleVariableList.md#getvehiclevariablelistresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetVehicleVariableListResults`](GetVehicleVariableList.md#getvehiclevariablelistresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetVehicleVariableList.ts:23](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableList.ts#L23) +[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) @@ -83,4 +83,4 @@ vPIC dataset. Information on the name, description and the type of the variable ##### Source -[api/endpoints/GetVehicleVariableList.ts:27](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableList.ts#L27) +[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/endpoints/GetVehicleVariableValuesList.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleVariableValuesList.md similarity index 63% rename from apps/docs/src/typedoc/api/endpoints/GetVehicleVariableValuesList.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleVariableValuesList.md index 9b0e8785..5f5aaf0a 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetVehicleVariableValuesList.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetVehicleVariableValuesList.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetVehicleVariableValuesList +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetVehicleVariableValuesList -# api/endpoints/GetVehicleVariableValuesList +# api/vpic/endpoints/GetVehicleVariableValuesList ## Contents @@ -31,7 +31,7 @@ Objects found in the `Results` array of `GetVehicleVariableValuesList` endpoint #### Source -[api/endpoints/GetVehicleVariableValuesList.ts:75](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts#L75) +[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 @@ -39,7 +39,7 @@ Objects found in the `Results` array of `GetVehicleVariableValuesList` endpoint #### GetVehicleVariableValuesList(variableValue, doFetch) -> **GetVehicleVariableValuesList**(`variableValue`, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleVariableValuesListResults`](GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults)\>\> +> **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) @@ -62,14 +62,14 @@ If `variableValue` is a string, it must use full name, not just part of it, e.g. ##### Returns -`Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetVehicleVariableValuesListResults`](GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetVehicleVariableValuesListResults`](GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetVehicleVariableValuesList.ts:29](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts#L29) +[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) @@ -88,4 +88,4 @@ If `variableValue` is a string, it must use full name, not just part of it, e.g. ##### Source -[api/endpoints/GetVehicleVariableValuesList.ts:34](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetVehicleVariableValuesList.ts#L34) +[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/endpoints/GetWMIsForManufacturer.md b/apps/docs/src/typedoc/api/vpic/endpoints/GetWMIsForManufacturer.md similarity index 69% rename from apps/docs/src/typedoc/api/endpoints/GetWMIsForManufacturer.md rename to apps/docs/src/typedoc/api/vpic/endpoints/GetWMIsForManufacturer.md index 2c81f096..33f8b4ae 100644 --- a/apps/docs/src/typedoc/api/endpoints/GetWMIsForManufacturer.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/GetWMIsForManufacturer.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/GetWMIsForManufacturer +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/GetWMIsForManufacturer -# api/endpoints/GetWMIsForManufacturer +# api/vpic/endpoints/GetWMIsForManufacturer ## Contents @@ -36,7 +36,7 @@ Objects found in the `Results` array of `GetWMIsForManufacturer` endpoint respon #### Source -[api/endpoints/GetWMIsForManufacturer.ts:123](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts#L123) +[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 @@ -44,7 +44,7 @@ Objects found in the `Results` array of `GetWMIsForManufacturer` endpoint respon #### GetWMIsForManufacturer(params, doFetch) -> **GetWMIsForManufacturer**(`params`?, `doFetch`?): `Promise`\<[`NhtsaResponse`](../types.md#nhtsaresponset)\<[`GetWMIsForManufacturerResults`](GetWMIsForManufacturer.md#getwmisformanufacturerresults)\>\> +> **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) @@ -77,19 +77,19 @@ params are the second arg. | 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 | +| `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#nhtsaresponset)\<[`GetWMIsForManufacturerResults`](GetWMIsForManufacturer.md#getwmisformanufacturerresults)\>\> +`Promise`\<[`NhtsaResponse`](../../types.md#nhtsaresponseresultstype-apitype)\<[`GetWMIsForManufacturerResults`](GetWMIsForManufacturer.md#getwmisformanufacturerresults)\>\> - Api Response `object` -or- url `string` if `doFetch = false` ##### Source -[api/endpoints/GetWMIsForManufacturer.ts:48](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts#L48) +[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) @@ -99,7 +99,7 @@ params are the second arg. | Parameter | Type | | :------ | :------ | -| `params` | [`AtLeastOne`](../../utils/types.md#atleastonet-r)\<`object`\> | +| `params` | [`AtLeastOne`](../../../utils/types.md#atleastonet-r)\<`object`\> | | `doFetch` | `false` | ##### Returns @@ -108,4 +108,4 @@ params are the second arg. ##### Source -[api/endpoints/GetWMIsForManufacturer.ts:56](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/api/endpoints/GetWMIsForManufacturer.ts#L56) +[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/endpoints/types.md b/apps/docs/src/typedoc/api/vpic/endpoints/types.md similarity index 96% rename from apps/docs/src/typedoc/api/endpoints/types.md rename to apps/docs/src/typedoc/api/vpic/endpoints/types.md index fa00b9de..1f416dde 100644 --- a/apps/docs/src/typedoc/api/endpoints/types.md +++ b/apps/docs/src/typedoc/api/vpic/endpoints/types.md @@ -1,10 +1,10 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../index.md) \| API ) +**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](../../../index.md) \| API ) *** -[@shaggytools/nhtsa-api-wrapper](../../modules.md) / api/endpoints/types +[@shaggytools/nhtsa-api-wrapper](../../../modules.md) / api/vpic/endpoints/types -# api/endpoints/types +# api/vpic/endpoints/types ## Contents 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 index 80540363..f76216bb 100644 --- a/apps/docs/src/typedoc/constants.md +++ b/apps/docs/src/typedoc/constants.md @@ -9,18 +9,45 @@ ## 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:1](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/constants.ts#L1) +[constants.ts:6](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/constants.ts#L6) *** @@ -30,4 +57,16 @@ #### Source -[constants.ts:2](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/constants.ts#L2) +[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..5a293898 --- /dev/null +++ b/apps/docs/src/typedoc/exports.md @@ -0,0 +1,419 @@ +**@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) + - [ApiTypes](exports.md#apitypes) + - [AtLeastOne](exports.md#atleastone) + - [CreateUrlOptions](exports.md#createurloptions) + - [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) + - [IArgToValidate](exports.md#iargtovalidate) + - [Impossible](exports.md#impossible) + - [NhtsaResponse](exports.md#nhtsaresponse) + - [NoExtraProperties](exports.md#noextraproperties) + - [QueryStringParams](exports.md#querystringparams) + - [QueryStringParamsEncoded](exports.md#querystringparamsencoded) + - [QueryStringTypes](exports.md#querystringtypes) + - [RequireOnlyOne](exports.md#requireonlyone) + - [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 + +### 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) + +## 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/global.md b/apps/docs/src/typedoc/global.md deleted file mode 100644 index 31360811..00000000 --- a/apps/docs/src/typedoc/global.md +++ /dev/null @@ -1,7 +0,0 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) - -*** - -[@shaggytools/nhtsa-api-wrapper](modules.md) / global - -# global diff --git a/apps/docs/src/typedoc/module.index.md b/apps/docs/src/typedoc/module.index.md deleted file mode 100644 index c2045277..00000000 --- a/apps/docs/src/typedoc/module.index.md +++ /dev/null @@ -1,328 +0,0 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) - -*** - -[@shaggytools/nhtsa-api-wrapper](modules.md) / index - -# index - -## Contents - -- [References](module.index.md#references) - - [AtLeastOne](module.index.md#atleastone) - - [CreateUrlOptions](module.index.md#createurloptions) - - [DecodeVin](module.index.md#decodevin) - - [DecodeVinExtended](module.index.md#decodevinextended) - - [DecodeVinExtendedResults](module.index.md#decodevinextendedresults) - - [DecodeVinExtendedVariable](module.index.md#decodevinextendedvariable) - - [DecodeVinResults](module.index.md#decodevinresults) - - [DecodeVinValues](module.index.md#decodevinvalues) - - [DecodeVinValuesBatch](module.index.md#decodevinvaluesbatch) - - [DecodeVinValuesBatchResults](module.index.md#decodevinvaluesbatchresults) - - [DecodeVinValuesExtended](module.index.md#decodevinvaluesextended) - - [DecodeVinValuesExtendedResults](module.index.md#decodevinvaluesextendedresults) - - [DecodeVinValuesResults](module.index.md#decodevinvaluesresults) - - [DecodeVinVariable](module.index.md#decodevinvariable) - - [DecodeWMI](module.index.md#decodewmi) - - [DecodeWMIResults](module.index.md#decodewmiresults) - - [GetAllMakes](module.index.md#getallmakes) - - [GetAllMakesResults](module.index.md#getallmakesresults) - - [GetAllManufacturers](module.index.md#getallmanufacturers) - - [GetAllManufacturersResults](module.index.md#getallmanufacturersresults) - - [GetCanadianVehicleSpecifications](module.index.md#getcanadianvehiclespecifications) - - [GetCanadianVehicleSpecificationsResults](module.index.md#getcanadianvehiclespecificationsresults) - - [GetEquipmentPlantCodes](module.index.md#getequipmentplantcodes) - - [GetEquipmentPlantCodesParams](module.index.md#getequipmentplantcodesparams) - - [GetEquipmentPlantCodesResults](module.index.md#getequipmentplantcodesresults) - - [GetMakeForManufacturer](module.index.md#getmakeformanufacturer) - - [GetMakeForManufacturerResults](module.index.md#getmakeformanufacturerresults) - - [GetMakesForManufacturerAndYear](module.index.md#getmakesformanufacturerandyear) - - [GetMakesForManufacturerAndYearResults](module.index.md#getmakesformanufacturerandyearresults) - - [GetMakesForVehicleType](module.index.md#getmakesforvehicletype) - - [GetMakesForVehicleTypeResults](module.index.md#getmakesforvehicletyperesults) - - [GetManufacturerDetails](module.index.md#getmanufacturerdetails) - - [GetManufacturerDetailsResults](module.index.md#getmanufacturerdetailsresults) - - [GetModelsForMake](module.index.md#getmodelsformake) - - [GetModelsForMakeId](module.index.md#getmodelsformakeid) - - [GetModelsForMakeIdResults](module.index.md#getmodelsformakeidresults) - - [GetModelsForMakeIdYear](module.index.md#getmodelsformakeidyear) - - [GetModelsForMakeIdYearResults](module.index.md#getmodelsformakeidyearresults) - - [GetModelsForMakeResults](module.index.md#getmodelsformakeresults) - - [GetModelsForMakeYear](module.index.md#getmodelsformakeyear) - - [GetModelsForMakeYearResults](module.index.md#getmodelsformakeyearresults) - - [GetParts](module.index.md#getparts) - - [GetPartsResults](module.index.md#getpartsresults) - - [GetVehicleTypesForMake](module.index.md#getvehicletypesformake) - - [GetVehicleTypesForMakeId](module.index.md#getvehicletypesformakeid) - - [GetVehicleTypesForMakeIdResults](module.index.md#getvehicletypesformakeidresults) - - [GetVehicleTypesForMakeResults](module.index.md#getvehicletypesformakeresults) - - [GetVehicleVariableList](module.index.md#getvehiclevariablelist) - - [GetVehicleVariableListResults](module.index.md#getvehiclevariablelistresults) - - [GetVehicleVariableValuesList](module.index.md#getvehiclevariablevalueslist) - - [GetVehicleVariableValuesListResults](module.index.md#getvehiclevariablevalueslistresults) - - [GetWMIsForManufacturer](module.index.md#getwmisformanufacturer) - - [GetWMIsForManufacturerResults](module.index.md#getwmisformanufacturerresults) - - [IArgToValidate](module.index.md#iargtovalidate) - - [NhtsaResponse](module.index.md#nhtsaresponse) - - [QueryStringParams](module.index.md#querystringparams) - - [QueryStringParamsEncoded](module.index.md#querystringparamsencoded) - - [QueryStringTypes](module.index.md#querystringtypes) - - [RequireOnlyOne](module.index.md#requireonlyone) - - [createQueryString](module.index.md#createquerystring) - - [encodeQueryStringParams](module.index.md#encodequerystringparams) - - [isValidVin](module.index.md#isvalidvin) - - [useNHTSA](module.index.md#usenhtsa) - -## References - -### AtLeastOne - -Re-exports [AtLeastOne](utils/types.md#atleastonet-r) - -### 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#nhtsaresponset) - -### 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) - -### 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.md b/apps/docs/src/typedoc/modules.md index f3d1615a..530bc29c 100644 --- a/apps/docs/src/typedoc/modules.md +++ b/apps/docs/src/typedoc/modules.md @@ -11,51 +11,63 @@ | [api](api.md) | - | | [api/useNHTSA](api/useNHTSA.md) | - | -## API Endpoints +## API - Safety Ratings | Module | Description | | :------ | :------ | -| [api/endpoints](api/endpoints.md) | - | -| [api/endpoints/DecodeVin](api/endpoints/DecodeVin.md) | - | -| [api/endpoints/DecodeVinExtended](api/endpoints/DecodeVinExtended.md) | - | -| [api/endpoints/DecodeVinValues](api/endpoints/DecodeVinValues.md) | - | -| [api/endpoints/DecodeVinValuesBatch](api/endpoints/DecodeVinValuesBatch.md) | - | -| [api/endpoints/DecodeVinValuesExtended](api/endpoints/DecodeVinValuesExtended.md) | - | -| [api/endpoints/DecodeWMI](api/endpoints/DecodeWMI.md) | - | -| [api/endpoints/GetAllMakes](api/endpoints/GetAllMakes.md) | - | -| [api/endpoints/GetAllManufacturers](api/endpoints/GetAllManufacturers.md) | - | -| [api/endpoints/GetCanadianVehicleSpecifications](api/endpoints/GetCanadianVehicleSpecifications.md) | - | -| [api/endpoints/GetEquipmentPlantCodes](api/endpoints/GetEquipmentPlantCodes.md) | - | -| [api/endpoints/GetMakeForManufacturer](api/endpoints/GetMakeForManufacturer.md) | - | -| [api/endpoints/GetMakesForManufacturerAndYear](api/endpoints/GetMakesForManufacturerAndYear.md) | - | -| [api/endpoints/GetMakesForVehicleType](api/endpoints/GetMakesForVehicleType.md) | - | -| [api/endpoints/GetManufacturerDetails](api/endpoints/GetManufacturerDetails.md) | - | -| [api/endpoints/GetModelsForMake](api/endpoints/GetModelsForMake.md) | - | -| [api/endpoints/GetModelsForMakeId](api/endpoints/GetModelsForMakeId.md) | - | -| [api/endpoints/GetModelsForMakeIdYear](api/endpoints/GetModelsForMakeIdYear.md) | - | -| [api/endpoints/GetModelsForMakeYear](api/endpoints/GetModelsForMakeYear.md) | - | -| [api/endpoints/GetParts](api/endpoints/GetParts.md) | - | -| [api/endpoints/GetVehicleTypesForMake](api/endpoints/GetVehicleTypesForMake.md) | - | -| [api/endpoints/GetVehicleTypesForMakeId](api/endpoints/GetVehicleTypesForMakeId.md) | - | -| [api/endpoints/GetVehicleVariableList](api/endpoints/GetVehicleVariableList.md) | - | -| [api/endpoints/GetVehicleVariableValuesList](api/endpoints/GetVehicleVariableValuesList.md) | - | -| [api/endpoints/GetWMIsForManufacturer](api/endpoints/GetWMIsForManufacturer.md) | - | - -## Other +| [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) | - | -| [global](global.md) | - | -| [index](module.index.md) | - | -| [vite-env](vite-env.md) | - | + +## Package Exports + +| Module | Description | +| :------ | :------ | +| [exports](exports.md) | - | ## Types | Module | Description | | :------ | :------ | -| [api/endpoints/types](api/endpoints/types.md) | - | +| [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) | - | diff --git a/apps/docs/src/typedoc/types.md b/apps/docs/src/typedoc/types.md index 996d813d..9dc1f3f5 100644 --- a/apps/docs/src/typedoc/types.md +++ b/apps/docs/src/typedoc/types.md @@ -9,6 +9,7 @@ ## Contents - [References](types.md#references) + - [ApiTypes](types.md#apitypes) - [AtLeastOne](types.md#atleastone) - [CreateUrlOptions](types.md#createurloptions) - [DecodeVinExtendedResults](types.md#decodevinextendedresults) @@ -39,14 +40,33 @@ - [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) @@ -57,119 +77,127 @@ Re-exports [CreateUrlOptions](api/useNHTSA.md#createurloptions) ### DecodeVinExtendedResults -Re-exports [DecodeVinExtendedResults](api/endpoints/DecodeVinExtended.md#decodevinextendedresults) +Re-exports [DecodeVinExtendedResults](api/vpic/endpoints/DecodeVinExtended.md#decodevinextendedresults) ### DecodeVinExtendedVariable -Re-exports [DecodeVinExtendedVariable](api/endpoints/DecodeVinExtended.md#decodevinextendedvariable) +Re-exports [DecodeVinExtendedVariable](api/vpic/endpoints/DecodeVinExtended.md#decodevinextendedvariable) ### DecodeVinResults -Re-exports [DecodeVinResults](api/endpoints/DecodeVin.md#decodevinresults) +Re-exports [DecodeVinResults](api/vpic/endpoints/DecodeVin.md#decodevinresults) ### DecodeVinValuesBatchResults -Re-exports [DecodeVinValuesBatchResults](api/endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatchresults) +Re-exports [DecodeVinValuesBatchResults](api/vpic/endpoints/DecodeVinValuesBatch.md#decodevinvaluesbatchresults) ### DecodeVinValuesExtendedResults -Re-exports [DecodeVinValuesExtendedResults](api/endpoints/DecodeVinValuesExtended.md#decodevinvaluesextendedresults) +Re-exports [DecodeVinValuesExtendedResults](api/vpic/endpoints/DecodeVinValuesExtended.md#decodevinvaluesextendedresults) ### DecodeVinValuesResults -Re-exports [DecodeVinValuesResults](api/endpoints/DecodeVinValues.md#decodevinvaluesresults) +Re-exports [DecodeVinValuesResults](api/vpic/endpoints/DecodeVinValues.md#decodevinvaluesresults) ### DecodeVinVariable -Re-exports [DecodeVinVariable](api/endpoints/DecodeVin.md#decodevinvariable) +Re-exports [DecodeVinVariable](api/vpic/endpoints/DecodeVin.md#decodevinvariable) ### DecodeWMIResults -Re-exports [DecodeWMIResults](api/endpoints/DecodeWMI.md#decodewmiresults) +Re-exports [DecodeWMIResults](api/vpic/endpoints/DecodeWMI.md#decodewmiresults) ### GetAllMakesResults -Re-exports [GetAllMakesResults](api/endpoints/GetAllMakes.md#getallmakesresults) +Re-exports [GetAllMakesResults](api/vpic/endpoints/GetAllMakes.md#getallmakesresults) ### GetAllManufacturersResults -Re-exports [GetAllManufacturersResults](api/endpoints/GetAllManufacturers.md#getallmanufacturersresults) +Re-exports [GetAllManufacturersResults](api/vpic/endpoints/GetAllManufacturers.md#getallmanufacturersresults) ### GetCanadianVehicleSpecificationsResults -Re-exports [GetCanadianVehicleSpecificationsResults](api/endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) +Re-exports [GetCanadianVehicleSpecificationsResults](api/vpic/endpoints/GetCanadianVehicleSpecifications.md#getcanadianvehiclespecificationsresults) ### GetEquipmentPlantCodesParams -Re-exports [GetEquipmentPlantCodesParams](api/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesparams) +Re-exports [GetEquipmentPlantCodesParams](api/vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesparams) ### GetEquipmentPlantCodesResults -Re-exports [GetEquipmentPlantCodesResults](api/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesresults) +Re-exports [GetEquipmentPlantCodesResults](api/vpic/endpoints/GetEquipmentPlantCodes.md#getequipmentplantcodesresults) ### GetMakeForManufacturerResults -Re-exports [GetMakeForManufacturerResults](api/endpoints/GetMakeForManufacturer.md#getmakeformanufacturerresults) +Re-exports [GetMakeForManufacturerResults](api/vpic/endpoints/GetMakeForManufacturer.md#getmakeformanufacturerresults) ### GetMakesForManufacturerAndYearResults -Re-exports [GetMakesForManufacturerAndYearResults](api/endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) +Re-exports [GetMakesForManufacturerAndYearResults](api/vpic/endpoints/GetMakesForManufacturerAndYear.md#getmakesformanufacturerandyearresults) ### GetMakesForVehicleTypeResults -Re-exports [GetMakesForVehicleTypeResults](api/endpoints/GetMakesForVehicleType.md#getmakesforvehicletyperesults) +Re-exports [GetMakesForVehicleTypeResults](api/vpic/endpoints/GetMakesForVehicleType.md#getmakesforvehicletyperesults) ### GetManufacturerDetailsResults -Re-exports [GetManufacturerDetailsResults](api/endpoints/GetManufacturerDetails.md#getmanufacturerdetailsresults) +Re-exports [GetManufacturerDetailsResults](api/vpic/endpoints/GetManufacturerDetails.md#getmanufacturerdetailsresults) ### GetModelsForMakeIdResults -Re-exports [GetModelsForMakeIdResults](api/endpoints/GetModelsForMakeId.md#getmodelsformakeidresults) +Re-exports [GetModelsForMakeIdResults](api/vpic/endpoints/GetModelsForMakeId.md#getmodelsformakeidresults) ### GetModelsForMakeIdYearResults -Re-exports [GetModelsForMakeIdYearResults](api/endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) +Re-exports [GetModelsForMakeIdYearResults](api/vpic/endpoints/GetModelsForMakeIdYear.md#getmodelsformakeidyearresults) ### GetModelsForMakeResults -Re-exports [GetModelsForMakeResults](api/endpoints/GetModelsForMake.md#getmodelsformakeresults) +Re-exports [GetModelsForMakeResults](api/vpic/endpoints/GetModelsForMake.md#getmodelsformakeresults) ### GetModelsForMakeYearResults -Re-exports [GetModelsForMakeYearResults](api/endpoints/GetModelsForMakeYear.md#getmodelsformakeyearresults) +Re-exports [GetModelsForMakeYearResults](api/vpic/endpoints/GetModelsForMakeYear.md#getmodelsformakeyearresults) ### GetPartsResults -Re-exports [GetPartsResults](api/endpoints/GetParts.md#getpartsresults) +Re-exports [GetPartsResults](api/vpic/endpoints/GetParts.md#getpartsresults) ### GetVehicleTypesForMakeIdResults -Re-exports [GetVehicleTypesForMakeIdResults](api/endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) +Re-exports [GetVehicleTypesForMakeIdResults](api/vpic/endpoints/GetVehicleTypesForMakeId.md#getvehicletypesformakeidresults) ### GetVehicleTypesForMakeResults -Re-exports [GetVehicleTypesForMakeResults](api/endpoints/GetVehicleTypesForMake.md#getvehicletypesformakeresults) +Re-exports [GetVehicleTypesForMakeResults](api/vpic/endpoints/GetVehicleTypesForMake.md#getvehicletypesformakeresults) ### GetVehicleVariableListResults -Re-exports [GetVehicleVariableListResults](api/endpoints/GetVehicleVariableList.md#getvehiclevariablelistresults) +Re-exports [GetVehicleVariableListResults](api/vpic/endpoints/GetVehicleVariableList.md#getvehiclevariablelistresults) ### GetVehicleVariableValuesListResults -Re-exports [GetVehicleVariableValuesListResults](api/endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) +Re-exports [GetVehicleVariableValuesListResults](api/vpic/endpoints/GetVehicleVariableValuesList.md#getvehiclevariablevalueslistresults) ### GetWMIsForManufacturerResults -Re-exports [GetWMIsForManufacturerResults](api/endpoints/GetWMIsForManufacturer.md#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#nhtsaresponset) +Re-exports [NhtsaResponse](api/types.md#nhtsaresponseresultstype-apitype) + +### NoExtraProperties + +Re-exports [NoExtraProperties](utils/types.md#noextrapropertiest-u) ### QueryStringParams @@ -186,3 +214,55 @@ 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/argHandler.md b/apps/docs/src/typedoc/utils/argHandler.md index ee92d3de..14e1b028 100644 --- a/apps/docs/src/typedoc/utils/argHandler.md +++ b/apps/docs/src/typedoc/utils/argHandler.md @@ -13,14 +13,14 @@ - [Functions](argHandler.md#functions) - [catchInvalidArguments()](argHandler.md#catchinvalidarguments) - [validateArgument()](argHandler.md#validateargument) - - [Options](argHandler.md#options) + - [`argData` Object](argHandler.md#argdata-object) - [Validation Logic](argHandler.md#validation-logic) ## Type Aliases ### IArgToValidate -> **IArgToValidate**: `object` & [`AtLeastOne`](types.md#atleastonet-r)\<`object`\> +> **IArgToValidate**: `object` & [`AtLeastOne`](types.md#atleastonet-r)\<`object`\> \| `object` #### Type declaration @@ -28,6 +28,9 @@ | :------ | :------ | :------ | | `errorMode` | `"error"` \| `"boolean"` | - | | `name` | `string` | - | +| `required` | `boolean` | - | +| `requiredBy` | `object`[] | - | +| `types` | `string`[] | - | | `value` | `unknown` | - | #### Source @@ -55,7 +58,7 @@ validation logic works and how to override the default error throwing behavior. | Parameter | Type | Description | | :------ | :------ | :------ | -| `options` | `object` | options object | +| `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 | @@ -67,16 +70,16 @@ validation logic works and how to override the default error throwing behavior. #### Source -[utils/argHandler.ts:148](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/argHandler.ts#L148) +[utils/argHandler.ts:234](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/argHandler.ts#L234) *** ### validateArgument() -> **validateArgument**(`options`): `boolean` +> **validateArgument**(`argData`): `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. +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. @@ -95,23 +98,22 @@ invalid and return true if the argument is valid. 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 @@ -133,7 +135,7 @@ simply return true. | Parameter | Type | Description | | :------ | :------ | :------ | -| `options` | [`IArgToValidate`](argHandler.md#iargtovalidate) | options object | +| `argData` | [`IArgToValidate`](argHandler.md#iargtovalidate) | options object | #### Returns @@ -144,4 +146,4 @@ validation failure, mode 'boolean' returns false in the case of validation failu #### Source -[utils/argHandler.ts:83](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/argHandler.ts#L83) +[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/utils/getTypeof.md b/apps/docs/src/typedoc/utils/getTypeof.md index cd1a141e..fb013551 100644 --- a/apps/docs/src/typedoc/utils/getTypeof.md +++ b/apps/docs/src/typedoc/utils/getTypeof.md @@ -21,8 +21,11 @@ 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()`. +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 @@ -39,4 +42,4 @@ It will also accurately recognize any Error types, Error, TypeError, etc., as 'e #### Source -[utils/getTypeof.ts:18](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/getTypeof.ts#L18) +[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/utils/queryString.md b/apps/docs/src/typedoc/utils/queryString.md index 7191aae3..3dbae39f 100644 --- a/apps/docs/src/typedoc/utils/queryString.md +++ b/apps/docs/src/typedoc/utils/queryString.md @@ -50,7 +50,7 @@ Object returned by encodeQueryStringParams() ### QueryStringTypes -> **QueryStringTypes**: `string` \| `number` \| `boolean` +> **QueryStringTypes**: `string` \| `number` \| `boolean` \| `undefined` Valid URI component types @@ -105,7 +105,7 @@ formats at this time. This means the default query string will be `"?format=json #### Source -[utils/queryString.ts:100](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L100) +[utils/queryString.ts:96](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L96) *** @@ -129,10 +129,6 @@ filtered out, and that all values are valid. If you need to be sure that all key 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 | Parameter | @@ -155,4 +151,4 @@ boolean are filtered out of final object. #### Source -[utils/queryString.ts:44](https://github.com/ShaggyTech/nhtsa-api-wrapper/blob/main/packages/lib/src/utils/queryString.ts#L44) +[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 index 27caf991..35ee8955 100644 --- a/apps/docs/src/typedoc/utils/types.md +++ b/apps/docs/src/typedoc/utils/types.md @@ -15,6 +15,8 @@ - [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 @@ -57,6 +59,48 @@ https://stackoverflow.com/a/49725198 *** +### 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`\] diff --git a/apps/docs/src/typedoc/vite-env.md b/apps/docs/src/typedoc/vite-env.md deleted file mode 100644 index 615c4ed2..00000000 --- a/apps/docs/src/typedoc/vite-env.md +++ /dev/null @@ -1,7 +0,0 @@ -**@shaggytools/nhtsa-api-wrapper - v3.0.4** ( [Readme](index.md) \| API ) - -*** - -[@shaggytools/nhtsa-api-wrapper](modules.md) / vite-env - -# vite-env From be6d5d84756a9eec5570c1bd71b0626c55ea2799 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 00:35:28 -0600 Subject: [PATCH 53/93] chore(deps): update dependencies --- .changeset/hungry-stingrays-promise.md | 16 +- apps/docs/package.json | 8 +- packages/lib/package.json | 18 +- pnpm-lock.yaml | 2786 +++++++++++++++--------- 4 files changed, 1827 insertions(+), 1001 deletions(-) diff --git a/.changeset/hungry-stingrays-promise.md b/.changeset/hungry-stingrays-promise.md index 520a6944..fd58bed1 100644 --- a/.changeset/hungry-stingrays-promise.md +++ b/.changeset/hungry-stingrays-promise.md @@ -14,7 +14,7 @@ 🏡 Chores -- Add dependency `@vitest/coverage-v8` +- Add dependency `@vitest/coverage-v8` - `v1.0.1` - Remove dependency `@vitest/coverage-c8` - Update dependency `pnpm` to `v8.9.2` @@ -26,14 +26,14 @@ - 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 `v4.5.0` -- Update dependency `@vite-pwa/vitepress` to `v0.2.3` -- Update dependency `vitepress` to `v1.0.0-rc.24` -- Update dependency `vite-plugin-dts` to `v3.0.0` -- Update dependency `vite-plugin-pwa` to `v0.16.5` +- 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 `v0.34.6` -- Update dependency `@vitest/ui` to `v0.34.6` +- 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` diff --git a/apps/docs/package.json b/apps/docs/package.json index 5e58ae90..895dd38c 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "@types/node": "18.18.7", - "@vite-pwa/vitepress": "0.2.3", + "@vite-pwa/vitepress": "0.3.1", "dotenv": "16.3.1", "eslint": "8.52.0", "eslint-config-custom": "workspace:*", @@ -34,8 +34,8 @@ "sitemap": "7.1.1", "tsconfig": "workspace:*", "typescript": "5.2.2", - "vite-plugin-pwa": "0.16.5", - "vitepress": "1.0.0-rc.24", + "vite-plugin-pwa": "0.17.3", + "vitepress": "1.0.0-rc.31", "workbox-window": "7.0.0" }, "eslintConfig": { @@ -45,4 +45,4 @@ "root": true }, "prettier": "prettier-config" -} +} \ No newline at end of file diff --git a/packages/lib/package.json b/packages/lib/package.json index a020912d..26ff0515 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -67,19 +67,21 @@ "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/**/*.{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-v8": "0.34.6", - "@vitest/ui": "0.34.6", + "@vitest/coverage-v8": "1.0.1", + "@vitest/ui": "1.0.1", "eslint": "8.52.0", "eslint-config-custom": "workspace:*", "prettier": "3.0.3", @@ -89,10 +91,10 @@ "typedoc": "0.25.2", "typedoc-config": "workspace:*", "typescript": "5.2.2", - "vite": "4.5.0", - "vite-plugin-dts": "3.6.1", + "vite": "5.0.5", + "vite-plugin-dts": "3.6.4", "vite-tsconfig-paths": "4.2.1", - "vitest": "0.34.6", + "vitest": "1.0.1", "vitest-fetch-mock": "0.2.2" }, "eslintConfig": { @@ -102,4 +104,4 @@ "root": true }, "prettier": "prettier-config" -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f87ef9de..f11a2175 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,8 +43,8 @@ importers: specifier: 18.18.7 version: 18.18.7 '@vite-pwa/vitepress': - specifier: 0.2.3 - version: 0.2.3(vite-plugin-pwa@0.16.5) + specifier: 0.3.1 + version: 0.3.1(vite-plugin-pwa@0.17.3) dotenv: specifier: 16.3.1 version: 16.3.1 @@ -76,11 +76,11 @@ importers: specifier: 5.2.2 version: 5.2.2 vite-plugin-pwa: - specifier: 0.16.5 - version: 0.16.5(vite@4.5.0)(workbox-build@7.0.0)(workbox-window@7.0.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-rc.24 - version: 1.0.0-rc.24(@algolia/client-search@4.20.0)(@types/node@18.18.7)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2) + 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: 7.0.0 version: 7.0.0 @@ -146,11 +146,11 @@ importers: packages/lib: devDependencies: '@vitest/coverage-v8': - specifier: 0.34.6 - version: 0.34.6(vitest@0.34.6) + specifier: 1.0.1 + version: 1.0.1(vitest@1.0.1) '@vitest/ui': - specifier: 0.34.6 - version: 0.34.6(vitest@0.34.6) + specifier: 1.0.1 + version: 1.0.1(vitest@1.0.1) eslint: specifier: 8.52.0 version: 8.52.0 @@ -179,20 +179,20 @@ importers: specifier: 5.2.2 version: 5.2.2 vite: - specifier: 4.5.0 - version: 4.5.0(@types/node@18.18.7)(sass@1.69.4) + specifier: 5.0.5 + version: 5.0.5(@types/node@18.18.7)(sass@1.69.4) vite-plugin-dts: - specifier: 3.6.1 - version: 3.6.1(@types/node@18.18.7)(typescript@5.2.2)(vite@4.5.0) + 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.1 - version: 4.2.1(typescript@5.2.2)(vite@4.5.0) + version: 4.2.1(typescript@5.2.2)(vite@5.0.5) vitest: - specifier: 0.34.6 - version: 0.34.6(@vitest/ui@0.34.6) + 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.34.6) + version: 0.2.2(vitest@1.0.1) packages: @@ -200,10 +200,10 @@ packages: 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.9.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.9.0) + '@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' @@ -211,13 +211,13 @@ packages: - 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.9.0): + /@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.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0) - search-insights: 2.9.0 + search-insights: 2.11.0 transitivePeerDependencies: - '@algolia/client-search' - algoliasearch @@ -339,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): @@ -361,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.23.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 @@ -632,6 +634,15 @@ packages: js-tokens: 4.0.0 dev: true + /@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'} @@ -639,882 +650,856 @@ packages: 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'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead. 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'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead. + /@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 @@ -1529,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.23.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.23.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: @@ -1564,6 +1556,15 @@ 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 @@ -1931,10 +1932,10 @@ packages: resolution: {integrity: sha512-SPiDHaWKQZpwR2siD0KQUwlStvIAnEyK6tAE2h2Wuoq8ue9skzhlyVQ1ddzOxX6khULnAALDiR/isSF3bnuciA==} dev: true - /@docsearch/js@3.5.2(@algolia/client-search@4.20.0)(search-insights@2.9.0): + /@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.5.2(@algolia/client-search@4.20.0)(search-insights@2.9.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' @@ -1944,7 +1945,7 @@ packages: - search-insights dev: true - /@docsearch/react@3.5.2(@algolia/client-search@4.20.0)(search-insights@2.9.0): + /@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' @@ -1961,17 +1962,17 @@ packages: search-insights: optional: true dependencies: - '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.20.0)(algoliasearch@4.20.0)(search-insights@2.9.0) + '@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.9.0 + search-insights: 2.11.0 transitivePeerDependencies: - '@algolia/client-search' dev: true - /@esbuild/android-arm64@0.18.20: - resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} + /@esbuild/android-arm64@0.19.5: + resolution: {integrity: sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1979,8 +1980,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.18.20: - resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} + /@esbuild/android-arm@0.19.5: + resolution: {integrity: sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -1988,8 +1989,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.18.20: - resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} + /@esbuild/android-x64@0.19.5: + resolution: {integrity: sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -1997,8 +1998,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.18.20: - resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} + /@esbuild/darwin-arm64@0.19.5: + resolution: {integrity: sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -2006,8 +2007,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.18.20: - resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} + /@esbuild/darwin-x64@0.19.5: + resolution: {integrity: sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -2015,8 +2016,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.18.20: - resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} + /@esbuild/freebsd-arm64@0.19.5: + resolution: {integrity: sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -2024,8 +2025,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.18.20: - resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} + /@esbuild/freebsd-x64@0.19.5: + resolution: {integrity: sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -2033,8 +2034,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.18.20: - resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} + /@esbuild/linux-arm64@0.19.5: + resolution: {integrity: sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -2042,8 +2043,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.18.20: - resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} + /@esbuild/linux-arm@0.19.5: + resolution: {integrity: sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -2051,8 +2052,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.18.20: - resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} + /@esbuild/linux-ia32@0.19.5: + resolution: {integrity: sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -2060,8 +2061,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.18.20: - resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} + /@esbuild/linux-loong64@0.19.5: + resolution: {integrity: sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -2069,8 +2070,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.18.20: - resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} + /@esbuild/linux-mips64el@0.19.5: + resolution: {integrity: sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -2078,8 +2079,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.18.20: - resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} + /@esbuild/linux-ppc64@0.19.5: + resolution: {integrity: sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -2087,8 +2088,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.18.20: - resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} + /@esbuild/linux-riscv64@0.19.5: + resolution: {integrity: sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -2096,8 +2097,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.18.20: - resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} + /@esbuild/linux-s390x@0.19.5: + resolution: {integrity: sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -2105,8 +2106,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.18.20: - resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} + /@esbuild/linux-x64@0.19.5: + resolution: {integrity: sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -2114,8 +2115,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.18.20: - resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} + /@esbuild/netbsd-x64@0.19.5: + resolution: {integrity: sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -2123,8 +2124,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.18.20: - resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} + /@esbuild/openbsd-x64@0.19.5: + resolution: {integrity: sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -2132,8 +2133,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.18.20: - resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} + /@esbuild/sunos-x64@0.19.5: + resolution: {integrity: sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -2141,8 +2142,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.18.20: - resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} + /@esbuild/win32-arm64@0.19.5: + resolution: {integrity: sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -2150,8 +2151,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.18.20: - resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} + /@esbuild/win32-ia32@0.19.5: + resolution: {integrity: sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -2159,8 +2160,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.18.20: - resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} + /@esbuild/win32-x64@0.19.5: + resolution: {integrity: sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -2248,12 +2249,7 @@ packages: 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: @@ -2266,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: @@ -2336,7 +2328,7 @@ packages: '@rushstack/ts-command-line': 4.16.1 colors: 1.2.5 lodash: 4.17.21 - resolve: 1.22.2 + resolve: 1.22.8 semver: 7.5.4 source-map: 0.6.1 typescript: 5.0.4 @@ -2398,7 +2390,7 @@ packages: 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: @@ -2409,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 @@ -2426,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 @@ -2466,6 +2458,102 @@ packages: picomatch: 2.3.1 dev: true + /@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: @@ -2479,7 +2567,7 @@ packages: fs-extra: 7.0.1 import-lazy: 4.0.0 jju: 1.4.0 - resolve: 1.22.2 + resolve: 1.22.8 semver: 7.5.4 z-schema: 5.0.5 dev: true @@ -2487,7 +2575,7 @@ packages: /@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 @@ -2510,7 +2598,7 @@ packages: ejs: 3.1.9 json5: 2.2.3 magic-string: 0.25.9 - string.prototype.matchall: 4.0.8 + string.prototype.matchall: 4.0.10 dev: true /@tsconfig/node10@1.0.9: @@ -2533,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 @@ -2551,6 +2629,12 @@ 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: @@ -2569,8 +2653,8 @@ packages: resolution: {integrity: sha512-hPpIeeHb/2UuCw06kSNAOVWgehBLXEo0/fUs0mw3W2qhqX89PI2yvok83MnuctYGCPrabGIoi0fFso4DQ+sNUQ==} dev: true - /@types/markdown-it@13.0.5: - resolution: {integrity: sha512-QhJP7hkq3FCrFNx0szMNCT/79CXfcEgUIA3jc5GBfeXqoKsk3R8JZm2wRXJ2DiyjbPE4VMFOSDemLFcUTZmHEQ==} + /@types/markdown-it@13.0.7: + resolution: {integrity: sha512-U/CBi2YUUcTHBt5tjO2r5QV/x0Po6nsYwQU4Y04fBS6vfoImaiZ6f8bi3CjTCxBPQSO1LMyUqkByzi8AidyxfA==} dependencies: '@types/linkify-it': 3.0.4 '@types/mdurl': 1.0.4 @@ -2582,6 +2666,12 @@ packages: '@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 @@ -2630,8 +2720,12 @@ packages: resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==} dev: false - /@types/web-bluetooth@0.0.18: - resolution: {integrity: sha512-v/ZHEj9xh82usl8LMR3GarzFY1IrbXJw5L4QfQhokjRV91q+SelFqxQWSep1ucXEZ22+dSTwLFkXeur25sPIbw==} + /@types/unist@3.0.2: + resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==} + dev: true + + /@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): @@ -2768,96 +2862,98 @@ packages: /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - /@vite-pwa/vitepress@0.2.3(vite-plugin-pwa@0.16.5): - resolution: {integrity: sha512-6k9151CmILbSJQ88hLEMLL+MOQZDURKg2c4Wo5UcaEaOWU0jv7S+mo8nqyg86sM6ry8Jlnp6Zfv6AE0FqnfEyQ==} + /@vite-pwa/vitepress@0.3.1(vite-plugin-pwa@0.17.3): + resolution: {integrity: sha512-krgiYQCWXUkpQCx+IHdsanFFpAzfH5pY86MARDa6as5ZNmG18mb/gC6MEahFV67V0xfMfTaNL4B8dQNzzcikLw==} peerDependencies: - vite-plugin-pwa: '>=0.16.5 <1' + vite-plugin-pwa: '>=0.17.2 <1' dependencies: - vite-plugin-pwa: 0.16.5(vite@4.5.0)(workbox-build@7.0.0)(workbox-window@7.0.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.3.1(vite@4.5.0)(vue@3.3.7): - resolution: {integrity: sha512-tUBEtWcF7wFtII7ayNiLNDTCE1X1afySEo+XNVMNkFXaThENyCowIEX095QqbJZGTgoOcSVDJGlnde2NG4jtbQ==} + /@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.5.0(@types/node@18.18.7)(sass@1.69.4) - vue: 3.3.7(typescript@5.2.2) + 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-v8@0.34.6(vitest@0.34.6): - resolution: {integrity: sha512-fivy/OK2d/EsJFoEoxHFEnNGTg+MmdZBAVK9Ka4qhXR2K3J0DS08vcGVwzDtXSuUMabLv4KtPcpSKkcMXFDViw==} + /@vitest/coverage-v8@1.0.1(vitest@1.0.1): + resolution: {integrity: sha512-Z4a7ig4VjUCT/P+LRB3IZrBRXb9xWRUM8rSBH9cKgfrU1Oe01/K2WJKtGshOnQwXZoSfQtwCGpbnHmB/qJwjcw==} peerDependencies: - vitest: '>=0.32.0 <1' + vitest: ^1.0.0 dependencies: '@ampproject/remapping': 2.2.1 '@bcoe/v8-coverage': 0.2.3 - istanbul-lib-coverage: 3.2.0 + 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 + std-env: 3.5.0 test-exclude: 6.0.0 - v8-to-istanbul: 9.1.3 - vitest: 0.34.6(@vitest/ui@0.34.6) + 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.34.6: - resolution: {integrity: sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==} + /@vitest/expect@1.0.1: + resolution: {integrity: sha512-3cdrb/eKD/0tygDX75YscuHEHMUJ70u3UoLSq2eqhWks57AyzvsDQbyn53IhZ0tBN7gA8Jj2VhXiOV2lef7thw==} dependencies: - '@vitest/spy': 0.34.6 - '@vitest/utils': 0.34.6 + '@vitest/spy': 1.0.1 + '@vitest/utils': 1.0.1 chai: 4.3.10 dev: true - /@vitest/runner@0.34.6: - resolution: {integrity: sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==} + /@vitest/runner@1.0.1: + resolution: {integrity: sha512-/+z0vhJ0MfRPT3AyTvAK6m57rzlew/ct8B2a4LMv7NhpPaiI2QLGyOBMB3lcioWdJHjRuLi9aYppfOv0B5aRQA==} dependencies: - '@vitest/utils': 0.34.6 - p-limit: 4.0.0 + '@vitest/utils': 1.0.1 + p-limit: 5.0.0 pathe: 1.1.1 dev: true - /@vitest/snapshot@0.34.6: - resolution: {integrity: sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==} + /@vitest/snapshot@1.0.1: + resolution: {integrity: sha512-wIPtPDGSxEZ+DpNMc94AsybX6LV6uN6sosf5TojyP1m2QbKwiRuLV/5RSsjt1oWViHsTj8mlcwrQQ1zHGO0fMw==} dependencies: magic-string: 0.30.5 pathe: 1.1.1 pretty-format: 29.7.0 dev: true - /@vitest/spy@0.34.6: - resolution: {integrity: sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==} + /@vitest/spy@1.0.1: + resolution: {integrity: sha512-yXwm1uKhBVr/5MhVeSmtNqK+0q2RXIchJt8kokEKdrWLtkPeDgdbZ6SjR1VQGZuNdWL6sSBnLayIyVvcS0qLfA==} dependencies: tinyspy: 2.2.0 dev: true - /@vitest/ui@0.34.6(vitest@0.34.6): - resolution: {integrity: sha512-/fxnCwGC0Txmr3tF3BwAbo3v6U2SkBTGR9UB8zo0Ztlx0BTOXHucE0gDHY7SjwEktCOHatiGmli9kZD6gYSoWQ==} + /@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.34.6 - fast-glob: 3.3.1 + '@vitest/utils': 1.0.1 + fast-glob: 3.3.2 fflate: 0.8.1 - flatted: 3.2.7 + flatted: 3.2.9 pathe: 1.1.1 picocolors: 1.0.0 sirv: 2.0.3 - vitest: 0.34.6(@vitest/ui@0.34.6) + vitest: 1.0.1(@types/node@18.18.7)(@vitest/ui@1.0.1) dev: true - /@vitest/utils@0.34.6: - resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==} + /@vitest/utils@1.0.1: + resolution: {integrity: sha512-MGPCHkzXbbAyscrhwGzh8uP1HPrTYLWaj1WTDtWSGrpe2yJWLRN9mF9ooKawr6NMOg9vTBtg2JqWLfuLC7Dknw==} dependencies: diff-sequences: 29.6.3 - loupe: 2.3.6 + loupe: 2.3.7 pretty-format: 29.7.0 dev: true @@ -2879,6 +2975,15 @@ packages: '@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: @@ -2887,12 +2992,34 @@ packages: estree-walker: 2.0.2 source-map-js: 1.0.2 + /@vue/compiler-dom@3.3.10: + resolution: {integrity: sha512-NCrqF5fm10GXZIK0GrEAauBqdy+F2LZRt3yNHzrYjpYBuRssQbuPLtSnSNjyR9luHKkWSH8we5LMB3g+4z2HvA==} + dependencies: + '@vue/compiler-core': 3.3.10 + '@vue/shared': 3.3.10 + dev: true + /@vue/compiler-dom@3.3.7: resolution: {integrity: sha512-0LwkyJjnUPssXv/d1vNJ0PKfBlDoQs7n81CbO6Q0zdL7H1EzqYRrTVXDqdBVqro0aJjo/FOa1qBAPVI4PGSHBw==} dependencies: '@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: @@ -2906,12 +3033,21 @@ packages: 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==} @@ -2936,6 +3072,16 @@ packages: vue-template-compiler: 2.7.15 dev: true + /@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.7: resolution: {integrity: sha512-APhRmLVbgE1VPGtoLQoWBJEaQk4V8JUsqrQihImVqKT+8U6Qi3t5ATcg4Y9wGAPb3kIhetpufyZ1RhwbZCIdDA==} dependencies: @@ -2944,17 +3090,41 @@ packages: '@vue/shared': 3.3.7 estree-walker: 2.0.2 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/runtime-core@3.3.7: resolution: {integrity: sha512-LHq9du3ubLZFdK/BP0Ysy3zhHqRfBn80Uc+T5Hz3maFJBGhci1MafccnL3rpd5/3wVfRHAe6c+PnlO2PAavPTQ==} dependencies: '@vue/reactivity': 3.3.7 '@vue/shared': 3.3.7 + dev: false + + /@vue/runtime-dom@3.3.10: + resolution: {integrity: sha512-c/jKb3ny05KJcYk0j1m7Wbhrxq7mZYr06GhKykDMNRRR9S+/dGT8KpHuNQjv3/8U4JshfkAk6TpecPD3B21Ijw==} + dependencies: + '@vue/runtime-core': 3.3.10 + '@vue/shared': 3.3.10 + csstype: 3.1.2 + dev: true /@vue/runtime-dom@3.3.7: resolution: {integrity: sha512-PFQU1oeJxikdDmrfoNQay5nD4tcPNYixUBruZzVX/l0eyZvFKElZUjW4KctCcs52nnpMGO6UDK+jF5oV4GT5Lw==} @@ -2962,6 +3132,17 @@ packages: '@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.7(vue@3.3.7): resolution: {integrity: sha512-UlpKDInd1hIZiNuVVVvLgxpfnSouxKQOSE2bOfQpBuGwxRV/JqqTCyyjXUWiwtVMyeRaZhOYYqntxElk8FhBhw==} @@ -2971,24 +3152,29 @@ packages: '@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.7: resolution: {integrity: sha512-N/tbkINRUDExgcPTBvxNkvHGu504k8lzlNQRITVnm6YjOjwa4r0nnbd4Jb01sNpur5hAllyRJzSK5PvB9PPwRg==} - /@vueuse/core@10.5.0(vue@3.3.7): - resolution: {integrity: sha512-z/tI2eSvxwLRjOhDm0h/SXAjNm8N5ld6/SC/JQs6o6kpJ6Ya50LnEL8g5hoYu005i28L0zqB5L5yAl8Jl26K3A==} + /@vueuse/core@10.7.0(vue@3.3.10): + resolution: {integrity: sha512-4EUDESCHtwu44ZWK3Gc/hZUVhVo/ysvdtwocB5vcauSV4B7NiGY5972WnsojB3vRNdxvAt7kzJWE2h9h7C9d5w==} dependencies: - '@types/web-bluetooth': 0.0.18 - '@vueuse/metadata': 10.5.0 - '@vueuse/shared': 10.5.0(vue@3.3.7) - vue-demi: 0.14.6(vue@3.3.7) + '@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.5.0(focus-trap@7.5.4)(vue@3.3.7): - resolution: {integrity: sha512-fm5sXLCK0Ww3rRnzqnCQRmfjDURaI4xMsx+T+cec0ngQqHx/JgUtm8G0vRjwtonIeTBsH1Q8L3SucE+7K7upJQ==} + /@vueuse/integrations@10.7.0(focus-trap@7.5.4)(vue@3.3.10): + resolution: {integrity: sha512-rxiMYgS+91n93qXpHZF9NbHhppWY6IJyVTDxt4acyChL0zZVx7P8FAAfpF1qVK8e4wfjerhpEiMJ0IZ1GWUZ2A==} peerDependencies: async-validator: '*' axios: '*' @@ -3028,23 +3214,23 @@ packages: universal-cookie: optional: true dependencies: - '@vueuse/core': 10.5.0(vue@3.3.7) - '@vueuse/shared': 10.5.0(vue@3.3.7) + '@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.7) + vue-demi: 0.14.6(vue@3.3.10) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true - /@vueuse/metadata@10.5.0: - resolution: {integrity: sha512-fEbElR+MaIYyCkeM0SzWkdoMtOpIwO72x8WsZHRE7IggiOlILttqttM69AS13nrDxosnDBYdyy3C5mR1LCxHsw==} + /@vueuse/metadata@10.7.0: + resolution: {integrity: sha512-GlaH7tKP2iBCZ3bHNZ6b0cl9g0CJK8lttkBNUX156gWvNYhTKEtbweWLm9rxCPIiwzYcr/5xML6T8ZUEt+DkvA==} dev: true - /@vueuse/shared@10.5.0(vue@3.3.7): - resolution: {integrity: sha512-18iyxbbHYLst9MqU1X1QNdMHIjks6wC7XTVf0KNOv5es/Ms6gjVFCAAWTVP2JStuGqydg3DT+ExpFORUEi9yhg==} + /@vueuse/shared@10.7.0(vue@3.3.10): + resolution: {integrity: sha512-kc00uV6CiaTdc3i1CDC4a3lBxzaBE9AgYNtFN87B5OOscqeWElj/uza8qVDmk7/U8JbqoONLbtqiLJ5LGRuqlw==} dependencies: - vue-demi: 0.14.6(vue@3.3.7) + vue-demi: 0.14.6(vue@3.3.10) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -3070,11 +3256,22 @@ packages: engines: {node: '>=0.4.0'} dev: true + /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: @@ -3202,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'} @@ -3211,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: @@ -3225,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 @@ -3312,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: @@ -3351,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'} @@ -3369,8 +3587,12 @@ 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 + + /ccount@2.0.1: + resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} dev: true /chai@4.3.10: @@ -3381,7 +3603,7 @@ packages: check-error: 1.0.3 deep-eql: 4.1.3 get-func-name: 2.0.2 - loupe: 2.3.6 + loupe: 2.3.7 pathval: 1.1.1 type-detect: 4.0.8 dev: true @@ -3402,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 @@ -3436,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: @@ -3490,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 @@ -3545,18 +3779,14 @@ packages: split2: 4.2.0 dev: true - /convert-source-map@1.9.0: - resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} - dev: true - /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@18.18.7)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.2.2): @@ -3714,6 +3944,15 @@ packages: 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'} @@ -3727,11 +3966,31 @@ 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} @@ -3775,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: @@ -3797,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: @@ -3843,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'} @@ -3852,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: @@ -3867,34 +4185,34 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild@0.18.20: - resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} + /esbuild@0.19.5: + resolution: {integrity: sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.18.20 - '@esbuild/android-arm64': 0.18.20 - '@esbuild/android-x64': 0.18.20 - '@esbuild/darwin-arm64': 0.18.20 - '@esbuild/darwin-x64': 0.18.20 - '@esbuild/freebsd-arm64': 0.18.20 - '@esbuild/freebsd-x64': 0.18.20 - '@esbuild/linux-arm': 0.18.20 - '@esbuild/linux-arm64': 0.18.20 - '@esbuild/linux-ia32': 0.18.20 - '@esbuild/linux-loong64': 0.18.20 - '@esbuild/linux-mips64el': 0.18.20 - '@esbuild/linux-ppc64': 0.18.20 - '@esbuild/linux-riscv64': 0.18.20 - '@esbuild/linux-s390x': 0.18.20 - '@esbuild/linux-x64': 0.18.20 - '@esbuild/netbsd-x64': 0.18.20 - '@esbuild/openbsd-x64': 0.18.20 - '@esbuild/sunos-x64': 0.18.20 - '@esbuild/win32-arm64': 0.18.20 - '@esbuild/win32-ia32': 0.18.20 - '@esbuild/win32-x64': 0.18.20 + '@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: @@ -4080,6 +4398,21 @@ packages: 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: resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} dev: true @@ -4110,6 +4443,17 @@ packages: merge2: 1.4.1 micromatch: 4.0.5 + /fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + 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 + dev: true + /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -4175,6 +4519,10 @@ packages: /flatted@3.2.7: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} + /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: @@ -4229,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 @@ -4247,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'} @@ -4257,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 @@ -4271,10 +4633,6 @@ packages: engines: {node: 6.* || 8.* || >= 10.*} dev: true - /get-func-name@2.0.0: - resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} - dev: true - /get-func-name@2.0.2: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} dev: true @@ -4288,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 @@ -4296,6 +4663,11 @@ packages: 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: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} engines: {node: '>= 0.4'} @@ -4431,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'} @@ -4455,6 +4833,95 @@ 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 @@ -4475,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 @@ -4488,6 +4959,11 @@ packages: 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: resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} engines: {node: '>=14'} @@ -4556,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 @@ -4618,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'} @@ -4733,7 +5224,6 @@ packages: /is-stream@3.0.0: resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: false /is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} @@ -4774,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: @@ -4792,11 +5289,15 @@ packages: 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 @@ -4804,7 +5305,7 @@ packages: resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} engines: {node: '>=10'} dependencies: - istanbul-lib-coverage: 3.2.0 + istanbul-lib-coverage: 3.2.2 make-dir: 4.0.0 supports-color: 7.2.0 dev: true @@ -4814,7 +5315,7 @@ packages: engines: {node: '>=10'} dependencies: debug: 4.3.4 - istanbul-lib-coverage: 3.2.0 + istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: - supports-color @@ -4837,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 @@ -4982,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: @@ -5059,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: @@ -5105,6 +5609,14 @@ packages: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 + /magicast@0.3.2: + resolution: {integrity: sha512-Fjwkl6a0syt9TFN0JSYpOybxiMCkYNEeOTnOTNRbjphirLakznZXAqrXgj/7GG3D1dvETONNwrBfinvAbpunDg==} + dependencies: + '@babel/parser': 7.23.5 + '@babel/types': 7.23.5 + source-map-js: 1.0.2 + dev: true + /make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} @@ -5148,6 +5660,19 @@ 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 @@ -5198,6 +5723,33 @@ packages: 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: @@ -5221,7 +5773,6 @@ packages: /mimic-fn@4.0.0: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} - dev: false /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} @@ -5272,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: @@ -5284,7 +5835,7 @@ packages: /mlly@1.4.2: resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==} dependencies: - acorn: 8.10.0 + acorn: 8.11.2 pathe: 1.1.1 pkg-types: 1.0.3 ufo: 1.3.1 @@ -5306,6 +5857,13 @@ packages: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + 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==} @@ -5322,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: @@ -5361,12 +5919,15 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: path-key: 4.0.0 - dev: false /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'} @@ -5382,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: @@ -5398,7 +5969,6 @@ packages: engines: {node: '>=12'} dependencies: mimic-fn: 4.0.0 - dev: false /open@9.1.0: resolution: {integrity: sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==} @@ -5450,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 @@ -5507,6 +6077,12 @@ packages: lines-and-columns: 1.2.4 dev: true + /parse5@7.1.2: + resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} + dependencies: + entities: 4.5.0 + dev: true + /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -5522,7 +6098,6 @@ packages: /path-key@4.0.0: resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} engines: {node: '>=12'} - dev: false /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -5582,6 +6157,16 @@ packages: 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==} @@ -5638,6 +6223,10 @@ packages: react-is: 18.2.0 dev: true + /property-information@6.4.0: + resolution: {integrity: sha512-9t5qARVofg2xQqKtytzt+lZ4d1Qvj8t5B8fEwXK6qOfgRLgH/b13QlgEyDh033NOS31nXeFbYv7CLUDG1CeifQ==} + dev: true + /pseudomap@1.0.2: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} dev: true @@ -5646,6 +6235,11 @@ packages: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} + /punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + dev: true + /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -5717,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 @@ -5732,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: @@ -5747,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 @@ -5799,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 @@ -5812,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'} @@ -5836,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: @@ -5848,15 +6464,27 @@ packages: engines: {node: '>=10.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true - /rollup@3.29.4: - resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} - 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 + '@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: @@ -5871,6 +6499,16 @@ packages: 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 @@ -5901,8 +6539,8 @@ packages: resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==} dev: true - /search-insights@2.9.0: - resolution: {integrity: sha512-bkWW9nIHOFkLwjQ1xqVaMbjjO5vhP26ERsH9Y3pKr8imthofEFIxlnOabkmGcw6ksRj9jWidcI65vvjJH/nTGg==} + /search-insights@2.11.0: + resolution: {integrity: sha512-Uin2J8Bpm3xaZi9Y8QibSys6uJOFZ+REMrf42v20AA3FUDUrshKkMEP6liJbMAHCm71wO6ls4mwAf7a3gFVxLw==} dev: true /semver@5.7.1: @@ -5910,8 +6548,8 @@ packages: hasBin: true dev: true - /semver@6.3.0: - resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + /semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true dev: true @@ -5932,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'} @@ -5963,13 +6620,16 @@ packages: vscode-textmate: 8.0.0 dev: true - /shiki@0.14.5: - resolution: {integrity: sha512-1gCAYOcmCFONmErGTrS1fjzJLA7MGZmKzrBNX7apqSwhyITJg2O102uFzXUeBxNnEkDA9vHIKLyeKq0V083vIw==} + /shikiji-transformers@0.7.6: + resolution: {integrity: sha512-yTp+7JMD/aXbV9ndn14eo9IK/UNt8iDsLNyqlOmCtcldlkqWE9T2YKAlOHOTVaeDfYWUWZa2EgSXb/CBfepBrw==} dependencies: - ansi-sequence-parser: 1.1.0 - jsonc-parser: 3.2.0 - vscode-oniguruma: 1.7.0 - vscode-textmate: 8.0.0 + 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: @@ -5992,6 +6652,11 @@ packages: 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'} @@ -6057,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: @@ -6105,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: @@ -6138,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 @@ -6160,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: @@ -6168,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: @@ -6176,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'} @@ -6221,7 +6923,6 @@ packages: /strip-final-newline@3.0.0: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} - dev: false /strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} @@ -6234,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.10.0 + acorn: 8.11.2 dev: true /supports-color@5.5.0: @@ -6290,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.10.0 + '@jridgewell/source-map': 0.3.5 + acorn: 8.11.2 commander: 2.20.3 source-map-support: 0.5.21 dev: true @@ -6328,12 +7029,12 @@ packages: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} 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.7.0: - resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==} + /tinypool@0.8.1: + resolution: {integrity: sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg==} engines: {node: '>=14.0.0'} dev: true @@ -6376,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: @@ -6555,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: @@ -6642,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'} @@ -6658,6 +7426,11 @@ 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'} @@ -6668,13 +7441,13 @@ packages: 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 @@ -6692,11 +7465,11 @@ packages: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true - /v8-to-istanbul@9.1.3: - resolution: {integrity: sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==} + /v8-to-istanbul@9.2.0: + resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} engines: {node: '>=10.12.0'} dependencies: - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.20 '@types/istanbul-lib-coverage': 2.0.5 convert-source-map: 2.0.0 dev: true @@ -6713,17 +7486,38 @@ packages: engines: {node: '>= 0.10'} dev: true - /vite-node@0.34.6(@types/node@18.18.7): - resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} - 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.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) + vite: 5.0.5(@types/node@18.18.7)(sass@1.69.4) transitivePeerDependencies: - '@types/node' - less @@ -6735,8 +7529,8 @@ packages: - terser dev: true - /vite-plugin-dts@3.6.1(@types/node@18.18.7)(typescript@5.2.2)(vite@4.5.0): - resolution: {integrity: sha512-Juy5qsDVxag9p0seSjkcdXnAkTfI9WtYcP9ccJbxZlavtK5nGY17ViqjuKpj0+qk+003PPcC6j/CIV/KIorlAg==} + /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: typescript: '*' @@ -6751,7 +7545,7 @@ packages: debug: 4.3.4 kolorist: 1.8.0 typescript: 5.2.2 - vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) + 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' @@ -6759,25 +7553,25 @@ packages: - supports-color dev: true - /vite-plugin-pwa@0.16.5(vite@4.5.0)(workbox-build@7.0.0)(workbox-window@7.0.0): - resolution: {integrity: sha512-Ahol4dwhMP2UHPQXkllSlXbihOaDFnvBIDPmAxoSZ1EObBUJGP4CMRyCyAVkIHjd6/H+//vH0DM2ON+XxHr81g==} + /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 + 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.3.1 + fast-glob: 3.3.2 pretty-bytes: 6.1.1 - vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) + vite: 5.0.5(@types/node@18.18.7)(sass@1.69.4) workbox-build: 7.0.0 workbox-window: 7.0.0 transitivePeerDependencies: - supports-color dev: true - /vite-tsconfig-paths@4.2.1(typescript@5.2.2)(vite@4.5.0): + /vite-tsconfig-paths@4.2.1(typescript@5.2.2)(vite@5.0.5): resolution: {integrity: sha512-GNUI6ZgPqT3oervkvzU+qtys83+75N/OuDaQl7HmOqFTb0pjZsuARrRipsyJhJ3enqV8beI1xhGbToR4o78nSQ==} peerDependencies: vite: '*' @@ -6788,18 +7582,18 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.1(typescript@5.2.2) - vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) + vite: 5.0.5(@types/node@18.18.7)(sass@1.69.4) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.5.0(@types/node@18.18.7)(sass@1.69.4): - resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} - 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: '*' @@ -6823,16 +7617,16 @@ packages: optional: true dependencies: '@types/node': 18.18.7 - esbuild: 0.18.20 - postcss: 8.4.31 - rollup: 3.29.4 + 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 - /vitepress@1.0.0-rc.24(@algolia/client-search@4.20.0)(@types/node@18.18.7)(sass@1.69.4)(search-insights@2.9.0)(typescript@5.2.2): - resolution: {integrity: sha512-RpnL8cnOGwiRlBbrYQUm9sYkJbtyOt/wYXk2diTcokY4yvks/5lq9LuSt+MURWB6ZqwpSNHvTmxgaSfLoG0/OA==} + /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: markdown-it-mathjax3: ^4.3.2 @@ -6844,18 +7638,20 @@ packages: optional: true dependencies: '@docsearch/css': 3.5.2 - '@docsearch/js': 3.5.2(@algolia/client-search@4.20.0)(search-insights@2.9.0) - '@types/markdown-it': 13.0.5 - '@vitejs/plugin-vue': 4.3.1(vite@4.5.0)(vue@3.3.7) + '@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.5.0(vue@3.3.7) - '@vueuse/integrations': 10.5.0(focus-trap@7.5.4)(vue@3.3.7) + '@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.5 - vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) - vue: 3.3.7(typescript@5.2.2) + 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' @@ -6884,34 +7680,34 @@ packages: - universal-cookie dev: true - /vitest-fetch-mock@0.2.2(vitest@0.34.6): + /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.34.6(@vitest/ui@0.34.6) + vitest: 1.0.1(@types/node@18.18.7)(@vitest/ui@1.0.1) transitivePeerDependencies: - encoding dev: true - /vitest@0.34.6(@vitest/ui@0.34.6): - resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==} - 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': @@ -6920,37 +7716,29 @@ 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': 18.18.7 - '@vitest/expect': 0.34.6 - '@vitest/runner': 0.34.6 - '@vitest/snapshot': 0.34.6 - '@vitest/spy': 0.34.6 - '@vitest/ui': 0.34.6(vitest@0.34.6) - '@vitest/utils': 0.34.6 - acorn: 8.10.0 - acorn-walk: 8.2.0 + '@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.10 debug: 4.3.4 - local-pkg: 0.4.3 + 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.7.0 - vite: 4.5.0(@types/node@18.18.7)(sass@1.69.4) - vite-node: 0.34.6(@types/node@18.18.7) + 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 @@ -6970,7 +7758,7 @@ packages: resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} dev: true - /vue-demi@0.14.6(vue@3.3.7): + /vue-demi@0.14.6(vue@3.3.10): resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} engines: {node: '>=12'} hasBin: true @@ -6982,7 +7770,7 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.3.7(typescript@5.2.2) + vue: 3.3.10(typescript@5.2.2) dev: true /vue-template-compiler@2.7.15: @@ -7004,6 +7792,22 @@ packages: 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.7(typescript@5.2.2): resolution: {integrity: sha512-YEMDia1ZTv1TeBbnu6VybatmSteGOS3A3YgfINOfraCbf85wdKHzscD6HSS/vB4GAtI7sa1XPX7HcQaJ1l24zA==} peerDependencies: @@ -7018,6 +7822,7 @@ packages: '@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==} @@ -7025,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 @@ -7070,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'} @@ -7123,10 +7943,10 @@ packages: 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 @@ -7374,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 From a766855335e6df10465b84fff29e168fb8d9060e Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 00:36:41 -0600 Subject: [PATCH 54/93] chore: update .gitignore file --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) 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 From ce82c4b6873168f91d5c52bf625e42ad80b8249f Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 00:40:58 -0600 Subject: [PATCH 55/93] chore(pkg): update vite config, move coverage to .vitest/dist/coverage --- .github/workflows/coverage.yml | 2 +- packages/lib/tsconfig.json | 5 ++++- packages/lib/vite.config.ts | 29 +++++++++++++++++------------ 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index d1befef0..c194447c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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/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 31ce60fc..95fc95cb 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,9 @@ export default defineConfig({ tsconfigPaths(), dts({ entryRoot: './src', - outputDir: './dist/types', + outDir: './dist/types', insertTypesEntry: true, + exclude: ['**/__tests__/**/*', 'node_modules/**'], }), ], resolve: { @@ -40,35 +42,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: '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}'], }, }) From 5292e630bef14e9adfb8238696b2d0c50068fd3a Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 00:41:50 -0600 Subject: [PATCH 56/93] chore(config): typedoc-config correctly exclude files --- config/typedoc-config/typedoc-config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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, From aaf731b2d6c1b1acdb37227b4c6bc060e5d07ba4 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 00:46:38 -0600 Subject: [PATCH 57/93] typedocs: fix and add @module and @category jsdoc comments --- packages/lib/src/api/vpic/endpoints/DecodeVin.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/DecodeVinValuesBatch.ts | 4 ++-- .../lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/DecodeWMI.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetAllMakes.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts | 4 ++-- .../api/vpic/endpoints/GetCanadianVehicleSpecifications.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetMakeForManufacturer.ts | 4 ++-- .../src/api/vpic/endpoints/GetMakesForManufacturerAndYear.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetMakesForVehicleType.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetManufacturerDetails.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetModelsForMake.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetModelsForMakeId.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetModelsForMakeIdYear.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetModelsForMakeYear.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetParts.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMake.ts | 4 ++-- .../lib/src/api/vpic/endpoints/GetVehicleTypesForMakeId.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts | 4 ++-- .../src/api/vpic/endpoints/GetVehicleVariableValuesList.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/GetWMIsForManufacturer.ts | 4 ++-- packages/lib/src/api/vpic/endpoints/index.ts | 2 +- packages/lib/src/api/vpic/index.ts | 2 +- 26 files changed, 50 insertions(+), 50 deletions(-) diff --git a/packages/lib/src/api/vpic/endpoints/DecodeVin.ts b/packages/lib/src/api/vpic/endpoints/DecodeVin.ts index 102df463..77e0ea8f 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts b/packages/lib/src/api/vpic/endpoints/DecodeVinExtended.ts index 7ee80078..b4576218 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts b/packages/lib/src/api/vpic/endpoints/DecodeVinValues.ts index 581a2863..cba668b9 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/DecodeVinValuesBatch.ts b/packages/lib/src/api/vpic/endpoints/DecodeVinValuesBatch.ts index 5391a73c..11424fa8 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts b/packages/lib/src/api/vpic/endpoints/DecodeVinValuesExtended.ts index 3b3a084e..bfc1eeb0 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/DecodeWMI.ts b/packages/lib/src/api/vpic/endpoints/DecodeWMI.ts index 6cf20e0c..677533da 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts b/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts index f9eed495..a5f54314 100644 --- a/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts +++ b/packages/lib/src/api/vpic/endpoints/GetAllMakes.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetAllMakes - * @category API Endpoints + * @module api/vpic/endpoints/GetAllMakes + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' diff --git a/packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts b/packages/lib/src/api/vpic/endpoints/GetAllManufacturers.ts index 828d43ad..4dd6e9c2 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetCanadianVehicleSpecifications.ts b/packages/lib/src/api/vpic/endpoints/GetCanadianVehicleSpecifications.ts index e7162123..35b84896 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts b/packages/lib/src/api/vpic/endpoints/GetEquipmentPlantCodes.ts index 912ffb81..80d91281 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetMakeForManufacturer.ts b/packages/lib/src/api/vpic/endpoints/GetMakeForManufacturer.ts index f0bba5be..fbdeb6a8 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetMakesForManufacturerAndYear.ts b/packages/lib/src/api/vpic/endpoints/GetMakesForManufacturerAndYear.ts index 952fd2f4..ee2245ec 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetMakesForVehicleType.ts b/packages/lib/src/api/vpic/endpoints/GetMakesForVehicleType.ts index c6acf0d7..f9ab6225 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetManufacturerDetails.ts b/packages/lib/src/api/vpic/endpoints/GetManufacturerDetails.ts index c0138823..dbd9d1b9 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetModelsForMake.ts b/packages/lib/src/api/vpic/endpoints/GetModelsForMake.ts index f8b57c07..ed6f7aa5 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetModelsForMakeId.ts b/packages/lib/src/api/vpic/endpoints/GetModelsForMakeId.ts index 096be823..8f3c8e51 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetModelsForMakeIdYear.ts b/packages/lib/src/api/vpic/endpoints/GetModelsForMakeIdYear.ts index 7b6b9536..3a66736a 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetModelsForMakeYear.ts b/packages/lib/src/api/vpic/endpoints/GetModelsForMakeYear.ts index 8e250d65..e28f59d4 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetParts.ts b/packages/lib/src/api/vpic/endpoints/GetParts.ts index 7142abca..1ffbbfe7 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMake.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMake.ts index 108bf948..1c5d4d15 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMakeId.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleTypesForMakeId.ts index e52e64a5..0ca04257 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts index ccffc90d..acc29cb1 100644 --- a/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts +++ b/packages/lib/src/api/vpic/endpoints/GetVehicleVariableList.ts @@ -1,6 +1,6 @@ /** - * @module api/endpoints/GetVehicleVariableList - * @category API Endpoints + * @module api/vpic/endpoints/GetVehicleVariableList + * @category API - VPIC (VIN Decoding) */ import { useNHTSA } from '@/api' diff --git a/packages/lib/src/api/vpic/endpoints/GetVehicleVariableValuesList.ts b/packages/lib/src/api/vpic/endpoints/GetVehicleVariableValuesList.ts index 88d985fc..ba38a4e0 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/GetWMIsForManufacturer.ts b/packages/lib/src/api/vpic/endpoints/GetWMIsForManufacturer.ts index 8f91b807..feb04141 100644 --- a/packages/lib/src/api/vpic/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' diff --git a/packages/lib/src/api/vpic/endpoints/index.ts b/packages/lib/src/api/vpic/endpoints/index.ts index 850094ec..1b9fc4ec 100644 --- a/packages/lib/src/api/vpic/endpoints/index.ts +++ b/packages/lib/src/api/vpic/endpoints/index.ts @@ -1,6 +1,6 @@ /** * @module api/vpic/endpoints - * @category API Endpoints + * @category API - VPIC (VIN Decoding) */ export { DecodeVin } from './DecodeVin' diff --git a/packages/lib/src/api/vpic/index.ts b/packages/lib/src/api/vpic/index.ts index f65cbee4..0187d183 100644 --- a/packages/lib/src/api/vpic/index.ts +++ b/packages/lib/src/api/vpic/index.ts @@ -1,6 +1,6 @@ /** * @module api/vpic - * @category VPIC API (VIN decoding) + * @category API - VPIC (VIN Decoding) */ export * from './endpoints' From 71f698afe1aff731e58fa698cf7815bd82a882c5 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 00:55:18 -0600 Subject: [PATCH 58/93] refactor(useNHTSA): add functionality to support NHTSA APIs other than VPIC --- .../lib/src/api/__tests__/useNHTSA.test.ts | 805 ++++++++++++------ packages/lib/src/api/types.ts | 104 ++- packages/lib/src/api/useNHTSA.ts | 224 ++--- packages/lib/src/constants.ts | 15 +- 4 files changed, 758 insertions(+), 390 deletions(-) diff --git a/packages/lib/src/api/__tests__/useNHTSA.test.ts b/packages/lib/src/api/__tests__/useNHTSA.test.ts index 5bbf9fb3..5ca93cb6 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/`) + }) }) /*********************** - * 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/types.ts b/packages/lib/src/api/types.ts index 23c85a69..afbdd194 100644 --- a/packages/lib/src/api/types.ts +++ b/packages/lib/src/api/types.ts @@ -3,21 +3,101 @@ * @category Types */ -export * from './endpoints/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 '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 '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 '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..25726c96 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,36 @@ 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 + + let { 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') } + if (apiType !== 'vpic') includeQueryString = false + 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 +175,17 @@ 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. + * + * For example, `NhtsaResponse` has a `Results` key, which + * contains an array of `DecodeVinResults` objects. * - * _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. + * 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,76 @@ 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 and return it */ + const data = await response.json() if (!data) { - throw Error(`VPIC API returned no data, got ${responseDetails}`) + throw Error(`API returned no data, response was: ${responseDetails}`) } else 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 +368,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 +384,7 @@ export const useNHTSA = () => { url = getTypeof(url) === 'string' ? url : getCachedUrl() + /* Validate url, RequestInit options, and options.body is a string */ catchInvalidArguments({ args: [ { @@ -371,16 +397,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/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' From 969aff22782b255077f2d9a59d5a76c7fbed2ffd Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 00:57:49 -0600 Subject: [PATCH 59/93] refactor(argHandler): add functionality to validate values required by other values --- .../src/utils/__tests__/argHandler.test.ts | 1208 +++++++++-------- packages/lib/src/utils/argHandler.ts | 177 ++- 2 files changed, 799 insertions(+), 586 deletions(-) diff --git a/packages/lib/src/utils/__tests__/argHandler.test.ts b/packages/lib/src/utils/__tests__/argHandler.test.ts index 2d178069..b1f6e760 100644 --- a/packages/lib/src/utils/__tests__/argHandler.test.ts +++ b/packages/lib/src/utils/__tests__/argHandler.test.ts @@ -1,652 +1,778 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { describe, expect, it } from 'vitest' +import { describe, expect, it, test } from 'vitest' import { catchInvalidArguments, validateArgument } from '../argHandler' -describe('argHandler.ts - exports', () => { - it('catchInvalidArguments function', () => { +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() - }) - }) - - 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( - validateArgument({ - name: 'test', - value: () => 'this is a function', - required: true, - }) - ).toEqual(true) - }) - - it('returns true when value is empty array', () => { - expect( - validateArgument({ - name: 'test', - value: [], - required: true, - }) - ).toEqual(true) - }) - - it('returns true when value is empty object', () => { - expect( - validateArgument({ - name: 'test', - value: {}, - required: true, - }) - ).toEqual(true) - }) - - /**************** - * Throws Error - ****************/ - it('throws error when value is undefined', () => { +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([ + '', + 'string', + 123, + 1234n, + 0, + -0, + 0n, + [], + ['1', '2', '3'], + () => 'a function', + true, + false, + null, + undefined, + NaN, + new Date(), + new String(), + new Error(), + ])('argData: %s', (argData) => { expect(() => - validateArgument({ - name: 'test', - value: undefined, - required: true, - }) - ).toThrowError() + 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/ + ) }) + }) - it('throws error when value is null', () => { + describe('argData.name is undefined or 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(), + ])('argData.name: %s', (name) => { expect(() => validateArgument({ - name: 'test', - value: null, - required: true, + // @ts-expect-error Type 'x' is not assignable to type 'string'. + name, + value: 'some string', }) - ).toThrowError() + ).toThrowError(/'argData.name', is required and must be of type string/) }) + }) - it('throws error when value is empty string', () => { + describe('argData.required is defined and is not a boolean:', () => { + test.each([ + 'string', + 123, + 1234n, + 0, + -0, + 0n, + [], + ['1', '2', '3'], + {}, + { a: '1', b: '2', c: '3' }, + () => 'a function', + null, + NaN, + new Date(), + new String(), + new Object(), + ])('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, }) - ).toThrowError() + ).toThrowError(/'argData.required' must be of type boolean if provided/) }) }) - describe('only types', () => { - /**************** - * 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'], - }) - ).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'], - }) - ).toEqual(true) - }) - - it('returns true with empty array when tested against type array', () => { - expect( - validateArgument({ - name: 'test', - value: [], - types: ['array'], - }) - ).toEqual(true) - }) - - it('returns true with empty object when tested against type object', () => { - expect( - validateArgument({ - name: 'test', - value: {}, - types: ['object'], - }) - ).toEqual(true) - }) - - /**************** - * Throws Error - ****************/ - it('throws error when types do not match and value is defined', () => { - expect(() => - validateArgument({ - name: 'test', - value: null, - types: ['string'], - }) - ).toThrowError() - + describe('argData.requiredBy is defined and is not an array of length > 0:', () => { + test.each([ + 'string', + 123, + 1234n, + [], + {}, + { a: '1', b: '2', c: '3' }, + () => 'a function', + true, + new Date(), + new String(), + ])('argData.requiredBy: %s', (requiredBy) => { expect(() => validateArgument({ name: 'test', - value: 123, - types: ['string'], + value: 'some string', + // @ts-expect-error Type 'x' is not assignable to type ... + requiredBy, }) - ).toThrowError() - - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - types: ['number', 'object'], - }) - ).toThrowError() + ).toThrowError( + /'argData.requiredBy' must be an arrry of objects if provided/ + ) }) + }) - it('throws error when types array is empty', () => { + describe('argData.requiredBy.value is defined and argData.requiredBy.name 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(), + ])('argData.requiredBy.name: %s', (requiredByName) => { expect(() => validateArgument({ name: 'test', - value: ['1', '2', '3'], - types: [] as any, + value: 'defined value', + requiredBy: [ + { + // @ts-expect-error Type 'x' is not assignable to type 'string'. + name: requiredByName, + value: 1234, + }, + ], }) - ).toThrowError() + ).toThrowError( + /'argData.requiredBy' requires both a name and value if value is defined/ + ) }) + }) - it('throws error when types is not an array', () => { - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - types: 'string' as any, - }) - ).toThrowError() - + describe('argData.types is defined and is not an array of strings with length > 0:', () => { + test.each([ + 123, + 'string', + true, + {}, + [], + [undefined], + [null], + [1234], + [true], + [{}], + ['string', 1234], + () => 'a function', + 1234n, + new Date(), + new String(), + new Object(), + ])('argData.types: %s', (types) => { expect(() => validateArgument({ name: 'test', - value: ['1', '2', '3'], - types: { a: '1' } as any, + 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/ + ) }) }) + }) - describe('required and types', () => { + describe('argument validation logic', () => { + describe('if argData.required: true', () => { /**************** - * Returns True + * 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'], + describe('returns true - if argData.value is defined or "truthy":', () => { + const testValues = [ + 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(), + ] + + describe('returns true - errorMode: "error" (default)', () => { + test.each(testValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + required: true, + }) + ).toEqual(true) }) - ).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 - errorMode: "boolean"', () => { + test.each(testValues)('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: [], - required: true, - types: ['array'], + /******************************** + * Throws Error or Returns False + ********************************/ + describe('throws error or returns false - if argData.value is undefined or "falsey"', () => { + const testValues = ['', undefined, false, null, NaN, 0, -0, 0n] + + describe('throws error - errorMode: "error" (default)', () => { + test.each(testValues)('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: {}, - required: true, - types: ['object'], + describe('returns false - errorMode: "boolean":', () => { + test.each(testValues)('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 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'], + describe('returns true - if argData.value is undefined because type match will be skipped', () => { + const testValues = ['', new String(), undefined] + + describe('returns true - errorMode: "error" (default)', () => { + test.each(testValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + types: ['string'], + }) + ).toEqual(true) }) - ).toThrowError() - }) + }) - it('throws error with empty string when tested against type string', () => { - expect(() => - validateArgument({ - name: 'test', - value: '', - required: true, - types: ['string'], + describe('returns true - errorMode: "boolean"', () => { + test.each(testValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + types: ['string'], + errorMode: 'boolean', + }) + ).toEqual(true) }) - ).toThrowError() + }) }) - it('throws error when type of value does not match', () => { - expect(() => - validateArgument({ - name: 'test', - value: 123, - required: true, - types: ['array'], - }) - ).toThrowError() - - expect(() => - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - required: true, - types: ['number', 'string', 'object'], + describe('returns true - if typeof argData.value matches at least one type:', () => { + const testValues: [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']], + [undefined, ['string', 'number', 'boolean', 'undefined']], + [null, ['string', 'number', 'boolean', 'undefined', 'null']], + [() => 'a function', ['string', 'number', 'function']], + ] + + describe('returns true - errorMode: "error" (default)', () => { + test.each(testValues)('typeof "%s" = %s', (value, types) => { + expect( + validateArgument({ + name: 'test', + value, + types, + }) + ).toEqual(true) }) - ).toThrowError() - }) - }) - }) - - describe('errorMode: "boolean"', () => { - describe('only required', () => { - /**************** - * 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', + describe('returns true - errorMode: "boolean"', () => { + test.each(testValues)('typeof "%s" = %s', (value, types) => { + expect( + validateArgument({ + name: 'test', + value, + types, + errorMode: 'boolean', + }) + ).toEqual(true) }) - ).toEqual(false) + }) }) - it('returns false when value is null', () => { - expect( - validateArgument({ - name: 'test', - value: null, - required: true, - errorMode: 'boolean', + /******************************** + * Throws Error or Returns False + ********************************/ + describe('throws error or returns false - if typeof argData.value does not match at least one type:', () => { + const testValues: [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('throws error - errorMode: "error" (default)', () => { + test.each(testValues)('typeof "%s" != type(s) %s', (value, types) => { + expect(() => + validateArgument({ + name: 'testValue', + value, + types, + }) + ).toThrowError( + /error validating argument named "testValue", must be of type\(s\)/ + ) }) - ).toEqual(false) - }) + }) - it('returns false when value is empty string', () => { - expect( - validateArgument({ - name: 'test', - value: '', - required: true, - errorMode: 'boolean', + describe('returns false - errorMode: "boolean"', () => { + test.each(testValues)('typeof "%s" != type(s) %s', (value, types) => { + expect( + validateArgument({ + name: 'testValue', + value, + types, + errorMode: 'boolean', + }) + ).toEqual(false) }) - ).toEqual(false) + }) }) }) - describe('only types', () => { + describe('if argData.required: true && argData.types is defined', () => { /**************** - * Returns true - * - same as default mode - ****************/ - - /**************** - * Returns false + * Returns True ****************/ - it('returns false when types do not match and value is defined', () => { - expect( - validateArgument({ - name: 'test', - value: null, - types: ['string'], - errorMode: 'boolean', + describe('returns true - if argData.value is defined and matches at least one type:', () => { + const testValues: [unknown, string[]][] = [ + /* match single type */ + ['string', ['string']], + [123, ['number']], + [true, ['boolean']], + [() => 'a function', ['function']], + [1234n, ['bigint']], + [{ a: '1', b: '2', c: '3' }, ['object']], + [['1', '2', '3'], ['array']], + [[], ['array']], + [{}, ['object']], + [new Date(), ['date']], + [new String(), ['string']], + [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']], + [() => 'a function', ['string', 'number', 'function']], + ] + + describe('returns true - errorMode: "error" (default)', () => { + test.each(testValues)('typeof "%s" === %s', (value, types) => { + expect( + validateArgument({ + name: 'test', + value, + required: true, + types, + }) + ).toEqual(true) }) - ).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 true - errorMode: "boolean"', () => { + test.each(testValues)('typeof "%s" === %s', (value, types) => { + expect( + validateArgument({ + name: 'test', + value, + required: true, + types, + errorMode: 'boolean', + }) + ).toEqual(true) }) - ).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', - }) - ).toThrowError() - }) + describe('throws error or returns false - if typeof argData.value does not match at least one type:', () => { + const testValues: [unknown, string[]][] = [ + /* mis-match single type */ + [123, ['string']], + [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']], + /* mis-match multiple types */ + [{}, ['string', 'number']], + [123, ['string', 'boolean']], + [true, ['string', 'number']], + [null, ['string', 'number', 'boolean', 'undefined']], + [() => 'a function', ['string', 'number', 'boolean']], + ] + + describe('throws error - errorMode: "error" (default)', () => { + test.each(testValues)( + 'typeof "%s" !== type(s) %s', + (value, types) => { + expect(() => + validateArgument({ + name: 'testValue', + value, + required: true, + types, + }) + ).toThrowError( + /error validating argument named "testValue", is required and must be of type\(s\)/ + ) + } + ) + }) - 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', - }) - ).toThrowError() + describe('returns false - errorMode: "boolean"', () => { + test.each(testValues)( + 'typeof "%s" !== type(s) %s', + (value, types) => { + expect( + validateArgument({ + name: 'testValue', + value, + required: true, + types, + errorMode: 'boolean', + }) + ).toEqual(false) + } + ) + }) }) }) - describe('required and types', () => { + describe('if argData.requiredBy is defined', () => { /**************** * 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', + describe('returns true - if argData.value is defined when requiredBy another defined value:', () => { + const testValues = [ + 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(), + ] + + describe('returns true - errorMode: "error" (default)', () => { + it.each(testValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + requiredBy: [{ name: 'test2', value: 'string' }], + }) + ).toEqual(true) }) - ).toBe(false) - }) + }) - it('returns false if value is null', () => { - expect( - validateArgument({ - name: 'test', - value: null, - required: true, - types: ['string'], - errorMode: 'boolean', + describe('returns true - errorMode: "boolean"', () => { + it.each(testValues)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + requiredBy: [{ name: 'test2', value: 'string' }], + errorMode: 'boolean', + }) + ).toEqual(true) }) - ).toBe(false) + }) }) - it('returns false with empty string when tested against type string', () => { - expect( - validateArgument({ - name: 'test', - value: '', - required: true, - types: ['string'], - errorMode: 'boolean', + /******************************** + * Throws Error or Returns False + *******************************/ + describe('throws error or returns false - if argData.value is undefined when requiredBy another defined value', () => { + const testValues = [undefined, false, null, '', NaN, 0, -0, 0n] + + describe('throws error - errorMode: "error" (default)', () => { + test.each([testValues])('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) - }) + }) - it('returns false when type of value does not match', () => { - expect( - validateArgument({ - name: 'test', - value: 123, - required: true, - types: ['array'], - errorMode: 'boolean', + describe('returns false - errorMode: "boolean"', () => { + test.each([testValues])('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + requiredBy: [{ name: 'test2', value: 132 }], + errorMode: 'boolean', + }) + ).toEqual(false) }) - ).toBe(false) - - expect( - validateArgument({ - name: 'test', - value: ['1', '2', '3'], - required: true, - types: ['number', 'string', 'object'], - errorMode: 'boolean', - }) - ).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', - }) - ).toThrowError() - }) + describe('throws error or returns false - if argData.value is required but undefined when requiredBy another defined value', () => { + const testValues = [undefined, false, null, '', NaN, 0, -0, 0n] - 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', + describe('throws error - errorMode: "error" (default)', () => { + test.each(testValues)('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() - 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)('argData.value: %s', (value) => { + expect( + validateArgument({ + name: 'test', + value, + required: true, + requiredBy: [{ name: 'test2', value: 132 }], + 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([ + '', + 'string', + 123, + 1234n, + 0, + -0, + 0n, + [], + ['1', '2', '3'], + () => 'a function', + true, + false, + null, + undefined, + NaN, + new Date(), + new String(), + new Error(), + ])('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([ + '', + 'string', + 123, + 1234n, + 0, + -0, + 0n, + [], + () => 'a function', + true, + false, + null, + undefined, + NaN, + new Date(), + new String(), + new Error(), + ])('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'] }, @@ -662,7 +788,7 @@ describe('catchInvalidArguments', () => { /**************** * Throws Error ****************/ - it('throws error if validation fails', () => { + test('throws error if validation fails', () => { expect(() => catchInvalidArguments({ args: [ @@ -674,7 +800,7 @@ describe('catchInvalidArguments', () => { }, ], }) - ).toThrowError() + ).toThrowError(/error validating argument named "make"/) expect(() => catchInvalidArguments({ @@ -687,7 +813,7 @@ describe('catchInvalidArguments', () => { }, ], }) - ).toThrowError() + ).toThrowError(/error validating argument named "make"/) expect(() => catchInvalidArguments({ @@ -699,15 +825,15 @@ describe('catchInvalidArguments', () => { }, ], }) - ).toThrowError() + ).toThrowError(/error validating argument named "modelYear"/) }) }) - 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 +841,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 +849,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 +861,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 +878,14 @@ describe('catchInvalidArguments', () => { }, { name: 'model', - value: null, + value: '', types: ['string'], }, ], }) - ).toThrowError() + ).toThrowError( + /must provide at least one of the following arguments: modelYear, make, model/ + ) }) }) }) diff --git a/packages/lib/src/utils/argHandler.ts b/packages/lib/src/utils/argHandler.ts index 01ad4ec3..4bc06f08 100644 --- a/packages/lib/src/utils/argHandler.ts +++ b/packages/lib/src/utils/argHandler.ts @@ -8,16 +8,30 @@ 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[] -}> + errorMode?: 'error' | 'boolean' +} & ( + | AtLeastOne<{ + required?: boolean + types?: string[] + }> + | { + requiredBy: Array<{ + name: string + value: unknown + }> + } +) /** - * 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 +50,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 +83,133 @@ 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, + errorMode = 'error', + } = argData + /* later we will use this to store types normalized to lowercase */ + let 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 arrry of objects if provided` + ) + } + requiredBy.forEach(({ name: requiredByName, value: requiredByValue }) => { + if (requiredByValue) { + if (getTypeof(requiredByName) !== '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 = types.map((type) => type.toLowerCase()) } + /* 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 + } - /* ex: if types = ['string', 'number'] then you'll get '' */ - const joinedTypes = types ? `<${types.join(' | ')}>` : '' + /* exit early if requiredBy 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}` + error = `${errorPrepend} it is required, ${errorAppend}` } } else if (types && !required) { /* 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}` + 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}` + error = `${errorPrepend} is required and must be of type(s) ${typesLowercased}, ${errorAppend}` } } + /* if any argument validation has failed, throw an error or return false dependign 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 +225,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') { From b82adfab4e5c3c5e307e01c8a77899f5026673b0 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 00:58:45 -0600 Subject: [PATCH 60/93] chore: improve comments for getTypeof function --- packages/lib/src/utils/getTypeof.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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). From 5f5360bf02094f2d06ecc1b72fe91ad5aa5b64ad Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 00:59:37 -0600 Subject: [PATCH 61/93] refactor(queryString): all undefined values in QueryStringTypes --- packages/lib/src/utils/queryString.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/lib/src/utils/queryString.ts b/packages/lib/src/utils/queryString.ts index 1aa24f11..e51e77ef 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 @@ -32,10 +32,6 @@ export type QueryStringParamsEncoded = { [key in keyof T]: string } * 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 @@ -62,8 +58,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) From 049a550a2843c82fedb9fd4c214753156bb5d3bd Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 01:00:17 -0600 Subject: [PATCH 62/93] types: add Impossible and NoExtraProperties util types --- packages/lib/src/utils/types.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 {} From 749394e50cea4062e7fb2c9492dfd31f998bbd01 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 01:01:59 -0600 Subject: [PATCH 63/93] refactor(package): explicitly name exported types in src index --- packages/lib/src/index.ts | 45 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/packages/lib/src/index.ts b/packages/lib/src/index.ts index 658a6cb7..d315d806 100644 --- a/packages/lib/src/index.ts +++ b/packages/lib/src/index.ts @@ -1,3 +1,11 @@ +/** + * @module exports + * @category Package Exports + */ + +/** + * @category Exported NHTSA API Functions + */ export { DecodeVin, DecodeVinExtended, @@ -26,6 +34,41 @@ export { useNHTSA, } from '@/api' +/** + * @category Exported Utility Functions + */ export { createQueryString, encodeQueryStringParams, isValidVin } from '@/utils' -export * from '@/types' +/** + * @category Exported Types + */ +export type { + 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, + NhtsaResponse, +} from '@/types' From 7de36806009d75c18852551915f80b3619c4cf50 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 01:03:13 -0600 Subject: [PATCH 64/93] refactor(package): after build rollup types into single index.d.ts file --- packages/lib/vite.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/lib/vite.config.ts b/packages/lib/vite.config.ts index 95fc95cb..764b7939 100644 --- a/packages/lib/vite.config.ts +++ b/packages/lib/vite.config.ts @@ -26,6 +26,7 @@ export default defineConfig({ entryRoot: './src', outDir: './dist/types', insertTypesEntry: true, + rollupTypes: true, exclude: ['**/__tests__/**/*', 'node_modules/**'], }), ], From 32fd5f3a00a96f04fbf017002eded42d89d114ff Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 01:04:44 -0600 Subject: [PATCH 65/93] docs(typedocs): add latest exports.md output --- apps/docs/src/typedoc/exports.md | 50 -------------------------------- 1 file changed, 50 deletions(-) diff --git a/apps/docs/src/typedoc/exports.md b/apps/docs/src/typedoc/exports.md index 5a293898..e248a645 100644 --- a/apps/docs/src/typedoc/exports.md +++ b/apps/docs/src/typedoc/exports.md @@ -36,9 +36,6 @@ - [safetyRatings](exports.md#safetyratings) - [useNHTSA](exports.md#usenhtsa) - [Exported Types](exports.md#exported-types) - - [ApiTypes](exports.md#apitypes) - - [AtLeastOne](exports.md#atleastone) - - [CreateUrlOptions](exports.md#createurloptions) - [DecodeVinExtendedResults](exports.md#decodevinextendedresults) - [DecodeVinExtendedVariable](exports.md#decodevinextendedvariable) - [DecodeVinResults](exports.md#decodevinresults) @@ -66,14 +63,7 @@ - [GetVehicleVariableListResults](exports.md#getvehiclevariablelistresults) - [GetVehicleVariableValuesListResults](exports.md#getvehiclevariablevalueslistresults) - [GetWMIsForManufacturerResults](exports.md#getwmisformanufacturerresults) - - [IArgToValidate](exports.md#iargtovalidate) - - [Impossible](exports.md#impossible) - [NhtsaResponse](exports.md#nhtsaresponse) - - [NoExtraProperties](exports.md#noextraproperties) - - [QueryStringParams](exports.md#querystringparams) - - [QueryStringParamsEncoded](exports.md#querystringparamsencoded) - - [QueryStringTypes](exports.md#querystringtypes) - - [RequireOnlyOne](exports.md#requireonlyone) - [SafetyRatingsOptions](exports.md#safetyratingsoptions) - [SafetyRatingsOptionsBase](exports.md#safetyratingsoptionsbase) - [SafetyRatingsOptionsEmpty](exports.md#safetyratingsoptionsempty) @@ -200,18 +190,6 @@ Re-exports [useNHTSA](api/useNHTSA.md#usenhtsa) ## Exported Types -### 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) @@ -320,38 +298,10 @@ Re-exports [GetVehicleVariableValuesListResults](api/vpic/endpoints/GetVehicleVa 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) From c0f4c6ff230b816a711459b73430ab56b4dd527f Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 5 Dec 2023 01:09:30 -0600 Subject: [PATCH 66/93] feat(lib): add safetyRatings function wrapper for SafetyRatings API --- packages/lib/src/api/__tests__/index.test.ts | 6 + packages/lib/src/api/index.ts | 1 + .../__tests__/safetyRatings.test-d.ts | 269 +++++++ .../__tests__/safetyRatings.test.ts | 732 ++++++++++++++++++ packages/lib/src/api/safetyRatings/index.ts | 660 ++++++++++++++++ packages/lib/src/api/safetyRatings/types.ts | 22 + packages/lib/src/index.ts | 14 + 7 files changed, 1704 insertions(+) create mode 100644 packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts create mode 100644 packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts create mode 100644 packages/lib/src/api/safetyRatings/index.ts create mode 100644 packages/lib/src/api/safetyRatings/types.ts diff --git a/packages/lib/src/api/__tests__/index.test.ts b/packages/lib/src/api/__tests__/index.test.ts index b2ece334..5a56a0ac 100644 --- a/packages/lib/src/api/__tests__/index.test.ts +++ b/packages/lib/src/api/__tests__/index.test.ts @@ -25,6 +25,7 @@ import { GetVehicleVariableValuesList, GetWMIsForManufacturer, useNHTSA, + safetyRatings, } from '../' describe('api/index.ts', () => { @@ -152,4 +153,9 @@ describe('api/index.ts', () => { expect(useNHTSA).toBeDefined() expect(useNHTSA).toBeInstanceOf(Function) }) + + it('exports safetyRatings function', () => { + expect(safetyRatings).toBeDefined() + expect(safetyRatings).toBeInstanceOf(Function) + }) }) diff --git a/packages/lib/src/api/index.ts b/packages/lib/src/api/index.ts index adcaee91..363d60e7 100644 --- a/packages/lib/src/api/index.ts +++ b/packages/lib/src/api/index.ts @@ -3,5 +3,6 @@ * @category API */ +export * from './safetyRatings' export * from './vpic' export { useNHTSA } from './useNHTSA' 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..2cbe3c51 --- /dev/null +++ b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts @@ -0,0 +1,269 @@ +import { describe, expectTypeOf, test } from 'vitest' + +import { safetyRatings, type NoInvalidOptions } from '../' + +import type { + SafetyRatingsOptions, + SafetyRatingsOptionsEmpty, + SafetyRatingsOptionsMake, + SafetyRatingsOptionsModel, + SafetyRatingsOptionsModelYear, + SafetyRatingsOptionsVehicleId, + SafetyRatingsResponseByOptions, + SafetyRatingsResponseByVariant, +} from '../types' + +const vehicleIdString = '1234' +const vehicleIdNumber = 1234 +// const vehicleId = vehicleIdNumber +const modelYearString = '2018' +const modelYearNumber = 2018 +const modelYear = modelYearNumber +const make = 'Audi' +const model = 'A5' + +test('Typecheck: safetyRatings() - parameters - ', () => { + expectTypeOf().toBeFunction() + expectTypeOf().parameters.toMatchTypeOf< + [ + options?: boolean | NoInvalidOptions | undefined, + doFetch?: boolean | undefined, + ] + >() +}) + +describe('Typecheck: safetyRatings() - return correct type of response data - ', () => { + /***************************** + * doFetch = true | undefined (default) + ****************************/ + test('with no arguments', async () => { + expectTypeOf(await safetyRatings()).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'getModelYears'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with no options and doFetch = true', async () => { + expectTypeOf(await safetyRatings(true)).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'getModelYears'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with undefined as first argument', async () => { + expectTypeOf(await safetyRatings(undefined)).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'getModelYears'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with undefined as first argument and doFetch = true', async () => { + expectTypeOf(await safetyRatings(undefined, true)).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'getModelYears'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with undefined as both arguments', async () => { + expectTypeOf(await safetyRatings(undefined, undefined)).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'getModelYears'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with empty object as first argument', async () => { + expectTypeOf(await safetyRatings({})).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'getModelYears'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with empty object as first argument and doFetch = true', async () => { + expectTypeOf(await safetyRatings({}, true)).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'getModelYears'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.modelYear as string', async () => { + expectTypeOf( + await safetyRatings({ modelYear: modelYearString }) + ).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'modelYear'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.modelYear as string and doFetch = true', async () => { + expectTypeOf( + await safetyRatings({ modelYear: modelYearString }, true) + ).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'modelYear'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.modelYear as number', async () => { + expectTypeOf( + await safetyRatings({ modelYear: modelYearNumber }) + ).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'modelYear'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.modelYear as number and doFetch = true', async () => { + expectTypeOf( + await safetyRatings({ modelYear: modelYearNumber }, true) + ).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'modelYear'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.make', async () => { + expectTypeOf(await safetyRatings({ modelYear, make })).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'make'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.make and doFetch = true', async () => { + expectTypeOf(await safetyRatings({ modelYear, make }, true)).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'make'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.model', async () => { + expectTypeOf(await safetyRatings({ modelYear, make, model })).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'model'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.model and doFetch = true', async () => { + expectTypeOf( + await safetyRatings({ modelYear, make, model }, true) + ).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'model'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.vehicleId as string', async () => { + expectTypeOf( + await safetyRatings({ vehicleId: vehicleIdString }) + ).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'vehicleId'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.vehicleId as string and doFetch = true', async () => { + expectTypeOf( + await safetyRatings({ vehicleId: vehicleIdString }, true) + ).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'vehicleId'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.vehicleId as number', async () => { + expectTypeOf( + await safetyRatings({ vehicleId: vehicleIdNumber }) + ).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'vehicleId'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.vehicleId as number and doFetch = true', async () => { + expectTypeOf( + await safetyRatings({ vehicleId: vehicleIdNumber }, true) + ).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'vehicleId'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.modelYear, and options.vehicleId = undefined, ', async () => { + expectTypeOf( + await safetyRatings({ vehicleId: undefined, modelYear }) + ).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'modelYear'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.modelYear, options.make, and options.vehicleId = undefined, ', async () => { + expectTypeOf( + await safetyRatings({ vehicleId: undefined, modelYear, make }) + ).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'make'> + | SafetyRatingsResponseByOptions + >() + }) + + test('with options.modelYear, options.make, options.model, and options.vehicleId = undefined, ', async () => { + expectTypeOf( + await safetyRatings({ vehicleId: undefined, modelYear, make, model }) + ).toEqualTypeOf< + | SafetyRatingsResponseByVariant<'model'> + | SafetyRatingsResponseByOptions + >() + }) +}) + +describe('Typecheck: safetyRatings() - returns type string if doFetch = false - ', () => { + /***************************** + * doFetch = false + ****************************/ + test('with doFetch = false', async () => { + expectTypeOf(await safetyRatings(false)).toEqualTypeOf() + }) + + test('with udnefined 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..7420b2a3 --- /dev/null +++ b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts @@ -0,0 +1,732 @@ +import { beforeEach, describe, expect, test } from 'vitest' +import { safetyRatings } from '../' + +// Mocks +import { createMockResponse } from '.vitest/helpers' +import { mockResults } from '.vitest/data' + +const vehicleIdString = '1234' +const vehicleIdNumber = 1234 +const vehicleId = vehicleIdNumber +const modelYearString = '2018' +const modelYearNumber = 2018 +const modelYear = modelYearNumber +const make = 'Audi' +const model = 'A5' + +// https://api.nhtsa.gov/safetyRatings/modelyear/2013/make/Acura/model/rdx + +const baseUrl = 'https://api.nhtsa.gov/SafetyRatings/' +const mockUrlVehicleId = `${baseUrl}vehicleId/${vehicleIdString}` +const mockUrlModelYear = `${baseUrl}modelYear/${modelYearString}` +const mockUrlMake = `${baseUrl}modelYear/${modelYearString}/make/${make}` +const mockUrlModel = `${baseUrl}modelYear/${modelYearString}/make/${make}/model/${model}` + +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: baseUrl }, + { + description: 'doFetch = true as first argument', + args: [true], + expectedUrl: baseUrl, + }, + { + description: 'undefined as first argument', + args: [undefined], + expectedUrl: baseUrl, + }, + { + description: 'undefined as first argument and doFetch = true', + args: [undefined, true], + expectedUrl: baseUrl, + }, + { + description: 'empty object as first argument', + args: [{}], + expectedUrl: baseUrl, + }, + { + description: 'empty object as first argument and doFetch = true', + args: [{}, true], + expectedUrl: baseUrl, + }, + // 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: baseUrl, + }, + { + description: 'undefined as first argument and doFetch = false', + args: [undefined, false], + expectedUrl: baseUrl, + }, + { + description: 'empty object and doFetch = false', + args: [{}, false], + expectedUrl: baseUrl, + }, + // 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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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(/error validating argument named "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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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. + * + * All of these calls to safetyRatings() mimic all of tests in the test.each() tests above. + * They are separated here to allow for testing of the IDE tooltips for each possible response + * type individually by hovering over the saved `result_x` and/or the function name each time it is + * called. + * + * This cannot be achieved in test.each() tests because the way .each() is typed, it will show all + * possible SafetyRatingsResultsVariants types at once when hovering over the saved results of + * safetyRatings(). This will still happen even if you only include arguments that would return + * the same type of response. + * + * 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/index.ts b/packages/lib/src/api/safetyRatings/index.ts new file mode 100644 index 00000000..5de5a70f --- /dev/null +++ b/packages/lib/src/api/safetyRatings/index.ts @@ -0,0 +1,660 @@ +/** + * @module api/safetyRatings + * @category API - Safety Ratings + */ + +import { useNHTSA } from '@/api' +import { + catchInvalidArguments, + encodeQueryStringParams, + rejectWithError, +} from '@/utils' +import type { NhtsaResponse, NoExtraProperties } from '@/types' + +/** + * ::: 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. + * + * @param options - Object names and values to append to the URL as a path + * @param {(string|number)} [options.modelYear] - Model Year of the vehicle to search + * @param {(string|number)} [options.make] - Make of the vehicle to search + * @param {string} [options.model] - Model of the vehicle to search + * @param {boolean} [doFetch=true] - Whether to fetch the data or just return the URL string + * (default: `true`) + * @returns {(Promise | string>)} + * - Parsed API response `object` -or- url `string` if `doFetch = false` + */ +function safetyRatings( + options?: true +): Promise> +function safetyRatings(options: false): Promise +function safetyRatings( + options: NoInvalidOptions | undefined, + doFetch: false +): Promise +function safetyRatings( + options: NoInvalidOptions, + doFetch?: true +): Promise> +function safetyRatings( + options?: undefined, + doFetch?: true +): Promise> +function safetyRatings( + options?: NoInvalidOptions | boolean, + doFetch?: boolean +): Promise +/* Implementation */ +async function safetyRatings( + options?: SafetyRatingsOptions | 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'] }, + { + 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'] }, + ], + }) + + /* + * Throw an error if options object contains invalid properties. + * + * This must be after the catchInvalidArguments() call above so we can ensure we have an actual + * object here and not 'null' 'array' etc., which typeof will let into the 'if' block as they + * are all considered typeof === 'object'. We only use typeof here to make the TS compiler + * happy. + */ + if (typeof options === 'object') { + const validKeys: Array = [ + 'modelYear', + 'make', + 'model', + 'vehicleId', + ] + const optionsKeys = Object.keys(options) as Array< + keyof SafetyRatingsOptionsBase + > + const invalidKeys = optionsKeys.filter((key) => { + return !validKeys.includes(key) + }) + + if (invalidKeys.length > 0) { + throw new Error( + `Invalid options: ${invalidKeys.join( + ', ' + )}. Valid options are: ${validKeys.join(', ')}` + ) + } + /* + * Using this to transform the options object into URI encoded string or undefined values + */ + const { vehicleId, modelYear, make, model } = + encodeQueryStringParams(options) + + /* Build the API URL path */ + path = buildPath({ vehicleId, modelYear, make, model }) + } + + const { get, createCachedUrl, getCachedUrl } = useNHTSA() + + createCachedUrl({ + apiType: 'safetyRatings', + endpointName, + path, + includeQueryString: false, + }) + + 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 build path: `/SafetyRatings` + */ +export type SafetyRatingsOptionsEmpty = { + modelYear?: undefined + make?: undefined + model?: undefined + vehicleId?: undefined +} + +/** + * Options to build path: `/SafetyRatings/modelYear/:modelYear` + */ +export type SafetyRatingsOptionsModelYear = { + modelYear: string | number + make?: undefined + model?: undefined + vehicleId?: undefined +} + +/** + * Options to build path: `/SafetyRatings/modelYear/:modelYear/make/:make` + */ +export type SafetyRatingsOptionsMake = { + modelYear: string | number + make: string + model?: undefined + vehicleId?: undefined +} + +/** + * Options to build path: `/SafetyRatings/modelYear/:modelYear/make/:make/model/:model` + */ +export type SafetyRatingsOptionsModel = { + modelYear: string | number + make: string + model: string + vehicleId?: undefined +} + +/** + * Options to build 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 + | SafetyRatingsOptionsModel + +/** Ensures only valid options are used in the `safetyRatings()` function */ +export type NoInvalidOptions = + NoExtraProperties + +/** + * 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. + */ +export type SafetyRatingsResultsVariants = + | 'getModelYears' + | 'modelYear' + | 'make' + | 'model' + | 'vehicleId' + | 'default' + +/** + * 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. + */ +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 `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. + */ +export type SafetyRatingsResultsByVariant< + Variant extends SafetyRatingsResultsVariants = 'default', +> = + /* Pick<> SafetyRatingsResultsData based on Variant string */ + Variant extends 'getModelYears' + ? /* Base Path / */ + { + [K in keyof Pick< + SafetyRatingsResultsData, + 'ModelYear' | 'VehicleId' + >]-?: SafetyRatingsResultsData[K] + } + : Variant extends 'modelYear' + ? /* Path /modelYear/:modelYear */ + { + [K in keyof Pick< + SafetyRatingsResultsData, + 'Make' | 'ModelYear' | 'VehicleId' + >]-?: SafetyRatingsResultsData[K] + } + : Variant extends 'make' + ? /* Path /modelYear/:modelYear/make/:make */ + { + [K in keyof Pick< + SafetyRatingsResultsData, + 'Make' | 'Model' | 'ModelYear' | 'VehicleId' + >]-?: SafetyRatingsResultsData[K] + } + : Variant extends 'model' + ? /* 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` array of the `Safety Ratings API` response based on the `options` passed + * to the function. + */ +export type SafetyRatingsResultsByOptions< + Options extends SafetyRatingsOptions, +> = Options extends SafetyRatingsOptionsModelYear + ? SafetyRatingsResultsByVariant<'modelYear'> + : Options extends SafetyRatingsOptionsMake + ? SafetyRatingsResultsByVariant<'make'> + : Options extends SafetyRatingsOptionsModel + ? SafetyRatingsResultsByVariant<'model'> + : 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` array 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 `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. + */ +export type SafetyRatingsResponseByVariant< + Variant extends SafetyRatingsResultsVariants = '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` 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. + */ +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..91ff4fce --- /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, + SafetyRatingsOptionsModel, + SafetyRatingsOptionsModelYear, + SafetyRatingsOptionsVehicleId, + SafetyRatingsResponseByOptions, + SafetyRatingsResponseByVariant, + SafetyRatingsResultsByOptions, + SafetyRatingsResultsByVariant, + SafetyRatingsResultsData, + SafetyRatingsResultsVariants, +} from '.' + +export {} diff --git a/packages/lib/src/index.ts b/packages/lib/src/index.ts index d315d806..f2bd8797 100644 --- a/packages/lib/src/index.ts +++ b/packages/lib/src/index.ts @@ -32,6 +32,7 @@ export { GetVehicleVariableValuesList, GetWMIsForManufacturer, useNHTSA, + safetyRatings, } from '@/api' /** @@ -71,4 +72,17 @@ export type { GetVehicleVariableValuesListResults, GetWMIsForManufacturerResults, NhtsaResponse, + SafetyRatingsOptions, + SafetyRatingsOptionsBase, + SafetyRatingsOptionsEmpty, + SafetyRatingsOptionsMake, + SafetyRatingsOptionsModel, + SafetyRatingsOptionsModelYear, + SafetyRatingsOptionsVehicleId, + SafetyRatingsResponseByOptions, + SafetyRatingsResponseByVariant, + SafetyRatingsResultsByOptions, + SafetyRatingsResultsByVariant, + SafetyRatingsResultsData, + SafetyRatingsResultsVariants, } from '@/types' From 8cf1725dfd2c513eb63c63759d54ac49d15caea9 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Wed, 6 Dec 2023 23:59:11 -0600 Subject: [PATCH 67/93] tests(pkg): improve utils/errorHandler tests --- .../src/utils/__tests__/errorHandler.test.ts | 259 ++++++++++++------ packages/lib/src/utils/errorHandler.ts | 1 + 2 files changed, 173 insertions(+), 87 deletions(-) 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/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. * From 32d0cecc629e907dbc75c1cf072c24982ee47766 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Thu, 7 Dec 2023 00:26:52 -0600 Subject: [PATCH 68/93] tests(pkg): improve tests for utils/getTypeof --- .../lib/src/utils/__tests__/getTypeof.test.ts | 77 +++++++++++++------ 1 file changed, 53 insertions(+), 24 deletions(-) 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') + }) }) }) From ca174824e0cf38fde006d5701f1c1120100d186b Mon Sep 17 00:00:00 2001 From: shaggytech Date: Sat, 9 Dec 2023 12:37:56 -0600 Subject: [PATCH 69/93] tests(pkg): improve tests for utils/isValidVin --- .../lib/src/utils/__tests__/index.test.ts | 20 ++-- .../src/utils/__tests__/isValidVin.test.ts | 106 ++++++++++++----- packages/lib/src/utils/isValidVin.ts | 110 +++++++++++------- 3 files changed, 149 insertions(+), 87 deletions(-) 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/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) } From 26499b8f0b38c10be9df4bb00bb470367cc0cee1 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Sat, 9 Dec 2023 21:14:49 -0600 Subject: [PATCH 70/93] tests(pkg): improve tests for utils/queryString --- .../src/utils/__tests__/queryString.test.ts | 256 ++++++++---------- packages/lib/src/utils/queryString.ts | 45 ++- 2 files changed, 126 insertions(+), 175 deletions(-) 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/queryString.ts b/packages/lib/src/utils/queryString.ts index e51e77ef..56ae75d0 100644 --- a/packages/lib/src/utils/queryString.ts +++ b/packages/lib/src/utils/queryString.ts @@ -16,26 +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. - * - * @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 @@ -67,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, From b300efb74b7c3a782039d08561e826c23aa6040a Mon Sep 17 00:00:00 2001 From: shaggytech Date: Wed, 20 Dec 2023 08:36:20 -0600 Subject: [PATCH 71/93] feat(lib): add function wrapper for Products API --- .../api/products/__tests__/products.test-d.ts | 432 ++++++++++++ .../api/products/__tests__/products.test.ts | 538 ++++++++++++++ packages/lib/src/api/products/products.ts | 667 ++++++++++++++++++ packages/lib/src/api/products/types.ts | 20 + 4 files changed, 1657 insertions(+) create mode 100644 packages/lib/src/api/products/__tests__/products.test-d.ts create mode 100644 packages/lib/src/api/products/__tests__/products.test.ts create mode 100644 packages/lib/src/api/products/products.ts create mode 100644 packages/lib/src/api/products/types.ts 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..5ae0fcba --- /dev/null +++ b/packages/lib/src/api/products/__tests__/products.test-d.ts @@ -0,0 +1,432 @@ +import { describe, expectTypeOf, test } from 'vitest' + +import { + products, + type NoInvalidOptions, + 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 | NoInvalidOptions | 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 + >() + }) + + test('with issueType = "r"', async () => { + const result = await products(issueTypeR) + + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType = "recalls"', async () => { + const result = await products(issueTypeRecalls) + + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).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 + >() + }) + + test('with issueType, options.modelYear, and options.make = undefined', async () => { + const result = await products(issueType, { modelYear, make: undefined }) + + 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, options.modelYear, and options.make', async () => { + const result = await products(issueType, { modelYear, make }) + + expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions + >() + + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getMakes'> + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByOptions + >() + }) + + test('with issueType, options.modelYear, options.make, and doFetch = true', async () => { + const result = await products(issueType, { modelYear, make }, 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<'getMakes'> + >() + 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..8126513b --- /dev/null +++ b/packages/lib/src/api/products/__tests__/products.test.ts @@ -0,0 +1,538 @@ +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", 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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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(/error validating argument named "modelYear"/) + + 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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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 safetyRatings.test-d.ts via Vitest type + * checking, these are simply hovering tooltip tests. + * + * All of these calls to safetyRatings() mimic all of tests in the test.each() tests above. + * They are separated here to allow for testing of the IDE tooltips for each possible response + * type individually by hovering over the saved `result_x` and/or the function name each time it is + * called. + * + * This cannot be achieved in test.each() tests because the way .each() is typed, it will show all + * possible SafetyRatingsResultsVariants types at once when hovering over the saved results of + * safetyRatings(). This will still happen even if you only include arguments that would return + * the same type of response. + * + * 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, 'why does this work?>??????????') + 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..c80167a5 --- /dev/null +++ b/packages/lib/src/api/products/products.ts @@ -0,0 +1,667 @@ +/** + * @module api/products + * @category API - Products + */ + +import { useNHTSA } from '@/api' +import { + catchInvalidArguments, + encodeQueryStringParams, + rejectWithError, +} from '@/utils' +import type { NhtsaResponse, NoExtraProperties } from '@/types' + +/** + * The products() function is used by the recalls() and complaints() functions to get + * model years, makes, and models based on query string ?issueType=r or ?issueType=c + * to then query for recalls or complaints based on a specific model year, make, and model + * + * There seems to be no other `issueTypes` other than `r` and `c` + * + * `issueType` is required + * 'c' or 'complaints' = complaints + * 'r' or 'recalls' = recalls + * + * If you pass no options, it will get all model years for the issueType and use url: + * api.nhtsa.gov/products/vehicle/modelYears?issueType={issueType} + * + * If you pass options.modelYear, it will get all makes for the issueType and use url: + * api.nhtsa.gov/products/vehicle/makes?modelYear={modelYear}&issueType={issueType} + * + * If you pass options.modelYear and options.make, will get all models for the issueType and use url: + * api.nhtsa.gov/products/vehicle/models?modelYear={modelYear}&make={make}&issueType={issueType} + * + * Throws an error: + * - if issueType is not passed or is not a string of 'r' 'recalls' 'c' or 'complaints' + * - if options is not an object + * - if options.modelYear is neither a string nor number + * - if options.make is not a string + * - if you pass options.make you must also pass options.modelYear + * + * + * # 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: + * + * - `recalls(issueType)` + * - `recalls(issueType, {})` + * - `recalls(issueType, { modelYear })` + * - `recalls(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. + * + * ### 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. + * + * ```js + * // Get a list of available model years in the recalls dataset + * await recalls().then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "2024", "2023", "2022", etc + * }) + * }) + * ``` + * + * ### Get Makes for Model Year + * + * Uses the `Products API` to get all available makes in the recalls dataset for a specific model + * year. + * + * If you pass a `modelYear` as the only option, the path and query string + * `/products/vehicle/makes?modelYear={modelYear}&issueType=r` will be used. + * + * ```js + * // Get a list of available makes for the 2013 model year + * await recalls({ + * modelYear: 2013, + * }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "ACURA", "AUDI", "BENTLEY", etc. + * console.log(results.make) // "JETTA", "ACCORD", etc. + * }) + * }) + * ``` + * + * 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 model + * year 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. + * + * ```js + * // Get a list of available models for a 2013 Honda + * 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. + * }) + * }) + * ``` + * + * 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 model year, 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. + * + * ```js + * // Get as list of recalls for a 2013 Honda Accord + * 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 + * }) + * }) + * ``` + * + * 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[]`. + * + * ```js + * // Get recall information for a specific campaign number + * 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 + * }) + * }) + * ``` + * + * ## 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. + * + * - `{}`, `{ 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 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` + */ +// Most specific: Overloads with generics +function products( + issueType: ProductsIssueType, + options: NoInvalidOptions, + doFetch?: true +): Promise> +function products( + issueType: ProductsIssueType, + options: NoInvalidOptions | undefined, + doFetch: false +): Promise +// Next, overloads with both issueType and doFetch +function products( + issueType: ProductsIssueType, + doFetch?: true +): Promise> +function products(issueType: ProductsIssueType, doFetch: false): Promise +// Then, overloads with only issueType +function products( + issueType: ProductsIssueType +): Promise> +function products( + issueType: ProductsIssueType, + options?: undefined, + doFetch?: true +): Promise> +// Most general: Catch-all overload +function products( + issueType: ProductsIssueType, + options?: NoInvalidOptions | boolean, + doFetch?: boolean +): Promise +/* Implementation */ +async function products( + issueType: ProductsIssueType, + options?: ProductsOptions | boolean, + doFetch: boolean = true +): Promise { + const endpointName = 'products' + + 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: 'issueType', + value: issueType, + required: true, + types: ['string'], + }, + { name: 'options', value: options, types: ['object'] }, + { + 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 + + let path = '' + let encodedParams = {} + /* + * Throw an error if options object contains invalid properties. + * + * This must be after the catchInvalidArguments() call above so we can ensure we have an actual + * object here and not 'null' 'array' etc., which typeof will let into the 'if' block as they + * are all considered typeof === 'object'. We only use typeof here to make the TS compiler + * happy. + */ + if (typeof options === 'object') { + const validKeys: Array = ['modelYear', 'make'] + const optionsKeys = Object.keys(options) as Array< + keyof ProductsOptionsBase + > + const invalidKeys = optionsKeys.filter((key) => { + return !validKeys.includes(key) + }) + + if (invalidKeys.length > 0) { + throw new Error( + `Invalid options: ${invalidKeys.join( + ', ' + )}. Valid options are: ${validKeys.join(', ')}` + ) + } + + 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 an empty string */ + 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' From eadaecec7e52ac6ebec2697994c628695200065c Mon Sep 17 00:00:00 2001 From: shaggytech Date: Wed, 20 Dec 2023 08:36:48 -0600 Subject: [PATCH 72/93] feat(lib): add function wrapper for Recalls API, needs tests --- packages/lib/src/api/recalls/recalls.ts | 704 ++++++++++++++++++++++++ 1 file changed, 704 insertions(+) create mode 100644 packages/lib/src/api/recalls/recalls.ts diff --git a/packages/lib/src/api/recalls/recalls.ts b/packages/lib/src/api/recalls/recalls.ts new file mode 100644 index 00000000..f510633c --- /dev/null +++ b/packages/lib/src/api/recalls/recalls.ts @@ -0,0 +1,704 @@ +/** + * @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 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 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. + * + * ```js + * // Get a list of available model years in the recalls dataset + * await recalls().then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "2024", "2023", "2022", etc + * }) + * }) + * ``` + * + * ### Get Makes for Model Year + * + * Uses the `Products API` to get all available makes in the recalls dataset for a specific model + * year. + * + * If you pass a `modelYear` as the only option, the path and query string + * `/products/vehicle/makes?modelYear={modelYear}&issueType=r` will be used. + * + * ```js + * // Get a list of available makes for the 2013 model year + * await recalls({ + * modelYear: 2013, + * }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "ACURA", "AUDI", "BENTLEY", etc. + * console.log(results.make) // "JETTA", "ACCORD", etc. + * }) + * }) + * ``` + * + * 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 model + * year 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. + * + * ```js + * // Get a list of available models for a 2013 Honda + * 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. + * }) + * }) + * ``` + * + * 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 model year, 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. + * + * ```js + * // Get as list of recalls for a 2013 Honda Accord + * 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 + * }) + * }) + * ``` + * + * 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[]`. + * + * ```js + * // Get recall information for a specific campaign number + * 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 + * }) + * }) + * ``` + * + * ## 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 + * `Results`: + * - `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( + doFetch?: true +): Promise> +function recalls(doFetch: false): Promise +function recalls( + options: NoInvalidOptions | undefined, + doFetch: false +): Promise +function recalls( + options: NoInvalidOptions, + doFetch?: true +): Promise> +function recalls( + options?: undefined, + doFetch?: true +): Promise> +function recalls( + options?: NoInvalidOptions | boolean, + doFetch?: boolean +): Promise +/* Implementation */ +async function recalls( + options?: RecallsOptions | 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'] }, + { + name: 'vehicleId', + value: options?.campaignNumber, + types: ['string'], + }, + { + 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'] }, + ], + }) + + /* + * Throw an error if options object contains invalid properties. + * + * This must be after the catchInvalidArguments() call above so we can ensure we have an actual + * object here and not 'null' 'array' etc., which typeof will let into the 'if' block as they + * are all considered typeof === 'object'. We only use typeof here to make the TS compiler + * happy. + */ + if (typeof options === 'object') { + const validKeys: Array = [ + 'modelYear', + 'make', + 'model', + 'campaignNumber', + ] + const optionsKeys = Object.keys(options) as Array< + keyof RecallsOptionsBase + > + const invalidKeys = optionsKeys.filter((key) => { + return !validKeys.includes(key) + }) + + if (invalidKeys.length > 0) { + throw new Error( + `Invalid options: ${invalidKeys.join( + ', ' + )}. Valid options are: ${validKeys.join(', ')}` + ) + } + + 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 */ + if (campaignNumber || hasVehicle) { + if (campaignNumber) { + path = `/recalls/campaignNumber` + } else if (hasVehicle) { + path = `/recalls/recallsByVehicle` + } + + createCachedUrl({ + apiType: 'recalls', + endpointName, + path, + params: { ...encodedParams }, + }) + + 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 + * 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 valid options for the `recalls()` function + */ +export type RecallsOptionsBase = { + modelYear?: string | number + make?: string + model?: string + campaignNumber?: string +} + +/** + * Options to get all available recall `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 recall `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 recall `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 `safetyRatings()`. + * + * 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 From 7cb86d8e8b760081fe66742e7014f0a502350a36 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Wed, 20 Dec 2023 08:41:54 -0600 Subject: [PATCH 73/93] lib: normalize all API responses to uppercase keys --- .../lib/src/api/__tests__/useNHTSA.test.ts | 2 +- packages/lib/src/api/types.ts | 21 +++++++------- packages/lib/src/api/useNHTSA.ts | 29 +++++++++++++++---- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/packages/lib/src/api/__tests__/useNHTSA.test.ts b/packages/lib/src/api/__tests__/useNHTSA.test.ts index 5ca93cb6..2a2d7fa0 100644 --- a/packages/lib/src/api/__tests__/useNHTSA.test.ts +++ b/packages/lib/src/api/__tests__/useNHTSA.test.ts @@ -297,7 +297,7 @@ describe('useNHTSA', () => { endpointName: 'someEndpoint', apiType, }) - expect(url).toBe(`https://api.nhtsa.gov/someEndpoint/`) + expect(url).toBe(`https://api.nhtsa.gov/someEndpoint/?format=json`) }) }) diff --git a/packages/lib/src/api/types.ts b/packages/lib/src/api/types.ts index afbdd194..68e3c89c 100644 --- a/packages/lib/src/api/types.ts +++ b/packages/lib/src/api/types.ts @@ -3,6 +3,7 @@ * @category Types */ +export * from './products/types' export * from './safetyRatings/types' export * from './vpic/endpoints/types' @@ -58,32 +59,32 @@ export type NhtsaResponse< /** Search terms (VIN, WMI, etc) used in the request URL. */ SearchCriteria: string | null } - : ApiType extends 'safetyRatings' + : ApiType extends 'recalls' ? { - /** The number of items returned in the Results object. Will = 0 if no Results */ + /** 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 */ + /** 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 'recalls' + : ApiType extends 'safetyRatings' ? { - /** The number of items returned in the Results object. Will = 0 if no results */ + /** 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 */ + /** 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 + Results: Array } : ApiType extends 'complaints' | 'products' ? { /** The number of items returned in the Results object. Will = 0 if no results */ - count: number + Count: number /** A message describing the results. If count is 0 check the message for helpful info */ - message: string + Message: string /** An array of objects of type 'ResultsType', specific to each individual API endpoint. */ - results: Array + Results: Array } : ApiType extends 'cssiStation' ? { diff --git a/packages/lib/src/api/useNHTSA.ts b/packages/lib/src/api/useNHTSA.ts index 25726c96..5c875f8c 100644 --- a/packages/lib/src/api/useNHTSA.ts +++ b/packages/lib/src/api/useNHTSA.ts @@ -121,14 +121,12 @@ export const useNHTSA = () => { saveUrl = true, } = options - let { includeQueryString = true } = options + const { includeQueryString = true } = options if (!endpointName || typeof endpointName !== 'string') { throw Error('options.endpointName is required to create a URL string') } - if (apiType !== 'vpic') includeQueryString = false - const queryString = includeQueryString ? createQueryString(params, allowEmptyParams) : '' @@ -180,7 +178,9 @@ export const useNHTSA = () => { * objects in the `Results` or `results` array of the `NhtsaResponse` object. * * For example, `NhtsaResponse` has a `Results` key, which - * contains an array of `DecodeVinResults` objects. + * 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. * @@ -325,11 +325,28 @@ export const useNHTSA = () => { ) } - /* Ensure response data exists and return it */ + /* Ensure response data exists */ const data = await response.json() if (!data) { throw Error(`API returned no data, response was: ${responseDetails}`) - } else return data + } + /* 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 NHTSA API data: ${error.message}` From b69b88a59b917fdb03a81e5880c492ca64d11002 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Wed, 20 Dec 2023 08:43:22 -0600 Subject: [PATCH 74/93] lib: update index imports --- packages/lib/src/api/index.ts | 31 ++++++++++++++++++++++++++++-- packages/lib/src/api/vpic/index.ts | 27 +++++++++++++++++++++++++- packages/lib/src/api/vpic/types.ts | 8 -------- packages/lib/src/index.ts | 27 ++++++++++++++++++++++---- packages/lib/src/utils/index.ts | 2 +- 5 files changed, 79 insertions(+), 16 deletions(-) delete mode 100644 packages/lib/src/api/vpic/types.ts diff --git a/packages/lib/src/api/index.ts b/packages/lib/src/api/index.ts index 363d60e7..d8c3101e 100644 --- a/packages/lib/src/api/index.ts +++ b/packages/lib/src/api/index.ts @@ -3,6 +3,33 @@ * @category API */ -export * from './safetyRatings' -export * from './vpic' +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/vpic/index.ts b/packages/lib/src/api/vpic/index.ts index 0187d183..fcee2f65 100644 --- a/packages/lib/src/api/vpic/index.ts +++ b/packages/lib/src/api/vpic/index.ts @@ -3,4 +3,29 @@ * @category API - VPIC (VIN Decoding) */ -export * from './endpoints' +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 deleted file mode 100644 index 1c5ba718..00000000 --- a/packages/lib/src/api/vpic/types.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @module api/vpic/types - * @category Types - */ - -export * from './endpoints/types' - -export {} diff --git a/packages/lib/src/index.ts b/packages/lib/src/index.ts index f2bd8797..eea8961d 100644 --- a/packages/lib/src/index.ts +++ b/packages/lib/src/index.ts @@ -33,17 +33,24 @@ export { GetWMIsForManufacturer, useNHTSA, safetyRatings, + products, } from '@/api' /** * @category Exported Utility Functions */ -export { createQueryString, encodeQueryStringParams, isValidVin } from '@/utils' +export { + createQueryString, + encodeQueryStringParams, + generateRandomVIN, + isValidVin, +} from '@/utils' /** * @category Exported Types */ export type { + NhtsaResponse, DecodeVinExtendedResults, DecodeVinResults, DecodeVinValuesBatchResults, @@ -71,18 +78,30 @@ export type { GetVehicleVariableListResults, GetVehicleVariableValuesListResults, GetWMIsForManufacturerResults, - NhtsaResponse, + ProductsIssueType, + ProductsOptions, + ProductsOptionsBase, + ProductsOptionsEmpty, + ProductsOptionsMake, + ProductsOptionsModelYear, + ProductsResponse, + ProductsResponseByOptions, + ProductsResponseByVariant, + ProductsResultsByOptions, + ProductsResultsByVariant, + ProductsResultsData, + ProductsResultsVariant, SafetyRatingsOptions, SafetyRatingsOptionsBase, SafetyRatingsOptionsEmpty, SafetyRatingsOptionsMake, - SafetyRatingsOptionsModel, SafetyRatingsOptionsModelYear, + SafetyRatingsOptionsVehicle, SafetyRatingsOptionsVehicleId, SafetyRatingsResponseByOptions, SafetyRatingsResponseByVariant, SafetyRatingsResultsByOptions, SafetyRatingsResultsByVariant, SafetyRatingsResultsData, - SafetyRatingsResultsVariants, + SafetyRatingsResultsVariant, } from '@/types' diff --git a/packages/lib/src/utils/index.ts b/packages/lib/src/utils/index.ts index 6c2d9354..219c2471 100644 --- a/packages/lib/src/utils/index.ts +++ b/packages/lib/src/utils/index.ts @@ -6,5 +6,5 @@ export { catchInvalidArguments, 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' From 1ec400803cf418f65c527238d4f973bec1d87192 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Wed, 20 Dec 2023 08:43:37 -0600 Subject: [PATCH 75/93] chore: updat vscode settings --- .vscode/settings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From ae6bbb3376cb2bedc1a7b00a3f85b08c8ddd9e90 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Wed, 20 Dec 2023 08:44:35 -0600 Subject: [PATCH 76/93] lib: update safetyRatings folder structure to align with other API functions --- .../__tests__/safetyRatings.test-d.ts | 52 +-- .../__tests__/safetyRatings.test.ts | 31 +- .../{index.ts => safetyRatings.ts} | 355 ++++++++++-------- packages/lib/src/api/safetyRatings/types.ts | 6 +- 4 files changed, 238 insertions(+), 206 deletions(-) rename packages/lib/src/api/safetyRatings/{index.ts => safetyRatings.ts} (63%) diff --git a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts index 2cbe3c51..23c6b087 100644 --- a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts +++ b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts @@ -1,17 +1,17 @@ import { describe, expectTypeOf, test } from 'vitest' -import { safetyRatings, type NoInvalidOptions } from '../' - -import type { - SafetyRatingsOptions, - SafetyRatingsOptionsEmpty, - SafetyRatingsOptionsMake, - SafetyRatingsOptionsModel, - SafetyRatingsOptionsModelYear, - SafetyRatingsOptionsVehicleId, - SafetyRatingsResponseByOptions, - SafetyRatingsResponseByVariant, -} from '../types' +import { + safetyRatings, + type NoInvalidOptions, + type SafetyRatingsOptions, + type SafetyRatingsOptionsEmpty, + type SafetyRatingsOptionsMake, + type SafetyRatingsOptionsVehicle, + type SafetyRatingsOptionsModelYear, + type SafetyRatingsOptionsVehicleId, + type SafetyRatingsResponseByOptions, + type SafetyRatingsResponseByVariant, +} from '../safetyRatings' const vehicleIdString = '1234' const vehicleIdNumber = 1234 @@ -89,7 +89,7 @@ describe('Typecheck: safetyRatings() - return correct type of response data - ', expectTypeOf( await safetyRatings({ modelYear: modelYearString }) ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'modelYear'> + | SafetyRatingsResponseByVariant<'getMakes'> | SafetyRatingsResponseByOptions >() }) @@ -98,7 +98,7 @@ describe('Typecheck: safetyRatings() - return correct type of response data - ', expectTypeOf( await safetyRatings({ modelYear: modelYearString }, true) ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'modelYear'> + | SafetyRatingsResponseByVariant<'getMakes'> | SafetyRatingsResponseByOptions >() }) @@ -107,7 +107,7 @@ describe('Typecheck: safetyRatings() - return correct type of response data - ', expectTypeOf( await safetyRatings({ modelYear: modelYearNumber }) ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'modelYear'> + | SafetyRatingsResponseByVariant<'getMakes'> | SafetyRatingsResponseByOptions >() }) @@ -116,29 +116,29 @@ describe('Typecheck: safetyRatings() - return correct type of response data - ', expectTypeOf( await safetyRatings({ modelYear: modelYearNumber }, true) ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'modelYear'> + | SafetyRatingsResponseByVariant<'getMakes'> | SafetyRatingsResponseByOptions >() }) test('with options.make', async () => { expectTypeOf(await safetyRatings({ modelYear, make })).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'make'> + | SafetyRatingsResponseByVariant<'getModels'> | SafetyRatingsResponseByOptions >() }) test('with options.make and doFetch = true', async () => { expectTypeOf(await safetyRatings({ modelYear, make }, true)).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'make'> + | SafetyRatingsResponseByVariant<'getModels'> | SafetyRatingsResponseByOptions >() }) test('with options.model', async () => { expectTypeOf(await safetyRatings({ modelYear, make, model })).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'model'> - | SafetyRatingsResponseByOptions + | SafetyRatingsResponseByVariant<'vehicle'> + | SafetyRatingsResponseByOptions >() }) @@ -146,8 +146,8 @@ describe('Typecheck: safetyRatings() - return correct type of response data - ', expectTypeOf( await safetyRatings({ modelYear, make, model }, true) ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'model'> - | SafetyRatingsResponseByOptions + | SafetyRatingsResponseByVariant<'vehicle'> + | SafetyRatingsResponseByOptions >() }) @@ -191,7 +191,7 @@ describe('Typecheck: safetyRatings() - return correct type of response data - ', expectTypeOf( await safetyRatings({ vehicleId: undefined, modelYear }) ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'modelYear'> + | SafetyRatingsResponseByVariant<'getMakes'> | SafetyRatingsResponseByOptions >() }) @@ -200,7 +200,7 @@ describe('Typecheck: safetyRatings() - return correct type of response data - ', expectTypeOf( await safetyRatings({ vehicleId: undefined, modelYear, make }) ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'make'> + | SafetyRatingsResponseByVariant<'getModels'> | SafetyRatingsResponseByOptions >() }) @@ -209,8 +209,8 @@ describe('Typecheck: safetyRatings() - return correct type of response data - ', expectTypeOf( await safetyRatings({ vehicleId: undefined, modelYear, make, model }) ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'model'> - | SafetyRatingsResponseByOptions + | SafetyRatingsResponseByVariant<'vehicle'> + | SafetyRatingsResponseByOptions >() }) }) diff --git a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts index 7420b2a3..1f9dd43a 100644 --- a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts +++ b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, test } from 'vitest' -import { safetyRatings } from '../' +import { safetyRatings } from '../safetyRatings' // Mocks import { createMockResponse } from '.vitest/helpers' @@ -17,10 +17,11 @@ const model = 'A5' // https://api.nhtsa.gov/safetyRatings/modelyear/2013/make/Acura/model/rdx const baseUrl = 'https://api.nhtsa.gov/SafetyRatings/' -const mockUrlVehicleId = `${baseUrl}vehicleId/${vehicleIdString}` -const mockUrlModelYear = `${baseUrl}modelYear/${modelYearString}` -const mockUrlMake = `${baseUrl}modelYear/${modelYearString}/make/${make}` -const mockUrlModel = `${baseUrl}modelYear/${modelYearString}/make/${make}/model/${model}` +const mockUrl = `${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, @@ -51,31 +52,31 @@ describe('safetyRatings()', () => { describe('Fetches API data with: ', () => { test.each([ // no arguments, empty object, undefined - returns all available model years - { description: 'no arguments', args: [], expectedUrl: baseUrl }, + { description: 'no arguments', args: [], expectedUrl: mockUrl }, { description: 'doFetch = true as first argument', args: [true], - expectedUrl: baseUrl, + expectedUrl: mockUrl, }, { description: 'undefined as first argument', args: [undefined], - expectedUrl: baseUrl, + expectedUrl: mockUrl, }, { description: 'undefined as first argument and doFetch = true', args: [undefined, true], - expectedUrl: baseUrl, + expectedUrl: mockUrl, }, { description: 'empty object as first argument', args: [{}], - expectedUrl: baseUrl, + expectedUrl: mockUrl, }, { description: 'empty object as first argument and doFetch = true', args: [{}, true], - expectedUrl: baseUrl, + expectedUrl: mockUrl, }, // options.modelYear { @@ -202,17 +203,17 @@ describe('safetyRatings()', () => { { description: 'doFetch = false as first argument', args: [false], - expectedUrl: baseUrl, + expectedUrl: mockUrl, }, { description: 'undefined as first argument and doFetch = false', args: [undefined, false], - expectedUrl: baseUrl, + expectedUrl: mockUrl, }, { description: 'empty object and doFetch = false', args: [{}, false], - expectedUrl: baseUrl, + expectedUrl: mockUrl, }, // options.modelYear { @@ -560,7 +561,7 @@ describe.skip('IDE Tooltips - manual test of results type on hover', async () => }[]; } ******************************/ - const result_1 = await safetyRatings() + const result_1 = await safetyRatings('why does this work??????????????????') const result_2 = await safetyRatings(undefined) const result_3 = await safetyRatings({}) const result_4 = await safetyRatings({}, true) diff --git a/packages/lib/src/api/safetyRatings/index.ts b/packages/lib/src/api/safetyRatings/safetyRatings.ts similarity index 63% rename from packages/lib/src/api/safetyRatings/index.ts rename to packages/lib/src/api/safetyRatings/safetyRatings.ts index 5de5a70f..95f030d4 100644 --- a/packages/lib/src/api/safetyRatings/index.ts +++ b/packages/lib/src/api/safetyRatings/safetyRatings.ts @@ -4,130 +4,144 @@ */ import { useNHTSA } from '@/api' -import { - catchInvalidArguments, - encodeQueryStringParams, - rejectWithError, -} from '@/utils' +import { catchInvalidArguments, rejectWithError } from '@/utils' import type { NhtsaResponse, NoExtraProperties } from '@/types' /** + * # Safety Ratings API + * * ::: tip :bulb: More Information - * See: [safetyRatings API Documentation] /guide/safetyRatings + * See: [Safety Ratings Documentation] /guide/safetyRatings * ::: * - * You can use `safetyRatings()` as a thin wrapper for the `Safety Ratings API` to get safety + * 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. - * - * 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. + * sense it is a single universal function that can handle the entirety of the Safety Ratings + * API. * - * From the official documentation: + * 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 + * ## 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. + * All are optional and 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: + * Valid `options` combinations: * - * 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. + * - `safetyRatings()` + * - `safetyRatings({})` + * - `safetyRatings({ modelYear })` + * - `safetyRatings({ modelYear, make })` + * - `safetyRatings({ modelYear, make, model })` + * - `safetyRatings({ vehicleId })` * - * FYI: Rules #1-3 will return a 404 error from the NHTSA API if you break them. + * Real Example URLs, w/trailing slash also ok: * - * - 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. + * - 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 * - * - 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. + * 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. * - * - Rule #4 is enforced by this function internally when fetching the data or returning the URL - * string. + * Returned data will be structured as `{ Count, Message, Results }` for any combination of options. * - * Some other important things to note: + * See the `Returns` section below for more details. * - * - If you pass an object that includes options not listed above, the function will throw an Error. + * ### Some Notes on `vehicleId` * - * - If you pass an object with an invalid options combination, the function will throw an Error. + * The `VehicleId` is found in `response.Results[x].VehicleId` for any path combination. * - * - If you pass an object with any valid combination of options but include options not listed - * above, the function will throw an Error. + * `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. * - * - 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`. + * 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`. * - * Full (valid) endpoint URL examples, trailing slash ok: + * - 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. * - * - 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 + * ## Rules * - * #### Some Notes on `VehicleId` + * There are several rules to follow when using this API or you will get a network error response + * from the NHTSA API. * - * 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`. + * 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. * - * - 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. + * FYI: Rules #1-3 will return a 404 Unknown error from the NHTSA API if you break them. * - * - 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. + * Consequences of breaking the rules: * - * - The other paths are used if you don't know the `modelYear`, `make`, or `model` and need to - * retrieve that information first. + * - 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. * - * The following describes the use of the different paths and options in more detail. + * There will also be TypeScript errors if you pass invalid options or invalid combinations of + * options. * - * #### Get All Model Years - `/SafetyRatings` + * To clarify, this function will `throw Error`s in the following cases: * - * If you pass no arguments, an empty object `{}`, `undefined`, or `true` as the first argument, the - * base path `/SafetyRatings` will be used. + * - 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 * - * This path returns a list of available model years in the database. + * 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. * * ```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(result.ModelYear) // "2024", "2023", "2022", etc * console.log(results.VehicleId) // 0 * }) * }) * ``` * - * #### Get Makes For Model Year - `/SafetyRatings/modelYear/:modelYear` + * ### Get Makes for Model Year * - * If you pass a `modelYear` as the only option, the `/modelYear/:modelYear` path will be used. + * Get a list of all available makes in the `Safety Ratings API` for a specific model year. * - * This path returns a list of available makes for that model year. + * If you pass a `modelYear` as the only option, the path `/modelYear/:modelYear` will be used. * * ```js * // Get a list of available makes for the 2013 model year @@ -136,7 +150,7 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * }) * .then((response) => { * response.Results.forEach((result) => { - * console.log(result.Make) // ACURA, AUDI, BENTLEY, etc. + * console.log(result.Make) // "ACURA", "AUDI", "BENTLEY", etc. * console.log(results.VehicleId) // 0 * }) * }) @@ -144,12 +158,13 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * * 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` + * ### Get Models for Make * - * If you pass a `modelYear` and `make` as the only options, the `/modelYear/:modelYear/make/:make` - * path will be used. + * Get a list of all available models in the `Safety Ratings API` for a specific model year and + * make. * - * This path returns all of the models for that model year and make combination. + * If you pass a `modelYear` and `make` as the only options, the path + * `/modelYear/:modelYear/make/:make` will be used. * * ```js * // Get the models for a 2013 Honda @@ -159,7 +174,7 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * }) * .then((response) => { * response.Results.forEach((model) => { - * console.log(model.Model) // Accord, Civic, etc + * console.log(model.Model) // "Accord", "Civic", etc * console.log(model.VehicleId) // 0 * }) * }) @@ -168,14 +183,14 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * 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` + * ### 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. * - * 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({ @@ -184,16 +199,18 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * 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 + * 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 + * 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. + * 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 @@ -204,16 +221,15 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * 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` + * ### Get Safety Ratings by VehicleId * - * If you pass `options.vehicleId`, the `/vehicleId/:vehicleId` path will be used. + * Gets a list of Safety Ratings for the given `vehicleId`. * - * This path returns 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 a `vehicleId` option. + * All other options will be ignored if you provide `options.vehicleId`. * - * There will only be one object in the `Results` array for this path that contains all of the - * safety ratings. + * There will only be one object that contains all of the safety ratings in the `Results[]`. * * ```js * // Get the Safety Ratings for a 2013 Honda Accord 4 DR FWD @@ -225,68 +241,63 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * console.log(response.Results[0].InvestigationCount) * console.log(response.Results[0].RecallsCount) * console.log(response.Results[0].VehiclePicture) - * // ...etc + * // ...more properties * }) * ``` * - * ### API Response + * ## Returns * - * 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 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[]`. * - * The response will be an object with the following properties: + * 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` 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 `Results[]` will be typed based on the `options` passed to the function but will contain some + * combination of SafetyRatingsResultsData properties. * - * 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. + * - See type `SafetyRatingsResultsData` 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 names and values to append to the URL as a path - * @param {(string|number)} [options.modelYear] - Model Year of the vehicle to search - * @param {(string|number)} [options.make] - Make of the vehicle to search - * @param {string} [options.model] - Model of the vehicle to search - * @param {boolean} [doFetch=true] - Whether to fetch the data or just return the URL string + * @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 {(Promise | string>)} - * - Parsed API response `object` -or- url `string` if `doFetch = false` + * @returns - Parsed API response `object` -or- url `string` if `doFetch = false` */ -function safetyRatings( - options?: true -): Promise> -function safetyRatings(options: false): Promise -function safetyRatings( - options: NoInvalidOptions | undefined, - doFetch: false -): Promise 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 +): Promise /* Implementation */ async function safetyRatings( options?: SafetyRatingsOptions | boolean, doFetch: boolean = true -): Promise { +): Promise { const endpointName = 'SafetyRatings' /** @@ -378,14 +389,11 @@ async function safetyRatings( )}. Valid options are: ${validKeys.join(', ')}` ) } - /* - * Using this to transform the options object into URI encoded string or undefined values - */ - const { vehicleId, modelYear, make, model } = - encodeQueryStringParams(options) + + // const { vehicleId, modelYear, make, model } = options /* Build the API URL path */ - path = buildPath({ vehicleId, modelYear, make, model }) + path = buildPath(options) } const { get, createCachedUrl, getCachedUrl } = useNHTSA() @@ -394,13 +402,12 @@ async function safetyRatings( apiType: 'safetyRatings', endpointName, path, - includeQueryString: false, }) if (!doFetch) { return getCachedUrl() } else { - return get() + return get() } } catch (error) { return rejectWithError(error) @@ -434,7 +441,9 @@ export type SafetyRatingsOptionsBase = { } /** - * Options to build path: `/SafetyRatings` + * Options to get all available `modelYear`s in the `Safety Ratings API` + * + * Builds path: `/SafetyRatings` */ export type SafetyRatingsOptionsEmpty = { modelYear?: undefined @@ -444,7 +453,10 @@ export type SafetyRatingsOptionsEmpty = { } /** - * Options to build path: `/SafetyRatings/modelYear/:modelYear` + * 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 @@ -454,7 +466,10 @@ export type SafetyRatingsOptionsModelYear = { } /** - * Options to build path: `/SafetyRatings/modelYear/:modelYear/make/:make` + * 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 @@ -464,9 +479,12 @@ export type SafetyRatingsOptionsMake = { } /** - * Options to build path: `/SafetyRatings/modelYear/:modelYear/make/:make/model/:model` + * 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 SafetyRatingsOptionsModel = { +export type SafetyRatingsOptionsVehicle = { modelYear: string | number make: string model: string @@ -474,7 +492,10 @@ export type SafetyRatingsOptionsModel = { } /** - * Options to build path: `/SafetyRatings/vehicleId/:vehicleId` + * 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 @@ -491,27 +512,36 @@ export type SafetyRatingsOptions = | SafetyRatingsOptionsVehicleId | SafetyRatingsOptionsModelYear | SafetyRatingsOptionsMake - | SafetyRatingsOptionsModel + | SafetyRatingsOptionsVehicle -/** Ensures only valid options are used in the `safetyRatings()` function */ +/** + * Ensures only valid options are passed to the `safetyRatings()` function + */ export type NoInvalidOptions = NoExtraProperties +// export type NoInvalidOptions = +// T extends SafetyRatingsOptions +// ? NoExtraProperties +// : never + /** - * 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. + * 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 SafetyRatingsResultsVariants = +export type SafetyRatingsResultsVariant = | 'getModelYears' - | 'modelYear' - | 'make' - | 'model' + | 'getMakes' + | 'getModels' + | 'vehicle' | 'vehicleId' | 'default' /** - * All possible properties and values found in the `Results` array objects of `Safety Ratings API` + * 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. @@ -555,15 +585,15 @@ export type SafetyRatingsResultsData = { * auto complete show them the keys, but this is more user friendly. */ /** - * Types the `Results[]` of the `Safety Ratings API` response based on the `ResultsVariant` that is - * passed to this type. + * 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()`. * - * 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. + * Also used in .test-d.ts files to easily match the expected return type of the function. */ export type SafetyRatingsResultsByVariant< - Variant extends SafetyRatingsResultsVariants = 'default', + Variant extends SafetyRatingsResultsVariant = 'default', > = /* Pick<> SafetyRatingsResultsData based on Variant string */ Variant extends 'getModelYears' @@ -574,7 +604,7 @@ export type SafetyRatingsResultsByVariant< 'ModelYear' | 'VehicleId' >]-?: SafetyRatingsResultsData[K] } - : Variant extends 'modelYear' + : Variant extends 'getMakes' ? /* Path /modelYear/:modelYear */ { [K in keyof Pick< @@ -582,7 +612,7 @@ export type SafetyRatingsResultsByVariant< 'Make' | 'ModelYear' | 'VehicleId' >]-?: SafetyRatingsResultsData[K] } - : Variant extends 'make' + : Variant extends 'getModels' ? /* Path /modelYear/:modelYear/make/:make */ { [K in keyof Pick< @@ -590,7 +620,7 @@ export type SafetyRatingsResultsByVariant< 'Make' | 'Model' | 'ModelYear' | 'VehicleId' >]-?: SafetyRatingsResultsData[K] } - : Variant extends 'model' + : Variant extends 'vehicle' ? /* Path /modelYear/:modelYear/make/:make/model/:model */ { [K in keyof Pick< SafetyRatingsResultsData, @@ -605,17 +635,17 @@ export type SafetyRatingsResultsByVariant< SafetyRatingsResultsData /** - * Types the `Results` array of the `Safety Ratings API` response based on the `options` passed - * to the function. + * 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<'modelYear'> + ? SafetyRatingsResultsByVariant<'getMakes'> : Options extends SafetyRatingsOptionsMake - ? SafetyRatingsResultsByVariant<'make'> - : Options extends SafetyRatingsOptionsModel - ? SafetyRatingsResultsByVariant<'model'> + ? SafetyRatingsResultsByVariant<'getModels'> + : Options extends SafetyRatingsOptionsVehicle + ? SafetyRatingsResultsByVariant<'vehicle'> : Options extends SafetyRatingsOptionsVehicleId ? SafetyRatingsResultsByVariant<'vehicleId'> : Options extends SafetyRatingsOptionsEmpty @@ -628,21 +658,22 @@ export type SafetyRatingsResultsByOptions< * * This type represents the complete parsed API response. * - * The `Results` array will be typed based on the `options` passed to the function. + * 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 `variant` passed to this type. + * Types the `safetyRatings()` function return based on the `SafetyRatingsResultsVariant` 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. + * The `Results[]` will be typed based on the `SafetyRatingsResultsVariant`. */ export type SafetyRatingsResponseByVariant< - Variant extends SafetyRatingsResultsVariants = 'default', + Variant extends SafetyRatingsResultsVariant = 'default', > = NhtsaResponse, 'safetyRatings'> /** @@ -650,8 +681,8 @@ export type SafetyRatingsResponseByVariant< * * 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 + * 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< diff --git a/packages/lib/src/api/safetyRatings/types.ts b/packages/lib/src/api/safetyRatings/types.ts index 91ff4fce..ccea2daa 100644 --- a/packages/lib/src/api/safetyRatings/types.ts +++ b/packages/lib/src/api/safetyRatings/types.ts @@ -8,15 +8,15 @@ export type { SafetyRatingsOptionsBase, SafetyRatingsOptionsEmpty, SafetyRatingsOptionsMake, - SafetyRatingsOptionsModel, SafetyRatingsOptionsModelYear, + SafetyRatingsOptionsVehicle, SafetyRatingsOptionsVehicleId, SafetyRatingsResponseByOptions, SafetyRatingsResponseByVariant, SafetyRatingsResultsByOptions, SafetyRatingsResultsByVariant, SafetyRatingsResultsData, - SafetyRatingsResultsVariants, -} from '.' + SafetyRatingsResultsVariant, +} from './safetyRatings' export {} From 4a80674e7b9f99707ceebd9eaa25e29acfbd75bf Mon Sep 17 00:00:00 2001 From: shaggytech Date: Wed, 20 Dec 2023 10:27:27 -0600 Subject: [PATCH 77/93] lib: begin proof of concept refactor on VPIC funtion names --- .../src/api/vpic/__tests__/_decodeVin.test.ts | 179 ++++++++++++ packages/lib/src/api/vpic/_decodeVin.ts | 264 ++++++++++++++++++ 2 files changed, 443 insertions(+) create mode 100644 packages/lib/src/api/vpic/__tests__/_decodeVin.test.ts create mode 100644 packages/lib/src/api/vpic/_decodeVin.ts 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..1a20e3a9 --- /dev/null +++ b/packages/lib/src/api/vpic/__tests__/_decodeVin.test.ts @@ -0,0 +1,179 @@ +import { beforeEach, describe, expect, test } from 'vitest' +import { decodeVin } from '../_decodeVin' + +// Mocks +import { createMockResponse } from '.vitest/helpers' +import { mockResults } from '.vitest/data' + +const endpointName = 'DecodeVin' +const vin = 'WA1A4AFY2J2008189' +const modelYearString = '2018' +const modelYearNumber = 2018 +const modelYear = modelYearNumber +const params = { modelYear } + +const baseUrl = 'https://vpic.nhtsa.dot.gov/api/vehicles' +const mockUrl = `${baseUrl}/${endpointName}/${vin}?format=json` +const mockUrlWithParams = `${baseUrl}/${endpointName}/${vin}?modelYear=${modelYear}&format=json` + +const expectedFetchOptions = { + saveUrl: true, + method: 'GET', +} + +type TestEach = { + description: string + args: Parameters + expectedUrl: string +} + +describe('api/endpoints/decodeVin.ts', () => { + test('exports decodeVin function', () => { + expect(decodeVin).toBeDefined() + expect(decodeVin).toBeInstanceOf(Function) + }) +}) + +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:', () => { + test.each([ + { + description: 'when passed a VIN string', + args: [vin], + expectedUrl: mockUrl, + }, + { + description: 'when passed a VIN string and doFetch = true', + args: [vin, true], + expectedUrl: mockUrl, + }, + { + description: 'when passed a VIN string and params', + args: [vin, { ...params }], + expectedUrl: mockUrlWithParams, + }, + { + description: 'when passed a VIN string, params, and doFetch = true', + args: [vin, { ...params }, true], + expectedUrl: mockUrlWithParams, + }, + { + description: 'when params.modelYear passed as a string', + args: [vin, { modelYear: modelYearString }], + expectedUrl: mockUrlWithParams, + }, + { + description: 'when params.modelYear passed as a number', + args: [vin, { modelYear: modelYearNumber }], + expectedUrl: mockUrlWithParams, + }, + ])('$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:', () => { + test.each([ + { + description: 'when passed a VIN string and doFetch = false', + args: [vin, false], + expectedUrl: mockUrl, + }, + { + description: 'when passed a VIN string, params, and doFetch = false', + args: [vin, { ...params }, false], + expectedUrl: mockUrlWithParams, + }, + ])('$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:', () => { + describe('VIN is undefined or is not a string', () => { + test.each([ + undefined, + 123, + { object: 123 }, + ['array'], + true, + false, + null, + () => 'function', + ])('%s', async (arg) => { + await expect(() => + decodeVin(arg as unknown as string) + ).rejects.toThrowError(/error validating argument named "vin"/) + + expect(fetchMock.requests().length).toEqual(0) + }) + }) + + describe('params is neither an object nor boolean', () => { + test.each(['string', 123, ['array'], null, () => 'function'])( + '%s', + async (params) => { + await expect(() => + decodeVin( + vin, + // @ts-expect-error Type 'x' is not assignable to type ... + params + ) + ).rejects.toThrowError(/error validating argument named "params"/) + + expect(fetchMock.requests().length).toEqual(0) + } + ) + }) + + describe('params.modelYear is neither a string nor number', () => { + test.each([ + { modelYear: true }, + { modelYear: false }, + { modelYear: ['a', 'b'] }, + { modelYear: { a: 'b' } }, + { modelYear: null }, + { modelYear: () => 'function' }, + ])('%s', async (params) => { + await expect(() => + decodeVin( + vin, + // @ts-expect-error Types of property 'modelYear' are incompatible. + params + ) + ).rejects.toThrowError(/error validating argument named "modelYear"/) + + expect(fetchMock.requests().length).toEqual(0) + }) + }) + }) +}) diff --git a/packages/lib/src/api/vpic/_decodeVin.ts b/packages/lib/src/api/vpic/_decodeVin.ts new file mode 100644 index 00000000..0d0f0b73 --- /dev/null +++ b/packages/lib/src/api/vpic/_decodeVin.ts @@ -0,0 +1,264 @@ +/** + * @module api/vpic/endpoints/decodeVin + * @category API - VPIC (VIN Decoding) + */ + +import { useNHTSA } from '@/api' +import { catchInvalidArguments, rejectWithError } from '@/utils' +import type { IArgToValidate, NhtsaResponse } from '@/types' + +/** + * ::: 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 + * + * @param vin - Vehicle Identification Number (full or partial) + * @param [params] - Object of Query Search names and values to append to the URL as a query string + * @param [params.modelYear] - Optional Model Year search parameter + * @param [doFetch=true] - Whether to fetch the data or just return the URL + * (default: `true`) + * @returns {(Promise | string>)} - Api Response `object` + * -or- url `string` if `doFetch = false` + */ +function decodeVin(vin: string): Promise +function decodeVin(vin: string, doFetch: true): Promise +function decodeVin(vin: string, doFetch: false): Promise +function decodeVin( + vin: string, + params: { modelYear?: string | number }, + doFetch: false +): Promise +function decodeVin( + vin: string, + params?: { modelYear?: string | number }, + doFetch?: true +): Promise +function decodeVin( + vin: string, + params?: + | { + modelYear?: string | number + } + | boolean, + doFetch?: boolean +): Promise +/* Implementation */ +async function decodeVin( + vin: string, + params?: + | { + modelYear?: string | number + } + | boolean, + doFetch = true +): Promise { + const endpointName = 'DecodeVin' + + try { + if (typeof params === 'boolean') { + doFetch = params + params = undefined + } + + const args: IArgToValidate[] = [ + { name: 'vin', value: vin, required: true, types: ['string'] }, + { name: 'params', value: params, types: ['object'] }, + { + name: 'modelYear', + value: params?.modelYear, + types: ['string', 'number'], + }, + ] + catchInvalidArguments({ args }) + + const { get, createCachedUrl, getCachedUrl } = useNHTSA() + + createCachedUrl({ endpointName, path: vin, params }) + + 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 DecodeVinResults = { + 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 From 901c00de5611e509132715f51e73d194ec3c24e1 Mon Sep 17 00:00:00 2001 From: ShaggyTech Date: Wed, 20 Dec 2023 14:59:08 -0600 Subject: [PATCH 78/93] lib(tests): add tests for recalls function --- .../api/recalls/__tests__/recalls.test-d.ts | 780 ++++++++++++++++++ .../src/api/recalls/__tests__/recalls.test.ts | 718 ++++++++++++++++ packages/lib/src/api/recalls/types.ts | 23 + 3 files changed, 1521 insertions(+) create mode 100644 packages/lib/src/api/recalls/__tests__/recalls.test-d.ts create mode 100644 packages/lib/src/api/recalls/__tests__/recalls.test.ts create mode 100644 packages/lib/src/api/recalls/types.ts 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..c50980df --- /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 campaignNumber = '20V505000' +const modelYearString = '2020' +const modelYearNumber = 2020 +const modelYear = modelYearNumber +const make = 'Volkswagen' +const model = 'Atlas' + +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..ca6e5920 --- /dev/null +++ b/packages/lib/src/api/recalls/__tests__/recalls.test.ts @@ -0,0 +1,718 @@ +import { beforeEach, describe, expect, test } from 'vitest' +import { recalls } from '../recalls' + +// Mocks +import { createMockResponse } from '.vitest/helpers' +import { mockResults } from '.vitest/data' + +const campaignNumber = '20V505000' +const modelYearString = '2020' +const modelYearNumber = 2020 +const modelYear = modelYearNumber +const make = 'Volkswagen' +const model = 'Atlas' + +// 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.vehicleId + { + 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) + console.log('results: ', results) + console.log('expectedUrl: ', 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 options: notAnOption. Valid options are: modelYear, make, model, campaignNumber/ + ) + + 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 options: notAnOption. Valid options are: modelYear, make, model, campaignNumber/ + ) + + 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 options: notAnOption. Valid options are: modelYear, make, model, campaignNumber/ + ) + + 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(/error validating argument named "campaignNumber"/) + + 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 options: notAnOption. Valid options are: modelYear, make, model, campaignNumber/ + ) + + 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 options: notAnOption. Valid options are: modelYear, make, model, campaignNumber/ + ) + + 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 options: notAnOption. Valid options are: modelYear, make, model, campaignNumber/ + ) + + expect(fetchMock.requests().length).toEqual(0) + }) + + test('with invalid options and all valid options', async () => { + await expect(() => + recalls({ + notAnOption: 'no TS error, campaignNumber error takes precedence', + modelYear, + make, + model, + // @ts-expect-error Type 'number' is not assignable to type 'undefined' + campaignNumber: 123, + }) + ).rejects.toThrowError(/error validating argument named "campaignNumber"/) + + 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. + * + * All of these calls to safetyRatings() mimic all of tests in the test.each() tests above. + * They are separated here to allow for testing of the IDE tooltips for each possible response + * type individually by hovering over the saved `result_x` and/or the function name each time it is + * called. + * + * This cannot be achieved in test.each() tests because the way .each() is typed, it will show all + * possible SafetyRatingsResultsVariants types at once when hovering over the saved results of + * safetyRatings(). This will still happen even if you only include arguments that would return + * the same type of response. + * + * 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/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 {} From 6dfe37973db73b0d228da9fa5a241ce332f6c641 Mon Sep 17 00:00:00 2001 From: ShaggyTech Date: Wed, 20 Dec 2023 15:00:12 -0600 Subject: [PATCH 79/93] lib(tests): improve products and safetyRatings tests --- .../api/products/__tests__/products.test-d.ts | 132 ++- .../api/products/__tests__/products.test.ts | 2 +- .../__tests__/safetyRatings.test-d.ts | 821 +++++++++++++++--- .../__tests__/safetyRatings.test.ts | 28 +- 4 files changed, 789 insertions(+), 194 deletions(-) diff --git a/packages/lib/src/api/products/__tests__/products.test-d.ts b/packages/lib/src/api/products/__tests__/products.test-d.ts index 5ae0fcba..dcc78b7c 100644 --- a/packages/lib/src/api/products/__tests__/products.test-d.ts +++ b/packages/lib/src/api/products/__tests__/products.test-d.ts @@ -2,7 +2,6 @@ import { describe, expectTypeOf, test } from 'vitest' import { products, - type NoInvalidOptions, type ProductsIssueType, type ProductsOptions, type ProductsOptionsEmpty, @@ -27,7 +26,7 @@ test('Typecheck: products() - parameters - ', () => { expectTypeOf().parameters.toMatchTypeOf< [ issueType: ProductsIssueType, - options?: boolean | NoInvalidOptions | undefined, + options?: boolean | ProductsOptions | undefined, doFetch?: boolean | undefined, ] >() @@ -76,32 +75,29 @@ describe('Typecheck: products() - returns correct type of response data - ', () expectTypeOf(result).toEqualTypeOf< ProductsResponseByOptions >() - }) - - test('with issueType = "r"', async () => { - const result = await products(issueTypeR) - expectTypeOf(result).toEqualTypeOf< - ProductsResponseByVariant<'getModelYears'> + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'default'> >() - expectTypeOf(result).toEqualTypeOf< - ProductsResponseByOptions + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getMakes'> >() - }) - - test('with issueType = "recalls"', async () => { - const result = await products(issueTypeRecalls) - - expectTypeOf(result).toEqualTypeOf< - ProductsResponseByVariant<'getModelYears'> + expectTypeOf(result).not.toEqualTypeOf< + ProductsResponseByVariant<'getModels'> >() - expectTypeOf(result).toEqualTypeOf< - ProductsResponseByOptions + 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) + test('with issueType = "r"', async () => { + const result = await products(issueTypeR) expectTypeOf(result).toEqualTypeOf< ProductsResponseByVariant<'getModelYears'> @@ -130,8 +126,8 @@ describe('Typecheck: products() - returns correct type of response data - ', () >() }) - test('with issueType and options/doFetch = undefined', async () => { - const result = await products(issueType, undefined) + test('with issueType = "recalls"', async () => { + const result = await products(issueTypeRecalls) expectTypeOf(result).toEqualTypeOf< ProductsResponseByVariant<'getModelYears'> @@ -160,8 +156,8 @@ describe('Typecheck: products() - returns correct type of response data - ', () >() }) - test('with issueType, options = undefined, and doFetch = true', async () => { - const result = await products(issueType, undefined, true) + test('with issueType and doFetch = true', async () => { + const result = await products(issueType, true) expectTypeOf(result).toEqualTypeOf< ProductsResponseByVariant<'getModelYears'> @@ -190,8 +186,8 @@ describe('Typecheck: products() - returns correct type of response data - ', () >() }) - test('with issueType and options = {}', async () => { - const result = await products(issueType, {}) + test('with issueType and options/doFetch = undefined', async () => { + const result = await products(issueType, undefined) expectTypeOf(result).toEqualTypeOf< ProductsResponseByVariant<'getModelYears'> @@ -220,8 +216,8 @@ describe('Typecheck: products() - returns correct type of response data - ', () >() }) - test('with issueType, options = {}, and doFetch = true', async () => { - const result = await products(issueType, {}, true) + test('with issueType, options = undefined, and doFetch = true', async () => { + const result = await products(issueType, undefined, true) expectTypeOf(result).toEqualTypeOf< ProductsResponseByVariant<'getModelYears'> @@ -250,19 +246,21 @@ describe('Typecheck: products() - returns correct type of response data - ', () >() }) - test('with issueType and options.modelYear as string', async () => { - const result = await products(issueType, { modelYear: modelYearString }) + test('with issueType and options = {}', async () => { + const result = await products(issueType, {}) - expectTypeOf(result).toEqualTypeOf>() expectTypeOf(result).toEqualTypeOf< - ProductsResponseByOptions + ProductsResponseByVariant<'getModelYears'> + >() + expectTypeOf(result).toEqualTypeOf< + ProductsResponseByOptions >() expectTypeOf(result).not.toEqualTypeOf< ProductsResponseByVariant<'default'> >() expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByVariant<'getModelYears'> + ProductsResponseByVariant<'getMakes'> >() expectTypeOf(result).not.toEqualTypeOf< ProductsResponseByVariant<'getModels'> @@ -271,35 +269,28 @@ describe('Typecheck: products() - returns correct type of response data - ', () ProductsResponseByOptions >() expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByOptions + ProductsResponseByOptions >() expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByOptions + ProductsResponseByOptions >() }) - test('with issueType and options.modelYear as number', async () => { - const result = await products(issueType, { modelYear: modelYearNumber }) + test('with issueType, options = {}, and doFetch = true', async () => { + const result = await products(issueType, {}, true) - expectTypeOf(result).toEqualTypeOf>() expectTypeOf(result).toEqualTypeOf< - ProductsResponseByOptions + ProductsResponseByVariant<'getModelYears'> >() - }) - - test('with issueType, options.modelYear, and doFetch = true', async () => { - const result = await products(issueType, { modelYear }, true) - - expectTypeOf(result).toEqualTypeOf>() expectTypeOf(result).toEqualTypeOf< - ProductsResponseByOptions + ProductsResponseByOptions >() expectTypeOf(result).not.toEqualTypeOf< ProductsResponseByVariant<'default'> >() expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByVariant<'getModelYears'> + ProductsResponseByVariant<'getMakes'> >() expectTypeOf(result).not.toEqualTypeOf< ProductsResponseByVariant<'getModels'> @@ -308,15 +299,15 @@ describe('Typecheck: products() - returns correct type of response data - ', () ProductsResponseByOptions >() expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByOptions + ProductsResponseByOptions >() expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByOptions + ProductsResponseByOptions >() }) - test('with issueType, options.modelYear, and options.make = undefined', async () => { - const result = await products(issueType, { modelYear, make: undefined }) + test('with issueType and options.modelYear as string', async () => { + const result = await products(issueType, { modelYear: modelYearString }) expectTypeOf(result).toEqualTypeOf>() expectTypeOf(result).toEqualTypeOf< @@ -343,40 +334,21 @@ describe('Typecheck: products() - returns correct type of response data - ', () >() }) - test('with issueType, options.modelYear, and options.make', async () => { - const result = await products(issueType, { modelYear, make }) + test('with issueType and options.modelYear as number', async () => { + const result = await products(issueType, { modelYear: modelYearNumber }) - expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf>() expectTypeOf(result).toEqualTypeOf< - ProductsResponseByOptions - >() - - expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByVariant<'default'> - >() - expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByVariant<'getModelYears'> - >() - expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByVariant<'getMakes'> - >() - expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByOptions - >() - expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByOptions - >() - expectTypeOf(result).not.toEqualTypeOf< ProductsResponseByOptions >() }) - test('with issueType, options.modelYear, options.make, and doFetch = true', async () => { - const result = await products(issueType, { modelYear, make }, true) + test('with issueType, options.modelYear, and doFetch = true', async () => { + const result = await products(issueType, { modelYear }, true) - expectTypeOf(result).toEqualTypeOf>() + expectTypeOf(result).toEqualTypeOf>() expectTypeOf(result).toEqualTypeOf< - ProductsResponseByOptions + ProductsResponseByOptions >() expectTypeOf(result).not.toEqualTypeOf< @@ -386,7 +358,7 @@ describe('Typecheck: products() - returns correct type of response data - ', () ProductsResponseByVariant<'getModelYears'> >() expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByVariant<'getMakes'> + ProductsResponseByVariant<'getModels'> >() expectTypeOf(result).not.toEqualTypeOf< ProductsResponseByOptions @@ -395,7 +367,7 @@ describe('Typecheck: products() - returns correct type of response data - ', () ProductsResponseByOptions >() expectTypeOf(result).not.toEqualTypeOf< - ProductsResponseByOptions + ProductsResponseByOptions >() }) }) diff --git a/packages/lib/src/api/products/__tests__/products.test.ts b/packages/lib/src/api/products/__tests__/products.test.ts index 8126513b..5d58f5e6 100644 --- a/packages/lib/src/api/products/__tests__/products.test.ts +++ b/packages/lib/src/api/products/__tests__/products.test.ts @@ -440,7 +440,7 @@ describe.skip('IDE Tooltips - manual test of results type on hover', async () => }[]; } ******************************/ - const result_1 = await products(issueType, 'why does this work?>??????????') + 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) diff --git a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts index 23c6b087..d0d4fa90 100644 --- a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts +++ b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts @@ -2,7 +2,6 @@ import { describe, expectTypeOf, test } from 'vitest' import { safetyRatings, - type NoInvalidOptions, type SafetyRatingsOptions, type SafetyRatingsOptionsEmpty, type SafetyRatingsOptionsMake, @@ -26,7 +25,7 @@ test('Typecheck: safetyRatings() - parameters - ', () => { expectTypeOf().toBeFunction() expectTypeOf().parameters.toMatchTypeOf< [ - options?: boolean | NoInvalidOptions | undefined, + options?: boolean | SafetyRatingsOptions | undefined, doFetch?: boolean | undefined, ] >() @@ -37,180 +36,800 @@ describe('Typecheck: safetyRatings() - return correct type of response data - ', * doFetch = true | undefined (default) ****************************/ test('with no arguments', async () => { - expectTypeOf(await safetyRatings()).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getModelYears'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf(await safetyRatings(true)).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getModelYears'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf(await safetyRatings(undefined)).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getModelYears'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf(await safetyRatings(undefined, true)).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getModelYears'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf(await safetyRatings(undefined, undefined)).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getModelYears'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf(await safetyRatings({})).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getModelYears'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf(await safetyRatings({}, true)).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getModelYears'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf( - await safetyRatings({ modelYear: modelYearString }) - ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getMakes'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf( - await safetyRatings({ modelYear: modelYearString }, true) - ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getMakes'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf( - await safetyRatings({ modelYear: modelYearNumber }) - ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getMakes'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf( - await safetyRatings({ modelYear: modelYearNumber }, true) - ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getMakes'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf(await safetyRatings({ modelYear, make })).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getModels'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf(await safetyRatings({ modelYear, make }, true)).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getModels'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf(await safetyRatings({ modelYear, make, model })).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'vehicle'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf( - await safetyRatings({ modelYear, make, model }, true) - ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'vehicle'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf( - await safetyRatings({ vehicleId: vehicleIdString }) - ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'vehicleId'> - | SafetyRatingsResponseByOptions + 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 () => { - expectTypeOf( - await safetyRatings({ vehicleId: vehicleIdString }, true) - ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'vehicleId'> - | SafetyRatingsResponseByOptions + const result = await safetyRatings({ vehicleId: vehicleIdString }, true) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions >() - }) - test('with options.vehicleId as number', async () => { - expectTypeOf( - await safetyRatings({ vehicleId: vehicleIdNumber }) - ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'vehicleId'> - | 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 () => { - expectTypeOf( - await safetyRatings({ vehicleId: vehicleIdNumber }, true) - ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'vehicleId'> - | SafetyRatingsResponseByOptions + test('with options.vehicleId as number', async () => { + const result = await safetyRatings({ vehicleId: vehicleIdNumber }) + + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByVariant<'vehicleId'> + >() + expectTypeOf(result).toEqualTypeOf< + SafetyRatingsResponseByOptions >() - }) - test('with options.modelYear, and options.vehicleId = undefined, ', async () => { - expectTypeOf( - await safetyRatings({ vehicleId: undefined, modelYear }) - ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getMakes'> - | 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.modelYear, options.make, and options.vehicleId = undefined, ', async () => { - expectTypeOf( - await safetyRatings({ vehicleId: undefined, modelYear, make }) - ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'getModels'> - | 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 >() - }) - test('with options.modelYear, options.make, options.model, and options.vehicleId = undefined, ', async () => { - expectTypeOf( - await safetyRatings({ vehicleId: undefined, modelYear, make, model }) - ).toEqualTypeOf< - | SafetyRatingsResponseByVariant<'vehicle'> - | 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 >() }) }) @@ -223,7 +842,7 @@ describe('Typecheck: safetyRatings() - returns type string if doFetch = false - expectTypeOf(await safetyRatings(false)).toEqualTypeOf() }) - test('with udnefined as first argument and doFetch = false', async () => { + test('with undefined as first argument and doFetch = false', async () => { expectTypeOf(await safetyRatings(undefined, false)).toEqualTypeOf() }) diff --git a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts index 1f9dd43a..fbcddde7 100644 --- a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts +++ b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts @@ -14,10 +14,14 @@ const modelYear = modelYearNumber const make = 'Audi' const model = 'A5' -// https://api.nhtsa.gov/safetyRatings/modelyear/2013/make/Acura/model/rdx +// 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 mockUrl = `${baseUrl}?format=json` +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` @@ -52,31 +56,31 @@ describe('safetyRatings()', () => { describe('Fetches API data with: ', () => { test.each([ // no arguments, empty object, undefined - returns all available model years - { description: 'no arguments', args: [], expectedUrl: mockUrl }, + { description: 'no arguments', args: [], expectedUrl: mockUrlBase }, { description: 'doFetch = true as first argument', args: [true], - expectedUrl: mockUrl, + expectedUrl: mockUrlBase, }, { description: 'undefined as first argument', args: [undefined], - expectedUrl: mockUrl, + expectedUrl: mockUrlBase, }, { description: 'undefined as first argument and doFetch = true', args: [undefined, true], - expectedUrl: mockUrl, + expectedUrl: mockUrlBase, }, { description: 'empty object as first argument', args: [{}], - expectedUrl: mockUrl, + expectedUrl: mockUrlBase, }, { description: 'empty object as first argument and doFetch = true', args: [{}, true], - expectedUrl: mockUrl, + expectedUrl: mockUrlBase, }, // options.modelYear { @@ -203,17 +207,17 @@ describe('safetyRatings()', () => { { description: 'doFetch = false as first argument', args: [false], - expectedUrl: mockUrl, + expectedUrl: mockUrlBase, }, { description: 'undefined as first argument and doFetch = false', args: [undefined, false], - expectedUrl: mockUrl, + expectedUrl: mockUrlBase, }, { description: 'empty object and doFetch = false', args: [{}, false], - expectedUrl: mockUrl, + expectedUrl: mockUrlBase, }, // options.modelYear { @@ -561,7 +565,7 @@ describe.skip('IDE Tooltips - manual test of results type on hover', async () => }[]; } ******************************/ - const result_1 = await safetyRatings('why does this work??????????????????') + const result_1 = await safetyRatings() const result_2 = await safetyRatings(undefined) const result_3 = await safetyRatings({}) const result_4 = await safetyRatings({}, true) From 35116f3d643acb2e6eb0ba1182b22b2e88115ab2 Mon Sep 17 00:00:00 2001 From: ShaggyTech Date: Wed, 20 Dec 2023 15:03:05 -0600 Subject: [PATCH 80/93] lib: correctly guard options object in non-vpic helper functions --- packages/lib/src/api/products/products.ts | 12 +++---- packages/lib/src/api/recalls/recalls.ts | 36 ++++++++++--------- .../src/api/safetyRatings/safetyRatings.ts | 15 +++----- 3 files changed, 28 insertions(+), 35 deletions(-) diff --git a/packages/lib/src/api/products/products.ts b/packages/lib/src/api/products/products.ts index c80167a5..8fd75d9c 100644 --- a/packages/lib/src/api/products/products.ts +++ b/packages/lib/src/api/products/products.ts @@ -335,24 +335,21 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * @param [doFetch=true] - If false, will return the url string instead of fetching the data * @returns NHTSA Api Response `object` */ -// Most specific: Overloads with generics -function products( +function products>( issueType: ProductsIssueType, options: NoInvalidOptions, doFetch?: true ): Promise> -function products( +function products>( issueType: ProductsIssueType, options: NoInvalidOptions | undefined, doFetch: false ): Promise -// Next, overloads with both issueType and doFetch function products( issueType: ProductsIssueType, doFetch?: true ): Promise> function products(issueType: ProductsIssueType, doFetch: false): Promise -// Then, overloads with only issueType function products( issueType: ProductsIssueType ): Promise> @@ -361,8 +358,7 @@ function products( options?: undefined, doFetch?: true ): Promise> -// Most general: Catch-all overload -function products( +function products>( issueType: ProductsIssueType, options?: NoInvalidOptions | boolean, doFetch?: boolean @@ -370,7 +366,7 @@ function products( /* Implementation */ async function products( issueType: ProductsIssueType, - options?: ProductsOptions | boolean, + options?: NoInvalidOptions | boolean, doFetch: boolean = true ): Promise { const endpointName = 'products' diff --git a/packages/lib/src/api/recalls/recalls.ts b/packages/lib/src/api/recalls/recalls.ts index f510633c..18c7de34 100644 --- a/packages/lib/src/api/recalls/recalls.ts +++ b/packages/lib/src/api/recalls/recalls.ts @@ -303,29 +303,29 @@ import type { * (default: `true`) * @returns - Parsed API response `object` -or- url `string` if `doFetch = false` */ -function recalls( +function recalls>( + options: NoInvalidOptions, doFetch?: true -): Promise> -function recalls(doFetch: false): Promise -function recalls( +): Promise> +function recalls>( options: NoInvalidOptions | undefined, doFetch: false ): Promise -function recalls( - options: NoInvalidOptions, - doFetch?: true -): Promise> function recalls( options?: undefined, doFetch?: true ): Promise> -function recalls( +function recalls( + doFetch?: true +): Promise> +function recalls(doFetch: false): Promise +function recalls>( options?: NoInvalidOptions | boolean, doFetch?: boolean -): Promise +): Promise /* Implementation */ async function recalls( - options?: RecallsOptions | boolean, + options?: NoInvalidOptions | boolean, doFetch: boolean = true ): Promise { const endpointName = 'recalls' @@ -346,7 +346,7 @@ async function recalls( args: [ { name: 'options', value: options, types: ['object'] }, { - name: 'vehicleId', + name: 'campaignNumber', value: options?.campaignNumber, types: ['string'], }, @@ -407,19 +407,23 @@ async function recalls( const hasVehicle = modelYear && make && model const { get, createCachedUrl, getCachedUrl } = useNHTSA() - /* use the Recalls API if campaignNumber or full vehicle is passed */ + /* use the Recalls API if campaignNumber or full vehicle is passed, ignores vehicle if campaignNumber exists */ if (campaignNumber || hasVehicle) { if (campaignNumber) { - path = `/recalls/campaignNumber` + path = `campaignNumber` } else if (hasVehicle) { - path = `/recalls/recallsByVehicle` + path = `recallsByVehicle` } + const params = campaignNumber + ? { campaignNumber } + : { modelYear, make, model } + createCachedUrl({ apiType: 'recalls', endpointName, path, - params: { ...encodedParams }, + params, }) if (!doFetch) { diff --git a/packages/lib/src/api/safetyRatings/safetyRatings.ts b/packages/lib/src/api/safetyRatings/safetyRatings.ts index 95f030d4..d35faf01 100644 --- a/packages/lib/src/api/safetyRatings/safetyRatings.ts +++ b/packages/lib/src/api/safetyRatings/safetyRatings.ts @@ -273,11 +273,11 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * (default: `true`) * @returns - Parsed API response `object` -or- url `string` if `doFetch = false` */ -function safetyRatings( +function safetyRatings>( options: NoInvalidOptions, doFetch?: true ): Promise> -function safetyRatings( +function safetyRatings>( options: NoInvalidOptions | undefined, doFetch: false ): Promise @@ -289,13 +289,13 @@ function safetyRatings( doFetch?: true ): Promise> function safetyRatings(doFetch: false): Promise -function safetyRatings( +function safetyRatings>( options?: NoInvalidOptions | boolean, doFetch?: boolean ): Promise /* Implementation */ async function safetyRatings( - options?: SafetyRatingsOptions | boolean, + options?: NoInvalidOptions | boolean, doFetch: boolean = true ): Promise { const endpointName = 'SafetyRatings' @@ -390,8 +390,6 @@ async function safetyRatings( ) } - // const { vehicleId, modelYear, make, model } = options - /* Build the API URL path */ path = buildPath(options) } @@ -520,11 +518,6 @@ export type SafetyRatingsOptions = export type NoInvalidOptions = NoExtraProperties -// export type NoInvalidOptions = -// T extends SafetyRatingsOptions -// ? NoExtraProperties -// : never - /** * 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 From 67f4df67cbf459478f6b80ad528dabdb5b43ca34 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Thu, 21 Dec 2023 00:16:27 -0600 Subject: [PATCH 81/93] chore(lib): cleanup tests and comments for api functions --- packages/lib/src/api/products/products.ts | 27 ------------------- .../api/recalls/__tests__/recalls.test-d.ts | 2 +- .../src/api/recalls/__tests__/recalls.test.ts | 6 ++--- packages/lib/src/api/recalls/recalls.ts | 21 +++++++-------- .../__tests__/safetyRatings.test-d.ts | 5 ++-- .../__tests__/safetyRatings.test.ts | 6 ++--- 6 files changed, 18 insertions(+), 49 deletions(-) diff --git a/packages/lib/src/api/products/products.ts b/packages/lib/src/api/products/products.ts index 8fd75d9c..35c13bbd 100644 --- a/packages/lib/src/api/products/products.ts +++ b/packages/lib/src/api/products/products.ts @@ -12,33 +12,6 @@ import { import type { NhtsaResponse, NoExtraProperties } from '@/types' /** - * The products() function is used by the recalls() and complaints() functions to get - * model years, makes, and models based on query string ?issueType=r or ?issueType=c - * to then query for recalls or complaints based on a specific model year, make, and model - * - * There seems to be no other `issueTypes` other than `r` and `c` - * - * `issueType` is required - * 'c' or 'complaints' = complaints - * 'r' or 'recalls' = recalls - * - * If you pass no options, it will get all model years for the issueType and use url: - * api.nhtsa.gov/products/vehicle/modelYears?issueType={issueType} - * - * If you pass options.modelYear, it will get all makes for the issueType and use url: - * api.nhtsa.gov/products/vehicle/makes?modelYear={modelYear}&issueType={issueType} - * - * If you pass options.modelYear and options.make, will get all models for the issueType and use url: - * api.nhtsa.gov/products/vehicle/models?modelYear={modelYear}&make={make}&issueType={issueType} - * - * Throws an error: - * - if issueType is not passed or is not a string of 'r' 'recalls' 'c' or 'complaints' - * - if options is not an object - * - if options.modelYear is neither a string nor number - * - if options.make is not a string - * - if you pass options.make you must also pass options.modelYear - * - * * # Products API * * ::: tip :bulb: More Information diff --git a/packages/lib/src/api/recalls/__tests__/recalls.test-d.ts b/packages/lib/src/api/recalls/__tests__/recalls.test-d.ts index c50980df..409208e4 100644 --- a/packages/lib/src/api/recalls/__tests__/recalls.test-d.ts +++ b/packages/lib/src/api/recalls/__tests__/recalls.test-d.ts @@ -12,12 +12,12 @@ import { type RecallsResponseByVariant, } from '../recalls' -const campaignNumber = '20V505000' const modelYearString = '2020' const modelYearNumber = 2020 const modelYear = modelYearNumber const make = 'Volkswagen' const model = 'Atlas' +const campaignNumber = '20V505000' test('Typecheck: recalls() - parameters - ', () => { expectTypeOf().toBeFunction() diff --git a/packages/lib/src/api/recalls/__tests__/recalls.test.ts b/packages/lib/src/api/recalls/__tests__/recalls.test.ts index ca6e5920..c1f0041f 100644 --- a/packages/lib/src/api/recalls/__tests__/recalls.test.ts +++ b/packages/lib/src/api/recalls/__tests__/recalls.test.ts @@ -5,12 +5,12 @@ import { recalls } from '../recalls' import { createMockResponse } from '.vitest/helpers' import { mockResults } from '.vitest/data' -const campaignNumber = '20V505000' 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 @@ -239,7 +239,7 @@ describe('recalls()', () => { args: [{ modelYear, make, model }, false], expectedUrl: mockUrlVehicle, }, - // options.vehicleId + // options.campaignNumber { description: 'options.campaignNumber and doFetch = false', args: [{ campaignNumber }, false], @@ -263,8 +263,6 @@ describe('recalls()', () => { const results = await recalls(...args) expect(results).toEqual(expectedUrl) - console.log('results: ', results) - console.log('expectedUrl: ', expectedUrl) expect(fetchMock.requests().length).toEqual(0) }) }) diff --git a/packages/lib/src/api/recalls/recalls.ts b/packages/lib/src/api/recalls/recalls.ts index 18c7de34..c6981cca 100644 --- a/packages/lib/src/api/recalls/recalls.ts +++ b/packages/lib/src/api/recalls/recalls.ts @@ -23,8 +23,8 @@ import type { * See: [Recalls Documentation] /guide/recalls * ::: * - * You can use `recalls()` as a thin wrapper for the `NHTSA Recalls API` to get safety - * ratings for a vehicle. + * 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 @@ -277,8 +277,7 @@ import type { * - `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 - * `Results`: + * 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 @@ -450,7 +449,7 @@ export { recalls } * 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. + * 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, @@ -469,7 +468,7 @@ export type RecallsOptionsBase = { } /** - * Options to get all available recall `modelYear`s via the `Products API`. + * Options to get all available `modelYear`s via the `Products API`. * * Builds path: `/products/vehicle/modelYears?issueType=r` */ @@ -481,7 +480,7 @@ export type RecallsOptionsEmpty = { } /** - * Options to get all available recall `make`s for a specific `modelYear` via the `Products API`. + * Options to get all available `make`s for a specific `modelYear` via the `Products API`. * * Builds path: `/products/vehicle/makes?modelYear={modelYear}&issueType=r` */ @@ -493,7 +492,7 @@ export type RecallsOptionsModelYear = { } /** - * Options to get all available recall `models`s for a specific `modelYear` and `make` via the + * 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` @@ -506,7 +505,7 @@ export type RecallsOptionsMake = { } /** - * Options to get all available `recalls` for a specific vehicle by `modelYear`, `make`, and + * 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}` @@ -519,7 +518,7 @@ export type RecallsOptionsVehicle = { } /** - * Options to get `recalls` for a specific `campaignNumber`. + * Options to get recalls for a specific `campaignNumber`. * * Builds path: `/recalls/campaignNumber?campaignNumber={campaignNumber}` */ @@ -625,7 +624,7 @@ export type RecallsResultsData = { * 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 `safetyRatings()`. + * 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. */ diff --git a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts index d0d4fa90..59f2a447 100644 --- a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts +++ b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test-d.ts @@ -12,14 +12,13 @@ import { type SafetyRatingsResponseByVariant, } from '../safetyRatings' -const vehicleIdString = '1234' -const vehicleIdNumber = 1234 -// const vehicleId = vehicleIdNumber 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() diff --git a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts index fbcddde7..144dfa9d 100644 --- a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts +++ b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts @@ -5,14 +5,14 @@ import { safetyRatings } from '../safetyRatings' import { createMockResponse } from '.vitest/helpers' import { mockResults } from '.vitest/data' -const vehicleIdString = '1234' -const vehicleIdNumber = 1234 -const vehicleId = vehicleIdNumber 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 From fd428d9103d66bd0b6790bd2dee3eb608492200e Mon Sep 17 00:00:00 2001 From: shaggytech Date: Thu, 21 Dec 2023 00:17:13 -0600 Subject: [PATCH 82/93] feat(lib): add function wrapper for Complaints API --- .../complaints/__tests__/complaints.test-d.ts | 839 ++++++++++++++++++ .../complaints/__tests__/complaints.test.ts | 733 +++++++++++++++ packages/lib/src/api/complaints/complaints.ts | 673 ++++++++++++++ packages/lib/src/api/complaints/types.ts | 23 + 4 files changed, 2268 insertions(+) create mode 100644 packages/lib/src/api/complaints/__tests__/complaints.test-d.ts create mode 100644 packages/lib/src/api/complaints/__tests__/complaints.test.ts create mode 100644 packages/lib/src/api/complaints/complaints.ts create mode 100644 packages/lib/src/api/complaints/types.ts 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..eab2bd4e --- /dev/null +++ b/packages/lib/src/api/complaints/__tests__/complaints.test.ts @@ -0,0 +1,733 @@ +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 Recalls 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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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(/error validating argument named "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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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 options: notAnOption. Valid options 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(/error validating argument named "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 safetyRatings.test-d.ts via Vitest type + * checking, these are simply hovering tooltip tests. + * + * All of these calls to safetyRatings() mimic all of tests in the test.each() tests above. + * They are separated here to allow for testing of the IDE tooltips for each possible response + * type individually by hovering over the saved `result_x` and/or the function name each time it is + * called. + * + * This cannot be achieved in test.each() tests because the way .each() is typed, it will show all + * possible SafetyRatingsResultsVariants types at once when hovering over the saved results of + * safetyRatings(). This will still happen even if you only include arguments that would return + * the same type of response. + * + * 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..b9cda969 --- /dev/null +++ b/packages/lib/src/api/complaints/complaints.ts @@ -0,0 +1,673 @@ +/** + * @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. + * + * ```js + * // Get a list of available model years in the complaints dataset + * await complaints().then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "2024", "2023", "2022", etc + * }) + * }) + * ``` + * + * ### Get Makes for Model Year + * + * Uses the `Products API` to get all available makes in the complaints dataset for a specific model + * year. + * + * If you pass a `modelYear` as the only option, the path and query string + * `/products/vehicle/makes?modelYear={modelYear}&issueType=c` will be used. + * + * ```js + * // Get a list of available makes for the 2013 model year + * await complaints({ + * modelYear: 2013, + * }) + * .then((response) => { + * response.Results.forEach((result) => { + * console.log(result.modelYear) // "ACURA", "AUDI", "BENTLEY", etc. + * console.log(results.make) // "JETTA", "ACCORD", etc. + * }) + * }) + * ``` + * + * 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 + * model year 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. + * + * ```js + * // Get a list of available models for a 2013 Honda + * 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. + * }) + * }) + * ``` + * + * 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 model year, 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. + * + * ```js + * // Get as list of complaints for a 2013 Honda Accord + * 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 + * }) + * }) + * ``` + * + * 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[]`. + * + * ```js + * // Get complaint information for a specific ODI Number + * 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 + * }) + * }) + * ``` + * + * ## 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'] }, + { + name: 'odiNumber', + value: options?.odiNumber, + 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'] }, + ], + }) + + /* + * Throw an error if options object contains invalid properties. + * + * This must be after the catchInvalidArguments() call above so we can ensure we have an actual + * object here and not 'null' 'array' etc., which typeof will let into the 'if' block as they + * are all considered typeof === 'object'. We only use typeof here to make the TS compiler + * happy. + */ + if (typeof options === 'object') { + const validKeys: Array = [ + 'modelYear', + 'make', + 'model', + 'odiNumber', + ] + const optionsKeys = Object.keys(options) as Array< + keyof ComplaintsOptionsBase + > + const invalidKeys = optionsKeys.filter((key) => { + return !validKeys.includes(key) + }) + + if (invalidKeys.length > 0) { + throw new Error( + `Invalid options: ${invalidKeys.join( + ', ' + )}. Valid options are: ${validKeys.join(', ')}` + ) + } + + 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 {} From 98290b0a26f66bb71b19a033b210ef669e2fb3d0 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Thu, 21 Dec 2023 00:26:39 -0600 Subject: [PATCH 83/93] chore(lib): update exports and index tests with new functions --- packages/lib/src/__tests__/index.test.ts | 24 ++++++++++++++ packages/lib/src/api/__tests__/index.test.ts | 18 +++++++++++ packages/lib/src/api/index.ts | 1 + packages/lib/src/api/types.ts | 2 ++ packages/lib/src/index.ts | 34 ++++++++++++++++++-- 5 files changed, 77 insertions(+), 2 deletions(-) diff --git a/packages/lib/src/__tests__/index.test.ts b/packages/lib/src/__tests__/index.test.ts index 8c1231a8..60008577 100644 --- a/packages/lib/src/__tests__/index.test.ts +++ b/packages/lib/src/__tests__/index.test.ts @@ -25,6 +25,10 @@ import { GetVehicleVariableList, GetVehicleVariableValuesList, GetWMIsForManufacturer, + complaints, + products, + recalls, + safetyRatings, useNHTSA, // Utility functions createQueryString, @@ -153,6 +157,26 @@ describe('api/index.ts', () => { 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) diff --git a/packages/lib/src/api/__tests__/index.test.ts b/packages/lib/src/api/__tests__/index.test.ts index 5a56a0ac..28e23e04 100644 --- a/packages/lib/src/api/__tests__/index.test.ts +++ b/packages/lib/src/api/__tests__/index.test.ts @@ -25,6 +25,9 @@ import { GetVehicleVariableValuesList, GetWMIsForManufacturer, useNHTSA, + complaints, + products, + recalls, safetyRatings, } from '../' @@ -154,6 +157,21 @@ describe('api/index.ts', () => { 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/index.ts b/packages/lib/src/api/index.ts index d8c3101e..d160f773 100644 --- a/packages/lib/src/api/index.ts +++ b/packages/lib/src/api/index.ts @@ -3,6 +3,7 @@ * @category API */ +export { complaints } from './complaints/complaints' export { products } from './products/products' export { recalls } from './recalls/recalls' export { safetyRatings } from './safetyRatings/safetyRatings' diff --git a/packages/lib/src/api/types.ts b/packages/lib/src/api/types.ts index 68e3c89c..9d5bf61a 100644 --- a/packages/lib/src/api/types.ts +++ b/packages/lib/src/api/types.ts @@ -3,7 +3,9 @@ * @category Types */ +export * from './complaints/types' export * from './products/types' +export * from './recalls/types' export * from './safetyRatings/types' export * from './vpic/endpoints/types' diff --git a/packages/lib/src/index.ts b/packages/lib/src/index.ts index eea8961d..6afea169 100644 --- a/packages/lib/src/index.ts +++ b/packages/lib/src/index.ts @@ -31,9 +31,11 @@ export { GetVehicleVariableList, GetVehicleVariableValuesList, GetWMIsForManufacturer, - useNHTSA, - safetyRatings, + complaints, products, + recalls, + safetyRatings, + useNHTSA, } from '@/api' /** @@ -78,6 +80,20 @@ export type { GetVehicleVariableListResults, GetVehicleVariableValuesListResults, GetWMIsForManufacturerResults, + ComplaintsOptions, + ComplaintsOptionsBase, + ComplaintsOptionsEmpty, + ComplaintsOptionsMake, + ComplaintsOptionsModelYear, + ComplaintsOptionsOdiNumber, + ComplaintsOptionsVehicle, + ComplaintsResponse, + ComplaintsResponseByOptions, + ComplaintsResponseByVariant, + ComplaintsResultsByOptions, + ComplaintsResultsByVariant, + ComplaintsResultsData, + ComplaintsResultsVariant, ProductsIssueType, ProductsOptions, ProductsOptionsBase, @@ -91,6 +107,20 @@ export type { ProductsResultsByVariant, ProductsResultsData, ProductsResultsVariant, + RecallsOptions, + RecallsOptionsBase, + RecallsOptionsCampaignNumber, + RecallsOptionsEmpty, + RecallsOptionsMake, + RecallsOptionsModelYear, + RecallsOptionsVehicle, + RecallsResponse, + RecallsResponseByOptions, + RecallsResponseByVariant, + RecallsResultsByOptions, + RecallsResultsByVariant, + RecallsResultsData, + RecallsResultsVariant, SafetyRatingsOptions, SafetyRatingsOptionsBase, SafetyRatingsOptionsEmpty, From 7cc7efc2cf84701e233e19433d84bf0a8703717b Mon Sep 17 00:00:00 2001 From: ShaggyTech Date: Wed, 20 Dec 2023 21:01:20 -0600 Subject: [PATCH 84/93] lib(api): rough draft overview of CSSIStation API before implementing --- packages/lib/src/api/complaints/complaints.ts | 2 +- .../__tests__/cssiStation.test-d.ts | 0 .../cssiStation/__tests__/cssiStation.test.ts | 0 .../lib/src/api/cssiStation/cssiStation.ts | 159 ++++++++++++++++++ packages/lib/src/api/cssiStation/types.ts | 0 5 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 packages/lib/src/api/cssiStation/__tests__/cssiStation.test-d.ts create mode 100644 packages/lib/src/api/cssiStation/__tests__/cssiStation.test.ts create mode 100644 packages/lib/src/api/cssiStation/cssiStation.ts create mode 100644 packages/lib/src/api/cssiStation/types.ts diff --git a/packages/lib/src/api/complaints/complaints.ts b/packages/lib/src/api/complaints/complaints.ts index b9cda969..8c981aea 100644 --- a/packages/lib/src/api/complaints/complaints.ts +++ b/packages/lib/src/api/complaints/complaints.ts @@ -241,7 +241,7 @@ import type { * ```js * // Get complaint information for a specific ODI Number * await complaints({ - * odiNumber: '11549247', + * odiNumber: 11549247, * }) * .then((response) => { * response.Results.forEach((result) => { 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..e69de29b 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..e69de29b diff --git a/packages/lib/src/api/cssiStation/cssiStation.ts b/packages/lib/src/api/cssiStation/cssiStation.ts new file mode 100644 index 00000000..20f84778 --- /dev/null +++ b/packages/lib/src/api/cssiStation/cssiStation.ts @@ -0,0 +1,159 @@ +/** +Rough Draft Notes: + +Approach A. Get by Zip Code +Make the request with a zip code to get the list of CSSIStations at the specific zip code only (nearby zip codes are not included). + +/CSSIStation/zip/63640 +Response Fields: Response is a list of CSSIStations for a given zip code. + +Working Sample: https://api.nhtsa.gov/CSSIStation/zip/63640 + +--- + +Approach B. Get by State +Make the request with the state abbreviation to get the list of CSSIStations in that state only. + +/api/CSSIStation/state/NV +Response Fields: Response is a list of CSSIStations in a given state. + +Working Sample: https://api.nhtsa.gov/CSSIStation/state/NV + +--- + +Approach C. Get by Geo location +Make the request with an interested latitude and longitude location along with the miles nearby to look out for CSSIStations. + +/CSSIStation?lat=30.1783&long=-96.3911&miles=50 +Response Fields: Response is a list of CSSIStations nearby the interested geographical location spotted by its latitude and longitude. + +Working Sample: https://api.nhtsa.gov/CSSIStation?lat=30.1783&long=-96.3911&miles=50 + +--- +--- + +Filters. Optional Filters + +Filter 1: Filter by Spanish speaking Stations + +Make the request with a zip code/state/geographical location to get the list of CSSIStations filtered by spanish speaking (attach string - /lang/spanish) and stations participating in CPSWeek event (attach string - /cpsweek). Below filters in the request string are optional, either one/none OR both can be sent in. + +/CSSIStation/zip/67951/lang/spanish +Response Fields: Response is a list of CSSIStations for a given zip code applying the respective filter. + +Working Sample: https://api.nhtsa.gov//CSSIStation/zip/67951/lang/spanish + +--- + +Filter 2: Filter by Stations participating in CPSWeek + +Make the request with a zip code/state/geographical location to get the list of CSSIStations filtered by stations participating in CPSWeek event (attach string - /cpsweek). Below filters in the request string are optional, either one/none OR both can be sent in. + +/CSSIStation/zip/37066/cpsweek +Response Fields: Response is a list of CSSIStations for a given zip code applying the respective filter. + +Working Sample: https://api.nhtsa.gov/CSSIStation/zip/37066/cpsweek + +Notes +Request parameters and method names are case sensitive + +---------------------------------------------------------------------------- + +Possible Options: +- zip: string | number +- state: string +- lat: string | number +- long: string | number +- miles: string | number +- filters: { lang: string; cpsweek: boolean } + +Rules: +- If zip is provided, cannot provide other options except for filters +- If state is provided, cannot provide other options except for filters +- lat, long, and miles must be provided together +- filters are optional, either one/none OR both can be sent in. + +By zip: + +Uses url path to specify zip code: +https://api.nhtsa.gov/CSSIStation/zip/63640 + +Fitering by lang: +https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish + +Apparently you can pash whatever language string you want after the /lang/ part of the path, it doesn't have to be /lang/spanish as described in the docs. +It returns the same data no matter the path after /lang (e.g. /lang/blahblahblah returns the same data as /lang/spanish) + +Filtering by cpsweek: +https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek + +--- + +By state: + +Uses url path to specify state: +https://api.nhtsa.gov/CSSIStation/state/NV + +Filtering by lang: +https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish + +Apparently you can pash whatever language string you want after the /lang/ part of the path, it doesn't have to be /lang/spanish as described in the docs. +It returns the same data no matter the path after /lang (e.g. /lang/blahblahblah returns the same data as /lang/spanish) + +Filtering by cpsweek: +https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek + +doesn't seem to work, gives 404 error + +--- + +By lat, long, and miles: + +It doesn't appear the query string does anything, even with the example in the official docs. If you change the lat and long and miles the results are the same +as if you has just hit the baseURL of https://api.nhtsa.gov/CSSIStation with no query string. I'm not sure if this is a bug or if the docs are wrong. + +In practice you can send whatever query string names and values you want, it will ignore the query and still return the same data. + +I also don't know how to apply filters in this case although the docs say you can. + +--- + +Filters: + +Cannot use with lat, long, and miles, more accurately I don't know how to use it with lat, long, and miles query string or what the query name even is because query +strings don't do anything for the language filter. + +lang: + +By zip: +https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish + +By state: +https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish + +Apparently you can pass whatever language string you want after the /lang/ part of the path, it doesn't have to be /lang/spanish as described in the docs. +It returns the same data no matter the path after /lang (e.g. /lang/blahblahblah returns the same data as /lang/spanish) + +cpsweek: + +By zip: +https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek + +By state: +https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek <-- gives 404 error + + +Does not work with state, gives 404 error if added to the path as described in the docs + +--- + +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. + +Needs more real world testing before we try to implement. + + */ + +/** + * # CSSI Station + */ diff --git a/packages/lib/src/api/cssiStation/types.ts b/packages/lib/src/api/cssiStation/types.ts new file mode 100644 index 00000000..e69de29b From 8df30acba698a1af8a852c72f44ec0350f68ecd2 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Fri, 22 Dec 2023 00:28:09 -0600 Subject: [PATCH 85/93] lib(api): more notes on bug filled CSSIStation API --- .../lib/src/api/cssiStation/cssiStation.ts | 51 ++++++++++++++----- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/packages/lib/src/api/cssiStation/cssiStation.ts b/packages/lib/src/api/cssiStation/cssiStation.ts index 20f84778..f206d406 100644 --- a/packages/lib/src/api/cssiStation/cssiStation.ts +++ b/packages/lib/src/api/cssiStation/cssiStation.ts @@ -1,6 +1,14 @@ /** Rough Draft Notes: +After testing out the API and looking at the docs, I think the docs are wrong or for an abandoned +version of the API. + +---------------------------------------------------------------------------- +---------------------------------------------------------------------------- + +From the official docs at https://www.nhtsa.gov/nhtsa-datasets-and-apis#car-seat-inspection-locator + Approach A. Get by Zip Code Make the request with a zip code to get the list of CSSIStations at the specific zip code only (nearby zip codes are not included). @@ -71,7 +79,7 @@ Rules: - If zip is provided, cannot provide other options except for filters - If state is provided, cannot provide other options except for filters - lat, long, and miles must be provided together -- filters are optional, either one/none OR both can be sent in. +- filters are optional, either one/none OR both can be sent in according to docs By zip: @@ -109,19 +117,37 @@ doesn't seem to work, gives 404 error By lat, long, and miles: -It doesn't appear the query string does anything, even with the example in the official docs. If you change the lat and long and miles the results are the same -as if you has just hit the baseURL of https://api.nhtsa.gov/CSSIStation with no query string. I'm not sure if this is a bug or if the docs are wrong. +It doesn't appear the query string does anything, even with the example in the official docs. +If you change the lat and long and miles the results are the same as if you has just hit the baseURL +of https://api.nhtsa.gov/CSSIStation with no query string. + +I'm not sure if this is a bug or if the docs are wrong. -In practice you can send whatever query string names and values you want, it will ignore the query and still return the same data. +In practice you can send whatever query string names and values you want, it will ignore the query +and still return the same data. -I also don't know how to apply filters in this case although the docs say you can. +I also don't know how to apply filters in this case although the docs say you can, and again the +query string in any combination doesn't seem to change the data returned, which appears to be the +first 100 stations in the database. + +If you go here: +https://api.nhtsa.gov/CSSIStation?lat=32.71325&long=-97.28864&miles=50 +You get data returned with: +StartLatitude: 42.75565 +StartLongitude: -92.79417 + +Also the same data when using: +https://api.nhtsa.gov/CSSIStation + +Which does not match the query string. This appears to be broken on the NHTSA side. --- Filters: -Cannot use with lat, long, and miles, more accurately I don't know how to use it with lat, long, and miles query string or what the query name even is because query -strings don't do anything for the language filter. +Cannot use with lat, long, and miles, but more accurately I don't know how to use it with lat, long, +and miles query string or what the query names for filters are because query strings don't do +anything for the language filter. lang: @@ -131,15 +157,16 @@ https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish By state: https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish -Apparently you can pass whatever language string you want after the /lang/ part of the path, it doesn't have to be /lang/spanish as described in the docs. -It returns the same data no matter the path after /lang (e.g. /lang/blahblahblah returns the same data as /lang/spanish) +Apparently you can pass whatever language string you want after the /lang/ part of the path, it +doesn't have to be /lang/spanish as described in the docs. It returns the same data no matter the +path after /lang (e.g. /lang/blahblahblah returns the same data as /lang/spanish) cpsweek: By zip: https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek -By state: +By state (DOES NOT WORK): https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek <-- gives 404 error @@ -147,8 +174,8 @@ Does not work with state, gives 404 error if added to the path as described in t --- -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. +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. Needs more real world testing before we try to implement. From 75d2db8d9d4cf0f6bfef4408590a57005174eb27 Mon Sep 17 00:00:00 2001 From: ShaggyTech Date: Fri, 22 Dec 2023 14:22:35 -0600 Subject: [PATCH 86/93] lib(api): finish up notes about CSSI Station locator API --- .../lib/src/api/cssiStation/cssiStation.ts | 250 ++++++++++++++---- 1 file changed, 205 insertions(+), 45 deletions(-) diff --git a/packages/lib/src/api/cssiStation/cssiStation.ts b/packages/lib/src/api/cssiStation/cssiStation.ts index f206d406..947fd07d 100644 --- a/packages/lib/src/api/cssiStation/cssiStation.ts +++ b/packages/lib/src/api/cssiStation/cssiStation.ts @@ -1,8 +1,10 @@ /** -Rough Draft Notes: + * @module api/cssiStation + * @category API - CSSI Station Locator API + */ -After testing out the API and looking at the docs, I think the docs are wrong or for an abandoned -version of the API. +/** +Rough Draft Notes: ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- @@ -70,55 +72,191 @@ Request parameters and method names are case sensitive Possible Options: - zip: string | number - state: string -- lat: string | number -- long: string | number -- miles: string | number -- filters: { lang: string; cpsweek: boolean } +- location: { + lat: string | number; + long: string | number; + miles: string | number + } +- filters: { + lang: string; + cpsweek: boolean + } + +Possible Options Combinations: +- zip +- zip + filters +- state +- state + filter.lang +- location +- location + filters (same as location only) Rules: -- If zip is provided, cannot provide other options except for filters -- If state is provided, cannot provide other options except for filters -- lat, long, and miles must be provided together +- CSSIStation is not case sensitive for the path name +- If zip is provided, cannot provide state or location +- If state is provided, cannot provide zip or location +- lat, long, and miles must be provided all or none - filters are optional, either one/none OR both can be sent in according to docs +- filters.cpsweek not compatible with state + +--- + +Examples: + +FIRST 100 STATIONS (no options): + +cssiStation() +- returns first 100 stations +- uses base url of /CSSIStation + +cssiStation({}) +- returns first 100 stations +- uses base url of /CSSIStation + +--- + +ZIP: +Path - https://api.nhtsa.gov/CSSIStation/zip/63640 +cssiStation({ zip: 63640 }) + +Path- https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish +cssiStation({ zip: 63640, filters: { lang: 'spanish' } }) + +Path - https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek +cssiStation({ zip: 63640, filters: { cpsweek: true } }) + +Path - https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek?lang=spanish +cssiStation({ zip: 63640, filters: { lang: 'spanish', cpsweek: true } }) + +--- + +STATE: +Path - https://api.nhtsa.gov/CSSIStation/state/NV +cssiStation({ state: 'NV' }) +cssiStation({ state: 'nv' }) +cssiStation({ state: 'Nv' }) +cssiStation({ state: 'Nevada' }) +cssiStation({ state: 'nevada' }) + +Path - https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish +cssiStation({ state: 'NV', filters: { lang: 'spanish' } }) + +--- + +LOCATION (lat, long, miles): +- returns first 100 stations, same as no options +- query string has no effect on returned data +- uses base url of /CSSIStation with query string of ?lat=32.71325&long=-97.28864&miles=50 +- filters are added to query string as &lang=spanish &cpsweek=true + +Path - https://api.nhtsa.gov/CSSIStation?lat=32.71325&long=-97.28864&miles=50 +All paths here use query string to represent passed options as seen in the path above. + +cssiStation({ + location: { + lat: 32.71325, + long: -97.28864, + miles: 50 + } +}) + +cssiStation({ + location: { + lat: 32.71325, + long: -97.28864, + miles: 50 + }, + filters: { + lang: 'spanish' + } +}) + +cssiStation({ + location: { + lat: 32.71325, + long: -97.28864, + miles: 50 + }, + filters: { + cpsweek: true + } +}) + +cssiStation({ + location: { + lat: 32.71325, + long: -97.28864, + miles: 50 + }, + filters: { + lang: 'spanish', + cpsweek: true + } +}) + +---------------------------------------------------------------------------- By zip: Uses url path to specify zip code: -https://api.nhtsa.gov/CSSIStation/zip/63640 +- https://api.nhtsa.gov/CSSIStation/zip/63640 Fitering by lang: -https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish - -Apparently you can pash whatever language string you want after the /lang/ part of the path, it doesn't have to be /lang/spanish as described in the docs. -It returns the same data no matter the path after /lang (e.g. /lang/blahblahblah returns the same data as /lang/spanish) +- https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish +- Apparently you can pash whatever language string you want after the /lang/ part of the path, it + doesn't have to be /lang/spanish as described in the docs. +- It returns the same data no matter the path after /lang (e.g. /lang/blahblahblah returns the same + data as /lang/spanish) Filtering by cpsweek: -https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek +- https://api.nhtsa.gov/CSSIStation/zip/37066/cpsweek + +Filtering by cpsweek and lang as query string: +- https://api.nhtsa.gov/CSSIStation/zip/37066/cpsweek?lang=spanish --- By state: Uses url path to specify state: -https://api.nhtsa.gov/CSSIStation/state/NV +- https://api.nhtsa.gov/CSSIStation/state/NV +- state can be NV, nv, nevada, Nevada, etc. Filtering by lang: -https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish - -Apparently you can pash whatever language string you want after the /lang/ part of the path, it doesn't have to be /lang/spanish as described in the docs. -It returns the same data no matter the path after /lang (e.g. /lang/blahblahblah returns the same data as /lang/spanish) - -Filtering by cpsweek: -https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek - -doesn't seem to work, gives 404 error +- https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish +- Apparently you can pash whatever language string you want after the /lang/ part of the path, it + doesn't have to be /lang/spanish as described in the docs. +- It returns the same data no matter the path after /lang (e.g. /lang/blahblahblah returns the same + data as /lang/spanish) + +Filtering by cpsweek (DOES NOT WORK WITH STATE!): +- https://api.nhtsa.gov/CSSIStation/state/NV/?cpsweek=true <-- ignores query, returns same data as + /state/NV +- https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek <-- gives 404 error +- https://api.nhtsa.gov/CSSIStation/cpsweek/state/NV <-- gives 404 error with differing path + order + +Filtering by cpsweek and lang (DOES NOT WORK WITH STATE!): +- https://api.nhtsa.gov/CSSIStation/state/NV?cpsweek&lang=spanish <-- ignores query, returns same + data as /state/NV?lang=spanish +- https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek?lang=spanish <-- gives 404 error +- https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish/cpsweek <-- gives 404 error +- https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek/lang/spanish <-- gives 404 error --- By lat, long, and miles: -It doesn't appear the query string does anything, even with the example in the official docs. -If you change the lat and long and miles the results are the same as if you has just hit the baseURL +In real world use, this will return the same data no matter what query string you send, the same as +if you sent no query string at all. It appears the query string does nothing for this endpoint as +described in the official docs. You will get the same 100 stations returned no matter what query +string you send. + +After testing out the API and looking at the docs, I think the docs are wrong or at the very least +the lat/long/miles query is broken or abandoned, possibly in favor of the official site and form at: +https://www.nhtsa.gov/equipment/car-seats-and-booster-seats#installation-help-inspection + +It doesn't appear the query string does anything, even with the example in the official docs. If you +change the lat and long and miles the results are the same as if you has just hit the baseURL of https://api.nhtsa.gov/CSSIStation with no query string. I'm not sure if this is a bug or if the docs are wrong. @@ -132,45 +270,67 @@ first 100 stations in the database. If you go here: https://api.nhtsa.gov/CSSIStation?lat=32.71325&long=-97.28864&miles=50 + You get data returned with: StartLatitude: 42.75565 StartLongitude: -92.79417 -Also the same data when using: +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 the query string: https://api.nhtsa.gov/CSSIStation -Which does not match the query string. This appears to be broken on the NHTSA side. +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 api.nhtsa.gove/CSSIStation API. --- Filters: -Cannot use with lat, long, and miles, but more accurately I don't know how to use it with lat, long, -and miles query string or what the query names for filters are because query strings don't do -anything for the language filter. +Cannot use with lat, long, and miles, or more accurately, query strings do nothing for this endpoint +so determining if you can use filters with lat, long, and miles is impossible. lang: -By zip: -https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish - -By state: -https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish - Apparently you can pass whatever language string you want after the /lang/ part of the path, it doesn't have to be /lang/spanish as described in the docs. It returns the same data no matter the path after /lang (e.g. /lang/blahblahblah returns the same data as /lang/spanish) -cpsweek: +By zip with lang: +- https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish -By zip: -https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek +By zip with lang and cpsweek (cpsweek sent as query string = true): +- https://api.nhtsa.gov//CSSIStation/zip/67951/lang/spanish?cpsweek=true +- Returns: Count = 0 because there are no stations with CPSWeekEventFlag = "Yes" in zip 63640 but will + still return 200 status code and empty Results[] + +By state with lang: +- https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish + +By state with lang and cpsweek (cpsweek sent as query string = true): +- https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish?cpsweek=true <-- responds with same data + as above, query strings do nothing it appears, includes stations with CPSWeekEventFlag = "No" when + it should only include stations with CPSWeekEventFlag = "Yes" + +cpsweek: -By state (DOES NOT WORK): -https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek <-- gives 404 error +By zip With cpsweek: +- https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek +By zip with cpsweek and lang as query string: +- https://api.nhtsa.gov/CSSIStation/zip/37066/cpsweek?lang=spanish +- Returns: Count = 0 because there are no stations with CPSWeekEventFlag = "Yes" in zip 63640 that + have spanish speaking technicians but will still return 200 status code and empty Results[] -Does not work with state, gives 404 error if added to the path as described in the docs +By state with cpsweek (DOES NOT WORK): +- https://api.nhtsa.gov/CSSIStation/state/NV?cpsweek=true <-- ignores query, returns same data as /state/NV +- https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek <- gives 404 error +- https://api.nhtsa.gov/CSSIStation/cpsweek/state/NV <- also gives 404 error with differing path order --- From 8e3b5af8e56a92a10cf40ef2df97a3ab1c486d2a Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 26 Dec 2023 00:07:32 -0600 Subject: [PATCH 87/93] lib(utils): argHandler, add catchInvalidKeys(), refactor argHandler, cleanup tests --- .../src/utils/__tests__/argHandler.test.ts | 1092 ++++++++++------- packages/lib/src/utils/argHandler.ts | 160 ++- packages/lib/src/utils/index.ts | 6 +- 3 files changed, 806 insertions(+), 452 deletions(-) diff --git a/packages/lib/src/utils/__tests__/argHandler.test.ts b/packages/lib/src/utils/__tests__/argHandler.test.ts index b1f6e760..3dd1ae34 100644 --- a/packages/lib/src/utils/__tests__/argHandler.test.ts +++ b/packages/lib/src/utils/__tests__/argHandler.test.ts @@ -1,6 +1,10 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { describe, expect, it, test } from 'vitest' -import { catchInvalidArguments, validateArgument } from '../argHandler' +import { + catchInvalidArguments, + catchInvalidKeys, + validateArgument, +} from '../argHandler' describe('utils/argHandler.ts - exports:', () => { test('catchInvalidArguments function', () => { @@ -14,32 +18,188 @@ describe('utils/argHandler.ts - exports:', () => { }) }) +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([ - '', - 'string', - 123, - 1234n, - 0, - -0, - 0n, - [], - ['1', '2', '3'], - () => 'a function', - true, - false, - null, - undefined, - NaN, - new Date(), - new String(), - new Error(), - ])('argData: %s', (argData) => { + test.each([undefined, ...testNotObject])('argData: %s', (argData) => { expect(() => validateArgument( // @ts-expect-error Type 'x' is not assignable to type 'IArgToValidate'. @@ -51,26 +211,8 @@ describe('validateArgument()', () => { }) }) - describe('argData.name is undefined or 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(), - ])('argData.name: %s', (name) => { + describe('name is undefined or is not a string:', () => { + test.each([undefined, ...testNotString])('argData.name: %s', (name) => { expect(() => validateArgument({ // @ts-expect-error Type 'x' is not assignable to type 'string'. @@ -81,25 +223,8 @@ describe('validateArgument()', () => { }) }) - describe('argData.required is defined and is not a boolean:', () => { - test.each([ - 'string', - 123, - 1234n, - 0, - -0, - 0n, - [], - ['1', '2', '3'], - {}, - { a: '1', b: '2', c: '3' }, - () => 'a function', - null, - NaN, - new Date(), - new String(), - new Object(), - ])('argData.required: %s', (required) => { + describe('required is defined and is not a boolean:', () => { + test.each(testNotBoolean)('argData.required: %s', (required) => { expect(() => validateArgument({ name: 'test', @@ -111,98 +236,73 @@ describe('validateArgument()', () => { }) }) - describe('argData.requiredBy is defined and is not an array of length > 0:', () => { - test.each([ - 'string', - 123, - 1234n, - [], - {}, - { a: '1', b: '2', c: '3' }, - () => 'a function', - true, - new Date(), - new String(), - ])('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 arrry of objects if provided/ - ) - }) + 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/ + ) + } + ) }) - describe('argData.requiredBy.value is defined and argData.requiredBy.name 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(), - ])('argData.requiredBy.name: %s', (requiredByName) => { + 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/ + ) + } + ) + }) + + 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: 'defined value', - requiredBy: [ - { - // @ts-expect-error Type 'x' is not assignable to type 'string'. - name: requiredByName, - value: 1234, - }, - ], + value: 'some string', + // @ts-expect-error Type 'x' is not assignable to type 'string[]'. + types, }) ).toThrowError( - /'argData.requiredBy' requires both a name and value if value is defined/ + /'argData.types' must be an array of strings if provided/ ) }) }) - describe('argData.types is defined and is not an array of strings with length > 0:', () => { - test.each([ - 123, - 'string', - true, - {}, - [], - [undefined], - [null], - [1234], - [true], - [{}], - ['string', 1234], - () => 'a function', - 1234n, - new Date(), - new String(), - new Object(), - ])('argData.types: %s', (types) => { + 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: 'some string', - // @ts-expect-error Type 'x' is not assignable to type 'string[]'. - types, + // @ts-expect-error Type 'x' is not assignable to type 'string[]' | undefined. + validKeys, }) ).toThrowError( - /'argData.types' must be an array of strings if provided/ + /'argData.validKeys' must be an array of strings if provided/ ) }) }) @@ -214,29 +314,8 @@ describe('validateArgument()', () => { * Returns true ****************/ describe('returns true - if argData.value is defined or "truthy":', () => { - const testValues = [ - 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(), - ] - - describe('returns true - errorMode: "error" (default)', () => { - test.each(testValues)('argData.value: %s', (value) => { + describe('errorMode: "error" (default)', () => { + test.each(truthyValues)('argData.value: %s', (value) => { expect( validateArgument({ name: 'test', @@ -247,8 +326,8 @@ describe('validateArgument()', () => { }) }) - describe('returns true - errorMode: "boolean"', () => { - test.each(testValues)('argData.value: %s', (value) => { + describe('errorMode: "boolean"', () => { + test.each(truthyValues)('argData.value: %s', (value) => { expect( validateArgument({ name: 'test', @@ -264,11 +343,9 @@ describe('validateArgument()', () => { /******************************** * Throws Error or Returns False ********************************/ - describe('throws error or returns false - if argData.value is undefined or "falsey"', () => { - const testValues = ['', undefined, false, null, NaN, 0, -0, 0n] - - describe('throws error - errorMode: "error" (default)', () => { - test.each(testValues)('argData.value: %s', (value) => { + 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', @@ -281,8 +358,8 @@ describe('validateArgument()', () => { }) }) - describe('returns false - errorMode: "boolean":', () => { - test.each(testValues)('argData.value: %s', (value) => { + describe('errorMode: "boolean":', () => { + test.each([undefined])('argData.value: %s', (value) => { expect( validateArgument({ name: 'testValue', @@ -303,7 +380,7 @@ describe('validateArgument()', () => { describe('returns true - if argData.value is undefined because type match will be skipped', () => { const testValues = ['', new String(), undefined] - describe('returns true - errorMode: "error" (default)', () => { + describe('errorMode: "error" (default)', () => { test.each(testValues)('argData.value: %s', (value) => { expect( validateArgument({ @@ -315,7 +392,7 @@ describe('validateArgument()', () => { }) }) - describe('returns true - errorMode: "boolean"', () => { + describe('errorMode: "boolean"', () => { test.each(testValues)('argData.value: %s', (value) => { expect( validateArgument({ @@ -330,40 +407,8 @@ describe('validateArgument()', () => { }) describe('returns true - if typeof argData.value matches at least one type:', () => { - const testValues: [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']], - [undefined, ['string', 'number', 'boolean', 'undefined']], - [null, ['string', 'number', 'boolean', 'undefined', 'null']], - [() => 'a function', ['string', 'number', 'function']], - ] - - describe('returns true - errorMode: "error" (default)', () => { - test.each(testValues)('typeof "%s" = %s', (value, types) => { + describe('errorMode: "error" (default)', () => { + test.each(testTypesMatch)('typeof "%s" = %s', (value, types) => { expect( validateArgument({ name: 'test', @@ -374,8 +419,8 @@ describe('validateArgument()', () => { }) }) - describe('returns true - errorMode: "boolean"', () => { - test.each(testValues)('typeof "%s" = %s', (value, types) => { + describe('errorMode: "boolean"', () => { + test.each(testTypesMatch)('typeof "%s" = %s', (value, types) => { expect( validateArgument({ name: 'test', @@ -391,61 +436,38 @@ describe('validateArgument()', () => { /******************************** * Throws Error or Returns False ********************************/ - describe('throws error or returns false - if typeof argData.value does not match at least one type:', () => { - const testValues: [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('if typeof argData.value does not match at least one type:', () => { describe('throws error - errorMode: "error" (default)', () => { - test.each(testValues)('typeof "%s" != type(s) %s', (value, types) => { - expect(() => - validateArgument({ - name: 'testValue', - value, - types, - }) - ).toThrowError( - /error validating argument named "testValue", must be of type\(s\)/ - ) - }) + 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\)/ + ) + } + ) }) describe('returns false - errorMode: "boolean"', () => { - test.each(testValues)('typeof "%s" != type(s) %s', (value, types) => { - expect( - validateArgument({ - name: 'testValue', - value, - types, - errorMode: 'boolean', - }) - ).toEqual(false) - }) + test.each(testTypesMismatch)( + 'typeof "%s" != type(s) %s', + (value, types) => { + expect( + validateArgument({ + name: 'testValue', + value, + types, + errorMode: 'boolean', + }) + ).toEqual(false) + } + ) }) }) }) @@ -455,37 +477,8 @@ describe('validateArgument()', () => { * Returns True ****************/ describe('returns true - if argData.value is defined and matches at least one type:', () => { - const testValues: [unknown, string[]][] = [ - /* match single type */ - ['string', ['string']], - [123, ['number']], - [true, ['boolean']], - [() => 'a function', ['function']], - [1234n, ['bigint']], - [{ a: '1', b: '2', c: '3' }, ['object']], - [['1', '2', '3'], ['array']], - [[], ['array']], - [{}, ['object']], - [new Date(), ['date']], - [new String(), ['string']], - [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']], - [() => 'a function', ['string', 'number', 'function']], - ] - - describe('returns true - errorMode: "error" (default)', () => { - test.each(testValues)('typeof "%s" === %s', (value, types) => { + describe('errorMode: "error" (default)', () => { + test.each(testTypesMatch)('typeof "%s" === %s', (value, types) => { expect( validateArgument({ name: 'test', @@ -497,8 +490,8 @@ describe('validateArgument()', () => { }) }) - describe('returns true - errorMode: "boolean"', () => { - test.each(testValues)('typeof "%s" === %s', (value, types) => { + describe('errorMode: "boolean"', () => { + test.each(testTypesMatch)('typeof "%s" === %s', (value, types) => { expect( validateArgument({ name: 'test', @@ -515,33 +508,9 @@ describe('validateArgument()', () => { /**************** * Throws Error ****************/ - describe('throws error or returns false - if typeof argData.value does not match at least one type:', () => { - const testValues: [unknown, string[]][] = [ - /* mis-match single type */ - [123, ['string']], - [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']], - /* mis-match multiple types */ - [{}, ['string', 'number']], - [123, ['string', 'boolean']], - [true, ['string', 'number']], - [null, ['string', 'number', 'boolean', 'undefined']], - [() => 'a function', ['string', 'number', 'boolean']], - ] - + describe('if typeof argData.value does not match at least one type:', () => { describe('throws error - errorMode: "error" (default)', () => { - test.each(testValues)( + test.each(testTypesMismatch)( 'typeof "%s" !== type(s) %s', (value, types) => { expect(() => @@ -552,14 +521,14 @@ describe('validateArgument()', () => { types, }) ).toThrowError( - /error validating argument named "testValue", is required and must be of type\(s\)/ + /error validating argument named "testValue", it is required and must be of type\(s\)/ ) } ) }) describe('returns false - errorMode: "boolean"', () => { - test.each(testValues)( + test.each(testTypesMismatch)( 'typeof "%s" !== type(s) %s', (value, types) => { expect( @@ -582,29 +551,8 @@ describe('validateArgument()', () => { * Returns true ****************/ describe('returns true - if argData.value is defined when requiredBy another defined value:', () => { - const testValues = [ - 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(), - ] - - describe('returns true - errorMode: "error" (default)', () => { - it.each(testValues)('argData.value: %s', (value) => { + describe('errorMode: "error" (default)', () => { + it.each(truthyValues)('argData.value: %s', (value) => { expect( validateArgument({ name: 'test', @@ -615,8 +563,8 @@ describe('validateArgument()', () => { }) }) - describe('returns true - errorMode: "boolean"', () => { - it.each(testValues)('argData.value: %s', (value) => { + describe('errorMode: "boolean"', () => { + it.each(truthyValues)('argData.value: %s', (value) => { expect( validateArgument({ name: 'test', @@ -632,11 +580,9 @@ describe('validateArgument()', () => { /******************************** * Throws Error or Returns False *******************************/ - describe('throws error or returns false - if argData.value is undefined when requiredBy another defined value', () => { - const testValues = [undefined, false, null, '', NaN, 0, -0, 0n] - + describe('if argData.value is undefined when requiredBy another defined value', () => { describe('throws error - errorMode: "error" (default)', () => { - test.each([testValues])('argData.value: %s', (value) => { + test.each(falseyValues)('argData.value: %s', (value) => { expect(() => validateArgument({ name: 'test', @@ -650,7 +596,7 @@ describe('validateArgument()', () => { }) describe('returns false - errorMode: "boolean"', () => { - test.each([testValues])('argData.value: %s', (value) => { + test.each(falseyValues)('argData.value: %s', (value) => { expect( validateArgument({ name: 'test', @@ -663,11 +609,9 @@ describe('validateArgument()', () => { }) }) - describe('throws error or returns false - if argData.value is required but undefined when requiredBy another defined value', () => { - const testValues = [undefined, false, null, '', NaN, 0, -0, 0n] - + describe('if argData.value is required but undefined when requiredBy another defined value', () => { describe('throws error - errorMode: "error" (default)', () => { - test.each(testValues)('argData.value: %s', (value) => { + test.each(falseyValues)('argData.value: %s', (value) => { expect(() => validateArgument({ name: 'test', @@ -682,7 +626,7 @@ describe('validateArgument()', () => { }) describe('returns false - errorMode: "boolean"', () => { - test.each(testValues)('argData.value: %s', (value) => { + test.each(falseyValues)('argData.value: %s', (value) => { expect( validateArgument({ name: 'test', @@ -696,35 +640,100 @@ describe('validateArgument()', () => { }) }) }) + + describe('if argData.value is an object and argData.validKeys is an array of strings', () => { + /**************** + * Returns true + ****************/ + 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) + }) + }) + + describe('errorMode: "boolean"', () => { + test.each(testValues)('%s', ({ value, validKeys }) => { + expect( + validateArgument({ + name: 'test', + value, + validKeys, + errorMode: 'boolean', + }) + ).toEqual(true) + }) + }) + }) + + /******************************** + * 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/) + }) + }) + + describe('returns false - errorMode: "boolean"', () => { + test.each(testValues)('%s', ({ value, validKeys }) => { + expect( + validateArgument({ + name: 'test', + value, + validKeys, + errorMode: 'boolean', + }) + ).toEqual(false) + }) + }) + }) + }) }) }) describe('catchInvalidArguments', () => { - describe('all modes- throws error with invalid options passed to catchInvalidArguments():', () => { + describe('all modes - throws error with invalid options passed to catchInvalidArguments():', () => { /**************** * Throws Error ****************/ describe('options are undefined or not an object:', () => { - test.each([ - '', - 'string', - 123, - 1234n, - 0, - -0, - 0n, - [], - ['1', '2', '3'], - () => 'a function', - true, - false, - null, - undefined, - NaN, - new Date(), - new String(), - new Error(), - ])('options: %s', (argData) => { + test.each([undefined, ...testNotObject])('options: %s', (argData) => { expect(() => catchInvalidArguments( // @ts-expect-error Type 'x' is not assignable to type ... @@ -737,34 +746,19 @@ describe('catchInvalidArguments', () => { }) describe('options.args is undefined or is not an array of length > 0:', () => { - test.each([ - '', - 'string', - 123, - 1234n, - 0, - -0, - 0n, - [], - () => 'a function', - true, - false, - null, - undefined, - NaN, - new Date(), - new String(), - new Error(), - ])('options.args: %s', (args) => { - expect(() => - catchInvalidArguments( - // @ts-expect-error Type 'x' is not assignable to type 'IArgToValidate'. - { args } + 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/ ) - ).toThrowError( - /catchInvalidArguments requires "args" that must be an array of IArgToValidate objects/ - ) - }) + } + ) }) }) @@ -785,47 +779,72 @@ describe('catchInvalidArguments', () => { expect(catchInvalidArguments({ args })).toBe(true) }) + // Remainder of the cases are covered in validateArgument() tests + /**************** * Throws Error ****************/ - test('throws error if validation fails', () => { - expect(() => - catchInvalidArguments({ - args: [ - { - name: 'make', - value: '', - required: true, - types: ['string'], - }, - ], - }) - ).toThrowError(/error validating argument named "make"/) + 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(/error validating argument named "make"/) + 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(/error validating argument named "modelYear"/) + 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 }) }) @@ -889,3 +908,204 @@ describe('catchInvalidArguments', () => { }) }) }) + +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/argHandler.ts b/packages/lib/src/utils/argHandler.ts index 4bc06f08..dbd7e930 100644 --- a/packages/lib/src/utils/argHandler.ts +++ b/packages/lib/src/utils/argHandler.ts @@ -15,6 +15,7 @@ export type IArgToValidate = { value: unknown }> types?: string[] + validKeys?: string[] errorMode?: 'error' | 'boolean' } & ( | AtLeastOne<{ @@ -27,6 +28,10 @@ export type IArgToValidate = { value: unknown }> } + | { + value: Record + validKeys: string[] + } ) /** @@ -111,10 +116,11 @@ export const validateArgument = (argData: IArgToValidate): boolean => { required, requiredBy, types, + validKeys, errorMode = 'error', } = argData /* later we will use this to store types normalized to lowercase */ - let typesLowercased: string[] = [] + const typesLowercased: string[] = [] /* validate and typeguard argData passed to function */ if (getTypeof(name) !== 'string') { @@ -126,12 +132,17 @@ export const validateArgument = (argData: IArgToValidate): boolean => { if (requiredBy) { if (getTypeof(requiredBy) !== 'array' || !requiredBy.length) { throw Error( - `'argData.requiredBy' must be an arrry of objects if provided` + `'argData.requiredBy' must be an array of objects if provided` ) } - requiredBy.forEach(({ name: requiredByName, value: requiredByValue }) => { - if (requiredByValue) { - if (getTypeof(requiredByName) !== 'string') { + 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` ) @@ -147,10 +158,23 @@ export const validateArgument = (argData: IArgToValidate): boolean => { 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` + ) + } }) - /* normalize all passed types to lowercase */ - typesLowercased = types.map((type) => type.toLowerCase()) } + /* End of argData validation */ /* for argument validation error messages */ let error = '' @@ -187,23 +211,45 @@ export const validateArgument = (argData: IArgToValidate): boolean => { } } + /* + * 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) { + 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)) { + 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) ${typesLowercased}, ${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 dependign on mode */ + /* 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) @@ -258,3 +304,87 @@ export const catchInvalidArguments = (options: { 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/index.ts b/packages/lib/src/utils/index.ts index 219c2471..f9fd82b3 100644 --- a/packages/lib/src/utils/index.ts +++ b/packages/lib/src/utils/index.ts @@ -3,7 +3,11 @@ * @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, generateRandomVIN } from './isValidVin' From f8ecd1bbd20131043aee5fa6ce6602602a1a2626 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 26 Dec 2023 00:12:55 -0600 Subject: [PATCH 88/93] lib(api): simplify catching invalid keys in options objects --- .../complaints/__tests__/complaints.test.ts | 36 ++- packages/lib/src/api/complaints/complaints.ts | 100 ++++---- .../api/products/__tests__/products.test.ts | 32 +-- packages/lib/src/api/products/products.ts | 223 +++++------------- .../src/api/recalls/__tests__/recalls.test.ts | 36 ++- packages/lib/src/api/recalls/recalls.ts | 103 ++++---- .../__tests__/safetyRatings.test.ts | 28 +-- .../src/api/safetyRatings/safetyRatings.ts | 43 +--- 8 files changed, 232 insertions(+), 369 deletions(-) diff --git a/packages/lib/src/api/complaints/__tests__/complaints.test.ts b/packages/lib/src/api/complaints/__tests__/complaints.test.ts index eab2bd4e..30a34901 100644 --- a/packages/lib/src/api/complaints/__tests__/complaints.test.ts +++ b/packages/lib/src/api/complaints/__tests__/complaints.test.ts @@ -19,7 +19,7 @@ const odiNumber = odiNumberAsNumber // 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 Recalls API +// Use Complaints API // https://api.nhtsa.gov/complaints/complaintsByVehicle?modelYear=2020&make=Volkswagen&model=Jetta // https://api.nhtsa.gov/complaints/odiNumber?odiNumber=11549247 @@ -417,7 +417,7 @@ describe('complaints()', () => { notAnOption: 'invalid option with TS error', }) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, odiNumber/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ ) expect(fetchMock.requests().length).toEqual(0) @@ -433,7 +433,7 @@ describe('complaints()', () => { true ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, odiNumber/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ ) expect(fetchMock.requests().length).toEqual(0) @@ -449,7 +449,7 @@ describe('complaints()', () => { false ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, odiNumber/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ ) expect(fetchMock.requests().length).toEqual(0) @@ -462,7 +462,9 @@ describe('complaints()', () => { // @ts-expect-error Type 'never[]' is not assignable to type 'string | undefined' odiNumber: [], }) - ).rejects.toThrowError(/error validating argument named "odiNumber"/) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ + ) expect(fetchMock.requests().length).toEqual(0) }) @@ -475,7 +477,7 @@ describe('complaints()', () => { modelYear, }) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, odiNumber/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ ) expect(fetchMock.requests().length).toEqual(0) @@ -493,7 +495,7 @@ describe('complaints()', () => { true ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, odiNumber/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ ) expect(fetchMock.requests().length).toEqual(0) @@ -512,7 +514,7 @@ describe('complaints()', () => { false ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, odiNumber/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ ) expect(fetchMock.requests().length).toEqual(0) @@ -528,7 +530,9 @@ describe('complaints()', () => { // @ts-expect-error Type 'number' is not assignable to type 'undefined' odiNumber: ['array'], }) - ).rejects.toThrowError(/error validating argument named "odiNumber"/) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, odiNumber/ + ) expect(fetchMock.requests().length).toEqual(0) }) @@ -540,25 +544,17 @@ describe('complaints()', () => { * 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. - * - * All of these calls to safetyRatings() mimic all of tests in the test.each() tests above. - * They are separated here to allow for testing of the IDE tooltips for each possible response - * type individually by hovering over the saved `result_x` and/or the function name each time it is - * called. + * 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 SafetyRatingsResultsVariants types at once when hovering over the saved results of - * safetyRatings(). This will still happen even if you only include arguments that would return - * the same type of response. + * 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 () => { diff --git a/packages/lib/src/api/complaints/complaints.ts b/packages/lib/src/api/complaints/complaints.ts index 8c981aea..2e19557c 100644 --- a/packages/lib/src/api/complaints/complaints.ts +++ b/packages/lib/src/api/complaints/complaints.ts @@ -132,34 +132,41 @@ import type { * 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 - * // Get a list of available model years in the complaints dataset * 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 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 - * // Get a list of available makes for the 2013 model year - * await complaints({ - * modelYear: 2013, - * }) + * await complaints({ modelYear: 2013 }) * .then((response) => { * response.Results.forEach((result) => { * console.log(result.modelYear) // "ACURA", "AUDI", "BENTLEY", etc. - * console.log(results.make) // "JETTA", "ACCORD", 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. @@ -167,17 +174,14 @@ import type { * ### Get Models for Make * * Uses the `Products API` to get all available models in the complaints dataset for a specific - * model year and make. + * `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 - * // Get a list of available models for a 2013 Honda - * await complaints({ - * modelYear: 2013, - * make: 'Honda', - * }) + * await complaints({ modelYear: 2013, make: 'Honda' }) * .then((response) => { * response.Results.forEach((result) => { * console.log(result.modelYear) // "2013" @@ -185,6 +189,11 @@ import type { * 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 @@ -192,14 +201,14 @@ import type { * * ### Get Complaints for Year, Make, and Model * - * Uses the `Complaints API` to get all available complaints for a specific model 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 - * // Get as list of complaints for a 2013 Honda Accord * await complaints({ * modelYear: 2013, * make: 'Honda', @@ -217,6 +226,11 @@ import type { * // ...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 @@ -238,8 +252,8 @@ import type { * 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 - * // Get complaint information for a specific ODI Number * await complaints({ * odiNumber: 11549247, * }) @@ -255,6 +269,11 @@ import type { * // ...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 @@ -338,11 +357,11 @@ async function complaints( /* This will also ensure we have an actual object using our custom getTypeof() function */ catchInvalidArguments({ args: [ - { name: 'options', value: options, types: ['object'] }, { - name: 'odiNumber', - value: options?.odiNumber, - types: ['string', 'number'], + name: 'options', + value: options, + types: ['object'], + validKeys: ['modelYear', 'make', 'model', 'odiNumber'], }, { name: 'modelYear', @@ -361,39 +380,16 @@ async function complaints( requiredBy: [{ name: 'model', value: options?.model }], }, { name: 'model', value: options?.model, types: ['string'] }, + { + name: 'odiNumber', + value: options?.odiNumber, + types: ['string', 'number'], + }, ], }) - /* - * Throw an error if options object contains invalid properties. - * - * This must be after the catchInvalidArguments() call above so we can ensure we have an actual - * object here and not 'null' 'array' etc., which typeof will let into the 'if' block as they - * are all considered typeof === 'object'. We only use typeof here to make the TS compiler - * happy. - */ - if (typeof options === 'object') { - const validKeys: Array = [ - 'modelYear', - 'make', - 'model', - 'odiNumber', - ] - const optionsKeys = Object.keys(options) as Array< - keyof ComplaintsOptionsBase - > - const invalidKeys = optionsKeys.filter((key) => { - return !validKeys.includes(key) - }) - - if (invalidKeys.length > 0) { - throw new Error( - `Invalid options: ${invalidKeys.join( - ', ' - )}. Valid options are: ${validKeys.join(', ')}` - ) - } - + /* options are guaranteed to be an object by now because of catchInvalidArguments() */ + if (options) { encodedParams = encodeQueryStringParams(options) } diff --git a/packages/lib/src/api/products/__tests__/products.test.ts b/packages/lib/src/api/products/__tests__/products.test.ts index 5d58f5e6..13ee4565 100644 --- a/packages/lib/src/api/products/__tests__/products.test.ts +++ b/packages/lib/src/api/products/__tests__/products.test.ts @@ -205,7 +205,7 @@ describe('products()', () => { arg ) ).rejects.toThrowError( - /error validating argument named "issueType", is required and must be of type/ + /error validating argument named "issueType", it is required and must be of type/ ) expect(fetchMock.requests().length).toEqual(0) @@ -298,7 +298,7 @@ describe('products()', () => { notAnOption: 'invalid option with TS error', }) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ ) expect(fetchMock.requests().length).toEqual(0) @@ -315,7 +315,7 @@ describe('products()', () => { true ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ ) expect(fetchMock.requests().length).toEqual(0) @@ -332,7 +332,7 @@ describe('products()', () => { false ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ ) expect(fetchMock.requests().length).toEqual(0) @@ -345,7 +345,9 @@ describe('products()', () => { // @ts-expect-error Type 'x' is not assignable to type 'string | number | undefined'. modelYear: [1, 2, 3], }) - ).rejects.toThrowError(/error validating argument named "modelYear"/) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ + ) expect(fetchMock.requests().length).toEqual(0) }) @@ -358,7 +360,7 @@ describe('products()', () => { modelYear, }) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ ) expect(fetchMock.requests().length).toEqual(0) @@ -377,7 +379,7 @@ describe('products()', () => { true ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ ) expect(fetchMock.requests().length).toEqual(0) @@ -396,7 +398,7 @@ describe('products()', () => { false ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make/ ) expect(fetchMock.requests().length).toEqual(0) @@ -409,25 +411,17 @@ describe('products()', () => { * 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. - * - * All of these calls to safetyRatings() mimic all of tests in the test.each() tests above. - * They are separated here to allow for testing of the IDE tooltips for each possible response - * type individually by hovering over the saved `result_x` and/or the function name each time it is - * called. + * 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 SafetyRatingsResultsVariants types at once when hovering over the saved results of - * safetyRatings(). This will still happen even if you only include arguments that would return - * the same type of response. + * 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 () => { diff --git a/packages/lib/src/api/products/products.ts b/packages/lib/src/api/products/products.ts index 35c13bbd..c3165407 100644 --- a/packages/lib/src/api/products/products.ts +++ b/packages/lib/src/api/products/products.ts @@ -9,7 +9,11 @@ import { encodeQueryStringParams, rejectWithError, } from '@/utils' -import type { NhtsaResponse, NoExtraProperties } from '@/types' +import type { + NhtsaResponse, + NoExtraProperties, + QueryStringParamsEncoded, +} from '@/types' /** * # Products API @@ -68,10 +72,10 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * * Valid `options` combinations: * - * - `recalls(issueType)` - * - `recalls(issueType, {})` - * - `recalls(issueType, { modelYear })` - * - `recalls(issueType, { modelYear, make })` + * - `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 @@ -90,47 +94,27 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * * 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. + * There are several rules to follow when using this API or you will errors from the NHTSA API. * - * 1. If you provide a `campaignNumber` then you cannot provide any other options. + * 1. You must provide an `issueType`. * 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. + * - 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. @@ -141,54 +125,62 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * * ### Get All Model Years * - * Uses the `Products API` to get all available model years in the recalls dataset. + * Get all available model years in the recalls or complaints dataset, based on the `issueType`. * - * 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. + * 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 - * // Get a list of available model years in the recalls dataset - * await recalls().then((response) => { + * 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 * - * Uses the `Products API` to get all available makes in the recalls dataset for a specific 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=r` will be used. + * `/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 - * // Get a list of available makes for the 2013 model year - * await recalls({ - * modelYear: 2013, - * }) + * await products('r', { modelYear: 2013 }) * .then((response) => { * response.Results.forEach((result) => { * console.log(result.modelYear) // "ACURA", "AUDI", "BENTLEY", etc. - * console.log(results.make) // "JETTA", "ACCORD", 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 arguments. + * If you need to get all available model years, first call the function with no options. * * ### Get Models for Make * - * Uses the `Products API` to get all available models in the recalls dataset for a specific model - * year and 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 the only options, the path and query string - * `/products/vehicle/models?modelYear={modelYear}&make={make}&issueType=r` will be used. + * 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 - * // Get a list of available models for a 2013 Honda - * await recalls({ + * await products('r', { * modelYear: 2013, * make: 'Honda', * }) @@ -199,78 +191,16 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * 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. * - * ### Get Recalls for Year, Make, and Model - * - * Uses the `Recalls API` to get all available recalls for a specific model year, 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. - * - * ```js - * // Get as list of recalls for a 2013 Honda Accord - * 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 - * }) - * }) - * ``` - * - * 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[]`. - * - * ```js - * // Get recall information for a specific campaign number - * 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 - * }) - * }) - * ``` - * * ## Returns * * The return from this function will be a parsed JSON response, typed to reflect the different @@ -291,14 +221,9 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * * 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. + * - 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 @@ -345,6 +270,9 @@ async function products( const endpointName = 'products' try { + let path = '' + let encodedParams: QueryStringParamsEncoded = {} + if (typeof options === 'boolean') { /* If first argument is boolean, it is doFetch */ doFetch = options @@ -360,7 +288,12 @@ async function products( required: true, types: ['string'], }, - { name: 'options', value: options, types: ['object'] }, + { + name: 'options', + value: options, + types: ['object'], + validKeys: ['modelYear', 'make'], + }, { name: 'modelYear', value: options?.modelYear, @@ -391,35 +324,9 @@ async function products( ? 'c' : issueType - let path = '' - let encodedParams = {} - /* - * Throw an error if options object contains invalid properties. - * - * This must be after the catchInvalidArguments() call above so we can ensure we have an actual - * object here and not 'null' 'array' etc., which typeof will let into the 'if' block as they - * are all considered typeof === 'object'. We only use typeof here to make the TS compiler - * happy. - */ - if (typeof options === 'object') { - const validKeys: Array = ['modelYear', 'make'] - const optionsKeys = Object.keys(options) as Array< - keyof ProductsOptionsBase - > - const invalidKeys = optionsKeys.filter((key) => { - return !validKeys.includes(key) - }) - - if (invalidKeys.length > 0) { - throw new Error( - `Invalid options: ${invalidKeys.join( - ', ' - )}. Valid options are: ${validKeys.join(', ')}` - ) - } - + /* 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 */ @@ -427,7 +334,7 @@ async function products( else if (modelYear) path = `vehicle/makes` } - /* If there were no options passed, then path should still be an empty string */ + /* If there were no options passed, then path should still be vehicle/modelYears */ if (!path) path = `vehicle/modelYears` const { get, createCachedUrl, getCachedUrl } = useNHTSA() diff --git a/packages/lib/src/api/recalls/__tests__/recalls.test.ts b/packages/lib/src/api/recalls/__tests__/recalls.test.ts index c1f0041f..e3d2d938 100644 --- a/packages/lib/src/api/recalls/__tests__/recalls.test.ts +++ b/packages/lib/src/api/recalls/__tests__/recalls.test.ts @@ -400,7 +400,7 @@ describe('recalls()', () => { notAnOption: 'invalid option with TS error', }) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, campaignNumber/ + /Invalid keys for options: notAnOption. Valid keys are:/ ) expect(fetchMock.requests().length).toEqual(0) @@ -416,7 +416,7 @@ describe('recalls()', () => { true ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, campaignNumber/ + /Invalid keys for options: notAnOption. Valid keys are:/ ) expect(fetchMock.requests().length).toEqual(0) @@ -432,7 +432,7 @@ describe('recalls()', () => { false ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, campaignNumber/ + /Invalid keys for options: notAnOption. Valid keys are:/ ) expect(fetchMock.requests().length).toEqual(0) @@ -445,7 +445,9 @@ describe('recalls()', () => { // @ts-expect-error Type 'never[]' is not assignable to type 'string | undefined' campaignNumber: [], }) - ).rejects.toThrowError(/error validating argument named "campaignNumber"/) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) expect(fetchMock.requests().length).toEqual(0) }) @@ -458,7 +460,7 @@ describe('recalls()', () => { modelYear, }) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, campaignNumber/ + /Invalid keys for options: notAnOption. Valid keys are:/ ) expect(fetchMock.requests().length).toEqual(0) @@ -476,7 +478,7 @@ describe('recalls()', () => { true ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, campaignNumber/ + /Invalid keys for options: notAnOption. Valid keys are:/ ) expect(fetchMock.requests().length).toEqual(0) @@ -495,7 +497,7 @@ describe('recalls()', () => { false ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, campaignNumber/ + /Invalid keys for options: notAnOption. Valid keys are:/ ) expect(fetchMock.requests().length).toEqual(0) @@ -504,14 +506,16 @@ describe('recalls()', () => { test('with invalid options and all valid options', async () => { await expect(() => recalls({ - notAnOption: 'no TS error, campaignNumber error takes precedence', + 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(/error validating argument named "campaignNumber"/) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are:/ + ) expect(fetchMock.requests().length).toEqual(0) }) @@ -523,25 +527,17 @@ describe('recalls()', () => { * 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. - * - * All of these calls to safetyRatings() mimic all of tests in the test.each() tests above. - * They are separated here to allow for testing of the IDE tooltips for each possible response - * type individually by hovering over the saved `result_x` and/or the function name each time it is - * called. + * 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 SafetyRatingsResultsVariants types at once when hovering over the saved results of - * safetyRatings(). This will still happen even if you only include arguments that would return - * the same type of response. + * 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 () => { diff --git a/packages/lib/src/api/recalls/recalls.ts b/packages/lib/src/api/recalls/recalls.ts index c6981cca..89f8ee31 100644 --- a/packages/lib/src/api/recalls/recalls.ts +++ b/packages/lib/src/api/recalls/recalls.ts @@ -139,48 +139,55 @@ import type { * 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 - * // Get a list of available model years in the recalls dataset * 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 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 - * // Get a list of available makes for the 2013 model year - * await recalls({ - * modelYear: 2013, - * }) + * await recalls({ modelYear: 2013 }) * .then((response) => { * response.Results.forEach((result) => { * console.log(result.modelYear) // "ACURA", "AUDI", "BENTLEY", etc. - * console.log(results.make) // "JETTA", "ACCORD", 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 model - * year and 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 - * // Get a list of available models for a 2013 Honda * await recalls({ * modelYear: 2013, * make: 'Honda', @@ -192,6 +199,11 @@ import type { * 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 @@ -199,13 +211,14 @@ import type { * * ### Get Recalls for Year, Make, and Model * - * Uses the `Recalls API` to get all available recalls for a specific model 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 - * // Get as list of recalls for a 2013 Honda Accord * await recalls({ * modelYear: 2013, * make: 'Honda', @@ -223,6 +236,11 @@ import type { * // ...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 @@ -244,8 +262,8 @@ import type { * 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 - * // Get recall information for a specific campaign number * await recalls({ * campaignNumber: '12V176000', * }) @@ -262,6 +280,11 @@ import type { * // ...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 @@ -343,11 +366,11 @@ async function recalls( /* This will also ensure we have an actual object using our custom getTypeof() function */ catchInvalidArguments({ args: [ - { name: 'options', value: options, types: ['object'] }, { - name: 'campaignNumber', - value: options?.campaignNumber, - types: ['string'], + name: 'options', + value: options, + types: ['object'], + validKeys: ['modelYear', 'make', 'model', 'campaignNumber'], }, { name: 'modelYear', @@ -366,39 +389,16 @@ async function recalls( requiredBy: [{ name: 'model', value: options?.model }], }, { name: 'model', value: options?.model, types: ['string'] }, + { + name: 'campaignNumber', + value: options?.campaignNumber, + types: ['string'], + }, ], }) - /* - * Throw an error if options object contains invalid properties. - * - * This must be after the catchInvalidArguments() call above so we can ensure we have an actual - * object here and not 'null' 'array' etc., which typeof will let into the 'if' block as they - * are all considered typeof === 'object'. We only use typeof here to make the TS compiler - * happy. - */ - if (typeof options === 'object') { - const validKeys: Array = [ - 'modelYear', - 'make', - 'model', - 'campaignNumber', - ] - const optionsKeys = Object.keys(options) as Array< - keyof RecallsOptionsBase - > - const invalidKeys = optionsKeys.filter((key) => { - return !validKeys.includes(key) - }) - - if (invalidKeys.length > 0) { - throw new Error( - `Invalid options: ${invalidKeys.join( - ', ' - )}. Valid options are: ${validKeys.join(', ')}` - ) - } - + /* options are guaranteed to be an object by now because of catchInvalidArguments() */ + if (options) { encodedParams = encodeQueryStringParams(options) } @@ -406,7 +406,10 @@ async function recalls( 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 */ + /* + * Use the Recalls API if campaignNumber or full vehicle is passed + * ignores vehicle if campaignNumber exists + */ if (campaignNumber || hasVehicle) { if (campaignNumber) { path = `campaignNumber` @@ -432,7 +435,7 @@ async function recalls( } } - /* else use the Products API */ + /* 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) diff --git a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts index 144dfa9d..5944b89b 100644 --- a/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts +++ b/packages/lib/src/api/safetyRatings/__tests__/safetyRatings.test.ts @@ -408,7 +408,7 @@ describe('safetyRatings()', () => { notAnOption: 'invalid option with TS error', }) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, vehicleId/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ ) expect(fetchMock.requests().length).toEqual(0) @@ -424,7 +424,7 @@ describe('safetyRatings()', () => { true ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, vehicleId/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ ) expect(fetchMock.requests().length).toEqual(0) @@ -440,7 +440,7 @@ describe('safetyRatings()', () => { false ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, vehicleId/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ ) expect(fetchMock.requests().length).toEqual(0) @@ -453,7 +453,9 @@ describe('safetyRatings()', () => { // @ts-expect-error Type 'never[]' is not assignable to type 'string | number | undefined' vehicleId: [], }) - ).rejects.toThrowError(/error validating argument named "vehicleId"/) + ).rejects.toThrowError( + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ + ) expect(fetchMock.requests().length).toEqual(0) }) @@ -466,7 +468,7 @@ describe('safetyRatings()', () => { modelYear, }) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, vehicleId/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ ) expect(fetchMock.requests().length).toEqual(0) @@ -484,7 +486,7 @@ describe('safetyRatings()', () => { true ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, vehicleId/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ ) expect(fetchMock.requests().length).toEqual(0) @@ -503,7 +505,7 @@ describe('safetyRatings()', () => { false ) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, vehicleId/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ ) expect(fetchMock.requests().length).toEqual(0) @@ -520,7 +522,7 @@ describe('safetyRatings()', () => { vehicleId, }) ).rejects.toThrowError( - /Invalid options: notAnOption. Valid options are: modelYear, make, model, vehicleId/ + /Invalid keys for options: notAnOption. Valid keys are: modelYear, make, model, vehicleId/ ) expect(fetchMock.requests().length).toEqual(0) @@ -536,22 +538,14 @@ describe('safetyRatings()', () => { * The actual types and typed returns are tested in safetyRatings.test-d.ts via Vitest type * checking, these are simply hovering tooltip tests. * - * All of these calls to safetyRatings() mimic all of tests in the test.each() tests above. - * They are separated here to allow for testing of the IDE tooltips for each possible response - * type individually by hovering over the saved `result_x` and/or the function name each time it is - * called. - * * This cannot be achieved in test.each() tests because the way .each() is typed, it will show all - * possible SafetyRatingsResultsVariants types at once when hovering over the saved results of - * safetyRatings(). This will still happen even if you only include arguments that would return - * the same type of response. + * 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 () => { diff --git a/packages/lib/src/api/safetyRatings/safetyRatings.ts b/packages/lib/src/api/safetyRatings/safetyRatings.ts index d35faf01..65e839f8 100644 --- a/packages/lib/src/api/safetyRatings/safetyRatings.ts +++ b/packages/lib/src/api/safetyRatings/safetyRatings.ts @@ -132,7 +132,7 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * await safetyRatings().then((response) => { * response.Results.forEach((result) => { * console.log(result.ModelYear) // "2024", "2023", "2022", etc - * console.log(results.VehicleId) // 0 + * console.log(result.VehicleId) // 0 * }) * }) * ``` @@ -151,7 +151,7 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * .then((response) => { * response.Results.forEach((result) => { * console.log(result.Make) // "ACURA", "AUDI", "BENTLEY", etc. - * console.log(results.VehicleId) // 0 + * console.log(result.VehicleId) // 0 * }) * }) * ``` @@ -334,7 +334,12 @@ async function safetyRatings( /* This will also ensure we have an actual object using our custom getTypeof() function */ catchInvalidArguments({ args: [ - { name: 'options', value: options, types: ['object'] }, + { + name: 'options', + value: options, + types: ['object'], + validKeys: ['modelYear', 'make', 'model', 'vehicleId'], + }, { name: 'vehicleId', value: options?.vehicleId, @@ -360,36 +365,8 @@ async function safetyRatings( ], }) - /* - * Throw an error if options object contains invalid properties. - * - * This must be after the catchInvalidArguments() call above so we can ensure we have an actual - * object here and not 'null' 'array' etc., which typeof will let into the 'if' block as they - * are all considered typeof === 'object'. We only use typeof here to make the TS compiler - * happy. - */ - if (typeof options === 'object') { - const validKeys: Array = [ - 'modelYear', - 'make', - 'model', - 'vehicleId', - ] - const optionsKeys = Object.keys(options) as Array< - keyof SafetyRatingsOptionsBase - > - const invalidKeys = optionsKeys.filter((key) => { - return !validKeys.includes(key) - }) - - if (invalidKeys.length > 0) { - throw new Error( - `Invalid options: ${invalidKeys.join( - ', ' - )}. Valid options are: ${validKeys.join(', ')}` - ) - } - + /* options are guaranteed to be an object by now because of catchInvalidArguments() */ + if (options) { /* Build the API URL path */ path = buildPath(options) } From 37c346c55712cd99eb780bd3e4985380a6d4a034 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 26 Dec 2023 00:14:38 -0600 Subject: [PATCH 89/93] feat(lib): add function wrapper for CSSIStation API --- .../__tests__/cssiStation.test-d.ts | 218 ++++ .../cssiStation/__tests__/cssiStation.test.ts | 1042 +++++++++++++++++ .../lib/src/api/cssiStation/cssiStation.ts | 382 +++++- packages/lib/src/api/cssiStation/types.ts | 17 + 4 files changed, 1657 insertions(+), 2 deletions(-) diff --git a/packages/lib/src/api/cssiStation/__tests__/cssiStation.test-d.ts b/packages/lib/src/api/cssiStation/__tests__/cssiStation.test-d.ts index e69de29b..fede7cc6 100644 --- a/packages/lib/src/api/cssiStation/__tests__/cssiStation.test-d.ts +++ 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 index e69de29b..383a2381 100644 --- a/packages/lib/src/api/cssiStation/__tests__/cssiStation.test.ts +++ 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 index 947fd07d..8f43a6d1 100644 --- a/packages/lib/src/api/cssiStation/cssiStation.ts +++ b/packages/lib/src/api/cssiStation/cssiStation.ts @@ -3,6 +3,18 @@ * @category API - CSSI Station Locator API */ +import { useNHTSA } from '@/api' +import { + catchInvalidArguments, + encodeQueryStringParams, + rejectWithError, +} from '@/utils' +import type { + NhtsaResponse, + NoExtraProperties, + QueryStringParamsEncoded, +} from '@/types' + /** Rough Draft Notes: @@ -91,7 +103,7 @@ Possible Options Combinations: - location + filters (same as location only) Rules: -- CSSIStation is not case sensitive for the path name +- CSSIStation is not case sensitive for the path name, can be /CSSIStation or /cssistation, etc. - If zip is provided, cannot provide state or location - If state is provided, cannot provide zip or location - lat, long, and miles must be provided all or none @@ -144,7 +156,8 @@ cssiStation({ state: 'NV', filters: { lang: 'spanish' } }) LOCATION (lat, long, miles): - returns first 100 stations, same as no options -- query string has no effect on returned data +- query string has no effect on returned data, returns same data as no query string +- these options appears to be broken or abandoned by NHTSA - uses base url of /CSSIStation with query string of ?lat=32.71325&long=-97.28864&miles=50 - filters are added to query string as &lang=spanish &cpsweek=true @@ -344,3 +357,368 @@ Needs more real world testing before we try to implement. /** * # CSSI Station */ +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 index e69de29b..884ce595 100644 --- a/packages/lib/src/api/cssiStation/types.ts +++ 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' From f5f73f60c538072358320cb9e99fdc1cabfc0a82 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 26 Dec 2023 00:19:33 -0600 Subject: [PATCH 90/93] lib: add cssiStation function and related types to exports --- packages/lib/src/api/index.ts | 1 + packages/lib/src/api/types.ts | 1 + packages/lib/src/index.ts | 13 +++++++++++++ 3 files changed, 15 insertions(+) diff --git a/packages/lib/src/api/index.ts b/packages/lib/src/api/index.ts index d160f773..550e3b12 100644 --- a/packages/lib/src/api/index.ts +++ b/packages/lib/src/api/index.ts @@ -4,6 +4,7 @@ */ 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' diff --git a/packages/lib/src/api/types.ts b/packages/lib/src/api/types.ts index 9d5bf61a..024e5989 100644 --- a/packages/lib/src/api/types.ts +++ b/packages/lib/src/api/types.ts @@ -4,6 +4,7 @@ */ export * from './complaints/types' +export * from './cssiStation/types' export * from './products/types' export * from './recalls/types' export * from './safetyRatings/types' diff --git a/packages/lib/src/index.ts b/packages/lib/src/index.ts index 6afea169..30fdfe10 100644 --- a/packages/lib/src/index.ts +++ b/packages/lib/src/index.ts @@ -7,6 +7,7 @@ * @category Exported NHTSA API Functions */ export { + /* vPIC API */ DecodeVin, DecodeVinExtended, DecodeVinValues, @@ -31,10 +32,13 @@ export { GetVehicleVariableList, GetVehicleVariableValuesList, GetWMIsForManufacturer, + /* Other APIs */ complaints, + cssiStation, products, recalls, safetyRatings, + /* NHTSA Helper Function */ useNHTSA, } from '@/api' @@ -94,6 +98,15 @@ export type { ComplaintsResultsByVariant, ComplaintsResultsData, ComplaintsResultsVariant, + CSSIOptions, + CSSIOptionsBase, + CSSIOptionsEmpty, + CSSIOptionsCanBeQuery, + CSSIOptionsLocation, + CSSIOptionsState, + CSSIOptionsZip, + CSSIResponse, + CSSIResultsData, ProductsIssueType, ProductsOptions, ProductsOptionsBase, From fdf49a67b8ecb61b7d2b3b85dbac474cf33d4e32 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Tue, 26 Dec 2023 23:36:37 -0600 Subject: [PATCH 91/93] lib(api): finish description for cssiStation function --- packages/lib/src/api/complaints/complaints.ts | 10 +- .../lib/src/api/cssiStation/cssiStation.ts | 695 +++++++++--------- packages/lib/src/api/products/products.ts | 5 +- packages/lib/src/api/recalls/recalls.ts | 15 +- .../src/api/safetyRatings/safetyRatings.ts | 58 +- 5 files changed, 395 insertions(+), 388 deletions(-) diff --git a/packages/lib/src/api/complaints/complaints.ts b/packages/lib/src/api/complaints/complaints.ts index 2e19557c..6a4a17fd 100644 --- a/packages/lib/src/api/complaints/complaints.ts +++ b/packages/lib/src/api/complaints/complaints.ts @@ -209,11 +209,7 @@ import type { * * Example: Get as list of complaints for a 2013 Honda Accord * ```js - * await complaints({ - * modelYear: 2013, - * make: 'Honda', - * model: 'Accord', - * }) + * await complaints({ modelYear: 2013, make: 'Honda', model: 'Accord' }) * .then((response) => { * response.Results.forEach((result) => { * console.log(result.odiNumber) // 11549247, 11483831, etc. @@ -254,9 +250,7 @@ import type { * * Example: Get complaint information for a specific ODI Number * ```js - * await complaints({ - * odiNumber: 11549247, - * }) + * await complaints({ odiNumber: 11549247 }) * .then((response) => { * response.Results.forEach((result) => { * console.log(result.odiNumber) // 11549247, 11483831, etc. diff --git a/packages/lib/src/api/cssiStation/cssiStation.ts b/packages/lib/src/api/cssiStation/cssiStation.ts index 8f43a6d1..2c598db7 100644 --- a/packages/lib/src/api/cssiStation/cssiStation.ts +++ b/packages/lib/src/api/cssiStation/cssiStation.ts @@ -16,346 +16,361 @@ import type { } from '@/types' /** -Rough Draft Notes: - ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- - -From the official docs at https://www.nhtsa.gov/nhtsa-datasets-and-apis#car-seat-inspection-locator - -Approach A. Get by Zip Code -Make the request with a zip code to get the list of CSSIStations at the specific zip code only (nearby zip codes are not included). - -/CSSIStation/zip/63640 -Response Fields: Response is a list of CSSIStations for a given zip code. - -Working Sample: https://api.nhtsa.gov/CSSIStation/zip/63640 - ---- - -Approach B. Get by State -Make the request with the state abbreviation to get the list of CSSIStations in that state only. - -/api/CSSIStation/state/NV -Response Fields: Response is a list of CSSIStations in a given state. - -Working Sample: https://api.nhtsa.gov/CSSIStation/state/NV - ---- - -Approach C. Get by Geo location -Make the request with an interested latitude and longitude location along with the miles nearby to look out for CSSIStations. - -/CSSIStation?lat=30.1783&long=-96.3911&miles=50 -Response Fields: Response is a list of CSSIStations nearby the interested geographical location spotted by its latitude and longitude. - -Working Sample: https://api.nhtsa.gov/CSSIStation?lat=30.1783&long=-96.3911&miles=50 - ---- ---- - -Filters. Optional Filters - -Filter 1: Filter by Spanish speaking Stations - -Make the request with a zip code/state/geographical location to get the list of CSSIStations filtered by spanish speaking (attach string - /lang/spanish) and stations participating in CPSWeek event (attach string - /cpsweek). Below filters in the request string are optional, either one/none OR both can be sent in. - -/CSSIStation/zip/67951/lang/spanish -Response Fields: Response is a list of CSSIStations for a given zip code applying the respective filter. - -Working Sample: https://api.nhtsa.gov//CSSIStation/zip/67951/lang/spanish - ---- - -Filter 2: Filter by Stations participating in CPSWeek - -Make the request with a zip code/state/geographical location to get the list of CSSIStations filtered by stations participating in CPSWeek event (attach string - /cpsweek). Below filters in the request string are optional, either one/none OR both can be sent in. - -/CSSIStation/zip/37066/cpsweek -Response Fields: Response is a list of CSSIStations for a given zip code applying the respective filter. - -Working Sample: https://api.nhtsa.gov/CSSIStation/zip/37066/cpsweek - -Notes -Request parameters and method names are case sensitive - ----------------------------------------------------------------------------- - -Possible Options: -- zip: string | number -- state: string -- location: { - lat: string | number; - long: string | number; - miles: string | number - } -- filters: { - lang: string; - cpsweek: boolean - } - -Possible Options Combinations: -- zip -- zip + filters -- state -- state + filter.lang -- location -- location + filters (same as location only) - -Rules: -- CSSIStation is not case sensitive for the path name, can be /CSSIStation or /cssistation, etc. -- If zip is provided, cannot provide state or location -- If state is provided, cannot provide zip or location -- lat, long, and miles must be provided all or none -- filters are optional, either one/none OR both can be sent in according to docs -- filters.cpsweek not compatible with state - ---- - -Examples: - -FIRST 100 STATIONS (no options): - -cssiStation() -- returns first 100 stations -- uses base url of /CSSIStation - -cssiStation({}) -- returns first 100 stations -- uses base url of /CSSIStation - ---- - -ZIP: -Path - https://api.nhtsa.gov/CSSIStation/zip/63640 -cssiStation({ zip: 63640 }) - -Path- https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish -cssiStation({ zip: 63640, filters: { lang: 'spanish' } }) - -Path - https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek -cssiStation({ zip: 63640, filters: { cpsweek: true } }) - -Path - https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek?lang=spanish -cssiStation({ zip: 63640, filters: { lang: 'spanish', cpsweek: true } }) - ---- - -STATE: -Path - https://api.nhtsa.gov/CSSIStation/state/NV -cssiStation({ state: 'NV' }) -cssiStation({ state: 'nv' }) -cssiStation({ state: 'Nv' }) -cssiStation({ state: 'Nevada' }) -cssiStation({ state: 'nevada' }) - -Path - https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish -cssiStation({ state: 'NV', filters: { lang: 'spanish' } }) - ---- - -LOCATION (lat, long, miles): -- returns first 100 stations, same as no options -- query string has no effect on returned data, returns same data as no query string -- these options appears to be broken or abandoned by NHTSA -- uses base url of /CSSIStation with query string of ?lat=32.71325&long=-97.28864&miles=50 -- filters are added to query string as &lang=spanish &cpsweek=true - -Path - https://api.nhtsa.gov/CSSIStation?lat=32.71325&long=-97.28864&miles=50 -All paths here use query string to represent passed options as seen in the path above. - -cssiStation({ - location: { - lat: 32.71325, - long: -97.28864, - miles: 50 - } -}) - -cssiStation({ - location: { - lat: 32.71325, - long: -97.28864, - miles: 50 - }, - filters: { - lang: 'spanish' - } -}) - -cssiStation({ - location: { - lat: 32.71325, - long: -97.28864, - miles: 50 - }, - filters: { - cpsweek: true - } -}) - -cssiStation({ - location: { - lat: 32.71325, - long: -97.28864, - miles: 50 - }, - filters: { - lang: 'spanish', - cpsweek: true - } -}) - ----------------------------------------------------------------------------- - -By zip: - -Uses url path to specify zip code: -- https://api.nhtsa.gov/CSSIStation/zip/63640 - -Fitering by lang: -- https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish -- Apparently you can pash whatever language string you want after the /lang/ part of the path, it - doesn't have to be /lang/spanish as described in the docs. -- It returns the same data no matter the path after /lang (e.g. /lang/blahblahblah returns the same - data as /lang/spanish) - -Filtering by cpsweek: -- https://api.nhtsa.gov/CSSIStation/zip/37066/cpsweek - -Filtering by cpsweek and lang as query string: -- https://api.nhtsa.gov/CSSIStation/zip/37066/cpsweek?lang=spanish - ---- - -By state: - -Uses url path to specify state: -- https://api.nhtsa.gov/CSSIStation/state/NV -- state can be NV, nv, nevada, Nevada, etc. - -Filtering by lang: -- https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish -- Apparently you can pash whatever language string you want after the /lang/ part of the path, it - doesn't have to be /lang/spanish as described in the docs. -- It returns the same data no matter the path after /lang (e.g. /lang/blahblahblah returns the same - data as /lang/spanish) - -Filtering by cpsweek (DOES NOT WORK WITH STATE!): -- https://api.nhtsa.gov/CSSIStation/state/NV/?cpsweek=true <-- ignores query, returns same data as - /state/NV -- https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek <-- gives 404 error -- https://api.nhtsa.gov/CSSIStation/cpsweek/state/NV <-- gives 404 error with differing path - order - -Filtering by cpsweek and lang (DOES NOT WORK WITH STATE!): -- https://api.nhtsa.gov/CSSIStation/state/NV?cpsweek&lang=spanish <-- ignores query, returns same - data as /state/NV?lang=spanish -- https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek?lang=spanish <-- gives 404 error -- https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish/cpsweek <-- gives 404 error -- https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek/lang/spanish <-- gives 404 error - ---- - -By lat, long, and miles: - -In real world use, this will return the same data no matter what query string you send, the same as -if you sent no query string at all. It appears the query string does nothing for this endpoint as -described in the official docs. You will get the same 100 stations returned no matter what query -string you send. - -After testing out the API and looking at the docs, I think the docs are wrong or at the very least -the lat/long/miles query is broken or abandoned, possibly in favor of the official site and form at: -https://www.nhtsa.gov/equipment/car-seats-and-booster-seats#installation-help-inspection - -It doesn't appear the query string does anything, even with the example in the official docs. If you -change the lat and long and miles the results are the same as if you has just hit the baseURL -of https://api.nhtsa.gov/CSSIStation with no query string. - -I'm not sure if this is a bug or if the docs are wrong. - -In practice you can send whatever query string names and values you want, it will ignore the query -and still return the same data. - -I also don't know how to apply filters in this case although the docs say you can, and again the -query string in any combination doesn't seem to change the data returned, which appears to be the -first 100 stations in the database. - -If you go here: -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 the 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 api.nhtsa.gove/CSSIStation API. - ---- - -Filters: - -Cannot use with lat, long, and miles, or more accurately, query strings do nothing for this endpoint -so determining if you can use filters with lat, long, and miles is impossible. - -lang: - -Apparently you can pass whatever language string you want after the /lang/ part of the path, it -doesn't have to be /lang/spanish as described in the docs. It returns the same data no matter the -path after /lang (e.g. /lang/blahblahblah returns the same data as /lang/spanish) - -By zip with lang: -- https://api.nhtsa.gov/CSSIStation/zip/63640/lang/spanish - -By zip with lang and cpsweek (cpsweek sent as query string = true): -- https://api.nhtsa.gov//CSSIStation/zip/67951/lang/spanish?cpsweek=true -- Returns: Count = 0 because there are no stations with CPSWeekEventFlag = "Yes" in zip 63640 but will - still return 200 status code and empty Results[] - -By state with lang: -- https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish - -By state with lang and cpsweek (cpsweek sent as query string = true): -- https://api.nhtsa.gov/CSSIStation/state/NV/lang/spanish?cpsweek=true <-- responds with same data - as above, query strings do nothing it appears, includes stations with CPSWeekEventFlag = "No" when - it should only include stations with CPSWeekEventFlag = "Yes" - -cpsweek: - -By zip With cpsweek: -- https://api.nhtsa.gov/CSSIStation/zip/63640/cpsweek - -By zip with cpsweek and lang as query string: -- https://api.nhtsa.gov/CSSIStation/zip/37066/cpsweek?lang=spanish -- Returns: Count = 0 because there are no stations with CPSWeekEventFlag = "Yes" in zip 63640 that - have spanish speaking technicians but will still return 200 status code and empty Results[] - -By state with cpsweek (DOES NOT WORK): -- https://api.nhtsa.gov/CSSIStation/state/NV?cpsweek=true <-- ignores query, returns same data as /state/NV -- https://api.nhtsa.gov/CSSIStation/state/NV/cpsweek <- gives 404 error -- https://api.nhtsa.gov/CSSIStation/cpsweek/state/NV <- also gives 404 error with differing path order - ---- - -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. - -Needs more real world testing before we try to implement. - - */ - -/** - * # CSSI Station + * # 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, diff --git a/packages/lib/src/api/products/products.ts b/packages/lib/src/api/products/products.ts index c3165407..66a01ed7 100644 --- a/packages/lib/src/api/products/products.ts +++ b/packages/lib/src/api/products/products.ts @@ -180,10 +180,7 @@ import type { * * Example: Get a list of available models for a 2013 Honda in the recalls dataset * ```js - * await products('r', { - * modelYear: 2013, - * make: 'Honda', - * }) + * await products('r', { modelYear: 2013, make: 'Honda' }) * .then((response) => { * response.Results.forEach((result) => { * console.log(result.modelYear) // "2013" diff --git a/packages/lib/src/api/recalls/recalls.ts b/packages/lib/src/api/recalls/recalls.ts index 89f8ee31..d70861f9 100644 --- a/packages/lib/src/api/recalls/recalls.ts +++ b/packages/lib/src/api/recalls/recalls.ts @@ -188,10 +188,7 @@ import type { * * Example: Get a list of available models for a 2013 Honda * ```js - * await recalls({ - * modelYear: 2013, - * make: 'Honda', - * }) + * await recalls({ modelYear: 2013, make: 'Honda' }) * .then((response) => { * response.Results.forEach((result) => { * console.log(result.modelYear) // "2013" @@ -219,11 +216,7 @@ import type { * * Example: Get as list of recalls for a 2013 Honda Accord * ```js - * await recalls({ - * modelYear: 2013, - * make: 'Honda', - * model: 'Accord', - * }) + * await recalls({ modelYear: 2013, make: 'Honda', model: 'Accord' }) * .then((response) => { * response.Results.forEach((result) => { * console.log(result.NHTSACampaignNumber) // "13V132000", "19V182000", etc. @@ -264,9 +257,7 @@ import type { * * // Example: Get recall information for a specific campaign number * ```js - * await recalls({ - * campaignNumber: '12V176000', - * }) + * await recalls({ campaignNumber: '12V176000' }) * .then((response) => { * response.Results.forEach((result) => { * console.log(result.PotentialNumberofUnitsAffected) // 7600, 2230, etc. diff --git a/packages/lib/src/api/safetyRatings/safetyRatings.ts b/packages/lib/src/api/safetyRatings/safetyRatings.ts index 65e839f8..48511f02 100644 --- a/packages/lib/src/api/safetyRatings/safetyRatings.ts +++ b/packages/lib/src/api/safetyRatings/safetyRatings.ts @@ -127,14 +127,18 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * 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 - * // 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(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 @@ -143,17 +147,19 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * * 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 - * // Get a list of available makes for the 2013 model year - * await safetyRatings({ - * modelYear: 2013, - * }) + * 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. @@ -166,18 +172,19 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * 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 - * // Get the models for a 2013 Honda - * await safetyRatings({ - * modelYear: 2013, - * make: '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 + * 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 @@ -191,13 +198,9 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * 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 - * // Get as list of VehicleId(s) for a 2013 Honda Accord - * await safetyRatings({ - * modelYear: 2013, - * make: 'Honda', - * model: 'Accord', - * }) + * await safetyRatings({ modelYear: 2013, make: 'Honda', model: 'Accord' }) * .then((response) => { * // First Object in the Results array * console.log(response.Results[0].VehicleId) // 7523 @@ -206,6 +209,11 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * 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`. @@ -231,11 +239,9 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * * 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 - * // Get the Safety Ratings for a 2013 Honda Accord 4 DR FWD - * await safetyRatings({ - * vehicleId: 7523, - * }) + * await safetyRatings({ vehicleId: 7523 }) * .then((response) => { * console.log(response.Results[0].ComplaintsCount) * console.log(response.Results[0].InvestigationCount) @@ -243,6 +249,10 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * 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 @@ -262,7 +272,7 @@ import type { NhtsaResponse, NoExtraProperties } from '@/types' * combination of SafetyRatingsResultsData properties. * * - See type `SafetyRatingsResultsData` for a list of all possible properties. - * - See type `RecallsResultsByVariant` for clarity on which properties will be included based on + * - 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 From 7d98fc3eeb76280a055958856630ec20aaa9c0e8 Mon Sep 17 00:00:00 2001 From: ShaggyTech Date: Tue, 26 Dec 2023 20:39:01 -0600 Subject: [PATCH 92/93] lib: start refactor of vpic functions and tests, start with decodeVin --- .../src/api/vpic/__tests__/_decodeVin.test.ts | 332 +++++++++++++----- packages/lib/src/api/vpic/_decodeVin.ts | 215 +++++++++--- packages/lib/src/api/vpic/types.ts | 12 + 3 files changed, 433 insertions(+), 126 deletions(-) create mode 100644 packages/lib/src/api/vpic/types.ts diff --git a/packages/lib/src/api/vpic/__tests__/_decodeVin.test.ts b/packages/lib/src/api/vpic/__tests__/_decodeVin.test.ts index 1a20e3a9..eea6937b 100644 --- a/packages/lib/src/api/vpic/__tests__/_decodeVin.test.ts +++ b/packages/lib/src/api/vpic/__tests__/_decodeVin.test.ts @@ -5,16 +5,14 @@ import { decodeVin } from '../_decodeVin' import { createMockResponse } from '.vitest/helpers' import { mockResults } from '.vitest/data' -const endpointName = 'DecodeVin' const vin = 'WA1A4AFY2J2008189' const modelYearString = '2018' const modelYearNumber = 2018 const modelYear = modelYearNumber -const params = { modelYear } -const baseUrl = 'https://vpic.nhtsa.dot.gov/api/vehicles' -const mockUrl = `${baseUrl}/${endpointName}/${vin}?format=json` -const mockUrlWithParams = `${baseUrl}/${endpointName}/${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, @@ -27,13 +25,6 @@ type TestEach = { expectedUrl: string } -describe('api/endpoints/decodeVin.ts', () => { - test('exports decodeVin function', () => { - expect(decodeVin).toBeDefined() - expect(decodeVin).toBeInstanceOf(Function) - }) -}) - describe('decodeVin()', () => { beforeEach(() => { fetchMock.resetMocks() @@ -49,41 +40,42 @@ describe('decodeVin()', () => { /***************************** * doFetch = true (default) ****************************/ - describe('Fetches API data:', () => { + describe('Fetches API data with: ', () => { test.each([ + // vin with no options { - description: 'when passed a VIN string', + description: 'vin with no options', args: [vin], expectedUrl: mockUrl, }, { - description: 'when passed a VIN string and doFetch = true', + description: 'vin with no options and doFetch = true', args: [vin, true], expectedUrl: mockUrl, }, + // options.modelYear { - description: 'when passed a VIN string and params', - args: [vin, { ...params }], - expectedUrl: mockUrlWithParams, + description: 'options.modelYear as string', + args: [vin, { modelYear: modelYearString }], + expectedUrl: mockUrlModelYear, }, { - description: 'when passed a VIN string, params, and doFetch = true', - args: [vin, { ...params }, true], - expectedUrl: mockUrlWithParams, + description: 'options.modelYear as string and doFetch = true', + args: [vin, { modelYear: modelYearString }, true], + expectedUrl: mockUrlModelYear, }, { - description: 'when params.modelYear passed as a string', - args: [vin, { modelYear: modelYearString }], - expectedUrl: mockUrlWithParams, + description: 'options.modelYear as number', + args: [vin, { modelYear: modelYearNumber }], + expectedUrl: mockUrlModelYear, }, { - description: 'when params.modelYear passed as a number', - args: [vin, { modelYear: modelYearNumber }], - expectedUrl: mockUrlWithParams, + description: '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) @@ -94,18 +86,24 @@ describe('decodeVin()', () => { /***************************** * doFetch = false - ****************************/ - describe('Returns API URL string:', () => { + ***************************/ + describe('Returns API URL string with: ', () => { test.each([ { - description: 'when passed a VIN string and doFetch = false', + description: 'vin and doFetch = false', args: [vin, false], expectedUrl: mockUrl, }, + // options.modelYear + { + description: 'options.modelYear as string and doFetch = false', + args: [vin, { modelYear: modelYearString }, false], + expectedUrl: mockUrlModelYear, + }, { - description: 'when passed a VIN string, params, and doFetch = false', - args: [vin, { ...params }, false], - expectedUrl: mockUrlWithParams, + description: 'options.modelYear as number and doFetch = false', + args: [vin, { modelYear: modelYearNumber }, false], + expectedUrl: mockUrlModelYear, }, ])('$description', async ({ args, expectedUrl }) => { const results = await decodeVin(...args) @@ -118,62 +116,236 @@ describe('decodeVin()', () => { /***************************** * rejects with error ***************************/ - describe('Rejects with Error if:', () => { - describe('VIN is undefined or is not a string', () => { - test.each([ - undefined, - 123, - { object: 123 }, - ['array'], - true, - false, - null, - () => 'function', - ])('%s', async (arg) => { + 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(arg as unknown as string) - ).rejects.toThrowError(/error validating argument named "vin"/) + 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) - }) - }) + } + ) - describe('params is neither an object nor boolean', () => { - test.each(['string', 123, ['array'], null, () => 'function'])( - '%s', - async (params) => { - await expect(() => - decodeVin( - vin, - // @ts-expect-error Type 'x' is not assignable to type ... - params - ) - ).rejects.toThrowError(/error validating argument named "params"/) - - expect(fetchMock.requests().length).toEqual(0) - } - ) - }) - - describe('params.modelYear is neither a string nor number', () => { - test.each([ - { modelYear: true }, - { modelYear: false }, - { modelYear: ['a', 'b'] }, - { modelYear: { a: 'b' } }, - { modelYear: null }, - { modelYear: () => 'function' }, - ])('%s', async (params) => { + test.each(['string', 123, ['array'], null, () => {}])( + 'options is neither an object nor boolean, <%s>', + async (arg) => { await expect(() => decodeVin( vin, - // @ts-expect-error Types of property 'modelYear' are incompatible. - params + // @ts-expect-error Type (x) is not assignable to type ... + arg ) - ).rejects.toThrowError(/error validating argument named "modelYear"/) + ).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 + ******************************/ + const result_1 = await decodeVin(vin, false) + const result_2 = await decodeVin(vin, {}, false) + const result_3 = await decodeVin(vin, undefined, false) + 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/_decodeVin.ts b/packages/lib/src/api/vpic/_decodeVin.ts index 0d0f0b73..57ea704f 100644 --- a/packages/lib/src/api/vpic/_decodeVin.ts +++ b/packages/lib/src/api/vpic/_decodeVin.ts @@ -5,93 +5,216 @@ import { useNHTSA } from '@/api' import { catchInvalidArguments, rejectWithError } from '@/utils' -import type { IArgToValidate, NhtsaResponse } from '@/types' +import type { NhtsaResponse } from '@/types' /** + * # DecodeVin VPIC Endpoint + * * ::: 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. + * 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" + * ``` * - * 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. + * 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. + * }) + * }) + * ``` * - * 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 + * ### 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 [params] - Object of Query Search names and values to append to the URL as a query string - * @param [params.modelYear] - Optional Model Year search parameter - * @param [doFetch=true] - Whether to fetch the data or just return the URL + * @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 {(Promise | string>)} - Api Response `object` - * -or- url `string` if `doFetch = false` + * @returns - Parsed API response `object` -or- url `string` */ -function decodeVin(vin: string): Promise -function decodeVin(vin: string, doFetch: true): Promise -function decodeVin(vin: string, doFetch: false): Promise function decodeVin( vin: string, - params: { modelYear?: string | number }, - doFetch: false -): Promise -function decodeVin( - vin: string, - params?: { modelYear?: string | number }, + options?: { modelYear?: string | number }, doFetch?: true ): Promise function decodeVin( vin: string, - params?: + options: { modelYear?: string | number }, + 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 +): Promise /* Implementation */ async function decodeVin( vin: string, - params?: + options?: | { modelYear?: string | number } | boolean, doFetch = true -): Promise { +): Promise { const endpointName = 'DecodeVin' try { - if (typeof params === 'boolean') { - doFetch = params - params = undefined + 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 } - const args: IArgToValidate[] = [ - { name: 'vin', value: vin, required: true, types: ['string'] }, - { name: 'params', value: params, types: ['object'] }, - { - name: 'modelYear', - value: params?.modelYear, - types: ['string', 'number'], - }, - ] - catchInvalidArguments({ args }) + 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 }) + createCachedUrl({ endpointName, path: vin, params: options }) if (!doFetch) { return getCachedUrl() } else { - return get() + return get() } } catch (error) { return rejectWithError(error) @@ -103,7 +226,7 @@ export { decodeVin } /** * Objects in the `Results` array of `DecodeVin` endpoint response. */ -export type DecodeVinResults = { +export type DecodeVinResultsData = { Value: string | null ValueId: string | null Variable: DecodeVinVariable @@ -261,4 +384,4 @@ export type DecodeVinVariable = | 'Lane Centering Assistance' | (string & Record) -export type DecodeVinResponse = NhtsaResponse +export type DecodeVinResponse = NhtsaResponse 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 {} From 34ccde4c9a0362ba502e106e730236a0ac90d6c5 Mon Sep 17 00:00:00 2001 From: shaggytech Date: Wed, 27 Dec 2023 19:59:49 -0600 Subject: [PATCH 93/93] lib: add type tests and continue refactor in progress --- .../api/vpic/__tests__/_decodeVin.test-d.ts | 89 +++++++++++++++++++ .../src/api/vpic/__tests__/_decodeVin.test.ts | 23 +++-- packages/lib/src/api/vpic/_decodeVin.ts | 2 +- 3 files changed, 105 insertions(+), 9 deletions(-) create mode 100644 packages/lib/src/api/vpic/__tests__/_decodeVin.test-d.ts 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 index eea6937b..546ee905 100644 --- a/packages/lib/src/api/vpic/__tests__/_decodeVin.test.ts +++ b/packages/lib/src/api/vpic/__tests__/_decodeVin.test.ts @@ -10,6 +10,9 @@ 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` @@ -44,33 +47,33 @@ describe('decodeVin()', () => { test.each([ // vin with no options { - description: 'vin with no options', + description: 'vin and no options', args: [vin], expectedUrl: mockUrl, }, { - description: 'vin with no options and doFetch = true', + description: 'vin, no options, and doFetch = true', args: [vin, true], expectedUrl: mockUrl, }, // options.modelYear { - description: 'options.modelYear as string', + description: 'vin and options.modelYear as string', args: [vin, { modelYear: modelYearString }], expectedUrl: mockUrlModelYear, }, { - description: 'options.modelYear as string and doFetch = true', + description: 'vin, options.modelYear as string, and doFetch = true', args: [vin, { modelYear: modelYearString }, true], expectedUrl: mockUrlModelYear, }, { - description: 'options.modelYear as number', + description: 'vin and options.modelYear as number', args: [vin, { modelYear: modelYearNumber }], expectedUrl: mockUrlModelYear, }, { - description: 'options.modelYear as number and doFetch = true', + description: 'vin, options.modelYear as number, and doFetch = true', args: [vin, { modelYear: modelYearNumber }, true], expectedUrl: mockUrlModelYear, }, @@ -96,12 +99,12 @@ describe('decodeVin()', () => { }, // options.modelYear { - description: 'options.modelYear as string and doFetch = false', + description: 'vin, options.modelYear as string and doFetch = false', args: [vin, { modelYear: modelYearString }, false], expectedUrl: mockUrlModelYear, }, { - description: 'options.modelYear as number and doFetch = false', + description: 'vin, options.modelYear as number and doFetch = false', args: [vin, { modelYear: modelYearNumber }, false], expectedUrl: mockUrlModelYear, }, @@ -338,9 +341,13 @@ describe.skip('IDE Tooltips - manual test of results type on hover', 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) diff --git a/packages/lib/src/api/vpic/_decodeVin.ts b/packages/lib/src/api/vpic/_decodeVin.ts index 57ea704f..4f08b5fb 100644 --- a/packages/lib/src/api/vpic/_decodeVin.ts +++ b/packages/lib/src/api/vpic/_decodeVin.ts @@ -155,7 +155,7 @@ function decodeVin( ): Promise function decodeVin( vin: string, - options: { modelYear?: string | number }, + options: { modelYear?: string | number } | undefined, doFetch: false ): Promise function decodeVin(vin: string, doFetch: true): Promise