Skip to content

js-bao-wss-client


js-bao-wss-client / RuleSetsAPI

Interface: RuleSetsAPI ​

Client API for rule sets — CEL-based access rules evaluated against group and resource operations, with test and debug tooling. Accessed as client.ruleSets.

Methods ​

create() ​

create(params): Promise<RuleSetInfo>

Creates a new rule set with the given name, resource type, and rules.

Parameters ​

params ​

CreateRuleSetParams

Configuration for the new rule set

Returns ​

Promise<RuleSetInfo>


debug() ​

debug(data): Promise<RuleSetDebugResult>

Debugs rule evaluation for a real user, returning the full evaluation trace and context.

Parameters ​

data ​

DebugRuleSetParams

Parameters identifying the user, group, and operation to debug

Returns ​

Promise<RuleSetDebugResult>


delete() ​

delete(ruleSetId): Promise<{ success: boolean; }>

Deletes a rule set by its ID.

Parameters ​

ruleSetId ​

string

The unique identifier of the rule set to delete

Returns ​

Promise<{ success: boolean; }>


get() ​

get(ruleSetId): Promise<RuleSetInfo>

Retrieves a single rule set by its ID.

Parameters ​

ruleSetId ​

string

The unique identifier of the rule set to retrieve

Returns ​

Promise<RuleSetInfo>


list() ​

list(options?): Promise<RuleSetInfo[]>

Lists rule sets, optionally filtered by resource type.

Parameters ​

options? ​

ListRuleSetsOptions

Filtering options for listing rule sets

Returns ​

Promise<RuleSetInfo[]>


schema() ​

schema(): Promise<RuleSetSchema>

Retrieves the rule set schema describing available resource types.

Returns ​

Promise<RuleSetSchema>


test() ​

test(ruleSetId, data): Promise<RuleSetTestResult>

Evaluates a rule set against a simulated request and returns the access decision.

Parameters ​

ruleSetId ​

string

The unique identifier of the rule set to test

data ​

TestRuleSetParams

Simulated request parameters for rule evaluation

Returns ​

Promise<RuleSetTestResult>


update() ​

update(ruleSetId, params): Promise<RuleSetInfo>

Updates a rule set's name, description, or rules.

Parameters ​

ruleSetId ​

string

The unique identifier of the rule set to update

params ​

UpdateRuleSetParams

Fields to update on the rule set

Returns ​

Promise<RuleSetInfo>

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30