0.0.3-202501060800 • Published 6 months ago
lightdash-client-typescript-fetch v0.0.3-202501060800
Lightdash TypeScript Client
A TypeScript client for the Lightdash API, generated from the official OpenAPI specification using openapi-fetch.
Installation
npm install @syucream/lightdash-client-typescript-fetch
Usage
import createLightdashClient from '@syucream/lightdash-client-typescript-fetch';
// Create a client instance
const client = createLightdashClient('https://your-lightdash-instance.com');
// Example: Get projects
const { data, error } = await client.GET('/api/v1/projects');
if (error) {
console.error('Error fetching projects:', error);
} else {
console.log('Projects:', data);
}
Technical Stack
- TypeScript
- openapi-fetch - Type-safe API client generator
- openapi-typescript - OpenAPI to TypeScript type generator
Development
- Clone the repository
- Install dependencies:
npm install
- Generate the client code:
npm run generate
- Build the project:
npm run build
Code Quality
The project uses ESLint and Prettier for code quality and formatting:
npm run lint
- Check code style and potential issuesnpm run fix
- Automatically fix code style issues
Individual commands are also available:
npm run lint:eslint
- Run ESLint checks onlynpm run lint:prettier
- Run Prettier checks onlynpm run fix:eslint
- Run ESLint auto-fixnpm run fix:prettier
- Run Prettier auto-fix
Continuous Integration
The project uses GitHub Actions for CI:
Pull Request Checks:
- Runs linting on all pull requests
- Ensures code quality before merging
Main Branch CI:
- Runs on merges to main
- Generates client code from the latest OpenAPI spec
- Builds the project
- Uploads build artifacts
Publishing
This package is published to GitHub Packages. To publish a new version:
- Update the version in
package.json
- Make sure you're authenticated with GitHub Packages
- Run:
npm publish
License
MIT
0.0.3-202501060800
6 months ago