@kortexya/reasoninglayer 1.19.0 → 1.20.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 CHANGED
@@ -7,7 +7,7 @@ var __export = (target, all) => {
7
7
  };
8
8
 
9
9
  // src/config.ts
10
- var SDK_VERSION = "1.19.0";
10
+ var SDK_VERSION = "1.20.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?tenant_id=…&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.
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
@@ -20719,23 +20722,44 @@ var ReviewsClient = class {
20719
20722
  return response.data;
20720
20723
  }
20721
20724
  /**
20722
- * List all pending reviews for the authenticated tenant.
20725
+ * List pending reviews for the authenticated tenant.
20723
20726
  *
20727
+ * @param options - Optional filters and pagination. Omit to list the first
20728
+ * page of every pending review.
20724
20729
  * @returns List of pending review entries.
20725
20730
  * @throws {ApiError} If the request fails.
20726
20731
  *
20727
20732
  * @remarks
20728
- * `GET /api/v1/reviews/pending` no longer accepts a `tenant_id` query parameter:
20729
- * the tenant is taken from the authenticated principal (the `X-Tenant-Id` header the
20730
- * SDK already sends on every request), never from the caller.
20733
+ * The tenant is taken from the authenticated principal (the `X-Tenant-Id`
20734
+ * header the SDK sends on every request), never from the caller. The route
20735
+ * still accepts a `tenant_id` query parameter for wire-compatibility but
20736
+ * ignores it, so {@link ListPendingReviewsOptions} does not expose one.
20731
20737
  *
20732
- * @example
20738
+ * Filters are sent as query parameters in wire `snake_case`; any option left
20739
+ * `undefined` is omitted from the query string entirely, letting the backend
20740
+ * apply its own default.
20741
+ *
20742
+ * @example List everything pending
20733
20743
  * ```typescript
20734
20744
  * const pending = await client.reviews.listPending();
20735
20745
  * ```
20746
+ *
20747
+ * @example Second page of low-confidence reviews
20748
+ * ```typescript
20749
+ * const page = await client.reviews.listPending({
20750
+ * reason: 'low_confidence',
20751
+ * page: 1,
20752
+ * pageSize: 25,
20753
+ * });
20754
+ * ```
20736
20755
  */
20737
- async listPending() {
20738
- const response = await this.api.listPendingReviews();
20756
+ async listPending(options = {}) {
20757
+ const response = await this.api.listPendingReviews({
20758
+ sort: options.sort,
20759
+ reason: options.reason,
20760
+ page: options.page,
20761
+ page_size: options.pageSize
20762
+ });
20739
20763
  return response.data;
20740
20764
  }
20741
20765
  /**
@@ -23186,6 +23210,41 @@ var CommunitiesClient = class {
23186
23210
  const response = await this.api.predictLinks(LinkPredictionRequestFromFrontToApi(request));
23187
23211
  return LinkPredictionResponseFromApiToFront(response.data);
23188
23212
  }
23213
+ /**
23214
+ * Export the tenant's reference graph to a graph-interchange format.
23215
+ *
23216
+ * @param format - The interchange format to serialize to.
23217
+ * @returns The serialized graph as raw text.
23218
+ * @throws {ApiError} If the format is unknown (the backend answers 400).
23219
+ *
23220
+ * @remarks
23221
+ * `format` is mandatory on the wire — a request without it is rejected with
23222
+ * 400. Only the tenant of the authenticated principal is exported; the route
23223
+ * accepts a `tenant_id` query parameter for wire-compatibility but ignores
23224
+ * it, because trusting it allowed one tenant to export another's graph.
23225
+ *
23226
+ * The response is raw text, not JSON, and its content type varies by format
23227
+ * (XML for `graphml` and `gexf`, CSV for the `csv-*` pair, Graphviz source
23228
+ * for `dot`). The generated route class declares `void` because the OpenAPI
23229
+ * spec omits the response schema, so this calls `http.request` directly with
23230
+ * `format: 'text'` to read the body.
23231
+ *
23232
+ * @example
23233
+ * ```typescript
23234
+ * const dot = await client.communities.exportGraph('dot');
23235
+ * const graphml = await client.communities.exportGraph('graphml');
23236
+ * ```
23237
+ */
23238
+ async exportGraph(format) {
23239
+ const response = await this.api.http.request({
23240
+ path: "/api/v1/graph/export",
23241
+ method: "GET",
23242
+ query: { format },
23243
+ secure: true,
23244
+ format: "text"
23245
+ });
23246
+ return response.data;
23247
+ }
23189
23248
  };
23190
23249
 
23191
23250
  // src/normalizers/utilities.ts
@@ -23943,10 +24002,35 @@ var ActionReviewsClient = class {
23943
24002
  /**
23944
24003
  * List pending action reviews.
23945
24004
  *
24005
+ * @param options - Optional filters and pagination. Omit to list the first
24006
+ * page of pending action reviews.
23946
24007
  * @returns Paginated list of pending reviews.
24008
+ * @throws {ApiError} If the request fails.
24009
+ *
24010
+ * @remarks
24011
+ * The tenant is taken from the authenticated principal (the `X-Tenant-Id`
24012
+ * header), never from the caller, so {@link ListActionReviewsOptions} exposes
24013
+ * no `tenantId`. Filters are sent as query parameters in wire `snake_case`;
24014
+ * any option left `undefined` is omitted, letting the backend default apply
24015
+ * (`pendingOnly` defaults to `true`, `pageSize` to 50).
24016
+ *
24017
+ * @example Highest-risk actions awaiting a decision
24018
+ * ```typescript
24019
+ * const pending = await client.actionReviews.listPending({
24020
+ * reason: 'high_risk',
24021
+ * pageSize: 20,
24022
+ * });
24023
+ * ```
23947
24024
  */
23948
- async listPending() {
23949
- const response = await this.api.listPendingActionReviews();
24025
+ async listPending(options = {}) {
24026
+ const response = await this.api.listPendingActionReviews({
24027
+ agent_id: options.agentId,
24028
+ action_sort: options.actionSort,
24029
+ reason: options.reason,
24030
+ pending_only: options.pendingOnly,
24031
+ page: options.page,
24032
+ page_size: options.pageSize
24033
+ });
23950
24034
  return ListActionReviewsResponseFromApiToFront(response.data);
23951
24035
  }
23952
24036
  /**