@kortexya/reasoninglayer 7.1.0 → 8.0.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 = "7.1.0";
10
+ var SDK_VERSION = "8.0.0";
11
11
  function resolveConfig(config) {
12
12
  if (!config.baseUrl) {
13
13
  throw new Error("ClientConfig.baseUrl is required");
@@ -17106,6 +17106,23 @@ var Vocabulary = class {
17106
17106
  format: "json",
17107
17107
  ...params
17108
17108
  });
17109
+ /**
17110
+ * No description
17111
+ *
17112
+ * @tags vocabulary
17113
+ * @name RevisionRecords
17114
+ * @summary `GET /api/v1/vocabulary/revisions/{revision_id}/records` — the records the revision's cumulative change set inserts or replaces, by id, optionally of one kind (#628). The revision answer counts them; this read pages them.
17115
+ * @request GET:/api/v1/vocabulary/revisions/{revision_id}/records
17116
+ * @secure
17117
+ */
17118
+ revisionRecords = (revisionId, query, params = {}) => this.http.request({
17119
+ path: `/api/v1/vocabulary/revisions/${revisionId}/records`,
17120
+ method: "GET",
17121
+ query,
17122
+ secure: true,
17123
+ format: "json",
17124
+ ...params
17125
+ });
17109
17126
  /**
17110
17127
  * No description
17111
17128
  *
@@ -17892,7 +17909,8 @@ function FeatureDescriptorDtoFromApiToFront(dto) {
17892
17909
  minCount: dto.min_count ?? void 0,
17893
17910
  maxCount: dto.max_count ?? void 0,
17894
17911
  cardinalityOrigin: dto.cardinality_origin ?? void 0,
17895
- annotations: definedRecord2(dto.annotations)
17912
+ annotations: definedRecord2(dto.annotations),
17913
+ rangeConjunction: dto.range_conjunction
17896
17914
  };
17897
17915
  }
17898
17916
  function FeatureDescriptorDtoFromFrontToApi(model) {
@@ -19572,7 +19590,7 @@ var RESPONSE_COMPONENTS = {
19572
19590
  created_by: [1, 0],
19573
19591
  minted_ids: [1, { object: {} }],
19574
19592
  outcome: [1, 0],
19575
- records: [1, { array: 0 }],
19593
+ record_counts: [1, { object: {} }],
19576
19594
  removals: [1, { array: 0 }],
19577
19595
  replayed: [1, 0],
19578
19596
  revision_id: [1, 0],
@@ -21447,7 +21465,8 @@ var RESPONSE_COMPONENTS = {
21447
21465
  relations_integrated: [1, 0],
21448
21466
  sort_names: [1, { array: 0 }],
21449
21467
  term_ids: [1, { array: 0 }],
21450
- total_tokens: [1, 0]
21468
+ total_tokens: [1, 0],
21469
+ work_cache: [2, "IngestionWorkCacheDto"]
21451
21470
  }
21452
21471
  },
21453
21472
  DocumentStatusCounts: {
@@ -22071,6 +22090,7 @@ var RESPONSE_COMPONENTS = {
22071
22090
  object: {
22072
22091
  annotations: [0, { object: {} }],
22073
22092
  name: [1, 0],
22093
+ range_conjunction: [0, { array: 0 }],
22074
22094
  declared_by: [1, { array: 0 }],
22075
22095
  signature: [1, 0]
22076
22096
  }
@@ -22178,7 +22198,13 @@ var RESPONSE_COMPONENTS = {
22178
22198
  },
22179
22199
  FeatureBindingDto: { object: { name: [1, 0], value: [1, 0] } },
22180
22200
  FeatureChangeDto: { object: { feature: [1, 0] } },
22181
- FeatureDescriptorDto: { object: { annotations: [0, { object: {} }], name: [1, 0] } },
22201
+ FeatureDescriptorDto: {
22202
+ object: {
22203
+ annotations: [0, { object: {} }],
22204
+ name: [1, 0],
22205
+ range_conjunction: [0, { array: 0 }]
22206
+ }
22207
+ },
22182
22208
  FeatureDiff: { object: { change: [1, 0], feature: [1, 0] } },
22183
22209
  FeatureFilterDto: { object: { name: [1, 0], value: [1, 0] } },
22184
22210
  FeatureMismatchDto: {
@@ -25709,6 +25735,7 @@ var RESPONSE_COMPONENTS = {
25709
25735
  revision_id: [1, 0]
25710
25736
  }
25711
25737
  },
25738
+ RevisionRecordPageResponse: { object: { items: [1, { array: 0 }], revision_id: [1, 0] } },
25712
25739
  RevisionSummaryDto: {
25713
25740
  object: {
25714
25741
  authors: [1, { array: 0 }],
@@ -31280,6 +31307,11 @@ var RESPONSE_OPERATIONS = {
31280
31307
  path: "/api/v1/vocabulary/revisions/{revision_id}/diff",
31281
31308
  responses: { 200: "RevisionDiffDto" }
31282
31309
  },
31310
+ revisionRecords: {
31311
+ method: "GET",
31312
+ path: "/api/v1/vocabulary/revisions/{revision_id}/records",
31313
+ responses: { 200: "RevisionRecordPageResponse" }
31314
+ },
31283
31315
  revokeApproverRoleHandler: {
31284
31316
  method: "DELETE",
31285
31317
  path: "/api/v1/action-reviews/role-bindings/{principal}",
@@ -42730,7 +42762,8 @@ function DocumentStatsDtoFromApiToFront(dto) {
42730
42762
  sortNames: dto.sort_names,
42731
42763
  termIds: dto.term_ids,
42732
42764
  totalTokens: dto.total_tokens,
42733
- fcaDiscovery: dto.fca_discovery ? FcaIngestionReportFromApiToFront(dto.fca_discovery) : void 0
42765
+ fcaDiscovery: dto.fca_discovery ? FcaIngestionReportFromApiToFront(dto.fca_discovery) : void 0,
42766
+ workCache: dto.work_cache ? IngestionWorkCacheDtoFromApiToFront(dto.work_cache) : void 0
42734
42767
  };
42735
42768
  }
42736
42769
  function SessionStatsResponseFromApiToFront(dto) {
@@ -51255,8 +51288,7 @@ var AnalysisClient = class {
51255
51288
  * the first question, and the search report.
51256
51289
  * @throws {ForbiddenError} 403 with code `exploration_actor_required` when
51257
51290
  * the request carries no gateway human actor (`authenticatedUser`).
51258
- * @throws {BadRequestError} 400 for an unknown sort name, a refused
51259
- * population bound (`exploration_population_limit`), native-predicate
51291
+ * @throws {BadRequestError} 400 for an unknown sort name, native-predicate
51260
51292
  * semantics, or a scaled interpretation that is not complete.
51261
51293
  *
51262
51294
  * @remarks
@@ -51391,8 +51423,8 @@ var AnalysisClient = class {
51391
51423
  *
51392
51424
  * @param sessionId - Exploration session ID.
51393
51425
  * @param request - The bounds of this search step (`maxWork`,
51394
- * `maxCandidates`, `searchTimeoutMs`); each omitted bound takes the
51395
- * engine default.
51426
+ * `maxCandidates`, `searchTimeoutMs`); an omitted or `null` bound is
51427
+ * unbounded.
51396
51428
  * @param requestOptions - Per-call request options.
51397
51429
  * @returns The next question (absent when the search stopped again or was
51398
51430
  * exhausted), the progress, and the search report.
@@ -70650,6 +70682,12 @@ function TaxonomyPolicyInputFromFrontToApi(record) {
70650
70682
  }
70651
70683
  return out;
70652
70684
  }
70685
+ function DefinitionPolicyInputFromFrontToApi(record) {
70686
+ return {
70687
+ scheme: VocabularyRecordRefFromFrontToApi(record.scheme),
70688
+ definitions: record.definitions
70689
+ };
70690
+ }
70653
70691
  function ExternalConceptInputFromFrontToApi(record) {
70654
70692
  const out = {
70655
70693
  authority: record.authority,
@@ -70808,10 +70846,19 @@ function VocabularyRecordInputFromFrontToApi(record) {
70808
70846
  };
70809
70847
  case "collection_member":
70810
70848
  return { kind: "collection_member", ...CollectionMemberInputFromFrontToApi(record) };
70849
+ case "definition_policy":
70850
+ return { kind: "definition_policy", ...DefinitionPolicyInputFromFrontToApi(record) };
70811
70851
  }
70812
70852
  }
70813
70853
  function VocabularyRecordOperationFromFrontToApi(operation) {
70814
- return operation.op === "upsert" ? { op: "upsert", record: VocabularyRecordInputFromFrontToApi(operation.record) } : { op: "remove", record_id: operation.recordId };
70854
+ switch (operation.op) {
70855
+ case "upsert":
70856
+ return { op: "upsert", record: VocabularyRecordInputFromFrontToApi(operation.record) };
70857
+ case "remove":
70858
+ return { op: "remove", record_id: operation.recordId };
70859
+ case "accept_proposals":
70860
+ return { op: "accept_proposals" };
70861
+ }
70815
70862
  }
70816
70863
  function CreateVocabularyCandidateRequestFromFrontToApi(request) {
70817
70864
  return {
@@ -71173,6 +71220,16 @@ function VocabularyTaxonomyPolicyRecordFromApiToFront(dto) {
71173
71220
  if (present(dto.partitive_transitive)) out.partitiveTransitive = dto.partitive_transitive;
71174
71221
  return out;
71175
71222
  }
71223
+ function VocabularyDefinitionPolicyRecordFromApiToFront(dto) {
71224
+ return {
71225
+ recordId: dto.record_id,
71226
+ revision: dto.revision,
71227
+ changeReason: dto.change_reason,
71228
+ scheme: dto.scheme,
71229
+ policy: dto.policy,
71230
+ definitions: dto.definitions
71231
+ };
71232
+ }
71176
71233
  function VocabularyExternalConceptRecordFromApiToFront(dto) {
71177
71234
  const out = {
71178
71235
  recordId: dto.record_id,
@@ -71391,6 +71448,11 @@ function VocabularyRecordViewFromApiToFront(dto) {
71391
71448
  kind: "migration_decision",
71392
71449
  ...VocabularyMigrationDecisionRecordFromApiToFront(dto)
71393
71450
  };
71451
+ case "definition_policy":
71452
+ return {
71453
+ kind: "definition_policy",
71454
+ ...VocabularyDefinitionPolicyRecordFromApiToFront(dto)
71455
+ };
71394
71456
  }
71395
71457
  }
71396
71458
  function FindingContextFromApiToFront(dto) {
@@ -71758,7 +71820,7 @@ function VocabularyCandidateRevisionFromApiToFront(dto) {
71758
71820
  createdBy: dto.created_by,
71759
71821
  createdAt: dto.created_at,
71760
71822
  changeReason: dto.change_reason,
71761
- records: dto.records.map(VocabularyRecordViewFromApiToFront),
71823
+ recordCounts: dataMap(dto.record_counts),
71762
71824
  removals: dto.removals,
71763
71825
  mintedIds: dataMap(dto.minted_ids),
71764
71826
  advisoryFindings: dto.advisory_findings.map(VocabularyFindingFromApiToFront),
@@ -71939,6 +72001,14 @@ function VocabularyRecordPageFromApiToFront(dto) {
71939
72001
  if (present(dto.next_cursor)) out.nextCursor = dto.next_cursor;
71940
72002
  return out;
71941
72003
  }
72004
+ function VocabularyRevisionRecordPageFromApiToFront(dto) {
72005
+ const out = {
72006
+ revisionId: dto.revision_id,
72007
+ items: dto.items.map(VocabularyRecordViewFromApiToFront)
72008
+ };
72009
+ if (present(dto.next_cursor)) out.nextCursor = dto.next_cursor;
72010
+ return out;
72011
+ }
71942
72012
  function VocabularyActivationResultFromApiToFront(dto) {
71943
72013
  const out = {
71944
72014
  releaseId: dto.release_id,
@@ -73065,7 +73135,7 @@ var VocabularyClient = class {
73065
73135
  return decodeResponse(response, VocabularyCandidateRevisionFromApiToFront);
73066
73136
  }
73067
73137
  /**
73068
- * One revision: its baseline, authors, records and removals.
73138
+ * One revision: its baseline, authors, record counts and removals.
73069
73139
  *
73070
73140
  * @param revisionId - The revision (UUID).
73071
73141
  * @param requestOptions - Per-call options (timeout, retries, signal, headers).
@@ -73074,18 +73144,47 @@ var VocabularyClient = class {
73074
73144
  * @throws {@link VocabularyRefusedError} 409 `vocabulary_plugin_unavailable`.
73075
73145
  *
73076
73146
  * @remarks
73077
- * `GET /api/v1/vocabulary/revisions/{revision_id}`.
73147
+ * `GET /api/v1/vocabulary/revisions/{revision_id}`. The answer counts the
73148
+ * records by kind (`recordCounts`); read the records with
73149
+ * {@link VocabularyClient.listRevisionRecords}.
73078
73150
  *
73079
73151
  * @example
73080
73152
  * ```typescript
73081
73153
  * const revision = await client.vocabulary.getRevision(revisionId);
73082
- * const concepts = revision.records.filter((r) => r.kind === 'concept');
73154
+ * const conceptCount = revision.recordCounts['concept'] ?? 0;
73083
73155
  * ```
73084
73156
  */
73085
73157
  async getRevision(revisionId, requestOptions) {
73086
73158
  const response = await this.api.getRevision(revisionId, toRequestParams(requestOptions)).catch(rethrowVocabularyRefusal);
73087
73159
  return decodeResponse(response, VocabularyCandidateRevisionFromApiToFront);
73088
73160
  }
73161
+ /**
73162
+ * One page of the records a revision's cumulative change set inserts or
73163
+ * replaces.
73164
+ *
73165
+ * @param revisionId - The revision (UUID).
73166
+ * @param query - A record-kind filter and cursor paging (`limit` 1 to 500).
73167
+ * @param requestOptions - Per-call options (timeout, retries, signal, headers).
73168
+ * @returns The records and the next cursor.
73169
+ * @throws {@link NotFoundError} 404 for an unknown revision.
73170
+ * @throws {@link VocabularyRefusedError} 400 `invalid_request`; 409
73171
+ * `vocabulary_plugin_unavailable`.
73172
+ *
73173
+ * @remarks
73174
+ * `GET /api/v1/vocabulary/revisions/{revision_id}/records?kind&cursor&limit`.
73175
+ * Records come by id; the engine default page size is 50.
73176
+ *
73177
+ * @example
73178
+ * ```typescript
73179
+ * const page = await client.vocabulary.listRevisionRecords(revisionId, { kind: 'concept' });
73180
+ * ```
73181
+ */
73182
+ async listRevisionRecords(revisionId, query, requestOptions) {
73183
+ const wire = pageQuery(query);
73184
+ if (query?.kind !== void 0) wire.kind = query.kind;
73185
+ const response = await this.api.revisionRecords(revisionId, wire, toRequestParams(requestOptions)).catch(rethrowVocabularyRefusal);
73186
+ return decodeResponse(response, VocabularyRevisionRecordPageFromApiToFront);
73187
+ }
73089
73188
  /**
73090
73189
  * A revision against its baseline: records added, changed (with per-feature
73091
73190
  * before/after values) and removed.