@kortexya/reasoninglayer 7.2.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.js CHANGED
@@ -5,7 +5,7 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // src/config.ts
8
- var SDK_VERSION = "7.2.0";
8
+ var SDK_VERSION = "8.0.0";
9
9
  function resolveConfig(config) {
10
10
  if (!config.baseUrl) {
11
11
  throw new Error("ClientConfig.baseUrl is required");
@@ -17104,6 +17104,23 @@ var Vocabulary = class {
17104
17104
  format: "json",
17105
17105
  ...params
17106
17106
  });
17107
+ /**
17108
+ * No description
17109
+ *
17110
+ * @tags vocabulary
17111
+ * @name RevisionRecords
17112
+ * @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.
17113
+ * @request GET:/api/v1/vocabulary/revisions/{revision_id}/records
17114
+ * @secure
17115
+ */
17116
+ revisionRecords = (revisionId, query, params = {}) => this.http.request({
17117
+ path: `/api/v1/vocabulary/revisions/${revisionId}/records`,
17118
+ method: "GET",
17119
+ query,
17120
+ secure: true,
17121
+ format: "json",
17122
+ ...params
17123
+ });
17107
17124
  /**
17108
17125
  * No description
17109
17126
  *
@@ -19571,7 +19588,7 @@ var RESPONSE_COMPONENTS = {
19571
19588
  created_by: [1, 0],
19572
19589
  minted_ids: [1, { object: {} }],
19573
19590
  outcome: [1, 0],
19574
- records: [1, { array: 0 }],
19591
+ record_counts: [1, { object: {} }],
19575
19592
  removals: [1, { array: 0 }],
19576
19593
  replayed: [1, 0],
19577
19594
  revision_id: [1, 0],
@@ -25716,6 +25733,7 @@ var RESPONSE_COMPONENTS = {
25716
25733
  revision_id: [1, 0]
25717
25734
  }
25718
25735
  },
25736
+ RevisionRecordPageResponse: { object: { items: [1, { array: 0 }], revision_id: [1, 0] } },
25719
25737
  RevisionSummaryDto: {
25720
25738
  object: {
25721
25739
  authors: [1, { array: 0 }],
@@ -31287,6 +31305,11 @@ var RESPONSE_OPERATIONS = {
31287
31305
  path: "/api/v1/vocabulary/revisions/{revision_id}/diff",
31288
31306
  responses: { 200: "RevisionDiffDto" }
31289
31307
  },
31308
+ revisionRecords: {
31309
+ method: "GET",
31310
+ path: "/api/v1/vocabulary/revisions/{revision_id}/records",
31311
+ responses: { 200: "RevisionRecordPageResponse" }
31312
+ },
31290
31313
  revokeApproverRoleHandler: {
31291
31314
  method: "DELETE",
31292
31315
  path: "/api/v1/action-reviews/role-bindings/{principal}",
@@ -70657,6 +70680,12 @@ function TaxonomyPolicyInputFromFrontToApi(record) {
70657
70680
  }
70658
70681
  return out;
70659
70682
  }
70683
+ function DefinitionPolicyInputFromFrontToApi(record) {
70684
+ return {
70685
+ scheme: VocabularyRecordRefFromFrontToApi(record.scheme),
70686
+ definitions: record.definitions
70687
+ };
70688
+ }
70660
70689
  function ExternalConceptInputFromFrontToApi(record) {
70661
70690
  const out = {
70662
70691
  authority: record.authority,
@@ -70815,10 +70844,19 @@ function VocabularyRecordInputFromFrontToApi(record) {
70815
70844
  };
70816
70845
  case "collection_member":
70817
70846
  return { kind: "collection_member", ...CollectionMemberInputFromFrontToApi(record) };
70847
+ case "definition_policy":
70848
+ return { kind: "definition_policy", ...DefinitionPolicyInputFromFrontToApi(record) };
70818
70849
  }
70819
70850
  }
70820
70851
  function VocabularyRecordOperationFromFrontToApi(operation) {
70821
- return operation.op === "upsert" ? { op: "upsert", record: VocabularyRecordInputFromFrontToApi(operation.record) } : { op: "remove", record_id: operation.recordId };
70852
+ switch (operation.op) {
70853
+ case "upsert":
70854
+ return { op: "upsert", record: VocabularyRecordInputFromFrontToApi(operation.record) };
70855
+ case "remove":
70856
+ return { op: "remove", record_id: operation.recordId };
70857
+ case "accept_proposals":
70858
+ return { op: "accept_proposals" };
70859
+ }
70822
70860
  }
70823
70861
  function CreateVocabularyCandidateRequestFromFrontToApi(request) {
70824
70862
  return {
@@ -71180,6 +71218,16 @@ function VocabularyTaxonomyPolicyRecordFromApiToFront(dto) {
71180
71218
  if (present(dto.partitive_transitive)) out.partitiveTransitive = dto.partitive_transitive;
71181
71219
  return out;
71182
71220
  }
71221
+ function VocabularyDefinitionPolicyRecordFromApiToFront(dto) {
71222
+ return {
71223
+ recordId: dto.record_id,
71224
+ revision: dto.revision,
71225
+ changeReason: dto.change_reason,
71226
+ scheme: dto.scheme,
71227
+ policy: dto.policy,
71228
+ definitions: dto.definitions
71229
+ };
71230
+ }
71183
71231
  function VocabularyExternalConceptRecordFromApiToFront(dto) {
71184
71232
  const out = {
71185
71233
  recordId: dto.record_id,
@@ -71398,6 +71446,11 @@ function VocabularyRecordViewFromApiToFront(dto) {
71398
71446
  kind: "migration_decision",
71399
71447
  ...VocabularyMigrationDecisionRecordFromApiToFront(dto)
71400
71448
  };
71449
+ case "definition_policy":
71450
+ return {
71451
+ kind: "definition_policy",
71452
+ ...VocabularyDefinitionPolicyRecordFromApiToFront(dto)
71453
+ };
71401
71454
  }
71402
71455
  }
71403
71456
  function FindingContextFromApiToFront(dto) {
@@ -71765,7 +71818,7 @@ function VocabularyCandidateRevisionFromApiToFront(dto) {
71765
71818
  createdBy: dto.created_by,
71766
71819
  createdAt: dto.created_at,
71767
71820
  changeReason: dto.change_reason,
71768
- records: dto.records.map(VocabularyRecordViewFromApiToFront),
71821
+ recordCounts: dataMap(dto.record_counts),
71769
71822
  removals: dto.removals,
71770
71823
  mintedIds: dataMap(dto.minted_ids),
71771
71824
  advisoryFindings: dto.advisory_findings.map(VocabularyFindingFromApiToFront),
@@ -71946,6 +71999,14 @@ function VocabularyRecordPageFromApiToFront(dto) {
71946
71999
  if (present(dto.next_cursor)) out.nextCursor = dto.next_cursor;
71947
72000
  return out;
71948
72001
  }
72002
+ function VocabularyRevisionRecordPageFromApiToFront(dto) {
72003
+ const out = {
72004
+ revisionId: dto.revision_id,
72005
+ items: dto.items.map(VocabularyRecordViewFromApiToFront)
72006
+ };
72007
+ if (present(dto.next_cursor)) out.nextCursor = dto.next_cursor;
72008
+ return out;
72009
+ }
71949
72010
  function VocabularyActivationResultFromApiToFront(dto) {
71950
72011
  const out = {
71951
72012
  releaseId: dto.release_id,
@@ -73072,7 +73133,7 @@ var VocabularyClient = class {
73072
73133
  return decodeResponse(response, VocabularyCandidateRevisionFromApiToFront);
73073
73134
  }
73074
73135
  /**
73075
- * One revision: its baseline, authors, records and removals.
73136
+ * One revision: its baseline, authors, record counts and removals.
73076
73137
  *
73077
73138
  * @param revisionId - The revision (UUID).
73078
73139
  * @param requestOptions - Per-call options (timeout, retries, signal, headers).
@@ -73081,18 +73142,47 @@ var VocabularyClient = class {
73081
73142
  * @throws {@link VocabularyRefusedError} 409 `vocabulary_plugin_unavailable`.
73082
73143
  *
73083
73144
  * @remarks
73084
- * `GET /api/v1/vocabulary/revisions/{revision_id}`.
73145
+ * `GET /api/v1/vocabulary/revisions/{revision_id}`. The answer counts the
73146
+ * records by kind (`recordCounts`); read the records with
73147
+ * {@link VocabularyClient.listRevisionRecords}.
73085
73148
  *
73086
73149
  * @example
73087
73150
  * ```typescript
73088
73151
  * const revision = await client.vocabulary.getRevision(revisionId);
73089
- * const concepts = revision.records.filter((r) => r.kind === 'concept');
73152
+ * const conceptCount = revision.recordCounts['concept'] ?? 0;
73090
73153
  * ```
73091
73154
  */
73092
73155
  async getRevision(revisionId, requestOptions) {
73093
73156
  const response = await this.api.getRevision(revisionId, toRequestParams(requestOptions)).catch(rethrowVocabularyRefusal);
73094
73157
  return decodeResponse(response, VocabularyCandidateRevisionFromApiToFront);
73095
73158
  }
73159
+ /**
73160
+ * One page of the records a revision's cumulative change set inserts or
73161
+ * replaces.
73162
+ *
73163
+ * @param revisionId - The revision (UUID).
73164
+ * @param query - A record-kind filter and cursor paging (`limit` 1 to 500).
73165
+ * @param requestOptions - Per-call options (timeout, retries, signal, headers).
73166
+ * @returns The records and the next cursor.
73167
+ * @throws {@link NotFoundError} 404 for an unknown revision.
73168
+ * @throws {@link VocabularyRefusedError} 400 `invalid_request`; 409
73169
+ * `vocabulary_plugin_unavailable`.
73170
+ *
73171
+ * @remarks
73172
+ * `GET /api/v1/vocabulary/revisions/{revision_id}/records?kind&cursor&limit`.
73173
+ * Records come by id; the engine default page size is 50.
73174
+ *
73175
+ * @example
73176
+ * ```typescript
73177
+ * const page = await client.vocabulary.listRevisionRecords(revisionId, { kind: 'concept' });
73178
+ * ```
73179
+ */
73180
+ async listRevisionRecords(revisionId, query, requestOptions) {
73181
+ const wire = pageQuery(query);
73182
+ if (query?.kind !== void 0) wire.kind = query.kind;
73183
+ const response = await this.api.revisionRecords(revisionId, wire, toRequestParams(requestOptions)).catch(rethrowVocabularyRefusal);
73184
+ return decodeResponse(response, VocabularyRevisionRecordPageFromApiToFront);
73185
+ }
73096
73186
  /**
73097
73187
  * A revision against its baseline: records added, changed (with per-feature
73098
73188
  * before/after values) and removed.