@privateaim/core-http-kit
Typed HTTP client for the PrivateAIM core API, built on Hapic. Provides domain-specific API methods for all core entities.
Installation
bash
npm install @privateaim/core-http-kitUsage
Creating a Client
typescript
import { HTTPClient } from '@privateaim/core-http-kit';
const client = new HTTPClient({
baseURL: 'http://localhost:4000',
});CRUD Operations
typescript
// List analyses
const analyses = await client.analysis.getMany();
// Create a project
const project = await client.project.create({
name: 'My Project',
});
// Get a node by ID
const node = await client.node.getOne(nodeId);
// Update an entity
await client.analysis.update(analysisId, { name: 'Updated' });
// Delete an entity
await client.analysis.delete(analysisId);With Authentication
typescript
const client = new HTTPClient({
baseURL: 'http://localhost:4000',
token: 'Bearer <your-token>',
});API
Exports
| Module | Description |
|---|---|
client | HTTPClient class with typed domain API methods |
domains | Domain-specific request/response types |
Client Methods
The client exposes a property per domain entity, each with getMany, getOne, create, update, delete methods:
client.analysisclient.analysisBucketclient.analysisBucketFileclient.projectclient.projectNodeclient.nodeclient.registryclient.registryProjectclient.masterImageclient.masterImageGroup
Dependencies
@privateaim/core-kit— Domain typeshapic— HTTP client baserapiq— Query parameter building