TypeScript client for Holaspirit API generated using openapi-fetch
npm install holaspirit-client-typescript-fetchA TypeScript client for the Holaspirit API, generated from the official OpenAPI specification using openapi-fetch.
``bash`
npm install holaspirit-client-typescript-fetch
`typescript
import createHolaspiritClient from 'holaspirit-client-typescript-fetch';
// Create a client instance
const client = createHolaspiritClient('https://app.holaspirit.com');
// Example: Get organizations
const { data, error } = await client.GET('/api/organizations');
if (error) {
console.error('Error fetching organizations:', error);
} else {
console.log('Organizations:', data);
}
`
- TypeScript
- openapi-fetch - Type-safe API client generator
- openapi-typescript - OpenAPI to TypeScript type generator
1. Clone the repository
2. Install dependencies:
`bash`
npm install
`
3. Generate the client code:
bash`
npm run generate
`
4. Build the project:
bash`
npm run build
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
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
This package is published to GitHub Packages. To publish a new version:
1. Update the version in package.json`
2. Make sure you're authenticated with GitHub Packages
3. Run:
bash``
npm publish
MIT