@knowledge-stack/ksapi 2.14.4 → 2.15.1
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/.openapi-generator/FILES +2 -0
- package/README.md +4 -2
- package/dist/apis/AdminKbApi.d.ts +7 -7
- package/dist/apis/AdminKbApi.js +3 -3
- package/dist/apis/AdminWorkflowsApi.d.ts +26 -26
- package/dist/apis/AdminWorkflowsApi.js +18 -18
- package/dist/apis/SkillsApi.d.ts +39 -1
- package/dist/apis/SkillsApi.js +49 -0
- package/dist/esm/apis/AdminKbApi.d.ts +7 -7
- package/dist/esm/apis/AdminKbApi.js +3 -3
- package/dist/esm/apis/AdminWorkflowsApi.d.ts +26 -26
- package/dist/esm/apis/AdminWorkflowsApi.js +18 -18
- package/dist/esm/apis/SkillsApi.d.ts +39 -1
- package/dist/esm/apis/SkillsApi.js +50 -1
- package/dist/esm/models/ExportSkillsRequest.d.ts +47 -0
- package/dist/esm/models/ExportSkillsRequest.js +50 -0
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.js +1 -0
- package/dist/models/ExportSkillsRequest.d.ts +47 -0
- package/dist/models/ExportSkillsRequest.js +58 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/docs/AdminKbApi.md +8 -8
- package/docs/AdminWorkflowsApi.md +32 -32
- package/docs/ExportSkillsRequest.md +35 -0
- package/docs/SkillsApi.md +76 -0
- package/package.json +1 -1
- package/src/apis/AdminKbApi.ts +11 -11
- package/src/apis/AdminWorkflowsApi.ts +50 -50
- package/src/apis/SkillsApi.ts +88 -0
- package/src/models/ExportSkillsRequest.ts +88 -0
- package/src/models/index.ts +1 -0
package/src/apis/SkillsApi.ts
CHANGED
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
ActivateSkillVersionRequest,
|
|
19
19
|
CreateSkillRequest,
|
|
20
20
|
ErrorResponse,
|
|
21
|
+
ExportSkillsRequest,
|
|
21
22
|
HTTPValidationError,
|
|
22
23
|
PaginatedResponseSkillResponse,
|
|
23
24
|
SearchSkillsRequest,
|
|
@@ -35,6 +36,8 @@ import {
|
|
|
35
36
|
CreateSkillRequestToJSON,
|
|
36
37
|
ErrorResponseFromJSON,
|
|
37
38
|
ErrorResponseToJSON,
|
|
39
|
+
ExportSkillsRequestFromJSON,
|
|
40
|
+
ExportSkillsRequestToJSON,
|
|
38
41
|
HTTPValidationErrorFromJSON,
|
|
39
42
|
HTTPValidationErrorToJSON,
|
|
40
43
|
PaginatedResponseSkillResponseFromJSON,
|
|
@@ -85,6 +88,10 @@ export interface ExportSkillRequest {
|
|
|
85
88
|
skillId: string;
|
|
86
89
|
}
|
|
87
90
|
|
|
91
|
+
export interface ExportSkillsOperationRequest {
|
|
92
|
+
exportSkillsRequest: ExportSkillsRequest;
|
|
93
|
+
}
|
|
94
|
+
|
|
88
95
|
export interface GetSkillRequest {
|
|
89
96
|
skillId: string;
|
|
90
97
|
includeFileContents?: boolean;
|
|
@@ -298,6 +305,30 @@ export interface SkillsApiInterface {
|
|
|
298
305
|
*/
|
|
299
306
|
exportSkill(requestParameters: ExportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<any>;
|
|
300
307
|
|
|
308
|
+
/**
|
|
309
|
+
* Creates request options for exportSkills without sending the request
|
|
310
|
+
* @param {ExportSkillsRequest} exportSkillsRequest
|
|
311
|
+
* @throws {RequiredError}
|
|
312
|
+
* @memberof SkillsApiInterface
|
|
313
|
+
*/
|
|
314
|
+
exportSkillsRequestOpts(requestParameters: ExportSkillsOperationRequest): Promise<runtime.RequestOpts>;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
318
|
+
* @summary Export Skills Handler
|
|
319
|
+
* @param {ExportSkillsRequest} exportSkillsRequest
|
|
320
|
+
* @param {*} [options] Override http request option.
|
|
321
|
+
* @throws {RequiredError}
|
|
322
|
+
* @memberof SkillsApiInterface
|
|
323
|
+
*/
|
|
324
|
+
exportSkillsRaw(requestParameters: ExportSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
328
|
+
* Export Skills Handler
|
|
329
|
+
*/
|
|
330
|
+
exportSkills(requestParameters: ExportSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
|
|
331
|
+
|
|
301
332
|
/**
|
|
302
333
|
* Creates request options for getSkill without sending the request
|
|
303
334
|
* @param {string} skillId
|
|
@@ -892,6 +923,63 @@ export class SkillsApi extends runtime.BaseAPI implements SkillsApiInterface {
|
|
|
892
923
|
return await response.value();
|
|
893
924
|
}
|
|
894
925
|
|
|
926
|
+
/**
|
|
927
|
+
* Creates request options for exportSkills without sending the request
|
|
928
|
+
*/
|
|
929
|
+
async exportSkillsRequestOpts(requestParameters: ExportSkillsOperationRequest): Promise<runtime.RequestOpts> {
|
|
930
|
+
if (requestParameters['exportSkillsRequest'] == null) {
|
|
931
|
+
throw new runtime.RequiredError(
|
|
932
|
+
'exportSkillsRequest',
|
|
933
|
+
'Required parameter "exportSkillsRequest" was null or undefined when calling exportSkills().'
|
|
934
|
+
);
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
const queryParameters: any = {};
|
|
938
|
+
|
|
939
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
940
|
+
|
|
941
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
942
|
+
|
|
943
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
944
|
+
const token = this.configuration.accessToken;
|
|
945
|
+
const tokenString = await token("bearerAuth", []);
|
|
946
|
+
|
|
947
|
+
if (tokenString) {
|
|
948
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
let urlPath = `/v1/skills/export`;
|
|
953
|
+
|
|
954
|
+
return {
|
|
955
|
+
path: urlPath,
|
|
956
|
+
method: 'POST',
|
|
957
|
+
headers: headerParameters,
|
|
958
|
+
query: queryParameters,
|
|
959
|
+
body: ExportSkillsRequestToJSON(requestParameters['exportSkillsRequest']),
|
|
960
|
+
};
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
/**
|
|
964
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
965
|
+
* Export Skills Handler
|
|
966
|
+
*/
|
|
967
|
+
async exportSkillsRaw(requestParameters: ExportSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
|
|
968
|
+
const requestOptions = await this.exportSkillsRequestOpts(requestParameters);
|
|
969
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
970
|
+
|
|
971
|
+
return new runtime.BlobApiResponse(response);
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
976
|
+
* Export Skills Handler
|
|
977
|
+
*/
|
|
978
|
+
async exportSkills(requestParameters: ExportSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {
|
|
979
|
+
const response = await this.exportSkillsRaw(requestParameters, initOverrides);
|
|
980
|
+
return await response.value();
|
|
981
|
+
}
|
|
982
|
+
|
|
895
983
|
/**
|
|
896
984
|
* Creates request options for getSkill without sending the request
|
|
897
985
|
*/
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
* Skills to pack into one ZIP, each under a top-level folder named after it.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface ExportSkillsRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface ExportSkillsRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Skills whose frozen active versions are packed together; duplicates are ignored. Every skill must exist and be readable.
|
|
24
|
+
* @type {Array<string>}
|
|
25
|
+
* @memberof ExportSkillsRequest
|
|
26
|
+
*/
|
|
27
|
+
skillIds: Array<string>;
|
|
28
|
+
}
|
|
29
|
+
export const ExportSkillsRequestPropertyValidationAttributesMap: {
|
|
30
|
+
[property: string]: {
|
|
31
|
+
maxLength?: number,
|
|
32
|
+
minLength?: number,
|
|
33
|
+
pattern?: string,
|
|
34
|
+
maximum?: number,
|
|
35
|
+
exclusiveMaximum?: boolean,
|
|
36
|
+
minimum?: number,
|
|
37
|
+
exclusiveMinimum?: boolean,
|
|
38
|
+
multipleOf?: number,
|
|
39
|
+
maxItems?: number,
|
|
40
|
+
minItems?: number,
|
|
41
|
+
uniqueItems?: boolean
|
|
42
|
+
}
|
|
43
|
+
} = {
|
|
44
|
+
skillIds: {
|
|
45
|
+
maxItems: 50,
|
|
46
|
+
minItems: 1,
|
|
47
|
+
uniqueItems: false,
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Check if a given object implements the ExportSkillsRequest interface.
|
|
54
|
+
*/
|
|
55
|
+
export function instanceOfExportSkillsRequest(value: object): value is ExportSkillsRequest {
|
|
56
|
+
if (!('skillIds' in value) || value['skillIds'] === undefined) return false;
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function ExportSkillsRequestFromJSON(json: any): ExportSkillsRequest {
|
|
61
|
+
return ExportSkillsRequestFromJSONTyped(json, false);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function ExportSkillsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExportSkillsRequest {
|
|
65
|
+
if (json == null) {
|
|
66
|
+
return json;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
|
|
70
|
+
'skillIds': json['skill_ids'],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function ExportSkillsRequestToJSON(json: any): ExportSkillsRequest {
|
|
75
|
+
return ExportSkillsRequestToJSONTyped(json, false);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function ExportSkillsRequestToJSONTyped(value?: ExportSkillsRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
79
|
+
if (value == null) {
|
|
80
|
+
return value;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
|
|
85
|
+
'skill_ids': value['skillIds'],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -138,6 +138,7 @@ export * from './EnrichedThreadMessageContent';
|
|
|
138
138
|
export * from './ErrorResponse';
|
|
139
139
|
export * from './EventResponse';
|
|
140
140
|
export * from './ExcludedCommonFile';
|
|
141
|
+
export * from './ExportSkillsRequest';
|
|
141
142
|
export * from './ExtractRequest';
|
|
142
143
|
export * from './ExtractResponse';
|
|
143
144
|
export * from './FeaturesResponse';
|