@knowledge-stack/ksapi 1.159.1 → 1.160.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.
Files changed (33) hide show
  1. package/.openapi-generator/FILES +2 -0
  2. package/README.md +3 -2
  3. package/dist/apis/WorkflowDefinitionsApi.d.ts +9 -0
  4. package/dist/apis/WorkflowDefinitionsApi.js +9 -0
  5. package/dist/esm/apis/WorkflowDefinitionsApi.d.ts +9 -0
  6. package/dist/esm/apis/WorkflowDefinitionsApi.js +9 -0
  7. package/dist/esm/models/LastRunSummary.d.ts +89 -0
  8. package/dist/esm/models/LastRunSummary.js +64 -0
  9. package/dist/esm/models/WorkflowDefinitionOrder.d.ts +2 -1
  10. package/dist/esm/models/WorkflowDefinitionOrder.js +3 -2
  11. package/dist/esm/models/WorkflowDefinitionResponse.d.ts +13 -0
  12. package/dist/esm/models/WorkflowDefinitionResponse.js +5 -0
  13. package/dist/esm/models/index.d.ts +1 -0
  14. package/dist/esm/models/index.js +1 -0
  15. package/dist/models/LastRunSummary.d.ts +89 -0
  16. package/dist/models/LastRunSummary.js +72 -0
  17. package/dist/models/WorkflowDefinitionOrder.d.ts +2 -1
  18. package/dist/models/WorkflowDefinitionOrder.js +3 -2
  19. package/dist/models/WorkflowDefinitionResponse.d.ts +13 -0
  20. package/dist/models/WorkflowDefinitionResponse.js +5 -0
  21. package/dist/models/index.d.ts +1 -0
  22. package/dist/models/index.js +1 -0
  23. package/docs/FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.md +4 -0
  24. package/docs/LastRunSummary.md +47 -0
  25. package/docs/WorkflowDefinitionOrder.md +1 -1
  26. package/docs/WorkflowDefinitionResponse.md +4 -0
  27. package/docs/WorkflowDefinitionsApi.md +11 -2
  28. package/package.json +1 -1
  29. package/src/apis/WorkflowDefinitionsApi.ts +21 -0
  30. package/src/models/LastRunSummary.ts +155 -0
  31. package/src/models/WorkflowDefinitionOrder.ts +3 -2
  32. package/src/models/WorkflowDefinitionResponse.ts +23 -0
  33. package/src/models/index.ts +1 -0
