@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
|
@@ -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
|
+
}
|
|
@@ -33,8 +33,6 @@ function instanceOfUploadConstraints(value) {
|
|
|
33
33
|
return false;
|
|
34
34
|
if (!('maxMediaBytes' in value) || value['maxMediaBytes'] === undefined)
|
|
35
35
|
return false;
|
|
36
|
-
if (!('maxVideoBytes' in value) || value['maxVideoBytes'] === undefined)
|
|
37
|
-
return false;
|
|
38
36
|
if (!('maxMediaDurationMs' in value) || value['maxMediaDurationMs'] === undefined)
|
|
39
37
|
return false;
|
|
40
38
|
if (!('resumablePartSize' in value) || value['resumablePartSize'] === undefined)
|
|
@@ -53,7 +51,6 @@ function UploadConstraintsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
53
51
|
'maxBytes': json['max_bytes'],
|
|
54
52
|
'maxImageBytes': json['max_image_bytes'],
|
|
55
53
|
'maxMediaBytes': json['max_media_bytes'],
|
|
56
|
-
'maxVideoBytes': json['max_video_bytes'],
|
|
57
54
|
'maxMediaDurationMs': json['max_media_duration_ms'],
|
|
58
55
|
'resumablePartSize': json['resumable_part_size'],
|
|
59
56
|
};
|
|
@@ -70,7 +67,6 @@ function UploadConstraintsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
70
67
|
'max_bytes': value['maxBytes'],
|
|
71
68
|
'max_image_bytes': value['maxImageBytes'],
|
|
72
69
|
'max_media_bytes': value['maxMediaBytes'],
|
|
73
|
-
'max_video_bytes': value['maxVideoBytes'],
|
|
74
70
|
'max_media_duration_ms': value['maxMediaDurationMs'],
|
|
75
71
|
'resumable_part_size': value['resumablePartSize'],
|
|
76
72
|
};
|
|
@@ -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;
|
|
@@ -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
|
|
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(),
|
package/dist/models/index.d.ts
CHANGED
|
@@ -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/models/index.js
CHANGED
|
@@ -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<string>
|
|
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
|
+
|
|
@@ -10,7 +10,6 @@ Name | Type
|
|
|
10
10
|
`maxBytes` | number
|
|
11
11
|
`maxImageBytes` | number
|
|
12
12
|
`maxMediaBytes` | number
|
|
13
|
-
`maxVideoBytes` | number
|
|
14
13
|
`maxMediaDurationMs` | number
|
|
15
14
|
`resumablePartSize` | number
|
|
16
15
|
|
|
@@ -25,7 +24,6 @@ const example = {
|
|
|
25
24
|
"maxBytes": null,
|
|
26
25
|
"maxImageBytes": null,
|
|
27
26
|
"maxMediaBytes": null,
|
|
28
|
-
"maxVideoBytes": null,
|
|
29
27
|
"maxMediaDurationMs": null,
|
|
30
28
|
"resumablePartSize": null,
|
|
31
29
|
} satisfies UploadConstraints
|
|
@@ -24,6 +24,8 @@ Name | Type
|
|
|
24
24
|
`commonFilePathPartIds` | Array<string>
|
|
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
|
-
| **
|
|
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\'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
|
@@ -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\'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\'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
|
+
|
|
@@ -51,12 +51,6 @@ export interface UploadConstraints {
|
|
|
51
51
|
* @memberof UploadConstraints
|
|
52
52
|
*/
|
|
53
53
|
maxMediaBytes: number;
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @type {number}
|
|
57
|
-
* @memberof UploadConstraints
|
|
58
|
-
*/
|
|
59
|
-
maxVideoBytes: number;
|
|
60
54
|
/**
|
|
61
55
|
*
|
|
62
56
|
* @type {number}
|
|
@@ -96,7 +90,6 @@ export function instanceOfUploadConstraints(value: object): value is UploadConst
|
|
|
96
90
|
if (!('maxBytes' in value) || value['maxBytes'] === undefined) return false;
|
|
97
91
|
if (!('maxImageBytes' in value) || value['maxImageBytes'] === undefined) return false;
|
|
98
92
|
if (!('maxMediaBytes' in value) || value['maxMediaBytes'] === undefined) return false;
|
|
99
|
-
if (!('maxVideoBytes' in value) || value['maxVideoBytes'] === undefined) return false;
|
|
100
93
|
if (!('maxMediaDurationMs' in value) || value['maxMediaDurationMs'] === undefined) return false;
|
|
101
94
|
if (!('resumablePartSize' in value) || value['resumablePartSize'] === undefined) return false;
|
|
102
95
|
return true;
|
|
@@ -116,7 +109,6 @@ export function UploadConstraintsFromJSONTyped(json: any, ignoreDiscriminator: b
|
|
|
116
109
|
'maxBytes': json['max_bytes'],
|
|
117
110
|
'maxImageBytes': json['max_image_bytes'],
|
|
118
111
|
'maxMediaBytes': json['max_media_bytes'],
|
|
119
|
-
'maxVideoBytes': json['max_video_bytes'],
|
|
120
112
|
'maxMediaDurationMs': json['max_media_duration_ms'],
|
|
121
113
|
'resumablePartSize': json['resumable_part_size'],
|
|
122
114
|
};
|
|
@@ -137,7 +129,6 @@ export function UploadConstraintsToJSONTyped(value?: UploadConstraints | null, i
|
|
|
137
129
|
'max_bytes': value['maxBytes'],
|
|
138
130
|
'max_image_bytes': value['maxImageBytes'],
|
|
139
131
|
'max_media_bytes': value['maxMediaBytes'],
|
|
140
|
-
'max_video_bytes': value['maxVideoBytes'],
|
|
141
132
|
'max_media_duration_ms': value['maxMediaDurationMs'],
|
|
142
133
|
'resumable_part_size': value['resumablePartSize'],
|
|
143
134
|
};
|