Class: SettingsClient
@kortexya/reasoninglayer / SettingsClient
Class: SettingsClient
Section titled “Class: SettingsClient”Defined in: src/resources/settings.ts:9
Read and write the Space’s settings, and narrow them for a project.
Methods
Section titled “Methods”get(
key,options?,requestOptions?):Promise<Setting>
Defined in: src/resources/settings.ts:25
Read a setting as it applies to the Space or to one of its projects.
Parameters
Section titled “Parameters”string
The key: web_search, approval_mode, ai_disclosure,
answer_model or query_model.
options?
Section titled “options?”project: a project of the Space; absent reads the Space.
project?
Section titled “project?”string
requestOptions?
Section titled “requestOptions?”Per-call cancellation, timeout and request options.
Returns
Section titled “Returns”Promise<Setting>
The value that applies, where it came from, and what the key admits.
Throws
Section titled “Throws”404 for an unknown key (unknown_setting); 422 for a malformed
project id (invalid_project); 503 when the tenant’s lattice has no shared
setting sort (setting_sort_missing).
Remarks
Section titled “Remarks”Uses GET /api/v1/settings/{key}. The engine resolves the cascade.
Example
Section titled “Example”const setting = await client.settings.get('web_search', { project: projectId });put(
key,request,requestOptions?):Promise<Setting>
Defined in: src/resources/settings.ts:53
Set a key for the Space, or narrow it for one of its projects.
Parameters
Section titled “Parameters”string
The key.
request
Section titled “request”The value, the project (absent: the Space) and the reason.
requestOptions?
Section titled “requestOptions?”Per-call cancellation, timeout and request options.
Returns
Section titled “Returns”Promise<Setting>
The setting as it now applies at that scope.
Throws
Section titled “Throws”403 without an acting Space admin (acting_user_required,
settings_admin_required, setting_not_admitted); 404 for an unknown key; 409 when
the key is changed elsewhere (setting_not_writable_here), a project value widens
what applies above it (setting_widens) or the key is Space-only
(setting_space_only); 422 for a value the key does not admit
(setting_value_not_allowed) or a malformed project id; 503 without the
setting sort.
Remarks
Section titled “Remarks”Uses PUT /api/v1/settings/{key}. The value is a term of the setting sort.
Example
Section titled “Example”await client.settings.put('web_search', { value: 'off', project: projectId, reason: 'Client data' });