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