Registry / healthcare / ch-api-client-typescript2

ch-api-client-typescript2

JSON →
library5.90.39jsnpmunverified

OpenAPI-generated TypeScript-axios client for CloudHospital API. Current version 5.90.39. Automatically regenerated from Swagger spec; requires manual generation via openapi-generator-cli. Key differentiator: auto-generated, strongly-typed client for CloudHospital's API using TypeScript and Axios, with DateTime mapped to Date type.

npm install ch-api-client-typescript2
INSTALL
IMPORT
SIG · CH-API-CLIENT-TYPE
C
ch-api-client-typescript2
healthcarejavascriptv5.90.39
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CountriesApi
import { CountriesApi } from 'ch-api-client-typescript2'
const { CountriesApi } = require('ch-api-client-typescript2')
Package exports ESM modules; CommonJS require may still work if package supports both.
Configuration
import { Configuration } from 'ch-api-client-typescript2'
import Configuration from 'ch-api-client-typescript2'
Configuration is a named export, not default.
CountryItemViewModel
import { CountryItemViewModel } from 'ch-api-client-typescript2'
import { CountryItemView } from 'ch-api-client-typescript2'
Exact naming includes 'Model' suffix.

Shows how to import and use the generated client to fetch countries list with proper types.

import { Configuration, CountriesApi, CountryItemViewModel } from 'ch-api-client-typescript2'; const config = new Configuration({ basePath: 'https://api-int.icloudhospital.com/' }); const countriesApi = new CountriesApi(config); countriesApi.apiV1CountriesGet().then(response => { const items: CountryItemViewModel[] = response.data.items; console.log(items.map(item => item.name)); }).catch(err => console.error(err));
Debug
Known issues
gotchaAPI client must be regenerated whenever the CloudHospital API changes. Regenerate via openapi-generator-cli.
fix
Run openapi-generator-cli generate -g typescript-axios -o src -i <swagger-url> --type-mappings=DateTime=Date
affects: >=5.0.0
breakingVersion 5.x changed the package name from 'ch-api-client' to 'ch-api-client-typescript2'.
fix
Update import paths to use new package name.
affects: >=5.0.0 <6.0.0
deprecatedDateTime is mapped to Date type; ensure all code handles Date objects instead of strings.
fix
Use Date type for any DateTime fields in API responses.
affects: >=5.0.0
gotchaConfiguration must be instantiated with basePath; default basePath is not set.
fix
Create Configuration object with basePath pointing to valid CloudHospital API endpoint.
affects: >=5.0.0
breakingThe generated code uses Axios 0.x; compatibility with Axios 1.x may break.
fix
Stick with Axios 0.21.x or regenerate client with updated generator.
affects: 5.90.0
Errors
Common errors & fixes
Cannot find module 'ch-api-client-typescript2'
Package not installed or import path incorrect.
fix
Run npm install ch-api-client-typescript2 --save and verify import path.
TypeError: axios is not a function
Incompatible Axios version (1.x vs 0.x).
fix
Install Axios 0.21.x: npm install axios@0.21.4
Property 'apiV1CountriesGet' does not exist on type 'CountriesApi'
API endpoint changed or method not regenerated.
fix
Regenerate client with latest Swagger spec.
Upgrade
Version history
5.90.39latest on npm
Audit
Dependencies
axiosrequiredHTTP client used by generated code
Agent activity
35 hits · last 30 days
node
28
Amazon
1
OpenAI (training)
1
Resources
ch-api-client-typescript2 — npm install ch-api-client-typescript2 · libregistry