@@ -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.159.1
1
+ # @knowledge-stack/ksapi@1.160.0
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.159.1`
713
+ - Package version: `1.160.0`
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\&#39;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\&#39;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\&#39;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\&#39;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
+ }
@@ -10,12 +10,13 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * Sortable fields for workflow-definition listings (time only for now).
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 (time only for now).
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';
@@ -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;
@@ -0,0 +1,72 @@
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.LastRunSummaryPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfLastRunSummary = instanceOfLastRunSummary;
18
+ exports.LastRunSummaryFromJSON = LastRunSummaryFromJSON;
19
+ exports.LastRunSummaryFromJSONTyped = LastRunSummaryFromJSONTyped;
20
+ exports.LastRunSummaryToJSON = LastRunSummaryToJSON;
21
+ exports.LastRunSummaryToJSONTyped = LastRunSummaryToJSONTyped;
22
+ const WorkflowExecutionState_1 = require("./WorkflowExecutionState");
23
+ const PathPartApprovalState_1 = require("./PathPartApprovalState");
24
+ exports.LastRunSummaryPropertyValidationAttributesMap = {};
25
+ /**
26
+ * Check if a given object implements the LastRunSummary interface.
27
+ */
28
+ function instanceOfLastRunSummary(value) {
29
+ if (!('id' in value) || value['id'] === undefined)
30
+ return false;
31
+ if (!('executionState' in value) || value['executionState'] === undefined)
32
+ return false;
33
+ if (!('approvalState' in value) || value['approvalState'] === undefined)
34
+ return false;
35
+ if (!('createdAt' in value) || value['createdAt'] === undefined)
36
+ return false;
37
+ return true;
38
+ }
39
+ function LastRunSummaryFromJSON(json) {
40
+ return LastRunSummaryFromJSONTyped(json, false);
41
+ }
42
+ function LastRunSummaryFromJSONTyped(json, ignoreDiscriminator) {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+ 'id': json['id'],
48
+ 'executionState': (0, WorkflowExecutionState_1.WorkflowExecutionStateFromJSON)(json['execution_state']),
49
+ 'approvalState': (0, PathPartApprovalState_1.PathPartApprovalStateFromJSON)(json['approval_state']),
50
+ 'createdAt': (new Date(json['created_at'])),
51
+ 'startedAt': json['started_at'] == null ? undefined : (new Date(json['started_at'])),
52
+ 'completedAt': json['completed_at'] == null ? undefined : (new Date(json['completed_at'])),
53
+ 'error': json['error'] == null ? undefined : json['error'],
54
+ };
55
+ }
56
+ function LastRunSummaryToJSON(json) {
57
+ return LastRunSummaryToJSONTyped(json, false);
58
+ }
59
+ function LastRunSummaryToJSONTyped(value, ignoreDiscriminator = false) {
60
+ if (value == null) {
61
+ return value;
62
+ }
63
+ return {
64
+ 'id': value['id'],
65
+ 'execution_state': (0, WorkflowExecutionState_1.WorkflowExecutionStateToJSON)(value['executionState']),
66
+ 'approval_state': (0, PathPartApprovalState_1.PathPartApprovalStateToJSON)(value['approvalState']),
67
+ 'created_at': value['createdAt'].toISOString(),
68
+ 'started_at': value['startedAt'] == null ? value['startedAt'] : value['startedAt'].toISOString(),
69
+ 'completed_at': value['completedAt'] == null ? value['completedAt'] : value['completedAt'].toISOString(),
70
+ 'error': value['error'],
71
+ };
72
+ }
@@ -10,12 +10,13 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * Sortable fields for workflow-definition listings (time only for now).
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;
@@ -20,12 +20,13 @@ exports.WorkflowDefinitionOrderFromJSONTyped = WorkflowDefinitionOrderFromJSONTy
20
20
  exports.WorkflowDefinitionOrderToJSON = WorkflowDefinitionOrderToJSON;
21
21
  exports.WorkflowDefinitionOrderToJSONTyped = WorkflowDefinitionOrderToJSONTyped;
22
22
  /**
23
- * Sortable fields for workflow-definition listings (time only for now).
23
+ * Sortable fields for workflow-definition listings.
24
24
  * @export
25
25
  */
26
26
  exports.WorkflowDefinitionOrder = {
27
27
  CreatedAt: 'CREATED_AT',
28
- UpdatedAt: 'UPDATED_AT'
28
+ UpdatedAt: 'UPDATED_AT',
29
+ Name: 'NAME'
29
30
  };
30
31
  function instanceOfWorkflowDefinitionOrder(value) {
31
32
  for (const key in exports.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}
@@ -20,6 +20,7 @@ exports.WorkflowDefinitionResponseFromJSONTyped = WorkflowDefinitionResponseFrom
20
20
  exports.WorkflowDefinitionResponseToJSON = WorkflowDefinitionResponseToJSON;
21
21
  exports.WorkflowDefinitionResponseToJSONTyped = WorkflowDefinitionResponseToJSONTyped;
22
22
  const ItemPermissions_1 = require("./ItemPermissions");
23
+ const LastRunSummary_1 = require("./LastRunSummary");
23
24
  const PathPartApprovalState_1 = require("./PathPartApprovalState");
24
25
  const UserInfo_1 = require("./UserInfo");
25
26
  /**
@@ -92,6 +93,8 @@ function WorkflowDefinitionResponseFromJSONTyped(json, ignoreDiscriminator) {
92
93
  'commonFilePathPartIds': json['common_file_path_part_ids'] == null ? undefined : json['common_file_path_part_ids'],
93
94
  'createdFromId': json['created_from_id'],
94
95
  'copyCount': json['copy_count'] == null ? undefined : json['copy_count'],
96
+ 'lastRun': json['last_run'] == null ? undefined : (0, LastRunSummary_1.LastRunSummaryFromJSON)(json['last_run']),
97
+ 'pendingApprovalCount': json['pending_approval_count'] == null ? undefined : json['pending_approval_count'],
95
98
  'approvalState': (0, PathPartApprovalState_1.PathPartApprovalStateFromJSON)(json['approval_state']),
96
99
  'owner': json['owner'] == null ? undefined : (0, UserInfo_1.UserInfoFromJSON)(json['owner']),
97
100
  'createdAt': (new Date(json['created_at'])),
@@ -124,6 +127,8 @@ function WorkflowDefinitionResponseToJSONTyped(value, ignoreDiscriminator = fals
124
127
  'common_file_path_part_ids': value['commonFilePathPartIds'],
125
128
  'created_from_id': value['createdFromId'],
126
129
  'copy_count': value['copyCount'],
130
+ 'last_run': (0, LastRunSummary_1.LastRunSummaryToJSON)(value['lastRun']),
131
+ 'pending_approval_count': value['pendingApprovalCount'],
127
132
  'approval_state': (0, PathPartApprovalState_1.PathPartApprovalStateToJSON)(value['approvalState']),
128
133
  'owner': (0, UserInfo_1.UserInfoToJSON)(value['owner']),
129
134
  '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';
@@ -190,6 +190,7 @@ __exportStar(require("./KbMetric"), exports);
190
190
  __exportStar(require("./KbSummaryResponse"), exports);
191
191
  __exportStar(require("./KbTimeseriesResponse"), exports);
192
192
  __exportStar(require("./LabeledSeries"), exports);
193
+ __exportStar(require("./LastRunSummary"), exports);
193
194
  __exportStar(require("./LeaderboardEntry"), exports);
194
195
  __exportStar(require("./LineageEdgeResponse"), exports);
195
196
  __exportStar(require("./LineageGraphResponse"), exports);
@@ -36,6 +36,8 @@ Name | Type
36
36
  `commonFilePathPartIds` | Array&lt;string&gt;
37
37
  `createdFromId` | string
38
38
  `copyCount` | number
39
+ `lastRun` | [LastRunSummary](LastRunSummary.md)
40
+ `pendingApprovalCount` | number
39
41
  `workflowDefinitionId` | string
40
42
  `triggeredBy` | [UserInfo](UserInfo.md)
41
43
  `executionState` | [WorkflowExecutionState](WorkflowExecutionState.md)
@@ -106,6 +108,8 @@ const example = {
106
108
  "commonFilePathPartIds": null,
107
109
  "createdFromId": null,
108
110
  "copyCount": null,
111
+ "lastRun": null,
112
+ "pendingApprovalCount": null,
109
113
  "workflowDefinitionId": null,
110
114
  "triggeredBy": null,
111
115
  "executionState": null,
@@ -0,0 +1,47 @@
1
+
2
+ # LastRunSummary
3
+
4
+ The definition\'s most recent run — a compact projection for list rows. ``approval_state`` is the run folder\'s own approval state (execution and approval are separate axes). Named to avoid colliding with the unrelated ``last_run_timestamp`` document-ingestion concept.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `id` | string
11
+ `executionState` | [WorkflowExecutionState](WorkflowExecutionState.md)
12
+ `approvalState` | [PathPartApprovalState](PathPartApprovalState.md)
13
+ `createdAt` | Date
14
+ `startedAt` | Date
15
+ `completedAt` | Date
16
+ `error` | string
17
+
18
+ ## Example
19
+
20
+ ```typescript
21
+ import type { LastRunSummary } from '@knowledge-stack/ksapi'
22
+
23
+ // TODO: Update the object below with actual values
24
+ const example = {
25
+ "id": null,
26
+ "executionState": null,
27
+ "approvalState": null,
28
+ "createdAt": null,
29
+ "startedAt": null,
30
+ "completedAt": null,
31
+ "error": null,
32
+ } satisfies LastRunSummary
33
+
34
+ console.log(example)
35
+
36
+ // Convert the instance to a JSON string
37
+ const exampleJSON: string = JSON.stringify(example)
38
+ console.log(exampleJSON)
39
+
40
+ // Parse the JSON string back to an object
41
+ const exampleParsed = JSON.parse(exampleJSON) as LastRunSummary
42
+ console.log(exampleParsed)
43
+ ```
44
+
45
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
46
+
47
+
@@ -1,7 +1,7 @@
1
1
 
2
2
  # WorkflowDefinitionOrder
3
3
 
4
- Sortable fields for workflow-definition listings (time only for now).
4
+ Sortable fields for workflow-definition listings.
5
5
 
6
6
  ## Properties
7
7
 
@@ -24,6 +24,8 @@ Name | Type
24
24
  `commonFilePathPartIds` | Array&lt;string&gt;
25
25
  `createdFromId` | string
26
26
  `copyCount` | number
27
+ `lastRun` | [LastRunSummary](LastRunSummary.md)
28
+ `pendingApprovalCount` | number
27
29
  `approvalState` | [PathPartApprovalState](PathPartApprovalState.md)
28
30
  `owner` | [UserInfo](UserInfo.md)
29
31
  `createdAt` | Date
@@ -54,6 +56,8 @@ const example = {
54
56
  "commonFilePathPartIds": null,
55
57
  "createdFromId": null,
56
58
  "copyCount": null,
59
+ "lastRun": null,
60
+ "pendingApprovalCount": null,
57
61
  "approvalState": null,
58
62
  "owner": null,
59
63
  "createdAt": null,
@@ -408,7 +408,7 @@ example().catch(console.error);
408
408
 
409
409
  ## listWorkflowDefinitions
410
410
 
411
- > PaginatedResponseWorkflowDefinitionResponse listWorkflowDefinitions(mine, sortBy, sortDir, isTemplate, limit, offset, createdAfter, createdBefore, updatedAfter, updatedBefore)
411
+ > PaginatedResponseWorkflowDefinitionResponse listWorkflowDefinitions(mine, search, sortBy, sortDir, isTemplate, limit, offset, createdAfter, createdBefore, updatedAfter, updatedBefore, includeTagIds, excludeTagIds)
412
412
 
413
413
  List Workflow Definitions Handler
414
414
 
@@ -434,6 +434,8 @@ async function example() {
434
434
  const body = {
435
435
  // boolean | Only definitions the caller created (owner). (optional)
436
436
  mine: true,
437
+ // string | Case-insensitive substring over name and description. (optional)
438
+ search: search_example,
437
439
  // WorkflowDefinitionOrder | Field to sort definitions by (default: CREATED_AT) (optional)
438
440
  sortBy: ...,
439
441
  // SortDirection | Sort direction; overrides the field\'s natural default (optional)
@@ -452,6 +454,10 @@ async function example() {
452
454
  updatedAfter: 2013-10-20T19:20:30+01:00,
453
455
  // Date | Only items updated strictly before this timestamp (optional)
454
456
  updatedBefore: 2013-10-20T19:20:30+01:00,
457
+ // Array<string> | Keep only items that carry at least one of these tags on the item itself or any ancestor folder (repeatable, OR / tag inheritance). (optional)
458
+ includeTagIds: ...,
459
+ // Array<string> | Drop items that carry any of these tags on the item itself or any ancestor folder (repeatable). Takes precedence over include_tag_ids. (optional)
460
+ excludeTagIds: ...,
455
461
  } satisfies ListWorkflowDefinitionsRequest;
456
462
 
457
463
  try {
@@ -472,7 +478,8 @@ example().catch(console.error);
472
478
  | Name | Type | Description | Notes |
473
479
  |------------- | ------------- | ------------- | -------------|
474
480
  | **mine** | `boolean` | Only definitions the caller created (owner). | [Optional] [Defaults to `false`] |
475
- | **sortBy** | `WorkflowDefinitionOrder` | Field to sort definitions by (default: CREATED_AT) | [Optional] [Defaults to `undefined`] [Enum: CREATED_AT, UPDATED_AT] |
481
+ | **search** | `string` | Case-insensitive substring over name and description. | [Optional] [Defaults to `undefined`] |
482
+ | **sortBy** | `WorkflowDefinitionOrder` | Field to sort definitions by (default: CREATED_AT) | [Optional] [Defaults to `undefined`] [Enum: CREATED_AT, UPDATED_AT, NAME] |
476
483
  | **sortDir** | `SortDirection` | Sort direction; overrides the field\&#39;s natural default | [Optional] [Defaults to `undefined`] [Enum: ASC, DESC] |
477
484
  | **isTemplate** | `boolean` | | [Optional] [Defaults to `false`] |
478
485
  | **limit** | `number` | Number of items per page | [Optional] [Defaults to `20`] |
@@ -481,6 +488,8 @@ example().catch(console.error);
481
488
  | **createdBefore** | `Date` | Only items created strictly before this timestamp | [Optional] [Defaults to `undefined`] |
482
489
  | **updatedAfter** | `Date` | Only items updated at or after this timestamp (inclusive) | [Optional] [Defaults to `undefined`] |
483
490
  | **updatedBefore** | `Date` | Only items updated strictly before this timestamp | [Optional] [Defaults to `undefined`] |
491
+ | **includeTagIds** | `Array<string>` | Keep only items that carry at least one of these tags on the item itself or any ancestor folder (repeatable, OR / tag inheritance). | [Optional] |
492
+ | **excludeTagIds** | `Array<string>` | Drop items that carry any of these tags on the item itself or any ancestor folder (repeatable). Takes precedence over include_tag_ids. | [Optional] |
484
493
 
485
494
  ### Return type
486
495
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "1.159.1",
3
+ "version": "1.160.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -85,6 +85,7 @@ export interface InstantiateWorkflowTemplateOperationRequest {
85
85
 
86
86
  export interface ListWorkflowDefinitionsRequest {
87
87
  mine?: boolean;
88
+ search?: string | null;
88
89
  sortBy?: WorkflowDefinitionOrder;
89
90
  sortDir?: SortDirection;
90
91
  isTemplate?: boolean;
@@ -94,6 +95,8 @@ export interface ListWorkflowDefinitionsRequest {
94
95
  createdBefore?: Date | null;
95
96
  updatedAfter?: Date | null;
96
97
  updatedBefore?: Date | null;
98
+ includeTagIds?: Array<string> | null;
99
+ excludeTagIds?: Array<string> | null;
97
100
  }
98
101
 
99
102
  export interface ListWorkflowRunsRequest {
@@ -255,6 +258,7 @@ export interface WorkflowDefinitionsApiInterface {
255
258
  /**
256
259
  * Creates request options for listWorkflowDefinitions without sending the request
257
260
  * @param {boolean} [mine] Only definitions the caller created (owner).
261
+ * @param {string} [search] Case-insensitive substring over name and description.
258
262
  * @param {WorkflowDefinitionOrder} [sortBy] Field to sort definitions by (default: CREATED_AT)
259
263
  * @param {SortDirection} [sortDir] Sort direction; overrides the field\&#39;s natural default
260
264
  * @param {boolean} [isTemplate]
@@ -264,6 +268,8 @@ export interface WorkflowDefinitionsApiInterface {
264
268
  * @param {Date} [createdBefore] Only items created strictly before this timestamp
265
269
  * @param {Date} [updatedAfter] Only items updated at or after this timestamp (inclusive)
266
270
  * @param {Date} [updatedBefore] Only items updated strictly before this timestamp
271
+ * @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).
272
+ * @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.
267
273
  * @throws {RequiredError}
268
274
  * @memberof WorkflowDefinitionsApiInterface
269
275
  */
@@ -273,6 +279,7 @@ export interface WorkflowDefinitionsApiInterface {
273
279
  *
274
280
  * @summary List Workflow Definitions Handler
275
281
  * @param {boolean} [mine] Only definitions the caller created (owner).
282
+ * @param {string} [search] Case-insensitive substring over name and description.
276
283
  * @param {WorkflowDefinitionOrder} [sortBy] Field to sort definitions by (default: CREATED_AT)
277
284
  * @param {SortDirection} [sortDir] Sort direction; overrides the field\&#39;s natural default
278
285
  * @param {boolean} [isTemplate]
@@ -282,6 +289,8 @@ export interface WorkflowDefinitionsApiInterface {
282
289
  * @param {Date} [createdBefore] Only items created strictly before this timestamp
283
290
  * @param {Date} [updatedAfter] Only items updated at or after this timestamp (inclusive)
284
291
  * @param {Date} [updatedBefore] Only items updated strictly before this timestamp
292
+ * @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).
293
+ * @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.
285
294
  * @param {*} [options] Override http request option.
286
295
  * @throws {RequiredError}
287
296
  * @memberof WorkflowDefinitionsApiInterface
@@ -700,6 +709,10 @@ export class WorkflowDefinitionsApi extends runtime.BaseAPI implements WorkflowD
700
709
  queryParameters['mine'] = requestParameters['mine'];
701
710
  }
702
711
 
712
+ if (requestParameters['search'] != null) {
713
+ queryParameters['search'] = requestParameters['search'];
714
+ }
715
+
703
716
  if (requestParameters['sortBy'] != null) {
704
717
  queryParameters['sort_by'] = requestParameters['sortBy'];
705
718
  }
@@ -736,6 +749,14 @@ export class WorkflowDefinitionsApi extends runtime.BaseAPI implements WorkflowD
736
749
  queryParameters['updated_before'] = (requestParameters['updatedBefore'] as any).toISOString();
737
750
  }
738
751
 
752
+ if (requestParameters['includeTagIds'] != null) {
753
+ queryParameters['include_tag_ids'] = requestParameters['includeTagIds'];
754
+ }
755
+
756
+ if (requestParameters['excludeTagIds'] != null) {
757
+ queryParameters['exclude_tag_ids'] = requestParameters['excludeTagIds'];
758
+ }
759
+
739
760
  const headerParameters: runtime.HTTPHeaders = {};
740
761
 
741
762
  if (this.configuration && this.configuration.accessToken) {
@@ -0,0 +1,155 @@
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
+ import type { WorkflowExecutionState } from './WorkflowExecutionState';
17
+ import {
18
+ WorkflowExecutionStateFromJSON,
19
+ WorkflowExecutionStateFromJSONTyped,
20
+ WorkflowExecutionStateToJSON,
21
+ WorkflowExecutionStateToJSONTyped,
22
+ } from './WorkflowExecutionState';
23
+ import type { PathPartApprovalState } from './PathPartApprovalState';
24
+ import {
25
+ PathPartApprovalStateFromJSON,
26
+ PathPartApprovalStateFromJSONTyped,
27
+ PathPartApprovalStateToJSON,
28
+ PathPartApprovalStateToJSONTyped,
29
+ } from './PathPartApprovalState';
30
+
31
+ /**
32
+ * The definition's most recent run — a compact projection for list rows.
33
+ *
34
+ * ``approval_state`` is the run folder's own approval state (execution and
35
+ * approval are separate axes). Named to avoid colliding with the unrelated
36
+ * ``last_run_timestamp`` document-ingestion concept.
37
+ * @export
38
+ * @interface LastRunSummary
39
+ */
40
+ export interface LastRunSummary {
41
+ /**
42
+ *
43
+ * @type {string}
44
+ * @memberof LastRunSummary
45
+ */
46
+ id: string;
47
+ /**
48
+ *
49
+ * @type {WorkflowExecutionState}
50
+ * @memberof LastRunSummary
51
+ */
52
+ executionState: WorkflowExecutionState;
53
+ /**
54
+ *
55
+ * @type {PathPartApprovalState}
56
+ * @memberof LastRunSummary
57
+ */
58
+ approvalState: PathPartApprovalState;
59
+ /**
60
+ *
61
+ * @type {Date}
62
+ * @memberof LastRunSummary
63
+ */
64
+ createdAt: Date;
65
+ /**
66
+ *
67
+ * @type {Date}
68
+ * @memberof LastRunSummary
69
+ */
70
+ startedAt?: Date | null;
71
+ /**
72
+ *
73
+ * @type {Date}
74
+ * @memberof LastRunSummary
75
+ */
76
+ completedAt?: Date | null;
77
+ /**
78
+ *
79
+ * @type {string}
80
+ * @memberof LastRunSummary
81
+ */
82
+ error?: string | null;
83
+ }
84
+
85
+
86
+ export const LastRunSummaryPropertyValidationAttributesMap: {
87
+ [property: string]: {
88
+ maxLength?: number,
89
+ minLength?: number,
90
+ pattern?: string,
91
+ maximum?: number,
92
+ exclusiveMaximum?: boolean,
93
+ minimum?: number,
94
+ exclusiveMinimum?: boolean,
95
+ multipleOf?: number,
96
+ maxItems?: number,
97
+ minItems?: number,
98
+ uniqueItems?: boolean
99
+ }
100
+ } = {
101
+ }
102
+
103
+
104
+ /**
105
+ * Check if a given object implements the LastRunSummary interface.
106
+ */
107
+ export function instanceOfLastRunSummary(value: object): value is LastRunSummary {
108
+ if (!('id' in value) || value['id'] === undefined) return false;
109
+ if (!('executionState' in value) || value['executionState'] === undefined) return false;
110
+ if (!('approvalState' in value) || value['approvalState'] === undefined) return false;
111
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
112
+ return true;
113
+ }
114
+
115
+ export function LastRunSummaryFromJSON(json: any): LastRunSummary {
116
+ return LastRunSummaryFromJSONTyped(json, false);
117
+ }
118
+
119
+ export function LastRunSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): LastRunSummary {
120
+ if (json == null) {
121
+ return json;
122
+ }
123
+ return {
124
+
125
+ 'id': json['id'],
126
+ 'executionState': WorkflowExecutionStateFromJSON(json['execution_state']),
127
+ 'approvalState': PathPartApprovalStateFromJSON(json['approval_state']),
128
+ 'createdAt': (new Date(json['created_at'])),
129
+ 'startedAt': json['started_at'] == null ? undefined : (new Date(json['started_at'])),
130
+ 'completedAt': json['completed_at'] == null ? undefined : (new Date(json['completed_at'])),
131
+ 'error': json['error'] == null ? undefined : json['error'],
132
+ };
133
+ }
134
+
135
+ export function LastRunSummaryToJSON(json: any): LastRunSummary {
136
+ return LastRunSummaryToJSONTyped(json, false);
137
+ }
138
+
139
+ export function LastRunSummaryToJSONTyped(value?: LastRunSummary | null, ignoreDiscriminator: boolean = false): any {
140
+ if (value == null) {
141
+ return value;
142
+ }
143
+
144
+ return {
145
+
146
+ 'id': value['id'],
147
+ 'execution_state': WorkflowExecutionStateToJSON(value['executionState']),
148
+ 'approval_state': PathPartApprovalStateToJSON(value['approvalState']),
149
+ 'created_at': value['createdAt'].toISOString(),
150
+ 'started_at': value['startedAt'] == null ? value['startedAt'] : value['startedAt'].toISOString(),
151
+ 'completed_at': value['completedAt'] == null ? value['completedAt'] : value['completedAt'].toISOString(),
152
+ 'error': value['error'],
153
+ };
154
+ }
155
+
@@ -14,12 +14,13 @@
14
14
 
15
15
 
16
16
  /**
17
- * Sortable fields for workflow-definition listings (time only for now).
17
+ * Sortable fields for workflow-definition listings.
18
18
  * @export
19
19
  */
20
20
  export const WorkflowDefinitionOrder = {
21
21
  CreatedAt: 'CREATED_AT',
22
- UpdatedAt: 'UPDATED_AT'
22
+ UpdatedAt: 'UPDATED_AT',
23
+ Name: 'NAME'
23
24
  } as const;
24
25
  export type WorkflowDefinitionOrder = typeof WorkflowDefinitionOrder[keyof typeof WorkflowDefinitionOrder];
25
26
 
@@ -20,6 +20,13 @@ import {
20
20
  ItemPermissionsToJSON,
21
21
  ItemPermissionsToJSONTyped,
22
22
  } from './ItemPermissions';
23
+ import type { LastRunSummary } from './LastRunSummary';
24
+ import {
25
+ LastRunSummaryFromJSON,
26
+ LastRunSummaryFromJSONTyped,
27
+ LastRunSummaryToJSON,
28
+ LastRunSummaryToJSONTyped,
29
+ } from './LastRunSummary';
23
30
  import type { PathPartApprovalState } from './PathPartApprovalState';
24
31
  import {
25
32
  PathPartApprovalStateFromJSON,
@@ -149,6 +156,18 @@ export interface WorkflowDefinitionResponse {
149
156
  * @memberof WorkflowDefinitionResponse
150
157
  */
151
158
  copyCount?: number;
159
+ /**
160
+ * The definition's most recent run, or null if never run.
161
+ * @type {LastRunSummary}
162
+ * @memberof WorkflowDefinitionResponse
163
+ */
164
+ lastRun?: LastRunSummary | null;
165
+ /**
166
+ * Number of this definition's runs awaiting approval.
167
+ * @type {number}
168
+ * @memberof WorkflowDefinitionResponse
169
+ */
170
+ pendingApprovalCount?: number;
152
171
  /**
153
172
  *
154
173
  * @type {PathPartApprovalState}
@@ -258,6 +277,8 @@ export function WorkflowDefinitionResponseFromJSONTyped(json: any, ignoreDiscrim
258
277
  'commonFilePathPartIds': json['common_file_path_part_ids'] == null ? undefined : json['common_file_path_part_ids'],
259
278
  'createdFromId': json['created_from_id'],
260
279
  'copyCount': json['copy_count'] == null ? undefined : json['copy_count'],
280
+ 'lastRun': json['last_run'] == null ? undefined : LastRunSummaryFromJSON(json['last_run']),
281
+ 'pendingApprovalCount': json['pending_approval_count'] == null ? undefined : json['pending_approval_count'],
261
282
  'approvalState': PathPartApprovalStateFromJSON(json['approval_state']),
262
283
  'owner': json['owner'] == null ? undefined : UserInfoFromJSON(json['owner']),
263
284
  'createdAt': (new Date(json['created_at'])),
@@ -294,6 +315,8 @@ export function WorkflowDefinitionResponseToJSONTyped(value?: WorkflowDefinition
294
315
  'common_file_path_part_ids': value['commonFilePathPartIds'],
295
316
  'created_from_id': value['createdFromId'],
296
317
  'copy_count': value['copyCount'],
318
+ 'last_run': LastRunSummaryToJSON(value['lastRun']),
319
+ 'pending_approval_count': value['pendingApprovalCount'],
297
320
  'approval_state': PathPartApprovalStateToJSON(value['approvalState']),
298
321
  'owner': UserInfoToJSON(value['owner']),
299
322
  'created_at': value['createdAt'].toISOString(),
@@ -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';