@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.cjs +97 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +186 -16
- package/dist/index.d.ts +186 -16
- package/dist/index.js +97 -7
- 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 = "
|
|
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
|
*
|
|
@@ -19573,7 +19590,7 @@ var RESPONSE_COMPONENTS = {
|
|
|
19573
19590
|
created_by: [1, 0],
|
|
19574
19591
|
minted_ids: [1, { object: {} }],
|
|
19575
19592
|
outcome: [1, 0],
|
|
19576
|
-
|
|
19593
|
+
record_counts: [1, { object: {} }],
|
|
19577
19594
|
removals: [1, { array: 0 }],
|
|
19578
19595
|
replayed: [1, 0],
|
|
19579
19596
|
revision_id: [1, 0],
|
|
@@ -25718,6 +25735,7 @@ var RESPONSE_COMPONENTS = {
|
|
|
25718
25735
|
revision_id: [1, 0]
|
|
25719
25736
|
}
|
|
25720
25737
|
},
|
|
25738
|
+
RevisionRecordPageResponse: { object: { items: [1, { array: 0 }], revision_id: [1, 0] } },
|
|
25721
25739
|
RevisionSummaryDto: {
|
|
25722
25740
|
object: {
|
|
25723
25741
|
authors: [1, { array: 0 }],
|
|
@@ -31289,6 +31307,11 @@ var RESPONSE_OPERATIONS = {
|
|
|
31289
31307
|
path: "/api/v1/vocabulary/revisions/{revision_id}/diff",
|
|
31290
31308
|
responses: { 200: "RevisionDiffDto" }
|
|
31291
31309
|
},
|
|
31310
|
+
revisionRecords: {
|
|
31311
|
+
method: "GET",
|
|
31312
|
+
path: "/api/v1/vocabulary/revisions/{revision_id}/records",
|
|
31313
|
+
responses: { 200: "RevisionRecordPageResponse" }
|
|
31314
|
+
},
|
|
31292
31315
|
revokeApproverRoleHandler: {
|
|
31293
31316
|
method: "DELETE",
|
|
31294
31317
|
path: "/api/v1/action-reviews/role-bindings/{principal}",
|
|
@@ -70659,6 +70682,12 @@ function TaxonomyPolicyInputFromFrontToApi(record) {
|
|
|
70659
70682
|
}
|
|
70660
70683
|
return out;
|
|
70661
70684
|
}
|
|
70685
|
+
function DefinitionPolicyInputFromFrontToApi(record) {
|
|
70686
|
+
return {
|
|
70687
|
+
scheme: VocabularyRecordRefFromFrontToApi(record.scheme),
|
|
70688
|
+
definitions: record.definitions
|
|
70689
|
+
};
|
|
70690
|
+
}
|
|
70662
70691
|
function ExternalConceptInputFromFrontToApi(record) {
|
|
70663
70692
|
const out = {
|
|
70664
70693
|
authority: record.authority,
|
|
@@ -70817,10 +70846,19 @@ function VocabularyRecordInputFromFrontToApi(record) {
|
|
|
70817
70846
|
};
|
|
70818
70847
|
case "collection_member":
|
|
70819
70848
|
return { kind: "collection_member", ...CollectionMemberInputFromFrontToApi(record) };
|
|
70849
|
+
case "definition_policy":
|
|
70850
|
+
return { kind: "definition_policy", ...DefinitionPolicyInputFromFrontToApi(record) };
|
|
70820
70851
|
}
|
|
70821
70852
|
}
|
|
70822
70853
|
function VocabularyRecordOperationFromFrontToApi(operation) {
|
|
70823
|
-
|
|
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
|
+
}
|
|
70824
70862
|
}
|
|
70825
70863
|
function CreateVocabularyCandidateRequestFromFrontToApi(request) {
|
|
70826
70864
|
return {
|
|
@@ -71182,6 +71220,16 @@ function VocabularyTaxonomyPolicyRecordFromApiToFront(dto) {
|
|
|
71182
71220
|
if (present(dto.partitive_transitive)) out.partitiveTransitive = dto.partitive_transitive;
|
|
71183
71221
|
return out;
|
|
71184
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
|
+
}
|
|
71185
71233
|
function VocabularyExternalConceptRecordFromApiToFront(dto) {
|
|
71186
71234
|
const out = {
|
|
71187
71235
|
recordId: dto.record_id,
|
|
@@ -71400,6 +71448,11 @@ function VocabularyRecordViewFromApiToFront(dto) {
|
|
|
71400
71448
|
kind: "migration_decision",
|
|
71401
71449
|
...VocabularyMigrationDecisionRecordFromApiToFront(dto)
|
|
71402
71450
|
};
|
|
71451
|
+
case "definition_policy":
|
|
71452
|
+
return {
|
|
71453
|
+
kind: "definition_policy",
|
|
71454
|
+
...VocabularyDefinitionPolicyRecordFromApiToFront(dto)
|
|
71455
|
+
};
|
|
71403
71456
|
}
|
|
71404
71457
|
}
|
|
71405
71458
|
function FindingContextFromApiToFront(dto) {
|
|
@@ -71767,7 +71820,7 @@ function VocabularyCandidateRevisionFromApiToFront(dto) {
|
|
|
71767
71820
|
createdBy: dto.created_by,
|
|
71768
71821
|
createdAt: dto.created_at,
|
|
71769
71822
|
changeReason: dto.change_reason,
|
|
71770
|
-
|
|
71823
|
+
recordCounts: dataMap(dto.record_counts),
|
|
71771
71824
|
removals: dto.removals,
|
|
71772
71825
|
mintedIds: dataMap(dto.minted_ids),
|
|
71773
71826
|
advisoryFindings: dto.advisory_findings.map(VocabularyFindingFromApiToFront),
|
|
@@ -71948,6 +72001,14 @@ function VocabularyRecordPageFromApiToFront(dto) {
|
|
|
71948
72001
|
if (present(dto.next_cursor)) out.nextCursor = dto.next_cursor;
|
|
71949
72002
|
return out;
|
|
71950
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
|
+
}
|
|
71951
72012
|
function VocabularyActivationResultFromApiToFront(dto) {
|
|
71952
72013
|
const out = {
|
|
71953
72014
|
releaseId: dto.release_id,
|
|
@@ -73074,7 +73135,7 @@ var VocabularyClient = class {
|
|
|
73074
73135
|
return decodeResponse(response, VocabularyCandidateRevisionFromApiToFront);
|
|
73075
73136
|
}
|
|
73076
73137
|
/**
|
|
73077
|
-
* One revision: its baseline, authors,
|
|
73138
|
+
* One revision: its baseline, authors, record counts and removals.
|
|
73078
73139
|
*
|
|
73079
73140
|
* @param revisionId - The revision (UUID).
|
|
73080
73141
|
* @param requestOptions - Per-call options (timeout, retries, signal, headers).
|
|
@@ -73083,18 +73144,47 @@ var VocabularyClient = class {
|
|
|
73083
73144
|
* @throws {@link VocabularyRefusedError} 409 `vocabulary_plugin_unavailable`.
|
|
73084
73145
|
*
|
|
73085
73146
|
* @remarks
|
|
73086
|
-
* `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}.
|
|
73087
73150
|
*
|
|
73088
73151
|
* @example
|
|
73089
73152
|
* ```typescript
|
|
73090
73153
|
* const revision = await client.vocabulary.getRevision(revisionId);
|
|
73091
|
-
* const
|
|
73154
|
+
* const conceptCount = revision.recordCounts['concept'] ?? 0;
|
|
73092
73155
|
* ```
|
|
73093
73156
|
*/
|
|
73094
73157
|
async getRevision(revisionId, requestOptions) {
|
|
73095
73158
|
const response = await this.api.getRevision(revisionId, toRequestParams(requestOptions)).catch(rethrowVocabularyRefusal);
|
|
73096
73159
|
return decodeResponse(response, VocabularyCandidateRevisionFromApiToFront);
|
|
73097
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
|
+
}
|
|
73098
73188
|
/**
|
|
73099
73189
|
* A revision against its baseline: records added, changed (with per-feature
|
|
73100
73190
|
* before/after values) and removed.
|