@knowledge-stack/ksapi 3.13.1 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +4 -0
- package/README.md +6 -2
- package/dist/apis/DocumentVersionsApi.d.ts +4 -4
- package/dist/apis/DocumentVersionsApi.js +2 -2
- package/dist/apis/SystemJobsApi.d.ts +126 -17
- package/dist/apis/SystemJobsApi.js +137 -8
- package/dist/esm/apis/DocumentVersionsApi.d.ts +4 -4
- package/dist/esm/apis/DocumentVersionsApi.js +2 -2
- package/dist/esm/apis/SystemJobsApi.d.ts +126 -17
- package/dist/esm/apis/SystemJobsApi.js +138 -9
- package/dist/esm/models/BulkFailureReason.d.ts +3 -0
- package/dist/esm/models/BulkFailureReason.js +4 -1
- package/dist/esm/models/BulkRerunRequest.d.ts +47 -0
- package/dist/esm/models/BulkRerunRequest.js +42 -0
- package/dist/esm/models/PaginatedResponseUserInfo.d.ts +66 -0
- package/dist/esm/models/PaginatedResponseUserInfo.js +70 -0
- package/dist/esm/models/WorkflowDetailResponse.d.ts +26 -1
- package/dist/esm/models/WorkflowDetailResponse.js +17 -0
- package/dist/esm/models/WorkflowSummaryResponse.d.ts +26 -1
- package/dist/esm/models/WorkflowSummaryResponse.js +17 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/models/BulkFailureReason.d.ts +3 -0
- package/dist/models/BulkFailureReason.js +4 -1
- package/dist/models/BulkRerunRequest.d.ts +47 -0
- package/dist/models/BulkRerunRequest.js +50 -0
- package/dist/models/PaginatedResponseUserInfo.d.ts +66 -0
- package/dist/models/PaginatedResponseUserInfo.js +78 -0
- package/dist/models/WorkflowDetailResponse.d.ts +26 -1
- package/dist/models/WorkflowDetailResponse.js +17 -0
- package/dist/models/WorkflowSummaryResponse.d.ts +26 -1
- package/dist/models/WorkflowSummaryResponse.js +17 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/docs/BulkRerunRequest.md +35 -0
- package/docs/DocumentVersionsApi.md +1 -1
- package/docs/PaginatedResponseUserInfo.md +40 -0
- package/docs/SystemJobsApi.md +190 -5
- package/docs/WorkflowDetailResponse.md +8 -0
- package/docs/WorkflowSummaryResponse.md +8 -0
- package/package.json +1 -1
- package/src/apis/DocumentVersionsApi.ts +4 -4
- package/src/apis/SystemJobsApi.ts +272 -16
- package/src/models/BulkFailureReason.ts +4 -1
- package/src/models/BulkRerunRequest.ts +82 -0
- package/src/models/PaginatedResponseUserInfo.ts +130 -0
- package/src/models/WorkflowDetailResponse.ts +44 -1
- package/src/models/WorkflowSummaryResponse.ts +44 -1
- package/src/models/index.ts +2 -0
|
@@ -0,0 +1,130 @@
|
|
|
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 { UserInfo } from './UserInfo';
|
|
17
|
+
import {
|
|
18
|
+
UserInfoFromJSON,
|
|
19
|
+
UserInfoFromJSONTyped,
|
|
20
|
+
UserInfoToJSON,
|
|
21
|
+
UserInfoToJSONTyped,
|
|
22
|
+
} from './UserInfo';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface PaginatedResponseUserInfo
|
|
28
|
+
*/
|
|
29
|
+
export interface PaginatedResponseUserInfo {
|
|
30
|
+
/**
|
|
31
|
+
* List of items
|
|
32
|
+
* @type {Array<UserInfo>}
|
|
33
|
+
* @memberof PaginatedResponseUserInfo
|
|
34
|
+
*/
|
|
35
|
+
items: Array<UserInfo>;
|
|
36
|
+
/**
|
|
37
|
+
* Total number of items
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof PaginatedResponseUserInfo
|
|
40
|
+
*/
|
|
41
|
+
total: number;
|
|
42
|
+
/**
|
|
43
|
+
* Number of items per page
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof PaginatedResponseUserInfo
|
|
46
|
+
*/
|
|
47
|
+
limit: number;
|
|
48
|
+
/**
|
|
49
|
+
* Number of items to skip
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof PaginatedResponseUserInfo
|
|
52
|
+
*/
|
|
53
|
+
offset: number;
|
|
54
|
+
}
|
|
55
|
+
export const PaginatedResponseUserInfoPropertyValidationAttributesMap: {
|
|
56
|
+
[property: string]: {
|
|
57
|
+
maxLength?: number,
|
|
58
|
+
minLength?: number,
|
|
59
|
+
pattern?: string,
|
|
60
|
+
maximum?: number,
|
|
61
|
+
exclusiveMaximum?: boolean,
|
|
62
|
+
minimum?: number,
|
|
63
|
+
exclusiveMinimum?: boolean,
|
|
64
|
+
multipleOf?: number,
|
|
65
|
+
maxItems?: number,
|
|
66
|
+
minItems?: number,
|
|
67
|
+
uniqueItems?: boolean
|
|
68
|
+
}
|
|
69
|
+
} = {
|
|
70
|
+
total: {
|
|
71
|
+
minimum: 0,
|
|
72
|
+
exclusiveMinimum: false,
|
|
73
|
+
},
|
|
74
|
+
limit: {
|
|
75
|
+
minimum: 1,
|
|
76
|
+
exclusiveMinimum: false,
|
|
77
|
+
},
|
|
78
|
+
offset: {
|
|
79
|
+
minimum: 0,
|
|
80
|
+
exclusiveMinimum: false,
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Check if a given object implements the PaginatedResponseUserInfo interface.
|
|
87
|
+
*/
|
|
88
|
+
export function instanceOfPaginatedResponseUserInfo(value: object): value is PaginatedResponseUserInfo {
|
|
89
|
+
if (!('items' in value) || value['items'] === undefined) return false;
|
|
90
|
+
if (!('total' in value) || value['total'] === undefined) return false;
|
|
91
|
+
if (!('limit' in value) || value['limit'] === undefined) return false;
|
|
92
|
+
if (!('offset' in value) || value['offset'] === undefined) return false;
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function PaginatedResponseUserInfoFromJSON(json: any): PaginatedResponseUserInfo {
|
|
97
|
+
return PaginatedResponseUserInfoFromJSONTyped(json, false);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function PaginatedResponseUserInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedResponseUserInfo {
|
|
101
|
+
if (json == null) {
|
|
102
|
+
return json;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
|
|
106
|
+
'items': ((json['items'] as Array<any>).map(UserInfoFromJSON)),
|
|
107
|
+
'total': json['total'],
|
|
108
|
+
'limit': json['limit'],
|
|
109
|
+
'offset': json['offset'],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function PaginatedResponseUserInfoToJSON(json: any): PaginatedResponseUserInfo {
|
|
114
|
+
return PaginatedResponseUserInfoToJSONTyped(json, false);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function PaginatedResponseUserInfoToJSONTyped(value?: PaginatedResponseUserInfo | null, ignoreDiscriminator: boolean = false): any {
|
|
118
|
+
if (value == null) {
|
|
119
|
+
return value;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
|
|
124
|
+
'items': ((value['items'] as Array<any>).map(UserInfoToJSON)),
|
|
125
|
+
'total': value['total'],
|
|
126
|
+
'limit': value['limit'],
|
|
127
|
+
'offset': value['offset'],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
@@ -20,6 +20,13 @@ import {
|
|
|
20
20
|
PipelineStatusToJSON,
|
|
21
21
|
PipelineStatusToJSONTyped,
|
|
22
22
|
} from './PipelineStatus';
|
|
23
|
+
import type { UserInfo } from './UserInfo';
|
|
24
|
+
import {
|
|
25
|
+
UserInfoFromJSON,
|
|
26
|
+
UserInfoFromJSONTyped,
|
|
27
|
+
UserInfoToJSON,
|
|
28
|
+
UserInfoToJSONTyped,
|
|
29
|
+
} from './UserInfo';
|
|
23
30
|
|
|
24
31
|
/**
|
|
25
32
|
* Single item - adds live Temporal fields.
|
|
@@ -39,12 +46,36 @@ export interface WorkflowDetailResponse {
|
|
|
39
46
|
* @memberof WorkflowDetailResponse
|
|
40
47
|
*/
|
|
41
48
|
documentId: string;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @type {string}
|
|
52
|
+
* @memberof WorkflowDetailResponse
|
|
53
|
+
*/
|
|
54
|
+
documentName: string;
|
|
55
|
+
/**
|
|
56
|
+
* The document's path
|
|
57
|
+
* @type {string}
|
|
58
|
+
* @memberof WorkflowDetailResponse
|
|
59
|
+
*/
|
|
60
|
+
materializedPath: string;
|
|
42
61
|
/**
|
|
43
62
|
*
|
|
44
63
|
* @type {string}
|
|
45
64
|
* @memberof WorkflowDetailResponse
|
|
46
65
|
*/
|
|
47
66
|
documentVersionId: string;
|
|
67
|
+
/**
|
|
68
|
+
* Whether this version is the document's active one; false for an unfinished newer upload and for a superseded older version
|
|
69
|
+
* @type {boolean}
|
|
70
|
+
* @memberof WorkflowDetailResponse
|
|
71
|
+
*/
|
|
72
|
+
isActiveVersion: boolean;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @type {UserInfo}
|
|
76
|
+
* @memberof WorkflowDetailResponse
|
|
77
|
+
*/
|
|
78
|
+
uploader: UserInfo;
|
|
48
79
|
/**
|
|
49
80
|
*
|
|
50
81
|
* @type {PipelineStatus}
|
|
@@ -64,7 +95,7 @@ export interface WorkflowDetailResponse {
|
|
|
64
95
|
*/
|
|
65
96
|
error?: string | null;
|
|
66
97
|
/**
|
|
67
|
-
*
|
|
98
|
+
* When the last run started; the upload time until a run has started
|
|
68
99
|
* @type {Date}
|
|
69
100
|
* @memberof WorkflowDetailResponse
|
|
70
101
|
*/
|
|
@@ -150,7 +181,11 @@ export const WorkflowDetailResponsePropertyValidationAttributesMap: {
|
|
|
150
181
|
export function instanceOfWorkflowDetailResponse(value: object): value is WorkflowDetailResponse {
|
|
151
182
|
if (!('workflowId' in value) || value['workflowId'] === undefined) return false;
|
|
152
183
|
if (!('documentId' in value) || value['documentId'] === undefined) return false;
|
|
184
|
+
if (!('documentName' in value) || value['documentName'] === undefined) return false;
|
|
185
|
+
if (!('materializedPath' in value) || value['materializedPath'] === undefined) return false;
|
|
153
186
|
if (!('documentVersionId' in value) || value['documentVersionId'] === undefined) return false;
|
|
187
|
+
if (!('isActiveVersion' in value) || value['isActiveVersion'] === undefined) return false;
|
|
188
|
+
if (!('uploader' in value) || value['uploader'] === undefined) return false;
|
|
154
189
|
if (!('status' in value) || value['status'] === undefined) return false;
|
|
155
190
|
if (!('lastRunTimestamp' in value) || value['lastRunTimestamp'] === undefined) return false;
|
|
156
191
|
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
@@ -174,7 +209,11 @@ export function WorkflowDetailResponseFromJSONTyped(json: any, ignoreDiscriminat
|
|
|
174
209
|
|
|
175
210
|
'workflowId': json['workflow_id'],
|
|
176
211
|
'documentId': json['document_id'],
|
|
212
|
+
'documentName': json['document_name'],
|
|
213
|
+
'materializedPath': json['materialized_path'],
|
|
177
214
|
'documentVersionId': json['document_version_id'],
|
|
215
|
+
'isActiveVersion': json['is_active_version'],
|
|
216
|
+
'uploader': UserInfoFromJSON(json['uploader']),
|
|
178
217
|
'status': PipelineStatusFromJSON(json['status']),
|
|
179
218
|
'lastActivity': json['last_activity'] == null ? undefined : json['last_activity'],
|
|
180
219
|
'error': json['error'] == null ? undefined : json['error'],
|
|
@@ -204,7 +243,11 @@ export function WorkflowDetailResponseToJSONTyped(value?: WorkflowDetailResponse
|
|
|
204
243
|
|
|
205
244
|
'workflow_id': value['workflowId'],
|
|
206
245
|
'document_id': value['documentId'],
|
|
246
|
+
'document_name': value['documentName'],
|
|
247
|
+
'materialized_path': value['materializedPath'],
|
|
207
248
|
'document_version_id': value['documentVersionId'],
|
|
249
|
+
'is_active_version': value['isActiveVersion'],
|
|
250
|
+
'uploader': UserInfoToJSON(value['uploader']),
|
|
208
251
|
'status': PipelineStatusToJSON(value['status']),
|
|
209
252
|
'last_activity': value['lastActivity'],
|
|
210
253
|
'error': value['error'],
|
|
@@ -20,6 +20,13 @@ import {
|
|
|
20
20
|
PipelineStatusToJSON,
|
|
21
21
|
PipelineStatusToJSONTyped,
|
|
22
22
|
} from './PipelineStatus';
|
|
23
|
+
import type { UserInfo } from './UserInfo';
|
|
24
|
+
import {
|
|
25
|
+
UserInfoFromJSON,
|
|
26
|
+
UserInfoFromJSONTyped,
|
|
27
|
+
UserInfoToJSON,
|
|
28
|
+
UserInfoToJSONTyped,
|
|
29
|
+
} from './UserInfo';
|
|
23
30
|
|
|
24
31
|
/**
|
|
25
32
|
* List item - DB-only fields, no Temporal call per item.
|
|
@@ -39,12 +46,36 @@ export interface WorkflowSummaryResponse {
|
|
|
39
46
|
* @memberof WorkflowSummaryResponse
|
|
40
47
|
*/
|
|
41
48
|
documentId: string;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @type {string}
|
|
52
|
+
* @memberof WorkflowSummaryResponse
|
|
53
|
+
*/
|
|
54
|
+
documentName: string;
|
|
55
|
+
/**
|
|
56
|
+
* The document's path
|
|
57
|
+
* @type {string}
|
|
58
|
+
* @memberof WorkflowSummaryResponse
|
|
59
|
+
*/
|
|
60
|
+
materializedPath: string;
|
|
42
61
|
/**
|
|
43
62
|
*
|
|
44
63
|
* @type {string}
|
|
45
64
|
* @memberof WorkflowSummaryResponse
|
|
46
65
|
*/
|
|
47
66
|
documentVersionId: string;
|
|
67
|
+
/**
|
|
68
|
+
* Whether this version is the document's active one; false for an unfinished newer upload and for a superseded older version
|
|
69
|
+
* @type {boolean}
|
|
70
|
+
* @memberof WorkflowSummaryResponse
|
|
71
|
+
*/
|
|
72
|
+
isActiveVersion: boolean;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @type {UserInfo}
|
|
76
|
+
* @memberof WorkflowSummaryResponse
|
|
77
|
+
*/
|
|
78
|
+
uploader: UserInfo;
|
|
48
79
|
/**
|
|
49
80
|
*
|
|
50
81
|
* @type {PipelineStatus}
|
|
@@ -64,7 +95,7 @@ export interface WorkflowSummaryResponse {
|
|
|
64
95
|
*/
|
|
65
96
|
error?: string | null;
|
|
66
97
|
/**
|
|
67
|
-
*
|
|
98
|
+
* When the last run started; the upload time until a run has started
|
|
68
99
|
* @type {Date}
|
|
69
100
|
* @memberof WorkflowSummaryResponse
|
|
70
101
|
*/
|
|
@@ -108,7 +139,11 @@ export const WorkflowSummaryResponsePropertyValidationAttributesMap: {
|
|
|
108
139
|
export function instanceOfWorkflowSummaryResponse(value: object): value is WorkflowSummaryResponse {
|
|
109
140
|
if (!('workflowId' in value) || value['workflowId'] === undefined) return false;
|
|
110
141
|
if (!('documentId' in value) || value['documentId'] === undefined) return false;
|
|
142
|
+
if (!('documentName' in value) || value['documentName'] === undefined) return false;
|
|
143
|
+
if (!('materializedPath' in value) || value['materializedPath'] === undefined) return false;
|
|
111
144
|
if (!('documentVersionId' in value) || value['documentVersionId'] === undefined) return false;
|
|
145
|
+
if (!('isActiveVersion' in value) || value['isActiveVersion'] === undefined) return false;
|
|
146
|
+
if (!('uploader' in value) || value['uploader'] === undefined) return false;
|
|
112
147
|
if (!('status' in value) || value['status'] === undefined) return false;
|
|
113
148
|
if (!('lastRunTimestamp' in value) || value['lastRunTimestamp'] === undefined) return false;
|
|
114
149
|
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
@@ -127,7 +162,11 @@ export function WorkflowSummaryResponseFromJSONTyped(json: any, ignoreDiscrimina
|
|
|
127
162
|
|
|
128
163
|
'workflowId': json['workflow_id'],
|
|
129
164
|
'documentId': json['document_id'],
|
|
165
|
+
'documentName': json['document_name'],
|
|
166
|
+
'materializedPath': json['materialized_path'],
|
|
130
167
|
'documentVersionId': json['document_version_id'],
|
|
168
|
+
'isActiveVersion': json['is_active_version'],
|
|
169
|
+
'uploader': UserInfoFromJSON(json['uploader']),
|
|
131
170
|
'status': PipelineStatusFromJSON(json['status']),
|
|
132
171
|
'lastActivity': json['last_activity'] == null ? undefined : json['last_activity'],
|
|
133
172
|
'error': json['error'] == null ? undefined : json['error'],
|
|
@@ -150,7 +189,11 @@ export function WorkflowSummaryResponseToJSONTyped(value?: WorkflowSummaryRespon
|
|
|
150
189
|
|
|
151
190
|
'workflow_id': value['workflowId'],
|
|
152
191
|
'document_id': value['documentId'],
|
|
192
|
+
'document_name': value['documentName'],
|
|
193
|
+
'materialized_path': value['materializedPath'],
|
|
153
194
|
'document_version_id': value['documentVersionId'],
|
|
195
|
+
'is_active_version': value['isActiveVersion'],
|
|
196
|
+
'uploader': UserInfoToJSON(value['uploader']),
|
|
154
197
|
'status': PipelineStatusToJSON(value['status']),
|
|
155
198
|
'last_activity': value['lastActivity'],
|
|
156
199
|
'error': value['error'],
|
package/src/models/index.ts
CHANGED
|
@@ -37,6 +37,7 @@ export * from './BulkModelTablesRequest';
|
|
|
37
37
|
export * from './BulkModelTablesResponse';
|
|
38
38
|
export * from './BulkMoveRequest';
|
|
39
39
|
export * from './BulkOperationResponse';
|
|
40
|
+
export * from './BulkRerunRequest';
|
|
40
41
|
export * from './BulkRevokeRequest';
|
|
41
42
|
export * from './BulkTagRequest';
|
|
42
43
|
export * from './BulkTrashRequest';
|
|
@@ -237,6 +238,7 @@ export * from './PaginatedResponseTenantUserResponse';
|
|
|
237
238
|
export * from './PaginatedResponseThreadMessageResponse';
|
|
238
239
|
export * from './PaginatedResponseThreadResponse';
|
|
239
240
|
export * from './PaginatedResponseTrashItemResponse';
|
|
241
|
+
export * from './PaginatedResponseUserInfo';
|
|
240
242
|
export * from './PaginatedResponseWorkflowDefinitionResponse';
|
|
241
243
|
export * from './PaginatedResponseWorkflowRunResponse';
|
|
242
244
|
export * from './PaginatedResponseWorkflowSummaryResponse';
|