Skip to content

Class: BoundaryClient

@kortexya/reasoninglayer


@kortexya/reasoninglayer / BoundaryClient

Defined in: src/resources/boundary.ts:32

Read and replace native per-space boundary policy using the caller’s identity.

createSiteRequest(request, requestOptions?): Promise<SiteRequestFiled>

Defined in: src/resources/boundary.ts:139

Ask that the box declare one website for the caller’s Space.

CreateSiteRequest

The host, why the Space needs it, and where it is filed.

RequestOptions

Per-call cancellation, timeout and request options.

Promise<SiteRequestFiled>

The request and whether it was created (false: an open request for the host is returned).

When the engine refuses the request (403, 409, 422) or the store is unavailable (503).

Uses POST /api/v1/boundary/site-requests. The request is a term the engine keeps; an admin decides it.

const { request } = await client.boundary.createSiteRequest({ host: 'example.org', purpose: 'Supplier prices' });

decide(request, requestOptions?): Promise<BoundaryDecision>

Defined in: src/resources/boundary.ts:46

Ask the engine to decide one outbound call.

BoundaryDecideRequest

The registry entry and circumstances of this call.

RequestOptions

Per-call cancellation, timeout and request options.

Promise<BoundaryDecision>

The engine’s verdict and any associated restrictions, reason and quota.

When the HTTP request fails.

When the decision cannot be decoded.

Sends snake_case JSON to POST /api/v1/boundary/decide. The engine can count an admitted call against the entry’s daily quota.

const decision = await client.boundary.decide({ entryId: 'web-search' });

decideSiteRequest(id, decision, requestOptions?): Promise<SiteRequest>

Defined in: src/resources/boundary.ts:183

Approve or refuse a website request, as an admin.

string

The request id.

DecideSiteRequest

The decision, its reason and the terms acknowledgement.

RequestOptions

Per-call cancellation, timeout and request options.

Promise<SiteRequest>

The decided request.

When the caller may not decide (403), the request is unknown (404) or already decided (409).

Uses POST /api/v1/boundary/site-requests/{id}/decision.

await client.boundary.decideSiteRequest(id, { decision: 'approve', termsAcknowledged: true });

getEffective(spaceId, requestOptions?): Promise<EffectiveBoundary>

Defined in: src/resources/boundary.ts:65

Read the effective restrictions computed by the engine.

string

Project/space identifier, or * for the admin cap.

RequestOptions

Per-call cancellation, timeout and request options.

Promise<EffectiveBoundary>

Callable entries and their effective restrictions.

If the caller is unauthorized or the engine refuses the read.

Sends space_id as a query value; no policy is computed or cached in the SDK.

const effective = await client.boundary.getEffective(spaceId);

getPolicy(spaceId, requestOptions?): Promise<BoundaryPolicyView>

Defined in: src/resources/boundary.ts:81

Read one space’s stored policy section.

string

Project/space identifier, or * for the admin cap.

RequestOptions

Per-call cancellation, timeout and request options.

Promise<BoundaryPolicyView>

The stored section, or null when inherited, and its version.

If the caller is unauthorized or the read fails.

The native JSON response is normalized to SDK casing.

const stored = await client.boundary.getPolicy(spaceId);

listAllSiteRequests(requestOptions?): Promise<SiteRequest[]>

Defined in: src/resources/boundary.ts:169

List every Space’s website requests, newest first: the admin queue.

RequestOptions

Per-call cancellation, timeout and request options.

Promise<SiteRequest[]>

The requests.

When the caller is not an admin or the store is unavailable.

Uses GET /api/v1/boundary/site-requests/all.

const queue = await client.boundary.listAllSiteRequests();

listSiteRequests(requestOptions?): Promise<SiteRequest[]>

Defined in: src/resources/boundary.ts:157

List the caller’s Space’s website requests, newest first.

RequestOptions

Per-call cancellation, timeout and request options.

Promise<SiteRequest[]>

The requests.

When the read is refused or the store is unavailable.

Uses GET /api/v1/boundary/site-requests.

const requests = await client.boundary.listSiteRequests();

putPolicy(spaceId, policy, requestOptions?): Promise<BoundaryPolicyView>

Defined in: src/resources/boundary.ts:99

Replace a boundary section; null clears it and restores inheritance.

string

Project/space identifier, or * for the admin cap.

BoundaryPolicy | null

Replacement section, or null to clear it.

RequestOptions

Per-call cancellation, timeout and request options.

Promise<BoundaryPolicyView>

The section and version stored by the engine.

If authority or the registry ceiling refuses the change.

Sends snake_case JSON with opaque entry and data-class keys preserved. A clear sends literal JSON null, not an absent body. All state remains in the native policy store.

await client.boundary.putPolicy(spaceId, { denied: ['external-search'] });

recordSiteRequestCommit(id, registryCommit, requestOptions?): Promise<SiteRequest>

Defined in: src/resources/boundary.ts:205

Record the reviewed boundary-registry commit that declared an approved site.

string

The request id.

string

The registry commit.

RequestOptions

Per-call cancellation, timeout and request options.

Promise<SiteRequest>

The request with its commit.

When the caller may not record it (403), the request is unknown (404) or not approved (409).

Uses POST /api/v1/boundary/site-requests/{id}/registry-commit.

await client.boundary.recordSiteRequestCommit(id, commitSha);