Skip to content

Commit

Permalink
feat: add axios client
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlubos committed May 23, 2024
1 parent 0ac9401 commit 28fd8dd
Show file tree
Hide file tree
Showing 8 changed files with 9,008 additions and 7,109 deletions.
33 changes: 33 additions & 0 deletions packages/client-axios/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<div align="center">
<img width="150" height="150" src="https://heyapi.vercel.app/logo.png" alt="Logo">
<h1 align="center"><b>Axios Client</b></h1>
<p align="center">🚀 Typesafe Axios client for your Hey API types.</p>
</div>

Plug and play Axios wrapper for `@hey-api/openapi-ts` generator.

[Live demo](https://stackblitz.com/edit/hey-api-client-axios-example?file=openapi-ts.config.ts,src%2Fclient%2Fschemas.gen.ts,src%2Fclient%2Fservices.gen.ts,src%2Fclient%2Ftypes.gen.ts,src%2FApp.tsx)

## Features

- seamless integration with `@hey-api/openapi-ts`
- typesafe response data and errors
- access to the original request and response
- each request call is configurable
- minimal learning curve thanks to extending the underlying technology

## Documentation

Please visit our [website](https://heyapi.vercel.app/) for documentation, guides, migrating, and more.

## GitHub Integration (coming soon)

Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.vercel.app/openapi-ts/integrations.html).

## Migrating from OpenAPI Typescript Codegen?

Please read our [migration guide](https://heyapi.vercel.app/openapi-ts/migrating.html#openapi-typescript-codegen).

## Contributing

Want to get involved? Please refer to the [contributing guide](https://heyapi.vercel.app/contributing.html).
34 changes: 22 additions & 12 deletions packages/client-axios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hey-api/client-axios",
"version": "0.1.0",
"version": "0.0.1",
"private": true,
"type": "module",
"description": "Typesafe Axios client for your @hey-api/openapi-ts types",
Expand All @@ -16,21 +16,37 @@
"keywords": [
"axios",
"client",
"codegen",
"generator",
"http",
"javascript",
"openapi",
"react",
"rest",
"svelte",
"swagger",
"typescript",
"vue"
],
"types": "dist/node/index.d.ts",
"main": "dist/node/index.cjs",
"module": "dist/node/index.mjs",
"exports": {
"import": "./dist/node/index.mjs",
"require": "./dist/node/index.cjs",
"types": "./dist/node/index.d.ts"
".": {
"import": {
"types": "./dist/node/index.d.ts",
"default": "./dist/node/index.mjs"
},
"require": {
"types": "./dist/node/index.d.ts",
"default": "./dist/node/index.cjs"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
"files": [
"dist",
"src"
],
"scripts": {
"build-bundle": "rollup --config rollup.config.ts --configPlugin typescript",
"build-types-check": "tsc --project tsconfig.check.json",
Expand All @@ -47,12 +63,6 @@
"test": "vitest run",
"typecheck": "tsc --noEmit"
},
"engines": {
"node": "^18.0.0 || >=20.0.0"
},
"dependencies": {
"@hey-api/client-core": "workspace:*"
},
"peerDependencies": {
"axios": ">= 1.0.0 < 2"
},
Expand Down
Loading

0 comments on commit 28fd8dd

Please sign in to comment.