@kortexya/reasoninglayer 1.19.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +126 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +369 -32
- package/dist/index.d.ts +369 -32
- package/dist/index.js +126 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var __export = (target, all) => {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// src/config.ts
|
|
8
|
-
var SDK_VERSION = "1.
|
|
8
|
+
var SDK_VERSION = "1.21.0";
|
|
9
9
|
function resolveConfig(config) {
|
|
10
10
|
if (!config.baseUrl) {
|
|
11
11
|
throw new Error("ClientConfig.baseUrl is required");
|
|
@@ -3880,7 +3880,7 @@ var Communities = class {
|
|
|
3880
3880
|
...params
|
|
3881
3881
|
});
|
|
3882
3882
|
/**
|
|
3883
|
-
* @description `GET /api/v1/graph/export?
|
|
3883
|
+
* @description `GET /api/v1/graph/export?format=graphml|gexf|csv-nodes|csv-edges|dot` Read-only: returns the serialized graph as raw text with the matching content type. The graph is the same `Value::Reference` projection the analytics use, labelled by each term's `name` feature.
|
|
3884
3884
|
*
|
|
3885
3885
|
* @tags communities
|
|
3886
3886
|
* @name ExportGraph
|
|
@@ -3888,9 +3888,10 @@ var Communities = class {
|
|
|
3888
3888
|
* @request GET:/api/v1/graph/export
|
|
3889
3889
|
* @secure
|
|
3890
3890
|
*/
|
|
3891
|
-
exportGraph = (params = {}) => this.http.request({
|
|
3891
|
+
exportGraph = (query, params = {}) => this.http.request({
|
|
3892
3892
|
path: `/api/v1/graph/export`,
|
|
3893
3893
|
method: "GET",
|
|
3894
|
+
query,
|
|
3894
3895
|
secure: true,
|
|
3895
3896
|
...params
|
|
3896
3897
|
});
|
|
@@ -5300,9 +5301,10 @@ var Reviews = class {
|
|
|
5300
5301
|
* @request GET:/api/v1/reviews/pending
|
|
5301
5302
|
* @secure
|
|
5302
5303
|
*/
|
|
5303
|
-
listPendingReviews = (params = {}) => this.http.request({
|
|
5304
|
+
listPendingReviews = (query, params = {}) => this.http.request({
|
|
5304
5305
|
path: `/api/v1/reviews/pending`,
|
|
5305
5306
|
method: "GET",
|
|
5307
|
+
query,
|
|
5306
5308
|
secure: true,
|
|
5307
5309
|
format: "json",
|
|
5308
5310
|
...params
|
|
@@ -5851,9 +5853,10 @@ var ActionReviews = class {
|
|
|
5851
5853
|
* @request GET:/api/v1/action-reviews/pending
|
|
5852
5854
|
* @secure
|
|
5853
5855
|
*/
|
|
5854
|
-
listPendingActionReviews = (params = {}) => this.http.request({
|
|
5856
|
+
listPendingActionReviews = (query, params = {}) => this.http.request({
|
|
5855
5857
|
path: `/api/v1/action-reviews/pending`,
|
|
5856
5858
|
method: "GET",
|
|
5859
|
+
query,
|
|
5857
5860
|
secure: true,
|
|
5858
5861
|
format: "json",
|
|
5859
5862
|
...params
|
|
@@ -12252,7 +12255,9 @@ function SortDtoFromApiToFront(dto) {
|
|
|
12252
12255
|
description: dto.description ?? void 0,
|
|
12253
12256
|
origin: dto.origin ? SortOriginDtoFromApiToFront(dto.origin) : void 0,
|
|
12254
12257
|
status: dto.status ? SortStatusDtoFromApiToFront(dto.status) : void 0,
|
|
12255
|
-
needsReview: dto.needs_review
|
|
12258
|
+
needsReview: dto.needs_review,
|
|
12259
|
+
pluginId: dto.plugin_id ?? void 0,
|
|
12260
|
+
pluginLocalName: dto.plugin_local_name ?? void 0
|
|
12256
12261
|
};
|
|
12257
12262
|
}
|
|
12258
12263
|
function SortInfoDtoFromApiToFront(dto) {
|
|
@@ -13383,8 +13388,9 @@ var TermsClient = class {
|
|
|
13383
13388
|
return BulkAddTermsResponseFromApiToFront(response.data);
|
|
13384
13389
|
}
|
|
13385
13390
|
/**
|
|
13386
|
-
* List
|
|
13391
|
+
* List terms for the authenticated tenant.
|
|
13387
13392
|
*
|
|
13393
|
+
* @param query - Optional paging and sort filter. Omit for every term.
|
|
13388
13394
|
* @returns The list of terms with total count.
|
|
13389
13395
|
* @throws {ApiError} If the request fails.
|
|
13390
13396
|
*
|
|
@@ -13393,17 +13399,24 @@ var TermsClient = class {
|
|
|
13393
13399
|
* Requires X-Tenant-Id header (set via client configuration).
|
|
13394
13400
|
* Uses the tagged {@link ValueDto} serialization format.
|
|
13395
13401
|
*
|
|
13402
|
+
* `sortName` filters on the sort's committed name. For a plugin-contributed
|
|
13403
|
+
* sort that is the namespaced form (`plugin:<plugin-name>:<local>`), which
|
|
13404
|
+
* {@link SortDto.name} carries and {@link SortDto.pluginLocalName} maps back
|
|
13405
|
+
* to the name its author wrote.
|
|
13406
|
+
*
|
|
13396
13407
|
* @example
|
|
13397
13408
|
* ```typescript
|
|
13398
13409
|
* const result = await client.terms.listTerms();
|
|
13399
13410
|
* console.log(`Found ${result.count} terms`);
|
|
13400
|
-
*
|
|
13401
|
-
*
|
|
13402
|
-
* }
|
|
13411
|
+
*
|
|
13412
|
+
* // Only the first page of one sort's terms.
|
|
13413
|
+
* const page = await client.terms.listTerms({ sortName: 'person', limit: 50 });
|
|
13403
13414
|
* ```
|
|
13404
13415
|
*/
|
|
13405
|
-
async listTerms() {
|
|
13406
|
-
const response = await this.api.listTerms(
|
|
13416
|
+
async listTerms(query) {
|
|
13417
|
+
const response = await this.api.listTerms(
|
|
13418
|
+
query ? { limit: query.limit, offset: query.offset, sort_name: query.sortName } : void 0
|
|
13419
|
+
);
|
|
13407
13420
|
return TermListResponseFromApiToFront(response.data);
|
|
13408
13421
|
}
|
|
13409
13422
|
/**
|
|
@@ -20717,23 +20730,44 @@ var ReviewsClient = class {
|
|
|
20717
20730
|
return response.data;
|
|
20718
20731
|
}
|
|
20719
20732
|
/**
|
|
20720
|
-
* List
|
|
20733
|
+
* List pending reviews for the authenticated tenant.
|
|
20721
20734
|
*
|
|
20735
|
+
* @param options - Optional filters and pagination. Omit to list the first
|
|
20736
|
+
* page of every pending review.
|
|
20722
20737
|
* @returns List of pending review entries.
|
|
20723
20738
|
* @throws {ApiError} If the request fails.
|
|
20724
20739
|
*
|
|
20725
20740
|
* @remarks
|
|
20726
|
-
*
|
|
20727
|
-
* the
|
|
20728
|
-
*
|
|
20741
|
+
* The tenant is taken from the authenticated principal (the `X-Tenant-Id`
|
|
20742
|
+
* header the SDK sends on every request), never from the caller. The route
|
|
20743
|
+
* still accepts a `tenant_id` query parameter for wire-compatibility but
|
|
20744
|
+
* ignores it, so {@link ListPendingReviewsOptions} does not expose one.
|
|
20729
20745
|
*
|
|
20730
|
-
*
|
|
20746
|
+
* Filters are sent as query parameters in wire `snake_case`; any option left
|
|
20747
|
+
* `undefined` is omitted from the query string entirely, letting the backend
|
|
20748
|
+
* apply its own default.
|
|
20749
|
+
*
|
|
20750
|
+
* @example List everything pending
|
|
20731
20751
|
* ```typescript
|
|
20732
20752
|
* const pending = await client.reviews.listPending();
|
|
20733
20753
|
* ```
|
|
20754
|
+
*
|
|
20755
|
+
* @example Second page of low-confidence reviews
|
|
20756
|
+
* ```typescript
|
|
20757
|
+
* const page = await client.reviews.listPending({
|
|
20758
|
+
* reason: 'low_confidence',
|
|
20759
|
+
* page: 1,
|
|
20760
|
+
* pageSize: 25,
|
|
20761
|
+
* });
|
|
20762
|
+
* ```
|
|
20734
20763
|
*/
|
|
20735
|
-
async listPending() {
|
|
20736
|
-
const response = await this.api.listPendingReviews(
|
|
20764
|
+
async listPending(options = {}) {
|
|
20765
|
+
const response = await this.api.listPendingReviews({
|
|
20766
|
+
sort: options.sort,
|
|
20767
|
+
reason: options.reason,
|
|
20768
|
+
page: options.page,
|
|
20769
|
+
page_size: options.pageSize
|
|
20770
|
+
});
|
|
20737
20771
|
return response.data;
|
|
20738
20772
|
}
|
|
20739
20773
|
/**
|
|
@@ -23184,6 +23218,41 @@ var CommunitiesClient = class {
|
|
|
23184
23218
|
const response = await this.api.predictLinks(LinkPredictionRequestFromFrontToApi(request));
|
|
23185
23219
|
return LinkPredictionResponseFromApiToFront(response.data);
|
|
23186
23220
|
}
|
|
23221
|
+
/**
|
|
23222
|
+
* Export the tenant's reference graph to a graph-interchange format.
|
|
23223
|
+
*
|
|
23224
|
+
* @param format - The interchange format to serialize to.
|
|
23225
|
+
* @returns The serialized graph as raw text.
|
|
23226
|
+
* @throws {ApiError} If the format is unknown (the backend answers 400).
|
|
23227
|
+
*
|
|
23228
|
+
* @remarks
|
|
23229
|
+
* `format` is mandatory on the wire — a request without it is rejected with
|
|
23230
|
+
* 400. Only the tenant of the authenticated principal is exported; the route
|
|
23231
|
+
* accepts a `tenant_id` query parameter for wire-compatibility but ignores
|
|
23232
|
+
* it, because trusting it allowed one tenant to export another's graph.
|
|
23233
|
+
*
|
|
23234
|
+
* The response is raw text, not JSON, and its content type varies by format
|
|
23235
|
+
* (XML for `graphml` and `gexf`, CSV for the `csv-*` pair, Graphviz source
|
|
23236
|
+
* for `dot`). The generated route class declares `void` because the OpenAPI
|
|
23237
|
+
* spec omits the response schema, so this calls `http.request` directly with
|
|
23238
|
+
* `format: 'text'` to read the body.
|
|
23239
|
+
*
|
|
23240
|
+
* @example
|
|
23241
|
+
* ```typescript
|
|
23242
|
+
* const dot = await client.communities.exportGraph('dot');
|
|
23243
|
+
* const graphml = await client.communities.exportGraph('graphml');
|
|
23244
|
+
* ```
|
|
23245
|
+
*/
|
|
23246
|
+
async exportGraph(format) {
|
|
23247
|
+
const response = await this.api.http.request({
|
|
23248
|
+
path: "/api/v1/graph/export",
|
|
23249
|
+
method: "GET",
|
|
23250
|
+
query: { format },
|
|
23251
|
+
secure: true,
|
|
23252
|
+
format: "text"
|
|
23253
|
+
});
|
|
23254
|
+
return response.data;
|
|
23255
|
+
}
|
|
23187
23256
|
};
|
|
23188
23257
|
|
|
23189
23258
|
// src/normalizers/utilities.ts
|
|
@@ -23941,10 +24010,35 @@ var ActionReviewsClient = class {
|
|
|
23941
24010
|
/**
|
|
23942
24011
|
* List pending action reviews.
|
|
23943
24012
|
*
|
|
24013
|
+
* @param options - Optional filters and pagination. Omit to list the first
|
|
24014
|
+
* page of pending action reviews.
|
|
23944
24015
|
* @returns Paginated list of pending reviews.
|
|
24016
|
+
* @throws {ApiError} If the request fails.
|
|
24017
|
+
*
|
|
24018
|
+
* @remarks
|
|
24019
|
+
* The tenant is taken from the authenticated principal (the `X-Tenant-Id`
|
|
24020
|
+
* header), never from the caller, so {@link ListActionReviewsOptions} exposes
|
|
24021
|
+
* no `tenantId`. Filters are sent as query parameters in wire `snake_case`;
|
|
24022
|
+
* any option left `undefined` is omitted, letting the backend default apply
|
|
24023
|
+
* (`pendingOnly` defaults to `true`, `pageSize` to 50).
|
|
24024
|
+
*
|
|
24025
|
+
* @example Highest-risk actions awaiting a decision
|
|
24026
|
+
* ```typescript
|
|
24027
|
+
* const pending = await client.actionReviews.listPending({
|
|
24028
|
+
* reason: 'high_risk',
|
|
24029
|
+
* pageSize: 20,
|
|
24030
|
+
* });
|
|
24031
|
+
* ```
|
|
23945
24032
|
*/
|
|
23946
|
-
async listPending() {
|
|
23947
|
-
const response = await this.api.listPendingActionReviews(
|
|
24033
|
+
async listPending(options = {}) {
|
|
24034
|
+
const response = await this.api.listPendingActionReviews({
|
|
24035
|
+
agent_id: options.agentId,
|
|
24036
|
+
action_sort: options.actionSort,
|
|
24037
|
+
reason: options.reason,
|
|
24038
|
+
pending_only: options.pendingOnly,
|
|
24039
|
+
page: options.page,
|
|
24040
|
+
page_size: options.pageSize
|
|
24041
|
+
});
|
|
23948
24042
|
return ListActionReviewsResponseFromApiToFront(response.data);
|
|
23949
24043
|
}
|
|
23950
24044
|
/**
|
|
@@ -26941,7 +27035,8 @@ function ClearTenantResponseFromApiToFront(dto) {
|
|
|
26941
27035
|
fingerprintsDeleted: dto.fingerprints_deleted,
|
|
26942
27036
|
sortsDeleted: dto.sorts_deleted,
|
|
26943
27037
|
inferenceStateCleared: dto.inference_state_cleared,
|
|
26944
|
-
cacheInvalidated: dto.cache_invalidated
|
|
27038
|
+
cacheInvalidated: dto.cache_invalidated,
|
|
27039
|
+
pluginInstallsDeleted: dto.plugin_installs_deleted
|
|
26945
27040
|
};
|
|
26946
27041
|
}
|
|
26947
27042
|
function TenantInfoFromApiToFront(dto) {
|
|
@@ -32323,13 +32418,17 @@ function InstallPluginResponseFromApiToFront(dto) {
|
|
|
32323
32418
|
installId: dto.install_id,
|
|
32324
32419
|
sortsAdded: dto.sorts_added,
|
|
32325
32420
|
rulesAdded: dto.rules_added,
|
|
32326
|
-
state: dto.state
|
|
32421
|
+
state: dto.state,
|
|
32422
|
+
degraded: dto.degraded,
|
|
32423
|
+
degradation: dto.degradation ?? void 0
|
|
32327
32424
|
};
|
|
32328
32425
|
}
|
|
32329
32426
|
function InstallStateFromApiToFront(dto) {
|
|
32330
32427
|
return {
|
|
32331
32428
|
installId: dto.install_id,
|
|
32332
|
-
state: dto.state
|
|
32429
|
+
state: dto.state,
|
|
32430
|
+
degraded: dto.degraded,
|
|
32431
|
+
degradation: dto.degradation ?? void 0
|
|
32333
32432
|
};
|
|
32334
32433
|
}
|
|
32335
32434
|
function UpgradeInstallRequestFromFrontToApi(model) {
|
|
@@ -32353,7 +32452,9 @@ function InstallSummaryFromApiToFront(dto) {
|
|
|
32353
32452
|
pluginId: dto.plugin_id,
|
|
32354
32453
|
version: dto.version,
|
|
32355
32454
|
state: dto.state,
|
|
32356
|
-
systemWide: dto.system_wide
|
|
32455
|
+
systemWide: dto.system_wide,
|
|
32456
|
+
degraded: dto.degraded,
|
|
32457
|
+
degradation: dto.degradation ?? void 0
|
|
32357
32458
|
};
|
|
32358
32459
|
}
|
|
32359
32460
|
function InstallListFromApiToFront(dto) {
|