Skip to content

Add zod checks #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 74 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,92 @@
[![npm version](https://badge.fury.io/js/%40lazydynamics%2Frxinfer-client.svg)](https://badge.fury.io/js/%40lazydynamics%2Frxinfer-client)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A TypeScript SDK for interacting with RxInferServer, providing type-safe access to all server endpoints and features.
A TypeScript client for interacting with RxInferServer, providing type-safe access to its API endpoints.

## About RxInferServer

RxInferServer is a Julia-based server that provides an API for performing probabilistic inference using the RxInfer.jl package. This client library allows you to interact with RxInferServer from TypeScript/JavaScript applications.

### Key Features of RxInferServer
- Probabilistic inference using message passing
- Support for various probabilistic models
- RESTful API interface
- Real-time inference capabilities

## Installation

```bash
npm install @lazydynamics/rxinfer-client
```

## Documentation
## Usage

```typescript
import { RxInferClient, pingServer } from '@lazydynamics/rxinfer-client';

For detailed documentation and getting started guide, please visit our [official documentation](https://lazydynamics.github.io/RxInferClient.js/).
// Create a client instance
const client = await RxInferClient.create();

The documentation includes:
- Getting Started Guide
- API Reference
- Examples and Use Cases
- Best Practices
- Troubleshooting
// Use the client to interact with RxInferServer
const response = await pingServer({ client });
console.log(response.data); // { status: 'ok' }
```

## Development

For information about developing this package, please see our [Contributing Guide](CONTRIBUTING.md).
### Prerequisites
- Node.js (LTS version recommended)
- RxInferServer running locally or accessible via network

### Setting up RxInferServer
1. Clone the RxInferServer repository:
```bash
git clone https://github.com/lazydynamics/RxInferServer.git
cd RxInferServer
```

2. Build and start the server:
```bash
make docker
make dev
```

This will start RxInferServer on `http://localhost:8000`.

### Building the Client
1. Install dependencies:
```bash
npm install
```

2. Generate TypeScript client from OpenAPI specification:
```bash
npm run generate
```

3. Build the package:
```bash
npm run build
```

### Running Tests
```bash
npm test
```

Note: Tests require RxInferServer to be running locally.

## Documentation

Generate and view documentation:
```bash
npm run docs
npm run docs:serve
```

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this project.

## License

Expand Down
15 changes: 12 additions & 3 deletions openapi-ts.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { defaultPlugins } from '@hey-api/openapi-ts';
import { defineConfig } from '@hey-api/openapi-ts';

export default defineConfig({
input: 'https://raw.githubusercontent.com/lazydynamics/RxInferServer/refs/heads/main/openapi/spec.yaml',
output: 'src/client',
plugins: ['@hey-api/client-fetch'],
input: 'https://raw.githubusercontent.com/lazydynamics/RxInferServer/refs/heads/main/openapi/spec.yaml',
output: 'src/client',
plugins: [
...defaultPlugins,
'@hey-api/client-fetch',
'zod',
{
name: '@hey-api/sdk',
validator: true,
}
],
});
Loading