@revos/api-client
v0.1.0
Published
Generated TypeScript client for RevOS API
Readme
@revos/api-client
SDK for the RevOS.ai API.
Setup
import { Client, client } from "@revos/api-client";
// Configure the global client instance
client.setConfig({
auth: () => getAccessToken(),
});
// Create a client instance
const api = new Client();Usage
Tables
const tables = await api.tables.list({ pageSize: 10 });
const table = await api.tables.get({ id: "table-123" });
const created = await api.tables.create({ body: { name: "My Table" } });
const updated = await api.tables.update({
id: "table-123",
body: { name: "Renamed" },
});
await api.tables.delete({ id: "table-123" });Table Views
const views = await api.tableViews.list();
const created = await api.tableViews.create({
body: {
/* ... */
},
});
const updated = await api.tableViews.update({
id: "view-123",
body: {
/* ... */
},
});
await api.tableViews.delete({ id: "view-123" });Actions
const actions = await api.actions.list();
const action = await api.actions.get({ id: "action-123" });
const paramsSchema = await api.actions.getParamsSchema({ id: "action-123" });
const inputSchema = await api.actions.getInputSchema({ id: "action-123" });Action Runs
const runs = await api.actionRuns.list();
const run = await api.actionRuns.get({ id: "run-123" });AI Instructions
const instructions = await api.aiInstructions.list();
const instruction = await api.aiInstructions.get({ id: "instr-123" });
await api.aiInstructions.create({ body: { name: "My Instruction" } });
await api.aiInstructions.update({ id: "instr-123", body: { name: "Updated" } });
await api.aiInstructions.delete({ id: "instr-123" });Segments
const segments = await api.segments.list();
const segment = await api.segments.get({ id: "seg-123" });
await api.segments.create({
body: {
/* ... */
},
});
await api.segments.update({
id: "seg-123",
body: {
/* ... */
},
});
await api.segments.delete({ id: "seg-123" });
// Versions
const versions = await api.segments.listVersions({ id: "seg-123" });
const version = await api.segments.getVersion({ id: "seg-123", version: 2 });
await api.segments.restoreVersion({ id: "seg-123", version: 2 });
// Evaluations
const history = await api.segments.getEvaluationHistory({ id: "seg-123" });
await api.segments.evaluate({ id: "seg-123" });Scores
const scores = await api.scores.list();
await api.scores.create({
body: {
/* ... */
},
});
await api.scores.update({
id: "score-123",
body: {
/* ... */
},
});
await api.scores.delete({ id: "score-123" });Score Groups
const groups = await api.scoreGroups.list();
const group = await api.scoreGroups.get({ id: "group-123" });
await api.scoreGroups.create({
body: {
/* ... */
},
});
await api.scoreGroups.update({
id: "group-123",
body: {
/* ... */
},
});
await api.scoreGroups.delete({ id: "group-123" });Overlays
const overlays = await api.overlays.list();
const overlay = await api.overlays.get({ id: "overlay-123" });
await api.overlays.create({
body: {
/* ... */
},
});
await api.overlays.update({
id: "overlay-123",
body: {
/* ... */
},
});
await api.overlays.delete({ id: "overlay-123" });Organizations
const orgs = await api.organizations.list();
const org = await api.organizations.get({ id: "org-123" });
await api.organizations.create({ body: { name: "My Org" } });Google Service Accounts
const accounts = await api.gserviceAccounts.list();
const account = await api.gserviceAccounts.get({ id: "gsa-123" });
await api.gserviceAccounts.create({
body: {
/* ... */
},
});
await api.gserviceAccounts.delete({ id: "gsa-123" });
// Keys
const key = await api.gserviceAccountKeys.get({ id: "key-123" });
await api.gserviceAccountKeys.reveal({ id: "key-123" });