@knowledge-stack/ksapi 1.159.1 → 1.160.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +2 -0
- package/README.md +3 -2
- package/dist/apis/WorkflowDefinitionsApi.d.ts +9 -0
- package/dist/apis/WorkflowDefinitionsApi.js +9 -0
- package/dist/esm/apis/WorkflowDefinitionsApi.d.ts +9 -0
- package/dist/esm/apis/WorkflowDefinitionsApi.js +9 -0
- package/dist/esm/models/LastRunSummary.d.ts +89 -0
- package/dist/esm/models/LastRunSummary.js +64 -0
- package/dist/esm/models/UploadConstraints.d.ts +0 -6
- package/dist/esm/models/UploadConstraints.js +0 -4
- package/dist/esm/models/WorkflowDefinitionOrder.d.ts +2 -1
- package/dist/esm/models/WorkflowDefinitionOrder.js +3 -2
- package/dist/esm/models/WorkflowDefinitionResponse.d.ts +13 -0
- package/dist/esm/models/WorkflowDefinitionResponse.js +5 -0
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.js +1 -0
- package/dist/models/LastRunSummary.d.ts +89 -0
- package/dist/models/LastRunSummary.js +72 -0
- package/dist/models/UploadConstraints.d.ts +0 -6
- package/dist/models/UploadConstraints.js +0 -4
- package/dist/models/WorkflowDefinitionOrder.d.ts +2 -1
- package/dist/models/WorkflowDefinitionOrder.js +3 -2
- package/dist/models/WorkflowDefinitionResponse.d.ts +13 -0
- package/dist/models/WorkflowDefinitionResponse.js +5 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/docs/FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.md +4 -0
- package/docs/LastRunSummary.md +47 -0
- package/docs/UploadConstraints.md +0 -2
- package/docs/WorkflowDefinitionOrder.md +1 -1
- package/docs/WorkflowDefinitionResponse.md +4 -0
- package/docs/WorkflowDefinitionsApi.md +11 -2
- package/package.json +1 -1
- package/src/apis/WorkflowDefinitionsApi.ts +21 -0
- package/src/models/LastRunSummary.ts +155 -0
- package/src/models/UploadConstraints.ts +0 -9
- package/src/models/WorkflowDefinitionOrder.ts +3 -2
- package/src/models/WorkflowDefinitionResponse.ts +23 -0
- package/src/models/index.ts +1 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -197,6 +197,7 @@ docs/KbMetric.md
|
|
|
197
197
|
docs/KbSummaryResponse.md
|
|
198
198
|
docs/KbTimeseriesResponse.md
|
|
199
199
|
docs/LabeledSeries.md
|
|
200
|
+
docs/LastRunSummary.md
|
|
200
201
|
docs/LeaderboardEntry.md
|
|
201
202
|
docs/LineageEdgeResponse.md
|
|
202
203
|
docs/LineageGraphResponse.md
|
|
@@ -641,6 +642,7 @@ src/models/KbMetric.ts
|
|
|
641
642
|
src/models/KbSummaryResponse.ts
|
|
642
643
|
src/models/KbTimeseriesResponse.ts
|
|
643
644
|
src/models/LabeledSeries.ts
|
|
645
|
+
src/models/LastRunSummary.ts
|
|
644
646
|
src/models/LeaderboardEntry.ts
|
|
645
647
|
src/models/LineageEdgeResponse.ts
|
|
646
648
|
src/models/LineageGraphResponse.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @knowledge-stack/ksapi@1.
|
|
1
|
+
# @knowledge-stack/ksapi@1.160.1
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the localhost API.
|
|
4
4
|
|
|
@@ -476,6 +476,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
476
476
|
- [KbSummaryResponse](docs/KbSummaryResponse.md)
|
|
477
477
|
- [KbTimeseriesResponse](docs/KbTimeseriesResponse.md)
|
|
478
478
|
- [LabeledSeries](docs/LabeledSeries.md)
|
|
479
|
+
- [LastRunSummary](docs/LastRunSummary.md)
|
|
479
480
|
- [LeaderboardEntry](docs/LeaderboardEntry.md)
|
|
480
481
|
- [LineageEdgeResponse](docs/LineageEdgeResponse.md)
|
|
481
482
|
- [LineageGraphResponse](docs/LineageGraphResponse.md)
|
|
@@ -709,7 +710,7 @@ and is automatically generated by the
|
|
|
709
710
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
710
711
|
|
|
711
712
|
- API version: `0.1.0`
|
|
712
|
-
- Package version: `1.
|
|
713
|
+
- Package version: `1.160.1`
|
|
713
714
|
- Generator version: `7.21.0`
|
|
714
715
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
715
716
|
|
|
@@ -36,6 +36,7 @@ export interface InstantiateWorkflowTemplateOperationRequest {
|
|
|
36
36
|
}
|
|
37
37
|
export interface ListWorkflowDefinitionsRequest {
|
|
38
38
|
mine?: boolean;
|
|
39
|
+
search?: string | null;
|
|
39
40
|
sortBy?: WorkflowDefinitionOrder;
|
|
40
41
|
sortDir?: SortDirection;
|
|
41
42
|
isTemplate?: boolean;
|
|
@@ -45,6 +46,8 @@ export interface ListWorkflowDefinitionsRequest {
|
|
|
45
46
|
createdBefore?: Date | null;
|
|
46
47
|
updatedAfter?: Date | null;
|
|
47
48
|
updatedBefore?: Date | null;
|
|
49
|
+
includeTagIds?: Array<string> | null;
|
|
50
|
+
excludeTagIds?: Array<string> | null;
|
|
48
51
|
}
|
|
49
52
|
export interface ListWorkflowRunsRequest {
|
|
50
53
|
definitionId: string;
|
|
@@ -188,6 +191,7 @@ export interface WorkflowDefinitionsApiInterface {
|
|
|
188
191
|
/**
|
|
189
192
|
* Creates request options for listWorkflowDefinitions without sending the request
|
|
190
193
|
* @param {boolean} [mine] Only definitions the caller created (owner).
|
|
194
|
+
* @param {string} [search] Case-insensitive substring over name and description.
|
|
191
195
|
* @param {WorkflowDefinitionOrder} [sortBy] Field to sort definitions by (default: CREATED_AT)
|
|
192
196
|
* @param {SortDirection} [sortDir] Sort direction; overrides the field\'s natural default
|
|
193
197
|
* @param {boolean} [isTemplate]
|
|
@@ -197,6 +201,8 @@ export interface WorkflowDefinitionsApiInterface {
|
|
|
197
201
|
* @param {Date} [createdBefore] Only items created strictly before this timestamp
|
|
198
202
|
* @param {Date} [updatedAfter] Only items updated at or after this timestamp (inclusive)
|
|
199
203
|
* @param {Date} [updatedBefore] Only items updated strictly before this timestamp
|
|
204
|
+
* @param {Array<string>} [includeTagIds] Keep only items that carry at least one of these tags on the item itself or any ancestor folder (repeatable, OR / tag inheritance).
|
|
205
|
+
* @param {Array<string>} [excludeTagIds] Drop items that carry any of these tags on the item itself or any ancestor folder (repeatable). Takes precedence over include_tag_ids.
|
|
200
206
|
* @throws {RequiredError}
|
|
201
207
|
* @memberof WorkflowDefinitionsApiInterface
|
|
202
208
|
*/
|
|
@@ -205,6 +211,7 @@ export interface WorkflowDefinitionsApiInterface {
|
|
|
205
211
|
*
|
|
206
212
|
* @summary List Workflow Definitions Handler
|
|
207
213
|
* @param {boolean} [mine] Only definitions the caller created (owner).
|
|
214
|
+
* @param {string} [search] Case-insensitive substring over name and description.
|
|
208
215
|
* @param {WorkflowDefinitionOrder} [sortBy] Field to sort definitions by (default: CREATED_AT)
|
|
209
216
|
* @param {SortDirection} [sortDir] Sort direction; overrides the field\'s natural default
|
|
210
217
|
* @param {boolean} [isTemplate]
|
|
@@ -214,6 +221,8 @@ export interface WorkflowDefinitionsApiInterface {
|
|
|
214
221
|
* @param {Date} [createdBefore] Only items created strictly before this timestamp
|
|
215
222
|
* @param {Date} [updatedAfter] Only items updated at or after this timestamp (inclusive)
|
|
216
223
|
* @param {Date} [updatedBefore] Only items updated strictly before this timestamp
|
|
224
|
+
* @param {Array<string>} [includeTagIds] Keep only items that carry at least one of these tags on the item itself or any ancestor folder (repeatable, OR / tag inheritance).
|
|
225
|
+
* @param {Array<string>} [excludeTagIds] Drop items that carry any of these tags on the item itself or any ancestor folder (repeatable). Takes precedence over include_tag_ids.
|
|
217
226
|
* @param {*} [options] Override http request option.
|
|
218
227
|
* @throws {RequiredError}
|
|
219
228
|
* @memberof WorkflowDefinitionsApiInterface
|
|
@@ -347,6 +347,9 @@ class WorkflowDefinitionsApi extends runtime.BaseAPI {
|
|
|
347
347
|
if (requestParameters['mine'] != null) {
|
|
348
348
|
queryParameters['mine'] = requestParameters['mine'];
|
|
349
349
|
}
|
|
350
|
+
if (requestParameters['search'] != null) {
|
|
351
|
+
queryParameters['search'] = requestParameters['search'];
|
|
352
|
+
}
|
|
350
353
|
if (requestParameters['sortBy'] != null) {
|
|
351
354
|
queryParameters['sort_by'] = requestParameters['sortBy'];
|
|
352
355
|
}
|
|
@@ -374,6 +377,12 @@ class WorkflowDefinitionsApi extends runtime.BaseAPI {
|
|
|
374
377
|
if (requestParameters['updatedBefore'] != null) {
|
|
375
378
|
queryParameters['updated_before'] = requestParameters['updatedBefore'].toISOString();
|
|
376
379
|
}
|
|
380
|
+
if (requestParameters['includeTagIds'] != null) {
|
|
381
|
+
queryParameters['include_tag_ids'] = requestParameters['includeTagIds'];
|
|
382
|
+
}
|
|
383
|
+
if (requestParameters['excludeTagIds'] != null) {
|
|
384
|
+
queryParameters['exclude_tag_ids'] = requestParameters['excludeTagIds'];
|
|
385
|
+
}
|
|
377
386
|
const headerParameters = {};
|
|
378
387
|
if (this.configuration && this.configuration.accessToken) {
|
|
379
388
|
const token = this.configuration.accessToken;
|
|
@@ -36,6 +36,7 @@ export interface InstantiateWorkflowTemplateOperationRequest {
|
|
|
36
36
|
}
|
|
37
37
|
export interface ListWorkflowDefinitionsRequest {
|
|
38
38
|
mine?: boolean;
|
|
39
|
+
search?: string | null;
|
|
39
40
|
sortBy?: WorkflowDefinitionOrder;
|
|
40
41
|
sortDir?: SortDirection;
|
|
41
42
|
isTemplate?: boolean;
|
|
@@ -45,6 +46,8 @@ export interface ListWorkflowDefinitionsRequest {
|
|
|
45
46
|
createdBefore?: Date | null;
|
|
46
47
|
updatedAfter?: Date | null;
|
|
47
48
|
updatedBefore?: Date | null;
|
|
49
|
+
includeTagIds?: Array<string> | null;
|
|
50
|
+
excludeTagIds?: Array<string> | null;
|
|
48
51
|
}
|
|
49
52
|
export interface ListWorkflowRunsRequest {
|
|
50
53
|
definitionId: string;
|
|
@@ -188,6 +191,7 @@ export interface WorkflowDefinitionsApiInterface {
|
|
|
188
191
|
/**
|
|
189
192
|
* Creates request options for listWorkflowDefinitions without sending the request
|
|
190
193
|
* @param {boolean} [mine] Only definitions the caller created (owner).
|
|
194
|
+
* @param {string} [search] Case-insensitive substring over name and description.
|
|
191
195
|
* @param {WorkflowDefinitionOrder} [sortBy] Field to sort definitions by (default: CREATED_AT)
|
|
192
196
|
* @param {SortDirection} [sortDir] Sort direction; overrides the field\'s natural default
|
|
193
197
|
* @param {boolean} [isTemplate]
|
|
@@ -197,6 +201,8 @@ export interface WorkflowDefinitionsApiInterface {
|
|
|
197
201
|
* @param {Date} [createdBefore] Only items created strictly before this timestamp
|
|
198
202
|
* @param {Date} [updatedAfter] Only items updated at or after this timestamp (inclusive)
|
|
199
203
|
* @param {Date} [updatedBefore] Only items updated strictly before this timestamp
|
|
204
|
+
* @param {Array<string>} [includeTagIds] Keep only items that carry at least one of these tags on the item itself or any ancestor folder (repeatable, OR / tag inheritance).
|
|
205
|
+
* @param {Array<string>} [excludeTagIds] Drop items that carry any of these tags on the item itself or any ancestor folder (repeatable). Takes precedence over include_tag_ids.
|
|
200
206
|
* @throws {RequiredError}
|
|
201
207
|
* @memberof WorkflowDefinitionsApiInterface
|
|
202
208
|
*/
|
|
@@ -205,6 +211,7 @@ export interface WorkflowDefinitionsApiInterface {
|
|
|
205
211
|
*
|
|
206
212
|
* @summary List Workflow Definitions Handler
|
|
207
213
|
* @param {boolean} [mine] Only definitions the caller created (owner).
|
|
214
|
+
* @param {string} [search] Case-insensitive substring over name and description.
|
|
208
215
|
* @param {WorkflowDefinitionOrder} [sortBy] Field to sort definitions by (default: CREATED_AT)
|
|
209
216
|
* @param {SortDirection} [sortDir] Sort direction; overrides the field\'s natural default
|
|
210
217
|
* @param {boolean} [isTemplate]
|
|
@@ -214,6 +221,8 @@ export interface WorkflowDefinitionsApiInterface {
|
|
|
214
221
|
* @param {Date} [createdBefore] Only items created strictly before this timestamp
|
|
215
222
|
* @param {Date} [updatedAfter] Only items updated at or after this timestamp (inclusive)
|
|
216
223
|
* @param {Date} [updatedBefore] Only items updated strictly before this timestamp
|
|
224
|
+
* @param {Array<string>} [includeTagIds] Keep only items that carry at least one of these tags on the item itself or any ancestor folder (repeatable, OR / tag inheritance).
|
|
225
|
+
* @param {Array<string>} [excludeTagIds] Drop items that carry any of these tags on the item itself or any ancestor folder (repeatable). Takes precedence over include_tag_ids.
|
|
217
226
|
* @param {*} [options] Override http request option.
|
|
218
227
|
* @throws {RequiredError}
|
|
219
228
|
* @memberof WorkflowDefinitionsApiInterface
|
|
@@ -311,6 +311,9 @@ export class WorkflowDefinitionsApi extends runtime.BaseAPI {
|
|
|
311
311
|
if (requestParameters['mine'] != null) {
|
|
312
312
|
queryParameters['mine'] = requestParameters['mine'];
|
|
313
313
|
}
|
|
314
|
+
if (requestParameters['search'] != null) {
|
|
315
|
+
queryParameters['search'] = requestParameters['search'];
|
|
316
|
+
}
|
|
314
317
|
if (requestParameters['sortBy'] != null) {
|
|
315
318
|
queryParameters['sort_by'] = requestParameters['sortBy'];
|
|
316
319
|
}
|
|
@@ -338,6 +341,12 @@ export class WorkflowDefinitionsApi extends runtime.BaseAPI {
|
|
|
338
341
|
if (requestParameters['updatedBefore'] != null) {
|
|
339
342
|
queryParameters['updated_before'] = requestParameters['updatedBefore'].toISOString();
|
|
340
343
|
}
|
|
344
|
+
if (requestParameters['includeTagIds'] != null) {
|
|
345
|
+
queryParameters['include_tag_ids'] = requestParameters['includeTagIds'];
|
|
346
|
+
}
|
|
347
|
+
if (requestParameters['excludeTagIds'] != null) {
|
|
348
|
+
queryParameters['exclude_tag_ids'] = requestParameters['excludeTagIds'];
|
|
349
|
+
}
|
|
341
350
|
const headerParameters = {};
|
|
342
351
|
if (this.configuration && this.configuration.accessToken) {
|
|
343
352
|
const token = this.configuration.accessToken;
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
import type { WorkflowExecutionState } from './WorkflowExecutionState';
|
|
13
|
+
import type { PathPartApprovalState } from './PathPartApprovalState';
|
|
14
|
+
/**
|
|
15
|
+
* The definition's most recent run — a compact projection for list rows.
|
|
16
|
+
*
|
|
17
|
+
* ``approval_state`` is the run folder's own approval state (execution and
|
|
18
|
+
* approval are separate axes). Named to avoid colliding with the unrelated
|
|
19
|
+
* ``last_run_timestamp`` document-ingestion concept.
|
|
20
|
+
* @export
|
|
21
|
+
* @interface LastRunSummary
|
|
22
|
+
*/
|
|
23
|
+
export interface LastRunSummary {
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof LastRunSummary
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {WorkflowExecutionState}
|
|
33
|
+
* @memberof LastRunSummary
|
|
34
|
+
*/
|
|
35
|
+
executionState: WorkflowExecutionState;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {PathPartApprovalState}
|
|
39
|
+
* @memberof LastRunSummary
|
|
40
|
+
*/
|
|
41
|
+
approvalState: PathPartApprovalState;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {Date}
|
|
45
|
+
* @memberof LastRunSummary
|
|
46
|
+
*/
|
|
47
|
+
createdAt: Date;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @type {Date}
|
|
51
|
+
* @memberof LastRunSummary
|
|
52
|
+
*/
|
|
53
|
+
startedAt?: Date | null;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {Date}
|
|
57
|
+
* @memberof LastRunSummary
|
|
58
|
+
*/
|
|
59
|
+
completedAt?: Date | null;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @type {string}
|
|
63
|
+
* @memberof LastRunSummary
|
|
64
|
+
*/
|
|
65
|
+
error?: string | null;
|
|
66
|
+
}
|
|
67
|
+
export declare const LastRunSummaryPropertyValidationAttributesMap: {
|
|
68
|
+
[property: string]: {
|
|
69
|
+
maxLength?: number;
|
|
70
|
+
minLength?: number;
|
|
71
|
+
pattern?: string;
|
|
72
|
+
maximum?: number;
|
|
73
|
+
exclusiveMaximum?: boolean;
|
|
74
|
+
minimum?: number;
|
|
75
|
+
exclusiveMinimum?: boolean;
|
|
76
|
+
multipleOf?: number;
|
|
77
|
+
maxItems?: number;
|
|
78
|
+
minItems?: number;
|
|
79
|
+
uniqueItems?: boolean;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Check if a given object implements the LastRunSummary interface.
|
|
84
|
+
*/
|
|
85
|
+
export declare function instanceOfLastRunSummary(value: object): value is LastRunSummary;
|
|
86
|
+
export declare function LastRunSummaryFromJSON(json: any): LastRunSummary;
|
|
87
|
+
export declare function LastRunSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): LastRunSummary;
|
|
88
|
+
export declare function LastRunSummaryToJSON(json: any): LastRunSummary;
|
|
89
|
+
export declare function LastRunSummaryToJSONTyped(value?: LastRunSummary | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
import { WorkflowExecutionStateFromJSON, WorkflowExecutionStateToJSON, } from './WorkflowExecutionState';
|
|
15
|
+
import { PathPartApprovalStateFromJSON, PathPartApprovalStateToJSON, } from './PathPartApprovalState';
|
|
16
|
+
export const LastRunSummaryPropertyValidationAttributesMap = {};
|
|
17
|
+
/**
|
|
18
|
+
* Check if a given object implements the LastRunSummary interface.
|
|
19
|
+
*/
|
|
20
|
+
export function instanceOfLastRunSummary(value) {
|
|
21
|
+
if (!('id' in value) || value['id'] === undefined)
|
|
22
|
+
return false;
|
|
23
|
+
if (!('executionState' in value) || value['executionState'] === undefined)
|
|
24
|
+
return false;
|
|
25
|
+
if (!('approvalState' in value) || value['approvalState'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
export function LastRunSummaryFromJSON(json) {
|
|
32
|
+
return LastRunSummaryFromJSONTyped(json, false);
|
|
33
|
+
}
|
|
34
|
+
export function LastRunSummaryFromJSONTyped(json, ignoreDiscriminator) {
|
|
35
|
+
if (json == null) {
|
|
36
|
+
return json;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
'id': json['id'],
|
|
40
|
+
'executionState': WorkflowExecutionStateFromJSON(json['execution_state']),
|
|
41
|
+
'approvalState': PathPartApprovalStateFromJSON(json['approval_state']),
|
|
42
|
+
'createdAt': (new Date(json['created_at'])),
|
|
43
|
+
'startedAt': json['started_at'] == null ? undefined : (new Date(json['started_at'])),
|
|
44
|
+
'completedAt': json['completed_at'] == null ? undefined : (new Date(json['completed_at'])),
|
|
45
|
+
'error': json['error'] == null ? undefined : json['error'],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function LastRunSummaryToJSON(json) {
|
|
49
|
+
return LastRunSummaryToJSONTyped(json, false);
|
|
50
|
+
}
|
|
51
|
+
export function LastRunSummaryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
52
|
+
if (value == null) {
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
'id': value['id'],
|
|
57
|
+
'execution_state': WorkflowExecutionStateToJSON(value['executionState']),
|
|
58
|
+
'approval_state': PathPartApprovalStateToJSON(value['approvalState']),
|
|
59
|
+
'created_at': value['createdAt'].toISOString(),
|
|
60
|
+
'started_at': value['startedAt'] == null ? value['startedAt'] : value['startedAt'].toISOString(),
|
|
61
|
+
'completed_at': value['completedAt'] == null ? value['completedAt'] : value['completedAt'].toISOString(),
|
|
62
|
+
'error': value['error'],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -25,8 +25,6 @@ export function instanceOfUploadConstraints(value) {
|
|
|
25
25
|
return false;
|
|
26
26
|
if (!('maxMediaBytes' in value) || value['maxMediaBytes'] === undefined)
|
|
27
27
|
return false;
|
|
28
|
-
if (!('maxVideoBytes' in value) || value['maxVideoBytes'] === undefined)
|
|
29
|
-
return false;
|
|
30
28
|
if (!('maxMediaDurationMs' in value) || value['maxMediaDurationMs'] === undefined)
|
|
31
29
|
return false;
|
|
32
30
|
if (!('resumablePartSize' in value) || value['resumablePartSize'] === undefined)
|
|
@@ -45,7 +43,6 @@ export function UploadConstraintsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
45
43
|
'maxBytes': json['max_bytes'],
|
|
46
44
|
'maxImageBytes': json['max_image_bytes'],
|
|
47
45
|
'maxMediaBytes': json['max_media_bytes'],
|
|
48
|
-
'maxVideoBytes': json['max_video_bytes'],
|
|
49
46
|
'maxMediaDurationMs': json['max_media_duration_ms'],
|
|
50
47
|
'resumablePartSize': json['resumable_part_size'],
|
|
51
48
|
};
|
|
@@ -62,7 +59,6 @@ export function UploadConstraintsToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
62
59
|
'max_bytes': value['maxBytes'],
|
|
63
60
|
'max_image_bytes': value['maxImageBytes'],
|
|
64
61
|
'max_media_bytes': value['maxMediaBytes'],
|
|
65
|
-
'max_video_bytes': value['maxVideoBytes'],
|
|
66
62
|
'max_media_duration_ms': value['maxMediaDurationMs'],
|
|
67
63
|
'resumable_part_size': value['resumablePartSize'],
|
|
68
64
|
};
|
|
@@ -10,12 +10,13 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
-
* Sortable fields for workflow-definition listings
|
|
13
|
+
* Sortable fields for workflow-definition listings.
|
|
14
14
|
* @export
|
|
15
15
|
*/
|
|
16
16
|
export declare const WorkflowDefinitionOrder: {
|
|
17
17
|
readonly CreatedAt: 'CREATED_AT';
|
|
18
18
|
readonly UpdatedAt: 'UPDATED_AT';
|
|
19
|
+
readonly Name: 'NAME';
|
|
19
20
|
};
|
|
20
21
|
export type WorkflowDefinitionOrder = typeof WorkflowDefinitionOrder[keyof typeof WorkflowDefinitionOrder];
|
|
21
22
|
export declare function instanceOfWorkflowDefinitionOrder(value: any): boolean;
|
|
@@ -12,12 +12,13 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
/**
|
|
15
|
-
* Sortable fields for workflow-definition listings
|
|
15
|
+
* Sortable fields for workflow-definition listings.
|
|
16
16
|
* @export
|
|
17
17
|
*/
|
|
18
18
|
export const WorkflowDefinitionOrder = {
|
|
19
19
|
CreatedAt: 'CREATED_AT',
|
|
20
|
-
UpdatedAt: 'UPDATED_AT'
|
|
20
|
+
UpdatedAt: 'UPDATED_AT',
|
|
21
|
+
Name: 'NAME'
|
|
21
22
|
};
|
|
22
23
|
export function instanceOfWorkflowDefinitionOrder(value) {
|
|
23
24
|
for (const key in WorkflowDefinitionOrder) {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import type { ItemPermissions } from './ItemPermissions';
|
|
13
|
+
import type { LastRunSummary } from './LastRunSummary';
|
|
13
14
|
import type { PathPartApprovalState } from './PathPartApprovalState';
|
|
14
15
|
import type { UserInfo } from './UserInfo';
|
|
15
16
|
/**
|
|
@@ -126,6 +127,18 @@ export interface WorkflowDefinitionResponse {
|
|
|
126
127
|
* @memberof WorkflowDefinitionResponse
|
|
127
128
|
*/
|
|
128
129
|
copyCount?: number;
|
|
130
|
+
/**
|
|
131
|
+
* The definition's most recent run, or null if never run.
|
|
132
|
+
* @type {LastRunSummary}
|
|
133
|
+
* @memberof WorkflowDefinitionResponse
|
|
134
|
+
*/
|
|
135
|
+
lastRun?: LastRunSummary | null;
|
|
136
|
+
/**
|
|
137
|
+
* Number of this definition's runs awaiting approval.
|
|
138
|
+
* @type {number}
|
|
139
|
+
* @memberof WorkflowDefinitionResponse
|
|
140
|
+
*/
|
|
141
|
+
pendingApprovalCount?: number;
|
|
129
142
|
/**
|
|
130
143
|
*
|
|
131
144
|
* @type {PathPartApprovalState}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
import { ItemPermissionsFromJSON, ItemPermissionsToJSON, } from './ItemPermissions';
|
|
15
|
+
import { LastRunSummaryFromJSON, LastRunSummaryToJSON, } from './LastRunSummary';
|
|
15
16
|
import { PathPartApprovalStateFromJSON, PathPartApprovalStateToJSON, } from './PathPartApprovalState';
|
|
16
17
|
import { UserInfoFromJSON, UserInfoToJSON, } from './UserInfo';
|
|
17
18
|
/**
|
|
@@ -84,6 +85,8 @@ export function WorkflowDefinitionResponseFromJSONTyped(json, ignoreDiscriminato
|
|
|
84
85
|
'commonFilePathPartIds': json['common_file_path_part_ids'] == null ? undefined : json['common_file_path_part_ids'],
|
|
85
86
|
'createdFromId': json['created_from_id'],
|
|
86
87
|
'copyCount': json['copy_count'] == null ? undefined : json['copy_count'],
|
|
88
|
+
'lastRun': json['last_run'] == null ? undefined : LastRunSummaryFromJSON(json['last_run']),
|
|
89
|
+
'pendingApprovalCount': json['pending_approval_count'] == null ? undefined : json['pending_approval_count'],
|
|
87
90
|
'approvalState': PathPartApprovalStateFromJSON(json['approval_state']),
|
|
88
91
|
'owner': json['owner'] == null ? undefined : UserInfoFromJSON(json['owner']),
|
|
89
92
|
'createdAt': (new Date(json['created_at'])),
|
|
@@ -116,6 +119,8 @@ export function WorkflowDefinitionResponseToJSONTyped(value, ignoreDiscriminator
|
|
|
116
119
|
'common_file_path_part_ids': value['commonFilePathPartIds'],
|
|
117
120
|
'created_from_id': value['createdFromId'],
|
|
118
121
|
'copy_count': value['copyCount'],
|
|
122
|
+
'last_run': LastRunSummaryToJSON(value['lastRun']),
|
|
123
|
+
'pending_approval_count': value['pendingApprovalCount'],
|
|
119
124
|
'approval_state': PathPartApprovalStateToJSON(value['approvalState']),
|
|
120
125
|
'owner': UserInfoToJSON(value['owner']),
|
|
121
126
|
'created_at': value['createdAt'].toISOString(),
|
|
@@ -172,6 +172,7 @@ export * from './KbMetric';
|
|
|
172
172
|
export * from './KbSummaryResponse';
|
|
173
173
|
export * from './KbTimeseriesResponse';
|
|
174
174
|
export * from './LabeledSeries';
|
|
175
|
+
export * from './LastRunSummary';
|
|
175
176
|
export * from './LeaderboardEntry';
|
|
176
177
|
export * from './LineageEdgeResponse';
|
|
177
178
|
export * from './LineageGraphResponse';
|
package/dist/esm/models/index.js
CHANGED
|
@@ -174,6 +174,7 @@ export * from './KbMetric';
|
|
|
174
174
|
export * from './KbSummaryResponse';
|
|
175
175
|
export * from './KbTimeseriesResponse';
|
|
176
176
|
export * from './LabeledSeries';
|
|
177
|
+
export * from './LastRunSummary';
|
|
177
178
|
export * from './LeaderboardEntry';
|
|
178
179
|
export * from './LineageEdgeResponse';
|
|
179
180
|
export * from './LineageGraphResponse';
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
import type { WorkflowExecutionState } from './WorkflowExecutionState';
|
|
13
|
+
import type { PathPartApprovalState } from './PathPartApprovalState';
|
|
14
|
+
/**
|
|
15
|
+
* The definition's most recent run — a compact projection for list rows.
|
|
16
|
+
*
|
|
17
|
+
* ``approval_state`` is the run folder's own approval state (execution and
|
|
18
|
+
* approval are separate axes). Named to avoid colliding with the unrelated
|
|
19
|
+
* ``last_run_timestamp`` document-ingestion concept.
|
|
20
|
+
* @export
|
|
21
|
+
* @interface LastRunSummary
|
|
22
|
+
*/
|
|
23
|
+
export interface LastRunSummary {
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof LastRunSummary
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {WorkflowExecutionState}
|
|
33
|
+
* @memberof LastRunSummary
|
|
34
|
+
*/
|
|
35
|
+
executionState: WorkflowExecutionState;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {PathPartApprovalState}
|
|
39
|
+
* @memberof LastRunSummary
|
|
40
|
+
*/
|
|
41
|
+
approvalState: PathPartApprovalState;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {Date}
|
|
45
|
+
* @memberof LastRunSummary
|
|
46
|
+
*/
|
|
47
|
+
createdAt: Date;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @type {Date}
|
|
51
|
+
* @memberof LastRunSummary
|
|
52
|
+
*/
|
|
53
|
+
startedAt?: Date | null;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {Date}
|
|
57
|
+
* @memberof LastRunSummary
|
|
58
|
+
*/
|
|
59
|
+
completedAt?: Date | null;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @type {string}
|
|
63
|
+
* @memberof LastRunSummary
|
|
64
|
+
*/
|
|
65
|
+
error?: string | null;
|
|
66
|
+
}
|
|
67
|
+
export declare const LastRunSummaryPropertyValidationAttributesMap: {
|
|
68
|
+
[property: string]: {
|
|
69
|
+
maxLength?: number;
|
|
70
|
+
minLength?: number;
|
|
71
|
+
pattern?: string;
|
|
72
|
+
maximum?: number;
|
|
73
|
+
exclusiveMaximum?: boolean;
|
|
74
|
+
minimum?: number;
|
|
75
|
+
exclusiveMinimum?: boolean;
|
|
76
|
+
multipleOf?: number;
|
|
77
|
+
maxItems?: number;
|
|
78
|
+
minItems?: number;
|
|
79
|
+
uniqueItems?: boolean;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Check if a given object implements the LastRunSummary interface.
|
|
84
|
+
*/
|
|
85
|
+
export declare function instanceOfLastRunSummary(value: object): value is LastRunSummary;
|
|
86
|
+
export declare function LastRunSummaryFromJSON(json: any): LastRunSummary;
|
|
87
|
+
export declare function LastRunSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): LastRunSummary;
|
|
88
|
+
export declare function LastRunSummaryToJSON(json: any): LastRunSummary;
|
|
89
|
+
export declare function LastRunSummaryToJSONTyped(value?: LastRunSummary | null, ignoreDiscriminator?: boolean): any;
|