https://github.com/informaticsmatters/squonk2-data-manager-js-client
Generates a JS client and docs for the Squonk Data Manager API
https://github.com/informaticsmatters/squonk2-data-manager-js-client
squonk2
Last synced: about 1 year ago
JSON representation
Generates a JS client and docs for the Squonk Data Manager API
- Host: GitHub
- URL: https://github.com/informaticsmatters/squonk2-data-manager-js-client
- Owner: InformaticsMatters
- License: mit
- Created: 2021-06-29T13:29:58.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-09T13:41:18.000Z (about 2 years ago)
- Last Synced: 2024-04-17T19:07:07.337Z (about 2 years ago)
- Topics: squonk2
- Homepage: https://informaticsmatters.github.io/squonk2-data-manager-js-client/
- Size: 7.26 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Data Manager API JS Client
[](https://badge.fury.io/js/%40squonk%2Fdata-manager-client)
This repo is a NodeJS package that generates a typescript client from an open api specification.
- Consumes the Squonk Data Manager API
- Generated from the latest OpenAPI tag with [Orval](https://orval.dev)
- Typescript
- Calls made by Axios (this might change)
- Functions to call each API path
- React-Query hooks for use in React applications
## Output
Provides typescript async functions and react hooks. The contents published packages depend on the version of the `openapi.yaml` used to generate it. In general though, the package is organised as follows:
All types can be imported from the main entry point:
```ts
import type { Task, JobDetail, ... } from '@squonk/data-manager-client';
```
The custom instance (what is used to make all Axios calls) can also be imported from here:
```ts
import { customInstance } from '@squonk/data-manager-client';
```
Each `tag` from the `openapi.yaml` is used to create a sub-entry point. For example, the functions to make requests and the `react-query` hooks for a `dataset` tag can be imported as follows:
```ts
import { useGetDatasets, useCreateDataset, createDataset, ... } from '@squonk/data-manager-client/dataset';
```