@buildingopen/client
v0.1.2
Published
JavaScript client for RunIt
Readme
@buildingopen/client
JavaScript/TypeScript client for the RunIt API.
Install
npm install @buildingopen/clientUsage
import { RunitClient } from '@buildingopen/client';
const client = new RunitClient({
url: 'http://localhost:3001',
apiKey: 'your-api-key', // optional for OSS mode
});
// Deploy Python code
const project = await client.deploy(
'def run(city: str = "Berlin") -> dict:\n return {"message": f"Hello {city}"}',
'Greeter'
);
// Run an endpoint
const run = await client.run(
project.id,
project.version_id,
project.endpoints[0].id,
{ json: { city: 'Hamburg' } }
);
// Wait for result
const result = await client.waitForRun(run.run_id);
console.log(result.result?.json);
// { message: "Hello Hamburg" }API
Core
deploy(code, name, requirements?, config?)- Deploy Python code or base64 ZIPrun(projectId, versionId, endpointId, params?)- Execute an endpointwaitForRun(runId, timeoutMs?)- Poll until completion (default 120s)getRunStatus(runId)- Get run status and resultlistProjects()- List all projectsgetProject(projectId)- Get project details with endpoint schemasdeleteProject(projectId)- Delete a project
Versions
listVersions(projectId)- List versions with dev/prod flagspromote(projectId, versionId?)- Promote to productionrollback(projectId, versionId)- Rollback
Secrets
listSecrets(projectId)- List configured secretssetSecret(projectId, key, value)- Set a secretdeleteSecret(projectId, key)- Delete a secret
Storage
putStorage(projectId, key, value)- Store a valuegetStorage(projectId, key)- Retrieve a valuedeleteStorage(projectId, key)- Delete a valuelistStorage(projectId)- List all keys
Share Links
createShareLink(projectId)- Create public share linklistShareLinks(projectId)- List share linksdisableShareLink(projectId, shareId)- Disable a link
License
MIT
