@knowledge-stack/ksapi 2.14.4 → 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/SkillsApi.d.ts +39 -1
- package/dist/apis/SkillsApi.js +49 -0
- 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/ExportSkillsRequest.md +35 -0
- package/docs/SkillsApi.md +76 -0
- package/package.json +1 -1
- package/src/apis/SkillsApi.ts +88 -0
- package/src/models/ExportSkillsRequest.ts +88 -0
- package/src/models/index.ts +1 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -158,6 +158,7 @@ docs/EnrichedThreadMessageContent.md
|
|
|
158
158
|
docs/ErrorResponse.md
|
|
159
159
|
docs/EventResponse.md
|
|
160
160
|
docs/ExcludedCommonFile.md
|
|
161
|
+
docs/ExportSkillsRequest.md
|
|
161
162
|
docs/ExtractRequest.md
|
|
162
163
|
docs/ExtractResponse.md
|
|
163
164
|
docs/FeaturesApi.md
|
|
@@ -622,6 +623,7 @@ src/models/EnrichedThreadMessageContent.ts
|
|
|
622
623
|
src/models/ErrorResponse.ts
|
|
623
624
|
src/models/EventResponse.ts
|
|
624
625
|
src/models/ExcludedCommonFile.ts
|
|
626
|
+
src/models/ExportSkillsRequest.ts
|
|
625
627
|
src/models/ExtractRequest.ts
|
|
626
628
|
src/models/ExtractResponse.ts
|
|
627
629
|
src/models/FeaturesResponse.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @knowledge-stack/ksapi@2.
|
|
1
|
+
# @knowledge-stack/ksapi@2.15.0
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the localhost API.
|
|
4
4
|
|
|
@@ -203,6 +203,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
203
203
|
*SkillsApi* | [**deleteSkill**](docs/SkillsApi.md#deleteskill) | **DELETE** /v1/skills/{skill_id} | Delete Skill Handler
|
|
204
204
|
*SkillsApi* | [**discardSkillDraft**](docs/SkillsApi.md#discardskilldraft) | **POST** /v1/skills/{skill_id}/discard-draft | Discard Skill Draft Handler
|
|
205
205
|
*SkillsApi* | [**exportSkill**](docs/SkillsApi.md#exportskill) | **GET** /v1/skills/{skill_id}/export | Export Skill Handler
|
|
206
|
+
*SkillsApi* | [**exportSkills**](docs/SkillsApi.md#exportskillsoperation) | **POST** /v1/skills/export | Export Skills Handler
|
|
206
207
|
*SkillsApi* | [**getSkill**](docs/SkillsApi.md#getskill) | **GET** /v1/skills/{skill_id} | Get Skill Handler
|
|
207
208
|
*SkillsApi* | [**importSkill**](docs/SkillsApi.md#importskill) | **POST** /v1/skills/import | Import Skill Handler
|
|
208
209
|
*SkillsApi* | [**listSkillVersions**](docs/SkillsApi.md#listskillversions) | **GET** /v1/skills/{skill_id}/versions | List Skill Versions Handler
|
|
@@ -443,6 +444,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
443
444
|
- [ErrorResponse](docs/ErrorResponse.md)
|
|
444
445
|
- [EventResponse](docs/EventResponse.md)
|
|
445
446
|
- [ExcludedCommonFile](docs/ExcludedCommonFile.md)
|
|
447
|
+
- [ExportSkillsRequest](docs/ExportSkillsRequest.md)
|
|
446
448
|
- [ExtractRequest](docs/ExtractRequest.md)
|
|
447
449
|
- [ExtractResponse](docs/ExtractResponse.md)
|
|
448
450
|
- [FeaturesResponse](docs/FeaturesResponse.md)
|
|
@@ -725,7 +727,7 @@ and is automatically generated by the
|
|
|
725
727
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
726
728
|
|
|
727
729
|
- API version: `0.1.0`
|
|
728
|
-
- Package version: `2.
|
|
730
|
+
- Package version: `2.15.0`
|
|
729
731
|
- Generator version: `7.21.0`
|
|
730
732
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
731
733
|
|
package/dist/apis/SkillsApi.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { ActivateSkillVersionRequest, CreateSkillRequest, PaginatedResponseSkillResponse, SearchSkillsRequest, SearchSkillsResponse, SkillOrder, SkillResponse, SkillVersionResponse, SortDirection, UpdateSkillRequest } from '../models/index';
|
|
13
|
+
import type { ActivateSkillVersionRequest, CreateSkillRequest, ExportSkillsRequest, PaginatedResponseSkillResponse, SearchSkillsRequest, SearchSkillsResponse, SkillOrder, SkillResponse, SkillVersionResponse, SortDirection, UpdateSkillRequest } from '../models/index';
|
|
14
14
|
export interface ActivateSkillVersionOperationRequest {
|
|
15
15
|
skillId: string;
|
|
16
16
|
versionId: string;
|
|
@@ -34,6 +34,9 @@ export interface DiscardSkillDraftRequest {
|
|
|
34
34
|
export interface ExportSkillRequest {
|
|
35
35
|
skillId: string;
|
|
36
36
|
}
|
|
37
|
+
export interface ExportSkillsOperationRequest {
|
|
38
|
+
exportSkillsRequest: ExportSkillsRequest;
|
|
39
|
+
}
|
|
37
40
|
export interface GetSkillRequest {
|
|
38
41
|
skillId: string;
|
|
39
42
|
includeFileContents?: boolean;
|
|
@@ -219,6 +222,27 @@ export interface SkillsApiInterface {
|
|
|
219
222
|
* Export Skill Handler
|
|
220
223
|
*/
|
|
221
224
|
exportSkill(requestParameters: ExportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<any>;
|
|
225
|
+
/**
|
|
226
|
+
* Creates request options for exportSkills without sending the request
|
|
227
|
+
* @param {ExportSkillsRequest} exportSkillsRequest
|
|
228
|
+
* @throws {RequiredError}
|
|
229
|
+
* @memberof SkillsApiInterface
|
|
230
|
+
*/
|
|
231
|
+
exportSkillsRequestOpts(requestParameters: ExportSkillsOperationRequest): Promise<runtime.RequestOpts>;
|
|
232
|
+
/**
|
|
233
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
234
|
+
* @summary Export Skills Handler
|
|
235
|
+
* @param {ExportSkillsRequest} exportSkillsRequest
|
|
236
|
+
* @param {*} [options] Override http request option.
|
|
237
|
+
* @throws {RequiredError}
|
|
238
|
+
* @memberof SkillsApiInterface
|
|
239
|
+
*/
|
|
240
|
+
exportSkillsRaw(requestParameters: ExportSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
|
|
241
|
+
/**
|
|
242
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
243
|
+
* Export Skills Handler
|
|
244
|
+
*/
|
|
245
|
+
exportSkills(requestParameters: ExportSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
|
|
222
246
|
/**
|
|
223
247
|
* Creates request options for getSkill without sending the request
|
|
224
248
|
* @param {string} skillId
|
|
@@ -481,6 +505,20 @@ export declare class SkillsApi extends runtime.BaseAPI implements SkillsApiInter
|
|
|
481
505
|
* Export Skill Handler
|
|
482
506
|
*/
|
|
483
507
|
exportSkill(requestParameters: ExportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<any>;
|
|
508
|
+
/**
|
|
509
|
+
* Creates request options for exportSkills without sending the request
|
|
510
|
+
*/
|
|
511
|
+
exportSkillsRequestOpts(requestParameters: ExportSkillsOperationRequest): Promise<runtime.RequestOpts>;
|
|
512
|
+
/**
|
|
513
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
514
|
+
* Export Skills Handler
|
|
515
|
+
*/
|
|
516
|
+
exportSkillsRaw(requestParameters: ExportSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
|
|
517
|
+
/**
|
|
518
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
519
|
+
* Export Skills Handler
|
|
520
|
+
*/
|
|
521
|
+
exportSkills(requestParameters: ExportSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
|
|
484
522
|
/**
|
|
485
523
|
* Creates request options for getSkill without sending the request
|
|
486
524
|
*/
|
package/dist/apis/SkillsApi.js
CHANGED
|
@@ -411,6 +411,55 @@ class SkillsApi extends runtime.BaseAPI {
|
|
|
411
411
|
return yield response.value();
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
|
+
/**
|
|
415
|
+
* Creates request options for exportSkills without sending the request
|
|
416
|
+
*/
|
|
417
|
+
exportSkillsRequestOpts(requestParameters) {
|
|
418
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
419
|
+
if (requestParameters['exportSkillsRequest'] == null) {
|
|
420
|
+
throw new runtime.RequiredError('exportSkillsRequest', 'Required parameter "exportSkillsRequest" was null or undefined when calling exportSkills().');
|
|
421
|
+
}
|
|
422
|
+
const queryParameters = {};
|
|
423
|
+
const headerParameters = {};
|
|
424
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
425
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
426
|
+
const token = this.configuration.accessToken;
|
|
427
|
+
const tokenString = yield token("bearerAuth", []);
|
|
428
|
+
if (tokenString) {
|
|
429
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
let urlPath = `/v1/skills/export`;
|
|
433
|
+
return {
|
|
434
|
+
path: urlPath,
|
|
435
|
+
method: 'POST',
|
|
436
|
+
headers: headerParameters,
|
|
437
|
+
query: queryParameters,
|
|
438
|
+
body: (0, index_1.ExportSkillsRequestToJSON)(requestParameters['exportSkillsRequest']),
|
|
439
|
+
};
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
444
|
+
* Export Skills Handler
|
|
445
|
+
*/
|
|
446
|
+
exportSkillsRaw(requestParameters, initOverrides) {
|
|
447
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
448
|
+
const requestOptions = yield this.exportSkillsRequestOpts(requestParameters);
|
|
449
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
450
|
+
return new runtime.BlobApiResponse(response);
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
455
|
+
* Export Skills Handler
|
|
456
|
+
*/
|
|
457
|
+
exportSkills(requestParameters, initOverrides) {
|
|
458
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
459
|
+
const response = yield this.exportSkillsRaw(requestParameters, initOverrides);
|
|
460
|
+
return yield response.value();
|
|
461
|
+
});
|
|
462
|
+
}
|
|
414
463
|
/**
|
|
415
464
|
* Creates request options for getSkill without sending the request
|
|
416
465
|
*/
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { ActivateSkillVersionRequest, CreateSkillRequest, PaginatedResponseSkillResponse, SearchSkillsRequest, SearchSkillsResponse, SkillOrder, SkillResponse, SkillVersionResponse, SortDirection, UpdateSkillRequest } from '../models/index';
|
|
13
|
+
import type { ActivateSkillVersionRequest, CreateSkillRequest, ExportSkillsRequest, PaginatedResponseSkillResponse, SearchSkillsRequest, SearchSkillsResponse, SkillOrder, SkillResponse, SkillVersionResponse, SortDirection, UpdateSkillRequest } from '../models/index';
|
|
14
14
|
export interface ActivateSkillVersionOperationRequest {
|
|
15
15
|
skillId: string;
|
|
16
16
|
versionId: string;
|
|
@@ -34,6 +34,9 @@ export interface DiscardSkillDraftRequest {
|
|
|
34
34
|
export interface ExportSkillRequest {
|
|
35
35
|
skillId: string;
|
|
36
36
|
}
|
|
37
|
+
export interface ExportSkillsOperationRequest {
|
|
38
|
+
exportSkillsRequest: ExportSkillsRequest;
|
|
39
|
+
}
|
|
37
40
|
export interface GetSkillRequest {
|
|
38
41
|
skillId: string;
|
|
39
42
|
includeFileContents?: boolean;
|
|
@@ -219,6 +222,27 @@ export interface SkillsApiInterface {
|
|
|
219
222
|
* Export Skill Handler
|
|
220
223
|
*/
|
|
221
224
|
exportSkill(requestParameters: ExportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<any>;
|
|
225
|
+
/**
|
|
226
|
+
* Creates request options for exportSkills without sending the request
|
|
227
|
+
* @param {ExportSkillsRequest} exportSkillsRequest
|
|
228
|
+
* @throws {RequiredError}
|
|
229
|
+
* @memberof SkillsApiInterface
|
|
230
|
+
*/
|
|
231
|
+
exportSkillsRequestOpts(requestParameters: ExportSkillsOperationRequest): Promise<runtime.RequestOpts>;
|
|
232
|
+
/**
|
|
233
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
234
|
+
* @summary Export Skills Handler
|
|
235
|
+
* @param {ExportSkillsRequest} exportSkillsRequest
|
|
236
|
+
* @param {*} [options] Override http request option.
|
|
237
|
+
* @throws {RequiredError}
|
|
238
|
+
* @memberof SkillsApiInterface
|
|
239
|
+
*/
|
|
240
|
+
exportSkillsRaw(requestParameters: ExportSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
|
|
241
|
+
/**
|
|
242
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
243
|
+
* Export Skills Handler
|
|
244
|
+
*/
|
|
245
|
+
exportSkills(requestParameters: ExportSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
|
|
222
246
|
/**
|
|
223
247
|
* Creates request options for getSkill without sending the request
|
|
224
248
|
* @param {string} skillId
|
|
@@ -481,6 +505,20 @@ export declare class SkillsApi extends runtime.BaseAPI implements SkillsApiInter
|
|
|
481
505
|
* Export Skill Handler
|
|
482
506
|
*/
|
|
483
507
|
exportSkill(requestParameters: ExportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<any>;
|
|
508
|
+
/**
|
|
509
|
+
* Creates request options for exportSkills without sending the request
|
|
510
|
+
*/
|
|
511
|
+
exportSkillsRequestOpts(requestParameters: ExportSkillsOperationRequest): Promise<runtime.RequestOpts>;
|
|
512
|
+
/**
|
|
513
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
514
|
+
* Export Skills Handler
|
|
515
|
+
*/
|
|
516
|
+
exportSkillsRaw(requestParameters: ExportSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
|
|
517
|
+
/**
|
|
518
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
519
|
+
* Export Skills Handler
|
|
520
|
+
*/
|
|
521
|
+
exportSkills(requestParameters: ExportSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
|
|
484
522
|
/**
|
|
485
523
|
* Creates request options for getSkill without sending the request
|
|
486
524
|
*/
|
|
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
import * as runtime from '../runtime';
|
|
24
|
-
import { ActivateSkillVersionRequestToJSON, CreateSkillRequestToJSON, PaginatedResponseSkillResponseFromJSON, SearchSkillsRequestToJSON, SearchSkillsResponseFromJSON, SkillResponseFromJSON, SkillVersionResponseFromJSON, UpdateSkillRequestToJSON, } from '../models/index';
|
|
24
|
+
import { ActivateSkillVersionRequestToJSON, CreateSkillRequestToJSON, ExportSkillsRequestToJSON, PaginatedResponseSkillResponseFromJSON, SearchSkillsRequestToJSON, SearchSkillsResponseFromJSON, SkillResponseFromJSON, SkillVersionResponseFromJSON, UpdateSkillRequestToJSON, } from '../models/index';
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
@@ -375,6 +375,55 @@ export class SkillsApi extends runtime.BaseAPI {
|
|
|
375
375
|
return yield response.value();
|
|
376
376
|
});
|
|
377
377
|
}
|
|
378
|
+
/**
|
|
379
|
+
* Creates request options for exportSkills without sending the request
|
|
380
|
+
*/
|
|
381
|
+
exportSkillsRequestOpts(requestParameters) {
|
|
382
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
383
|
+
if (requestParameters['exportSkillsRequest'] == null) {
|
|
384
|
+
throw new runtime.RequiredError('exportSkillsRequest', 'Required parameter "exportSkillsRequest" was null or undefined when calling exportSkills().');
|
|
385
|
+
}
|
|
386
|
+
const queryParameters = {};
|
|
387
|
+
const headerParameters = {};
|
|
388
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
389
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
390
|
+
const token = this.configuration.accessToken;
|
|
391
|
+
const tokenString = yield token("bearerAuth", []);
|
|
392
|
+
if (tokenString) {
|
|
393
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
let urlPath = `/v1/skills/export`;
|
|
397
|
+
return {
|
|
398
|
+
path: urlPath,
|
|
399
|
+
method: 'POST',
|
|
400
|
+
headers: headerParameters,
|
|
401
|
+
query: queryParameters,
|
|
402
|
+
body: ExportSkillsRequestToJSON(requestParameters['exportSkillsRequest']),
|
|
403
|
+
};
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
408
|
+
* Export Skills Handler
|
|
409
|
+
*/
|
|
410
|
+
exportSkillsRaw(requestParameters, initOverrides) {
|
|
411
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
412
|
+
const requestOptions = yield this.exportSkillsRequestOpts(requestParameters);
|
|
413
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
414
|
+
return new runtime.BlobApiResponse(response);
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Download several skills\' active versions as one ZIP; needs can_read on each.
|
|
419
|
+
* Export Skills Handler
|
|
420
|
+
*/
|
|
421
|
+
exportSkills(requestParameters, initOverrides) {
|
|
422
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
423
|
+
const response = yield this.exportSkillsRaw(requestParameters, initOverrides);
|
|
424
|
+
return yield response.value();
|
|
425
|
+
});
|
|
426
|
+
}
|
|
378
427
|
/**
|
|
379
428
|
* Creates request options for getSkill without sending the request
|
|
380
429
|
*/
|
|
@@ -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);
|
|
@@ -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
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';
|