luex-common-types
v0.1.1
Published
Shared platform API contracts and common TypeScript types for Luex projects.
Readme
luex-types
Luex projects shared package. The current scope is intentionally limited to platform authentication APIs and the common types required by those APIs.
Structure
platform-api: platform API definitions and typed request methods only.common-types: shared request and response types used by the APIs.
The package does not include vehicle query APIs, vehicle option APIs, business diagnosis APIs, task APIs, vehicle logs, or ODX/OTX APIs.
Install and build
npm install
npm run buildUsage
import { createAuthApi } from 'luex-types/platform-api'
const authApi = createAuthApi(service, {
platformType: 'chery:cn',
serviceId: 'rds-oauth',
})
await authApi.login({ username, password })
await authApi.getCurrentUser()
await authApi.refreshToken(refreshToken)
await authApi.logout(accessToken)platform-api depends only on the small LuexRequest contract. Each project
can adapt its existing Axios or fetch wrapper without coupling this package to
a specific HTTP client.
