Skip to content

Latest commit

 

History

History

api

Intuition API

This library is the API interaction layer of Intuition.

Building

Run nx build @0xintuition/api to build the library.

Code Generation

The api-client folder contains code that is automatically generated. This code is produced based on the specifications defined in the openapi-ts.config.js file.

How Codegen Works

Codegen, or code generation, is a process where source code is automatically generated based on a given input. In the context of this project, the input is the openapi-ts.config.js file along with the OpenApi spec generated by the backend. The latter contains the specifications for the API endpoints, request bodies, and responses.

The codegen process reads these specifications and produces TypeScript code in the api-client folder. This generated code includes functions for making API requests, as well as TypeScript interfaces for the request bodies and responses.

Important Note

Since the api-client folder is populated with generated code, you should not manually modify the files in this folder. Any changes you make will be overwritten the next time the codegen process runs.

If you need to change the API interaction layer, you should modify the openapi-ts.config.js file. After you make your changes, run the codegen process again to update the generated code. You can do this from the root of the monorepo using the following command

pnpm run codegen