@knowledge-stack/ksapi 2.14.3 → 2.15.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/.openapi-generator/FILES +2 -0
- package/README.md +4 -2
- package/dist/apis/ApiConnectionsApi.d.ts +8 -8
- package/dist/apis/ApiConnectionsApi.js +4 -4
- package/dist/apis/DataSourcesApi.d.ts +4 -4
- package/dist/apis/DataSourcesApi.js +2 -2
- package/dist/apis/SkillsApi.d.ts +39 -1
- package/dist/apis/SkillsApi.js +49 -0
- package/dist/esm/apis/ApiConnectionsApi.d.ts +8 -8
- package/dist/esm/apis/ApiConnectionsApi.js +4 -4
- package/dist/esm/apis/DataSourcesApi.d.ts +4 -4
- package/dist/esm/apis/DataSourcesApi.js +2 -2
- 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/ApiConnectionsApi.md +2 -2
- package/docs/DataSourcesApi.md +1 -1
- package/docs/ExportSkillsRequest.md +35 -0
- package/docs/SkillsApi.md +76 -0
- package/package.json +1 -1
- package/src/apis/ApiConnectionsApi.ts +8 -8
- package/src/apis/DataSourcesApi.ts +4 -4
- package/src/apis/SkillsApi.ts +88 -0
- package/src/models/ExportSkillsRequest.ts +88 -0
- package/src/models/index.ts +1 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Stack API
|
|
3
|
+
* 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.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Skills to pack into one ZIP, each under a top-level folder named after it.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface ExportSkillsRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface ExportSkillsRequest {
|
|
18
|
+
/**
|
|
19
|
+
* Skills whose frozen active versions are packed together; duplicates are ignored. Every skill must exist and be readable.
|
|
20
|
+
* @type {Array<string>}
|
|
21
|
+
* @memberof ExportSkillsRequest
|
|
22
|
+
*/
|
|
23
|
+
skillIds: Array<string>;
|
|
24
|
+
}
|
|
25
|
+
export declare const ExportSkillsRequestPropertyValidationAttributesMap: {
|
|
26
|
+
[property: string]: {
|
|
27
|
+
maxLength?: number;
|
|
28
|
+
minLength?: number;
|
|
29
|
+
pattern?: string;
|
|
30
|
+
maximum?: number;
|
|
31
|
+
exclusiveMaximum?: boolean;
|
|
32
|
+
minimum?: number;
|
|
33
|
+
exclusiveMinimum?: boolean;
|
|
34
|
+
multipleOf?: number;
|
|
35
|
+
maxItems?: number;
|
|
36
|
+
minItems?: number;
|
|
37
|
+
uniqueItems?: boolean;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Check if a given object implements the ExportSkillsRequest interface.
|
|
42
|
+
*/
|
|
43
|
+
export declare function instanceOfExportSkillsRequest(value: object): value is ExportSkillsRequest;
|
|
44
|
+
export declare function ExportSkillsRequestFromJSON(json: any): ExportSkillsRequest;
|
|
45
|
+
export declare function ExportSkillsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExportSkillsRequest;
|
|
46
|
+
export declare function ExportSkillsRequestToJSON(json: any): ExportSkillsRequest;
|
|
47
|
+
export declare function ExportSkillsRequestToJSONTyped(value?: ExportSkillsRequest | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
export const ExportSkillsRequestPropertyValidationAttributesMap = {
|
|
15
|
+
skillIds: {
|
|
16
|
+
maxItems: 50,
|
|
17
|
+
minItems: 1,
|
|
18
|
+
uniqueItems: false,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the ExportSkillsRequest interface.
|
|
23
|
+
*/
|
|
24
|
+
export function instanceOfExportSkillsRequest(value) {
|
|
25
|
+
if (!('skillIds' in value) || value['skillIds'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
export function ExportSkillsRequestFromJSON(json) {
|
|
30
|
+
return ExportSkillsRequestFromJSONTyped(json, false);
|
|
31
|
+
}
|
|
32
|
+
export function ExportSkillsRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
|
+
if (json == null) {
|
|
34
|
+
return json;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
'skillIds': json['skill_ids'],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export function ExportSkillsRequestToJSON(json) {
|
|
41
|
+
return ExportSkillsRequestToJSONTyped(json, false);
|
|
42
|
+
}
|
|
43
|
+
export function ExportSkillsRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
44
|
+
if (value == null) {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
'skill_ids': value['skillIds'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -136,6 +136,7 @@ export * from './EnrichedThreadMessageContent';
|
|
|
136
136
|
export * from './ErrorResponse';
|
|
137
137
|
export * from './EventResponse';
|
|
138
138
|
export * from './ExcludedCommonFile';
|
|
139
|
+
export * from './ExportSkillsRequest';
|
|
139
140
|
export * from './ExtractRequest';
|
|
140
141
|
export * from './ExtractResponse';
|
|
141
142
|
export * from './FeaturesResponse';
|
package/dist/esm/models/index.js
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';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Stack API
|
|
3
|
+
* 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.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Skills to pack into one ZIP, each under a top-level folder named after it.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface ExportSkillsRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface ExportSkillsRequest {
|
|
18
|
+
/**
|
|
19
|
+
* Skills whose frozen active versions are packed together; duplicates are ignored. Every skill must exist and be readable.
|
|
20
|
+
* @type {Array<string>}
|
|
21
|
+
* @memberof ExportSkillsRequest
|
|
22
|
+
*/
|
|
23
|
+
skillIds: Array<string>;
|
|
24
|
+
}
|
|
25
|
+
export declare const ExportSkillsRequestPropertyValidationAttributesMap: {
|
|
26
|
+
[property: string]: {
|
|
27
|
+
maxLength?: number;
|
|
28
|
+
minLength?: number;
|
|
29
|
+
pattern?: string;
|
|
30
|
+
maximum?: number;
|
|
31
|
+
exclusiveMaximum?: boolean;
|
|
32
|
+
minimum?: number;
|
|
33
|
+
exclusiveMinimum?: boolean;
|
|
34
|
+
multipleOf?: number;
|
|
35
|
+
maxItems?: number;
|
|
36
|
+
minItems?: number;
|
|
37
|
+
uniqueItems?: boolean;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Check if a given object implements the ExportSkillsRequest interface.
|
|
42
|
+
*/
|
|
43
|
+
export declare function instanceOfExportSkillsRequest(value: object): value is ExportSkillsRequest;
|
|
44
|
+
export declare function ExportSkillsRequestFromJSON(json: any): ExportSkillsRequest;
|
|
45
|
+
export declare function ExportSkillsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExportSkillsRequest;
|
|
46
|
+
export declare function ExportSkillsRequestToJSON(json: any): ExportSkillsRequest;
|
|
47
|
+
export declare function ExportSkillsRequestToJSONTyped(value?: ExportSkillsRequest | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Knowledge Stack API
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.ExportSkillsRequestPropertyValidationAttributesMap = void 0;
|
|
17
|
+
exports.instanceOfExportSkillsRequest = instanceOfExportSkillsRequest;
|
|
18
|
+
exports.ExportSkillsRequestFromJSON = ExportSkillsRequestFromJSON;
|
|
19
|
+
exports.ExportSkillsRequestFromJSONTyped = ExportSkillsRequestFromJSONTyped;
|
|
20
|
+
exports.ExportSkillsRequestToJSON = ExportSkillsRequestToJSON;
|
|
21
|
+
exports.ExportSkillsRequestToJSONTyped = ExportSkillsRequestToJSONTyped;
|
|
22
|
+
exports.ExportSkillsRequestPropertyValidationAttributesMap = {
|
|
23
|
+
skillIds: {
|
|
24
|
+
maxItems: 50,
|
|
25
|
+
minItems: 1,
|
|
26
|
+
uniqueItems: false,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Check if a given object implements the ExportSkillsRequest interface.
|
|
31
|
+
*/
|
|
32
|
+
function instanceOfExportSkillsRequest(value) {
|
|
33
|
+
if (!('skillIds' in value) || value['skillIds'] === undefined)
|
|
34
|
+
return false;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
function ExportSkillsRequestFromJSON(json) {
|
|
38
|
+
return ExportSkillsRequestFromJSONTyped(json, false);
|
|
39
|
+
}
|
|
40
|
+
function ExportSkillsRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
41
|
+
if (json == null) {
|
|
42
|
+
return json;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
'skillIds': json['skill_ids'],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function ExportSkillsRequestToJSON(json) {
|
|
49
|
+
return ExportSkillsRequestToJSONTyped(json, false);
|
|
50
|
+
}
|
|
51
|
+
function ExportSkillsRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
52
|
+
if (value == null) {
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
'skill_ids': value['skillIds'],
|
|
57
|
+
};
|
|
58
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -136,6 +136,7 @@ export * from './EnrichedThreadMessageContent';
|
|
|
136
136
|
export * from './ErrorResponse';
|
|
137
137
|
export * from './EventResponse';
|
|
138
138
|
export * from './ExcludedCommonFile';
|
|
139
|
+
export * from './ExportSkillsRequest';
|
|
139
140
|
export * from './ExtractRequest';
|
|
140
141
|
export * from './ExtractResponse';
|
|
141
142
|
export * from './FeaturesResponse';
|
package/dist/models/index.js
CHANGED
|
@@ -154,6 +154,7 @@ __exportStar(require("./EnrichedThreadMessageContent"), exports);
|
|
|
154
154
|
__exportStar(require("./ErrorResponse"), exports);
|
|
155
155
|
__exportStar(require("./EventResponse"), exports);
|
|
156
156
|
__exportStar(require("./ExcludedCommonFile"), exports);
|
|
157
|
+
__exportStar(require("./ExportSkillsRequest"), exports);
|
|
157
158
|
__exportStar(require("./ExtractRequest"), exports);
|
|
158
159
|
__exportStar(require("./ExtractResponse"), exports);
|
|
159
160
|
__exportStar(require("./FeaturesResponse"), exports);
|
|
@@ -172,7 +172,7 @@ example().catch(console.error);
|
|
|
172
172
|
|
|
173
173
|
Delete Api Connection Handler
|
|
174
174
|
|
|
175
|
-
Move a connection to trash
|
|
175
|
+
Move a connection to trash; requires ``can_delete``.
|
|
176
176
|
|
|
177
177
|
### Example
|
|
178
178
|
|
|
@@ -400,7 +400,7 @@ example().catch(console.error);
|
|
|
400
400
|
|
|
401
401
|
Update Api Connection Handler
|
|
402
402
|
|
|
403
|
-
Update a connection
|
|
403
|
+
Update a connection; changing its egress envelope needs Admin/Owner.
|
|
404
404
|
|
|
405
405
|
### Example
|
|
406
406
|
|
package/docs/DataSourcesApi.md
CHANGED
|
@@ -1173,7 +1173,7 @@ example().catch(console.error);
|
|
|
1173
1173
|
|
|
1174
1174
|
Update Data Source Handler
|
|
1175
1175
|
|
|
1176
|
-
Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move). Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
|
|
1176
|
+
Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
|
|
1177
1177
|
|
|
1178
1178
|
### Example
|
|
1179
1179
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
# ExportSkillsRequest
|
|
3
|
+
|
|
4
|
+
Skills to pack into one ZIP, each under a top-level folder named after it.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`skillIds` | Array<string>
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { ExportSkillsRequest } from '@knowledge-stack/ksapi'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"skillIds": null,
|
|
20
|
+
} satisfies ExportSkillsRequest
|
|
21
|
+
|
|
22
|
+
console.log(example)
|
|
23
|
+
|
|
24
|
+
// Convert the instance to a JSON string
|
|
25
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
26
|
+
console.log(exampleJSON)
|
|
27
|
+
|
|
28
|
+
// Parse the JSON string back to an object
|
|
29
|
+
const exampleParsed = JSON.parse(exampleJSON) as ExportSkillsRequest
|
|
30
|
+
console.log(exampleParsed)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
34
|
+
|
|
35
|
+
|
package/docs/SkillsApi.md
CHANGED
|
@@ -11,6 +11,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
11
11
|
| [**deleteSkill**](SkillsApi.md#deleteskill) | **DELETE** /v1/skills/{skill_id} | Delete Skill Handler |
|
|
12
12
|
| [**discardSkillDraft**](SkillsApi.md#discardskilldraft) | **POST** /v1/skills/{skill_id}/discard-draft | Discard Skill Draft Handler |
|
|
13
13
|
| [**exportSkill**](SkillsApi.md#exportskill) | **GET** /v1/skills/{skill_id}/export | Export Skill Handler |
|
|
14
|
+
| [**exportSkills**](SkillsApi.md#exportskillsoperation) | **POST** /v1/skills/export | Export Skills Handler |
|
|
14
15
|
| [**getSkill**](SkillsApi.md#getskill) | **GET** /v1/skills/{skill_id} | Get Skill Handler |
|
|
15
16
|
| [**importSkill**](SkillsApi.md#importskill) | **POST** /v1/skills/import | Import Skill Handler |
|
|
16
17
|
| [**listSkillVersions**](SkillsApi.md#listskillversions) | **GET** /v1/skills/{skill_id}/versions | List Skill Versions Handler |
|
|
@@ -552,6 +553,81 @@ example().catch(console.error);
|
|
|
552
553
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
553
554
|
|
|
554
555
|
|
|
556
|
+
## exportSkills
|
|
557
|
+
|
|
558
|
+
> Blob exportSkills(exportSkillsRequest)
|
|
559
|
+
|
|
560
|
+
Export Skills Handler
|
|
561
|
+
|
|
562
|
+
Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
563
|
+
|
|
564
|
+
### Example
|
|
565
|
+
|
|
566
|
+
```ts
|
|
567
|
+
import {
|
|
568
|
+
Configuration,
|
|
569
|
+
SkillsApi,
|
|
570
|
+
} from '@knowledge-stack/ksapi';
|
|
571
|
+
import type { ExportSkillsOperationRequest } from '@knowledge-stack/ksapi';
|
|
572
|
+
|
|
573
|
+
async function example() {
|
|
574
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
575
|
+
const config = new Configuration({
|
|
576
|
+
// To configure API key authorization: cookieAuth
|
|
577
|
+
apiKey: "YOUR API KEY",
|
|
578
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
579
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
580
|
+
});
|
|
581
|
+
const api = new SkillsApi(config);
|
|
582
|
+
|
|
583
|
+
const body = {
|
|
584
|
+
// ExportSkillsRequest
|
|
585
|
+
exportSkillsRequest: ...,
|
|
586
|
+
} satisfies ExportSkillsOperationRequest;
|
|
587
|
+
|
|
588
|
+
try {
|
|
589
|
+
const data = await api.exportSkills(body);
|
|
590
|
+
console.log(data);
|
|
591
|
+
} catch (error) {
|
|
592
|
+
console.error(error);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
// Run the test
|
|
597
|
+
example().catch(console.error);
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
### Parameters
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
| Name | Type | Description | Notes |
|
|
604
|
+
|------------- | ------------- | ------------- | -------------|
|
|
605
|
+
| **exportSkillsRequest** | [ExportSkillsRequest](ExportSkillsRequest.md) | | |
|
|
606
|
+
|
|
607
|
+
### Return type
|
|
608
|
+
|
|
609
|
+
**Blob**
|
|
610
|
+
|
|
611
|
+
### Authorization
|
|
612
|
+
|
|
613
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
614
|
+
|
|
615
|
+
### HTTP request headers
|
|
616
|
+
|
|
617
|
+
- **Content-Type**: `application/json`
|
|
618
|
+
- **Accept**: `application/zip`, `application/json`
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
### HTTP response details
|
|
622
|
+
| Status code | Description | Response headers |
|
|
623
|
+
|-------------|-------------|------------------|
|
|
624
|
+
| **200** | One ZIP with a top-level folder per skill. | - |
|
|
625
|
+
| **422** | Validation Error | - |
|
|
626
|
+
| **0** | Error response. | - |
|
|
627
|
+
|
|
628
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
629
|
+
|
|
630
|
+
|
|
555
631
|
## getSkill
|
|
556
632
|
|
|
557
633
|
> SkillResponse getSkill(skillId, includeFileContents)
|
package/package.json
CHANGED
|
@@ -136,7 +136,7 @@ export interface ApiConnectionsApiInterface {
|
|
|
136
136
|
deleteApiConnectionRequestOpts(requestParameters: DeleteApiConnectionRequest): Promise<runtime.RequestOpts>;
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
|
-
* Move a connection to trash
|
|
139
|
+
* Move a connection to trash; requires ``can_delete``.
|
|
140
140
|
* @summary Delete Api Connection Handler
|
|
141
141
|
* @param {string} connectionId
|
|
142
142
|
* @param {*} [options] Override http request option.
|
|
@@ -146,7 +146,7 @@ export interface ApiConnectionsApiInterface {
|
|
|
146
146
|
deleteApiConnectionRaw(requestParameters: DeleteApiConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
|
-
* Move a connection to trash
|
|
149
|
+
* Move a connection to trash; requires ``can_delete``.
|
|
150
150
|
* Delete Api Connection Handler
|
|
151
151
|
*/
|
|
152
152
|
deleteApiConnection(requestParameters: DeleteApiConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
@@ -211,7 +211,7 @@ export interface ApiConnectionsApiInterface {
|
|
|
211
211
|
updateApiConnectionRequestOpts(requestParameters: UpdateApiConnectionOperationRequest): Promise<runtime.RequestOpts>;
|
|
212
212
|
|
|
213
213
|
/**
|
|
214
|
-
* Update a connection
|
|
214
|
+
* Update a connection; changing its egress envelope needs Admin/Owner.
|
|
215
215
|
* @summary Update Api Connection Handler
|
|
216
216
|
* @param {string} connectionId
|
|
217
217
|
* @param {UpdateApiConnectionRequest} updateApiConnectionRequest
|
|
@@ -222,7 +222,7 @@ export interface ApiConnectionsApiInterface {
|
|
|
222
222
|
updateApiConnectionRaw(requestParameters: UpdateApiConnectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiConnectionResponse>>;
|
|
223
223
|
|
|
224
224
|
/**
|
|
225
|
-
* Update a connection
|
|
225
|
+
* Update a connection; changing its egress envelope needs Admin/Owner.
|
|
226
226
|
* Update Api Connection Handler
|
|
227
227
|
*/
|
|
228
228
|
updateApiConnection(requestParameters: UpdateApiConnectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiConnectionResponse>;
|
|
@@ -392,7 +392,7 @@ export class ApiConnectionsApi extends runtime.BaseAPI implements ApiConnections
|
|
|
392
392
|
}
|
|
393
393
|
|
|
394
394
|
/**
|
|
395
|
-
* Move a connection to trash
|
|
395
|
+
* Move a connection to trash; requires ``can_delete``.
|
|
396
396
|
* Delete Api Connection Handler
|
|
397
397
|
*/
|
|
398
398
|
async deleteApiConnectionRaw(requestParameters: DeleteApiConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
@@ -403,7 +403,7 @@ export class ApiConnectionsApi extends runtime.BaseAPI implements ApiConnections
|
|
|
403
403
|
}
|
|
404
404
|
|
|
405
405
|
/**
|
|
406
|
-
* Move a connection to trash
|
|
406
|
+
* Move a connection to trash; requires ``can_delete``.
|
|
407
407
|
* Delete Api Connection Handler
|
|
408
408
|
*/
|
|
409
409
|
async deleteApiConnection(requestParameters: DeleteApiConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
@@ -576,7 +576,7 @@ export class ApiConnectionsApi extends runtime.BaseAPI implements ApiConnections
|
|
|
576
576
|
}
|
|
577
577
|
|
|
578
578
|
/**
|
|
579
|
-
* Update a connection
|
|
579
|
+
* Update a connection; changing its egress envelope needs Admin/Owner.
|
|
580
580
|
* Update Api Connection Handler
|
|
581
581
|
*/
|
|
582
582
|
async updateApiConnectionRaw(requestParameters: UpdateApiConnectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiConnectionResponse>> {
|
|
@@ -587,7 +587,7 @@ export class ApiConnectionsApi extends runtime.BaseAPI implements ApiConnections
|
|
|
587
587
|
}
|
|
588
588
|
|
|
589
589
|
/**
|
|
590
|
-
* Update a connection
|
|
590
|
+
* Update a connection; changing its egress envelope needs Admin/Owner.
|
|
591
591
|
* Update Api Connection Handler
|
|
592
592
|
*/
|
|
593
593
|
async updateApiConnection(requestParameters: UpdateApiConnectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiConnectionResponse> {
|
|
@@ -548,7 +548,7 @@ export interface DataSourcesApiInterface {
|
|
|
548
548
|
updateDataSourceRequestOpts(requestParameters: UpdateDataSourceOperationRequest): Promise<runtime.RequestOpts>;
|
|
549
549
|
|
|
550
550
|
/**
|
|
551
|
-
* Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move). Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
|
|
551
|
+
* Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
|
|
552
552
|
* @summary Update Data Source Handler
|
|
553
553
|
* @param {string} dataSourceId
|
|
554
554
|
* @param {UpdateDataSourceRequest} updateDataSourceRequest
|
|
@@ -559,7 +559,7 @@ export interface DataSourcesApiInterface {
|
|
|
559
559
|
updateDataSourceRaw(requestParameters: UpdateDataSourceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DataSourceResponse>>;
|
|
560
560
|
|
|
561
561
|
/**
|
|
562
|
-
* Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move). Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
|
|
562
|
+
* Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
|
|
563
563
|
* Update Data Source Handler
|
|
564
564
|
*/
|
|
565
565
|
updateDataSource(requestParameters: UpdateDataSourceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DataSourceResponse>;
|
|
@@ -1522,7 +1522,7 @@ export class DataSourcesApi extends runtime.BaseAPI implements DataSourcesApiInt
|
|
|
1522
1522
|
}
|
|
1523
1523
|
|
|
1524
1524
|
/**
|
|
1525
|
-
* Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move). Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
|
|
1525
|
+
* Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
|
|
1526
1526
|
* Update Data Source Handler
|
|
1527
1527
|
*/
|
|
1528
1528
|
async updateDataSourceRaw(requestParameters: UpdateDataSourceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DataSourceResponse>> {
|
|
@@ -1533,7 +1533,7 @@ export class DataSourcesApi extends runtime.BaseAPI implements DataSourcesApiInt
|
|
|
1533
1533
|
}
|
|
1534
1534
|
|
|
1535
1535
|
/**
|
|
1536
|
-
* Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move). Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
|
|
1536
|
+
* Rename, move, and/or re-credential a connector. Requires ``can_write`` on the connector (and on the destination folder for a move); supplying ``connection_config`` additionally requires OWNER/ADMIN. Fresh ``connection_config`` is re-validated against the DB before persisting (bad creds → 400, consistent with create); creds are never echoed back. ``engine`` is immutable.
|
|
1537
1537
|
* Update Data Source Handler
|
|
1538
1538
|
*/
|
|
1539
1539
|
async updateDataSource(requestParameters: UpdateDataSourceOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DataSourceResponse> {
|
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
|
*/
|