Manage Boundaries with the VB-OS Node.js SDK
The client.boundaries namespace provides methods for managing boundary definitions, their versions, and the review workflow.
Methods
Section titled “Methods”| Method | Signature | Description |
|---|---|---|
list |
(projectId, opts?) |
List boundaries in a project |
create |
(projectId, kwargs) |
Create a new boundary |
get |
(projectId, boundaryRef) |
Get a boundary by reference |
updateDraft |
(projectId, boundaryRef, kwargs) |
Update a draft boundary |
submit |
(projectId, boundaryRef) |
Submit a boundary for review |
versions |
(projectId, boundaryRef, opts?) |
List versions of a boundary |
getVersion |
(projectId, boundaryRef, versionId) |
Get a specific version |
approve |
(projectId, boundaryRef, versionId) |
Approve a version |
reject |
(projectId, boundaryRef, versionId) |
Reject a version |
diff |
(projectId, boundaryRef, kwargs) |
Diff two boundary versions |
List Boundaries
Section titled “List Boundaries”const boundaries = await client.boundaries.list('proj_abc123');
for (const b of boundaries.items) { console.log(b.ref, b.name);}Pagination options:
const page = await client.boundaries.list('proj_abc123', { limit: 10, cursor: 'next_cursor_value',});Create a Boundary
Section titled “Create a Boundary”const boundary = await client.boundaries.create('proj_abc123', { name: 'KYC Boundary', ref: 'kyc-boundary', source: 'require_evidence: applicant_age\npredicate: of_age: applicant_age >= 18',});Get a Boundary
Section titled “Get a Boundary”const boundary = await client.boundaries.get('proj_abc123', 'kyc-boundary');Update a Draft
Section titled “Update a Draft”await client.boundaries.updateDraft('proj_abc123', 'kyc-boundary', { source: 'require_evidence: applicant_age\npredicate: of_age: applicant_age >= 21',});Submit for Review
Section titled “Submit for Review”await client.boundaries.submit('proj_abc123', 'kyc-boundary');Version Management
Section titled “Version Management”// List versionsconst versions = await client.boundaries.versions('proj_abc123', 'kyc-boundary');
// Get a specific versionconst version = await client.boundaries.getVersion( 'proj_abc123', 'kyc-boundary', 'ver_abc123',);
// Approve a versionawait client.boundaries.approve('proj_abc123', 'kyc-boundary', 'ver_abc123');
// Reject a versionawait client.boundaries.reject('proj_abc123', 'kyc-boundary', 'ver_abc123');Diff Versions
Section titled “Diff Versions”const diff = await client.boundaries.diff('proj_abc123', 'kyc-boundary', { v1: 'ver_abc123', v2: 'ver_def456',});