@knowledge-stack/ksapi 3.13.1 → 3.14.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 +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/DocumentsApi.d.ts +4 -4
- package/dist/apis/DocumentsApi.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/DocumentsApi.d.ts +4 -4
- package/dist/esm/apis/DocumentsApi.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/DocumentsApi.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/DocumentsApi.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
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import type { PipelineStatus } from './PipelineStatus';
|
|
13
|
+
import type { UserInfo } from './UserInfo';
|
|
13
14
|
/**
|
|
14
15
|
* Single item - adds live Temporal fields.
|
|
15
16
|
* @export
|
|
@@ -28,12 +29,36 @@ export interface WorkflowDetailResponse {
|
|
|
28
29
|
* @memberof WorkflowDetailResponse
|
|
29
30
|
*/
|
|
30
31
|
documentId: string;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @type {string}
|
|
35
|
+
* @memberof WorkflowDetailResponse
|
|
36
|
+
*/
|
|
37
|
+
documentName: string;
|
|
38
|
+
/**
|
|
39
|
+
* The document's path
|
|
40
|
+
* @type {string}
|
|
41
|
+
* @memberof WorkflowDetailResponse
|
|
42
|
+
*/
|
|
43
|
+
materializedPath: string;
|
|
31
44
|
/**
|
|
32
45
|
*
|
|
33
46
|
* @type {string}
|
|
34
47
|
* @memberof WorkflowDetailResponse
|
|
35
48
|
*/
|
|
36
49
|
documentVersionId: string;
|
|
50
|
+
/**
|
|
51
|
+
* Whether this version is the document's active one; false for an unfinished newer upload and for a superseded older version
|
|
52
|
+
* @type {boolean}
|
|
53
|
+
* @memberof WorkflowDetailResponse
|
|
54
|
+
*/
|
|
55
|
+
isActiveVersion: boolean;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @type {UserInfo}
|
|
59
|
+
* @memberof WorkflowDetailResponse
|
|
60
|
+
*/
|
|
61
|
+
uploader: UserInfo;
|
|
37
62
|
/**
|
|
38
63
|
*
|
|
39
64
|
* @type {PipelineStatus}
|
|
@@ -53,7 +78,7 @@ export interface WorkflowDetailResponse {
|
|
|
53
78
|
*/
|
|
54
79
|
error?: string | null;
|
|
55
80
|
/**
|
|
56
|
-
*
|
|
81
|
+
* When the last run started; the upload time until a run has started
|
|
57
82
|
* @type {Date}
|
|
58
83
|
* @memberof WorkflowDetailResponse
|
|
59
84
|
*/
|
|
@@ -20,6 +20,7 @@ exports.WorkflowDetailResponseFromJSONTyped = WorkflowDetailResponseFromJSONType
|
|
|
20
20
|
exports.WorkflowDetailResponseToJSON = WorkflowDetailResponseToJSON;
|
|
21
21
|
exports.WorkflowDetailResponseToJSONTyped = WorkflowDetailResponseToJSONTyped;
|
|
22
22
|
const PipelineStatus_1 = require("./PipelineStatus");
|
|
23
|
+
const UserInfo_1 = require("./UserInfo");
|
|
23
24
|
exports.WorkflowDetailResponsePropertyValidationAttributesMap = {};
|
|
24
25
|
/**
|
|
25
26
|
* Check if a given object implements the WorkflowDetailResponse interface.
|
|
@@ -29,8 +30,16 @@ function instanceOfWorkflowDetailResponse(value) {
|
|
|
29
30
|
return false;
|
|
30
31
|
if (!('documentId' in value) || value['documentId'] === undefined)
|
|
31
32
|
return false;
|
|
33
|
+
if (!('documentName' in value) || value['documentName'] === undefined)
|
|
34
|
+
return false;
|
|
35
|
+
if (!('materializedPath' in value) || value['materializedPath'] === undefined)
|
|
36
|
+
return false;
|
|
32
37
|
if (!('documentVersionId' in value) || value['documentVersionId'] === undefined)
|
|
33
38
|
return false;
|
|
39
|
+
if (!('isActiveVersion' in value) || value['isActiveVersion'] === undefined)
|
|
40
|
+
return false;
|
|
41
|
+
if (!('uploader' in value) || value['uploader'] === undefined)
|
|
42
|
+
return false;
|
|
34
43
|
if (!('status' in value) || value['status'] === undefined)
|
|
35
44
|
return false;
|
|
36
45
|
if (!('lastRunTimestamp' in value) || value['lastRunTimestamp'] === undefined)
|
|
@@ -59,7 +68,11 @@ function WorkflowDetailResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
59
68
|
return {
|
|
60
69
|
'workflowId': json['workflow_id'],
|
|
61
70
|
'documentId': json['document_id'],
|
|
71
|
+
'documentName': json['document_name'],
|
|
72
|
+
'materializedPath': json['materialized_path'],
|
|
62
73
|
'documentVersionId': json['document_version_id'],
|
|
74
|
+
'isActiveVersion': json['is_active_version'],
|
|
75
|
+
'uploader': (0, UserInfo_1.UserInfoFromJSON)(json['uploader']),
|
|
63
76
|
'status': (0, PipelineStatus_1.PipelineStatusFromJSON)(json['status']),
|
|
64
77
|
'lastActivity': json['last_activity'] == null ? undefined : json['last_activity'],
|
|
65
78
|
'error': json['error'] == null ? undefined : json['error'],
|
|
@@ -85,7 +98,11 @@ function WorkflowDetailResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
85
98
|
return {
|
|
86
99
|
'workflow_id': value['workflowId'],
|
|
87
100
|
'document_id': value['documentId'],
|
|
101
|
+
'document_name': value['documentName'],
|
|
102
|
+
'materialized_path': value['materializedPath'],
|
|
88
103
|
'document_version_id': value['documentVersionId'],
|
|
104
|
+
'is_active_version': value['isActiveVersion'],
|
|
105
|
+
'uploader': (0, UserInfo_1.UserInfoToJSON)(value['uploader']),
|
|
89
106
|
'status': (0, PipelineStatus_1.PipelineStatusToJSON)(value['status']),
|
|
90
107
|
'last_activity': value['lastActivity'],
|
|
91
108
|
'error': value['error'],
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import type { PipelineStatus } from './PipelineStatus';
|
|
13
|
+
import type { UserInfo } from './UserInfo';
|
|
13
14
|
/**
|
|
14
15
|
* List item - DB-only fields, no Temporal call per item.
|
|
15
16
|
* @export
|
|
@@ -28,12 +29,36 @@ export interface WorkflowSummaryResponse {
|
|
|
28
29
|
* @memberof WorkflowSummaryResponse
|
|
29
30
|
*/
|
|
30
31
|
documentId: string;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @type {string}
|
|
35
|
+
* @memberof WorkflowSummaryResponse
|
|
36
|
+
*/
|
|
37
|
+
documentName: string;
|
|
38
|
+
/**
|
|
39
|
+
* The document's path
|
|
40
|
+
* @type {string}
|
|
41
|
+
* @memberof WorkflowSummaryResponse
|
|
42
|
+
*/
|
|
43
|
+
materializedPath: string;
|
|
31
44
|
/**
|
|
32
45
|
*
|
|
33
46
|
* @type {string}
|
|
34
47
|
* @memberof WorkflowSummaryResponse
|
|
35
48
|
*/
|
|
36
49
|
documentVersionId: string;
|
|
50
|
+
/**
|
|
51
|
+
* Whether this version is the document's active one; false for an unfinished newer upload and for a superseded older version
|
|
52
|
+
* @type {boolean}
|
|
53
|
+
* @memberof WorkflowSummaryResponse
|
|
54
|
+
*/
|
|
55
|
+
isActiveVersion: boolean;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @type {UserInfo}
|
|
59
|
+
* @memberof WorkflowSummaryResponse
|
|
60
|
+
*/
|
|
61
|
+
uploader: UserInfo;
|
|
37
62
|
/**
|
|
38
63
|
*
|
|
39
64
|
* @type {PipelineStatus}
|
|
@@ -53,7 +78,7 @@ export interface WorkflowSummaryResponse {
|
|
|
53
78
|
*/
|
|
54
79
|
error?: string | null;
|
|
55
80
|
/**
|
|
56
|
-
*
|
|
81
|
+
* When the last run started; the upload time until a run has started
|
|
57
82
|
* @type {Date}
|
|
58
83
|
* @memberof WorkflowSummaryResponse
|
|
59
84
|
*/
|
|
@@ -20,6 +20,7 @@ exports.WorkflowSummaryResponseFromJSONTyped = WorkflowSummaryResponseFromJSONTy
|
|
|
20
20
|
exports.WorkflowSummaryResponseToJSON = WorkflowSummaryResponseToJSON;
|
|
21
21
|
exports.WorkflowSummaryResponseToJSONTyped = WorkflowSummaryResponseToJSONTyped;
|
|
22
22
|
const PipelineStatus_1 = require("./PipelineStatus");
|
|
23
|
+
const UserInfo_1 = require("./UserInfo");
|
|
23
24
|
exports.WorkflowSummaryResponsePropertyValidationAttributesMap = {};
|
|
24
25
|
/**
|
|
25
26
|
* Check if a given object implements the WorkflowSummaryResponse interface.
|
|
@@ -29,8 +30,16 @@ function instanceOfWorkflowSummaryResponse(value) {
|
|
|
29
30
|
return false;
|
|
30
31
|
if (!('documentId' in value) || value['documentId'] === undefined)
|
|
31
32
|
return false;
|
|
33
|
+
if (!('documentName' in value) || value['documentName'] === undefined)
|
|
34
|
+
return false;
|
|
35
|
+
if (!('materializedPath' in value) || value['materializedPath'] === undefined)
|
|
36
|
+
return false;
|
|
32
37
|
if (!('documentVersionId' in value) || value['documentVersionId'] === undefined)
|
|
33
38
|
return false;
|
|
39
|
+
if (!('isActiveVersion' in value) || value['isActiveVersion'] === undefined)
|
|
40
|
+
return false;
|
|
41
|
+
if (!('uploader' in value) || value['uploader'] === undefined)
|
|
42
|
+
return false;
|
|
34
43
|
if (!('status' in value) || value['status'] === undefined)
|
|
35
44
|
return false;
|
|
36
45
|
if (!('lastRunTimestamp' in value) || value['lastRunTimestamp'] === undefined)
|
|
@@ -49,7 +58,11 @@ function WorkflowSummaryResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
49
58
|
return {
|
|
50
59
|
'workflowId': json['workflow_id'],
|
|
51
60
|
'documentId': json['document_id'],
|
|
61
|
+
'documentName': json['document_name'],
|
|
62
|
+
'materializedPath': json['materialized_path'],
|
|
52
63
|
'documentVersionId': json['document_version_id'],
|
|
64
|
+
'isActiveVersion': json['is_active_version'],
|
|
65
|
+
'uploader': (0, UserInfo_1.UserInfoFromJSON)(json['uploader']),
|
|
53
66
|
'status': (0, PipelineStatus_1.PipelineStatusFromJSON)(json['status']),
|
|
54
67
|
'lastActivity': json['last_activity'] == null ? undefined : json['last_activity'],
|
|
55
68
|
'error': json['error'] == null ? undefined : json['error'],
|
|
@@ -68,7 +81,11 @@ function WorkflowSummaryResponseToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
68
81
|
return {
|
|
69
82
|
'workflow_id': value['workflowId'],
|
|
70
83
|
'document_id': value['documentId'],
|
|
84
|
+
'document_name': value['documentName'],
|
|
85
|
+
'materialized_path': value['materializedPath'],
|
|
71
86
|
'document_version_id': value['documentVersionId'],
|
|
87
|
+
'is_active_version': value['isActiveVersion'],
|
|
88
|
+
'uploader': (0, UserInfo_1.UserInfoToJSON)(value['uploader']),
|
|
72
89
|
'status': (0, PipelineStatus_1.PipelineStatusToJSON)(value['status']),
|
|
73
90
|
'last_activity': value['lastActivity'],
|
|
74
91
|
'error': value['error'],
|
package/dist/models/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export * from './BulkModelTablesRequest';
|
|
|
35
35
|
export * from './BulkModelTablesResponse';
|
|
36
36
|
export * from './BulkMoveRequest';
|
|
37
37
|
export * from './BulkOperationResponse';
|
|
38
|
+
export * from './BulkRerunRequest';
|
|
38
39
|
export * from './BulkRevokeRequest';
|
|
39
40
|
export * from './BulkTagRequest';
|
|
40
41
|
export * from './BulkTrashRequest';
|
|
@@ -235,6 +236,7 @@ export * from './PaginatedResponseTenantUserResponse';
|
|
|
235
236
|
export * from './PaginatedResponseThreadMessageResponse';
|
|
236
237
|
export * from './PaginatedResponseThreadResponse';
|
|
237
238
|
export * from './PaginatedResponseTrashItemResponse';
|
|
239
|
+
export * from './PaginatedResponseUserInfo';
|
|
238
240
|
export * from './PaginatedResponseWorkflowDefinitionResponse';
|
|
239
241
|
export * from './PaginatedResponseWorkflowRunResponse';
|
|
240
242
|
export * from './PaginatedResponseWorkflowSummaryResponse';
|
package/dist/models/index.js
CHANGED
|
@@ -53,6 +53,7 @@ __exportStar(require("./BulkModelTablesRequest"), exports);
|
|
|
53
53
|
__exportStar(require("./BulkModelTablesResponse"), exports);
|
|
54
54
|
__exportStar(require("./BulkMoveRequest"), exports);
|
|
55
55
|
__exportStar(require("./BulkOperationResponse"), exports);
|
|
56
|
+
__exportStar(require("./BulkRerunRequest"), exports);
|
|
56
57
|
__exportStar(require("./BulkRevokeRequest"), exports);
|
|
57
58
|
__exportStar(require("./BulkTagRequest"), exports);
|
|
58
59
|
__exportStar(require("./BulkTrashRequest"), exports);
|
|
@@ -253,6 +254,7 @@ __exportStar(require("./PaginatedResponseTenantUserResponse"), exports);
|
|
|
253
254
|
__exportStar(require("./PaginatedResponseThreadMessageResponse"), exports);
|
|
254
255
|
__exportStar(require("./PaginatedResponseThreadResponse"), exports);
|
|
255
256
|
__exportStar(require("./PaginatedResponseTrashItemResponse"), exports);
|
|
257
|
+
__exportStar(require("./PaginatedResponseUserInfo"), exports);
|
|
256
258
|
__exportStar(require("./PaginatedResponseWorkflowDefinitionResponse"), exports);
|
|
257
259
|
__exportStar(require("./PaginatedResponseWorkflowRunResponse"), exports);
|
|
258
260
|
__exportStar(require("./PaginatedResponseWorkflowSummaryResponse"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
# BulkRerunRequest
|
|
3
|
+
|
|
4
|
+
Re-run ingestion for the selected document versions.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`documentVersionIds` | Array<string>
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { BulkRerunRequest } from '@knowledge-stack/ksapi'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"documentVersionIds": null,
|
|
20
|
+
} satisfies BulkRerunRequest
|
|
21
|
+
|
|
22
|
+
console.log(example)
|
|
23
|
+
|
|
24
|
+
// Convert the instance to a JSON string
|
|
25
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
26
|
+
console.log(exampleJSON)
|
|
27
|
+
|
|
28
|
+
// Parse the JSON string back to an object
|
|
29
|
+
const exampleParsed = JSON.parse(exampleJSON) as BulkRerunRequest
|
|
30
|
+
console.log(exampleParsed)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
34
|
+
|
|
35
|
+
|
|
@@ -826,7 +826,7 @@ example().catch(console.error);
|
|
|
826
826
|
|
|
827
827
|
Update Document Version Metadata Handler
|
|
828
828
|
|
|
829
|
-
Merge metadata fields into an existing document version\'s metadata. Only non-null fields in the request body are merged; existing metadata fields not present in the request are preserved. When this PATCH settles an ``inputs/`` upload\'s ingestion (an in-progress pipeline reaching a terminal state), it drives the parent workflow run forward: the two-step ``PENDING <-> NOT_STARTED`` toggle, plus auto-start / auto-fail for an ``auto_start`` run (see ``WorkflowRunStartService.auto_advance_on_input_settled``).
|
|
829
|
+
Merge metadata fields into an existing document version\'s metadata. Only non-null fields in the request body are merged; existing metadata fields not present in the request are preserved. When this PATCH settles an ``inputs/`` upload\'s ingestion (an in-progress pipeline reaching a terminal state), it drives the parent workflow run forward: the two-step ``PENDING <-> NOT_STARTED`` toggle, plus auto-start / auto-fail for an ``auto_start`` run (see ``WorkflowRunStartService.auto_advance_on_input_settled``). Any settle pushes a tenant-wide ``document_detail_changed``; a failed, cancelled or quota-limited one does so with the ``ingestion_failed`` kind so open views (the Ingestions page) refetch.
|
|
830
830
|
|
|
831
831
|
### Example
|
|
832
832
|
|
package/docs/DocumentsApi.md
CHANGED
|
@@ -832,7 +832,7 @@ example().catch(console.error);
|
|
|
832
832
|
|
|
833
833
|
Ingest Zip Handler
|
|
834
834
|
|
|
835
|
-
Upload a ZIP archive; ingest each member asynchronously via a fan-out. The whole archive nests under a single FOLDER named after the ZIP file (``report.zip`` -> ``report/``), with the ZIP\'s directory structure mirrored beneath it as FOLDER PathParts — all created synchronously. Returns 202 with the fan-out ``workflow_id`` (poll ``GET /v1/system-jobs/zip-ingestions/{workflow_id}`` for per-member outcomes)
|
|
835
|
+
Upload a ZIP archive; ingest each member asynchronously via a fan-out. The whole archive nests under a single FOLDER named after the ZIP file (``report.zip`` -> ``report/``), with the ZIP\'s directory structure mirrored beneath it as FOLDER PathParts — all created synchronously. Returns 202 with the fan-out ``workflow_id`` (poll ``GET /v1/system-jobs/zip-ingestions/{workflow_id}`` for per-member outcomes). ``skipped`` carries OS artifacts (skipped) and the members rejected up front (nested archive, empty, over the size cap) as errors; with nothing left to ingest no workflow starts and ``workflow_id`` is null. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes; a re-upload whose ZIP-named folder already exists returns 409. Failures of accepted members (for example an unsupported file type) surface in the polled workflow results, not in this response. Each member reuses the single-file ingest path, so run-enrollment and completion events fire per member there.
|
|
836
836
|
|
|
837
837
|
### Example
|
|
838
838
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# PaginatedResponseUserInfo
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`items` | [Array<UserInfo>](UserInfo.md)
|
|
10
|
+
`total` | number
|
|
11
|
+
`limit` | number
|
|
12
|
+
`offset` | number
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { PaginatedResponseUserInfo } from '@knowledge-stack/ksapi'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"items": null,
|
|
22
|
+
"total": null,
|
|
23
|
+
"limit": null,
|
|
24
|
+
"offset": null,
|
|
25
|
+
} satisfies PaginatedResponseUserInfo
|
|
26
|
+
|
|
27
|
+
console.log(example)
|
|
28
|
+
|
|
29
|
+
// Convert the instance to a JSON string
|
|
30
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
31
|
+
console.log(exampleJSON)
|
|
32
|
+
|
|
33
|
+
// Parse the JSON string back to an object
|
|
34
|
+
const exampleParsed = JSON.parse(exampleJSON) as PaginatedResponseUserInfo
|
|
35
|
+
console.log(exampleParsed)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
39
|
+
|
|
40
|
+
|
package/docs/SystemJobsApi.md
CHANGED
|
@@ -4,22 +4,99 @@ All URIs are relative to *http://localhost:8000*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
|
+
| [**bulkRerunDvWorkflows**](SystemJobsApi.md#bulkrerundvworkflows) | **POST** /v1/system-jobs/document_versions/bulk-rerun | Bulk Rerun Dv Workflows Handler |
|
|
7
8
|
| [**cancelTemporalWorkflow**](SystemJobsApi.md#canceltemporalworkflow) | **DELETE** /v1/system-jobs/{workflow_id} | Cancel Temporal Workflow Handler |
|
|
8
9
|
| [**dvWorkflowRerun**](SystemJobsApi.md#dvworkflowrerun) | **POST** /v1/system-jobs/document_versions/{workflow_id} | Dv Workflow Rerun Handler |
|
|
9
10
|
| [**getDvWorkflow**](SystemJobsApi.md#getdvworkflow) | **GET** /v1/system-jobs/document_versions/{workflow_id} | Get Dv Workflow Handler |
|
|
10
11
|
| [**getTemporalWorkflowStatus**](SystemJobsApi.md#gettemporalworkflowstatus) | **GET** /v1/system-jobs/{workflow_id} | Get Temporal Workflow Status Handler |
|
|
11
12
|
| [**getZipIngestionStatus**](SystemJobsApi.md#getzipingestionstatus) | **GET** /v1/system-jobs/zip-ingestions/{workflow_id} | Get Zip Ingestion Status Handler |
|
|
13
|
+
| [**listDvWorkflowUploaders**](SystemJobsApi.md#listdvworkflowuploaders) | **GET** /v1/system-jobs/document_versions/uploaders | List Dv Workflow Uploaders Handler |
|
|
12
14
|
| [**listDvWorkflows**](SystemJobsApi.md#listdvworkflows) | **GET** /v1/system-jobs/document_versions | List Dv Workflows Handler |
|
|
13
15
|
|
|
14
16
|
|
|
15
17
|
|
|
18
|
+
## bulkRerunDvWorkflows
|
|
19
|
+
|
|
20
|
+
> BulkOperationResponse bulkRerunDvWorkflows(bulkRerunRequest)
|
|
21
|
+
|
|
22
|
+
Bulk Rerun Dv Workflows Handler
|
|
23
|
+
|
|
24
|
+
Re-run ingestion for the selected document versions, reporting per item. ``not_found``: missing, trashed, never ingested or without its stored source; ``forbidden``: no ``can_write``; ``in_progress_workflow``: still pending/processing; ``already_ingested``: completed; ``unsupported_document_type``: a type that is no longer ingested; ``superseded``: a newer version of the document exists. More than 200 ids is a 400 before any re-run.
|
|
25
|
+
|
|
26
|
+
### Example
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import {
|
|
30
|
+
Configuration,
|
|
31
|
+
SystemJobsApi,
|
|
32
|
+
} from '@knowledge-stack/ksapi';
|
|
33
|
+
import type { BulkRerunDvWorkflowsRequest } from '@knowledge-stack/ksapi';
|
|
34
|
+
|
|
35
|
+
async function example() {
|
|
36
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
37
|
+
const config = new Configuration({
|
|
38
|
+
// To configure API key authorization: cookieAuth
|
|
39
|
+
apiKey: "YOUR API KEY",
|
|
40
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
41
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
42
|
+
});
|
|
43
|
+
const api = new SystemJobsApi(config);
|
|
44
|
+
|
|
45
|
+
const body = {
|
|
46
|
+
// BulkRerunRequest
|
|
47
|
+
bulkRerunRequest: ...,
|
|
48
|
+
} satisfies BulkRerunDvWorkflowsRequest;
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
const data = await api.bulkRerunDvWorkflows(body);
|
|
52
|
+
console.log(data);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
console.error(error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Run the test
|
|
59
|
+
example().catch(console.error);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Parameters
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
| Name | Type | Description | Notes |
|
|
66
|
+
|------------- | ------------- | ------------- | -------------|
|
|
67
|
+
| **bulkRerunRequest** | [BulkRerunRequest](BulkRerunRequest.md) | | |
|
|
68
|
+
|
|
69
|
+
### Return type
|
|
70
|
+
|
|
71
|
+
[**BulkOperationResponse**](BulkOperationResponse.md)
|
|
72
|
+
|
|
73
|
+
### Authorization
|
|
74
|
+
|
|
75
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
76
|
+
|
|
77
|
+
### HTTP request headers
|
|
78
|
+
|
|
79
|
+
- **Content-Type**: `application/json`
|
|
80
|
+
- **Accept**: `application/json`
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### HTTP response details
|
|
84
|
+
| Status code | Description | Response headers |
|
|
85
|
+
|-------------|-------------|------------------|
|
|
86
|
+
| **200** | Successful Response | - |
|
|
87
|
+
| **422** | Validation Error | - |
|
|
88
|
+
| **0** | Error response. | - |
|
|
89
|
+
|
|
90
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
91
|
+
|
|
92
|
+
|
|
16
93
|
## cancelTemporalWorkflow
|
|
17
94
|
|
|
18
95
|
> WorkflowCancelResponse cancelTemporalWorkflow(workflowId)
|
|
19
96
|
|
|
20
97
|
Cancel Temporal Workflow Handler
|
|
21
98
|
|
|
22
|
-
Cancel any Temporal workflow owned by the caller\'s tenant. No status guard — this is a thin Temporal wrapper. Cancelling an already-terminal workflow is a no-op on the Temporal side.
|
|
99
|
+
Cancel any Temporal workflow owned by the caller\'s tenant. No status guard — this is a thin Temporal wrapper. Cancelling an already-terminal workflow is a no-op on the Temporal side. A run no worker ever picked up is terminated instead, since a cancel request is itself a workflow task nobody would process. When Temporal no longer has the run, or it was terminated here, a document version still showing it running is settled as cancelled (needs ``can_write``) so it can be re-run.
|
|
23
100
|
|
|
24
101
|
### Example
|
|
25
102
|
|
|
@@ -94,7 +171,7 @@ example().catch(console.error);
|
|
|
94
171
|
|
|
95
172
|
Dv Workflow Rerun Handler
|
|
96
173
|
|
|
97
|
-
Rerun a workflow. USER role requires ``can_write`` on the document path. ``s3_client`` is injected because ``DocumentIngestionService.__init__`` requires it, even though the re-ingestion path reuses the existing S3 source.
|
|
174
|
+
Rerun a workflow. USER role requires ``can_write`` on the document path. A version that a newer live version supersedes is refused with 409. ``s3_client`` is injected because ``DocumentIngestionService.__init__`` requires it, even though the re-ingestion path reuses the existing S3 source.
|
|
98
175
|
|
|
99
176
|
### Example
|
|
100
177
|
|
|
@@ -319,7 +396,7 @@ example().catch(console.error);
|
|
|
319
396
|
|
|
320
397
|
Get Zip Ingestion Status Handler
|
|
321
398
|
|
|
322
|
-
Get a ZIP fan-out\'s live status + per-member outcomes. Tenant-scoped via the TenantId search attribute (no per-path can_read check — intentionally consistent with the sibling generic Temporal endpoints below; the opaque workflow_id is only handed to the uploader, who had can_write on the target). The per-member results come from the workflow\'s ``results`` query (served from retained history), so once Temporal retention expires this 404s.
|
|
399
|
+
Get a ZIP fan-out\'s live status + per-member outcomes. Tenant-scoped via the TenantId search attribute (no per-path can_read check — intentionally consistent with the sibling generic Temporal endpoints below; the opaque workflow_id is only handed to the uploader, who had can_write on the target). The per-member results come from the workflow\'s ``results`` query (served from retained history), so once Temporal retention expires this 404s. Any other workflow type has no ``results`` query and is a 404, not a 500.
|
|
323
400
|
|
|
324
401
|
### Example
|
|
325
402
|
|
|
@@ -388,13 +465,94 @@ example().catch(console.error);
|
|
|
388
465
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
389
466
|
|
|
390
467
|
|
|
468
|
+
## listDvWorkflowUploaders
|
|
469
|
+
|
|
470
|
+
> PaginatedResponseUserInfo listDvWorkflowUploaders(usernameLike, limit, offset)
|
|
471
|
+
|
|
472
|
+
List Dv Workflow Uploaders Handler
|
|
473
|
+
|
|
474
|
+
People who uploaded a version the caller can list, for the uploader filter. Scoped like ``list_dv_workflows``: USER only counts versions under readable paths.
|
|
475
|
+
|
|
476
|
+
### Example
|
|
477
|
+
|
|
478
|
+
```ts
|
|
479
|
+
import {
|
|
480
|
+
Configuration,
|
|
481
|
+
SystemJobsApi,
|
|
482
|
+
} from '@knowledge-stack/ksapi';
|
|
483
|
+
import type { ListDvWorkflowUploadersRequest } from '@knowledge-stack/ksapi';
|
|
484
|
+
|
|
485
|
+
async function example() {
|
|
486
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
487
|
+
const config = new Configuration({
|
|
488
|
+
// To configure API key authorization: cookieAuth
|
|
489
|
+
apiKey: "YOUR API KEY",
|
|
490
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
491
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
492
|
+
});
|
|
493
|
+
const api = new SystemJobsApi(config);
|
|
494
|
+
|
|
495
|
+
const body = {
|
|
496
|
+
// string | Case-insensitive substring of the first or last name (optional)
|
|
497
|
+
usernameLike: usernameLike_example,
|
|
498
|
+
// number | Number of items per page (optional)
|
|
499
|
+
limit: 56,
|
|
500
|
+
// number | Number of items to skip (optional)
|
|
501
|
+
offset: 56,
|
|
502
|
+
} satisfies ListDvWorkflowUploadersRequest;
|
|
503
|
+
|
|
504
|
+
try {
|
|
505
|
+
const data = await api.listDvWorkflowUploaders(body);
|
|
506
|
+
console.log(data);
|
|
507
|
+
} catch (error) {
|
|
508
|
+
console.error(error);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// Run the test
|
|
513
|
+
example().catch(console.error);
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
### Parameters
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
| Name | Type | Description | Notes |
|
|
520
|
+
|------------- | ------------- | ------------- | -------------|
|
|
521
|
+
| **usernameLike** | `string` | Case-insensitive substring of the first or last name | [Optional] [Defaults to `undefined`] |
|
|
522
|
+
| **limit** | `number` | Number of items per page | [Optional] [Defaults to `20`] |
|
|
523
|
+
| **offset** | `number` | Number of items to skip | [Optional] [Defaults to `0`] |
|
|
524
|
+
|
|
525
|
+
### Return type
|
|
526
|
+
|
|
527
|
+
[**PaginatedResponseUserInfo**](PaginatedResponseUserInfo.md)
|
|
528
|
+
|
|
529
|
+
### Authorization
|
|
530
|
+
|
|
531
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
532
|
+
|
|
533
|
+
### HTTP request headers
|
|
534
|
+
|
|
535
|
+
- **Content-Type**: Not defined
|
|
536
|
+
- **Accept**: `application/json`
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
### HTTP response details
|
|
540
|
+
| Status code | Description | Response headers |
|
|
541
|
+
|-------------|-------------|------------------|
|
|
542
|
+
| **200** | Successful Response | - |
|
|
543
|
+
| **422** | Validation Error | - |
|
|
544
|
+
| **0** | Error response. | - |
|
|
545
|
+
|
|
546
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
547
|
+
|
|
548
|
+
|
|
391
549
|
## listDvWorkflows
|
|
392
550
|
|
|
393
|
-
> PaginatedResponseWorkflowSummaryResponse listDvWorkflows(limit, offset)
|
|
551
|
+
> PaginatedResponseWorkflowSummaryResponse listDvWorkflows(limit, offset, sortDir, status, nameLike, latestVersionOnly, uploaderUserId, createdAfter, createdBefore, updatedAfter, updatedBefore)
|
|
394
552
|
|
|
395
553
|
List Dv Workflows Handler
|
|
396
554
|
|
|
397
|
-
List
|
|
555
|
+
List ingestions of live documents in the current tenant, newest upload first. ADMIN/OWNER see every version; USER only versions under readable paths. ``sort_dir=ASC`` lists the oldest upload first.
|
|
398
556
|
|
|
399
557
|
### Example
|
|
400
558
|
|
|
@@ -420,6 +578,24 @@ async function example() {
|
|
|
420
578
|
limit: 56,
|
|
421
579
|
// number | Number of items to skip (optional)
|
|
422
580
|
offset: 56,
|
|
581
|
+
// SortDirection | Sort direction (ASC or DESC); overrides the field\'s natural default. Every sort field supports both directions. (optional)
|
|
582
|
+
sortDir: ...,
|
|
583
|
+
// Array<PipelineStatus> | Only versions in one of these pipeline statuses (optional)
|
|
584
|
+
status: ...,
|
|
585
|
+
// string | Case-insensitive substring filter on document name (optional)
|
|
586
|
+
nameLike: nameLike_example,
|
|
587
|
+
// boolean | Skip versions superseded by a newer version (optional)
|
|
588
|
+
latestVersionOnly: true,
|
|
589
|
+
// string | Filter to versions uploaded by this user (optional)
|
|
590
|
+
uploaderUserId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
591
|
+
// Date | Only items created at or after this timestamp (inclusive) (optional)
|
|
592
|
+
createdAfter: 2013-10-20T19:20:30+01:00,
|
|
593
|
+
// Date | Only items created strictly before this timestamp (optional)
|
|
594
|
+
createdBefore: 2013-10-20T19:20:30+01:00,
|
|
595
|
+
// Date | Only items updated at or after this timestamp (inclusive) (optional)
|
|
596
|
+
updatedAfter: 2013-10-20T19:20:30+01:00,
|
|
597
|
+
// Date | Only items updated strictly before this timestamp (optional)
|
|
598
|
+
updatedBefore: 2013-10-20T19:20:30+01:00,
|
|
423
599
|
} satisfies ListDvWorkflowsRequest;
|
|
424
600
|
|
|
425
601
|
try {
|
|
@@ -441,6 +617,15 @@ example().catch(console.error);
|
|
|
441
617
|
|------------- | ------------- | ------------- | -------------|
|
|
442
618
|
| **limit** | `number` | Number of items per page | [Optional] [Defaults to `20`] |
|
|
443
619
|
| **offset** | `number` | Number of items to skip | [Optional] [Defaults to `0`] |
|
|
620
|
+
| **sortDir** | `SortDirection` | Sort direction (ASC or DESC); overrides the field\'s natural default. Every sort field supports both directions. | [Optional] [Defaults to `undefined`] [Enum: ASC, DESC] |
|
|
621
|
+
| **status** | `Array<PipelineStatus>` | Only versions in one of these pipeline statuses | [Optional] |
|
|
622
|
+
| **nameLike** | `string` | Case-insensitive substring filter on document name | [Optional] [Defaults to `undefined`] |
|
|
623
|
+
| **latestVersionOnly** | `boolean` | Skip versions superseded by a newer version | [Optional] [Defaults to `false`] |
|
|
624
|
+
| **uploaderUserId** | `string` | Filter to versions uploaded by this user | [Optional] [Defaults to `undefined`] |
|
|
625
|
+
| **createdAfter** | `Date` | Only items created at or after this timestamp (inclusive) | [Optional] [Defaults to `undefined`] |
|
|
626
|
+
| **createdBefore** | `Date` | Only items created strictly before this timestamp | [Optional] [Defaults to `undefined`] |
|
|
627
|
+
| **updatedAfter** | `Date` | Only items updated at or after this timestamp (inclusive) | [Optional] [Defaults to `undefined`] |
|
|
628
|
+
| **updatedBefore** | `Date` | Only items updated strictly before this timestamp | [Optional] [Defaults to `undefined`] |
|
|
444
629
|
|
|
445
630
|
### Return type
|
|
446
631
|
|
|
@@ -9,7 +9,11 @@ Name | Type
|
|
|
9
9
|
------------ | -------------
|
|
10
10
|
`workflowId` | string
|
|
11
11
|
`documentId` | string
|
|
12
|
+
`documentName` | string
|
|
13
|
+
`materializedPath` | string
|
|
12
14
|
`documentVersionId` | string
|
|
15
|
+
`isActiveVersion` | boolean
|
|
16
|
+
`uploader` | [UserInfo](UserInfo.md)
|
|
13
17
|
`status` | [PipelineStatus](PipelineStatus.md)
|
|
14
18
|
`lastActivity` | string
|
|
15
19
|
`error` | string
|
|
@@ -33,7 +37,11 @@ import type { WorkflowDetailResponse } from '@knowledge-stack/ksapi'
|
|
|
33
37
|
const example = {
|
|
34
38
|
"workflowId": null,
|
|
35
39
|
"documentId": null,
|
|
40
|
+
"documentName": null,
|
|
41
|
+
"materializedPath": null,
|
|
36
42
|
"documentVersionId": null,
|
|
43
|
+
"isActiveVersion": null,
|
|
44
|
+
"uploader": null,
|
|
37
45
|
"status": null,
|
|
38
46
|
"lastActivity": null,
|
|
39
47
|
"error": null,
|
|
@@ -9,7 +9,11 @@ Name | Type
|
|
|
9
9
|
------------ | -------------
|
|
10
10
|
`workflowId` | string
|
|
11
11
|
`documentId` | string
|
|
12
|
+
`documentName` | string
|
|
13
|
+
`materializedPath` | string
|
|
12
14
|
`documentVersionId` | string
|
|
15
|
+
`isActiveVersion` | boolean
|
|
16
|
+
`uploader` | [UserInfo](UserInfo.md)
|
|
13
17
|
`status` | [PipelineStatus](PipelineStatus.md)
|
|
14
18
|
`lastActivity` | string
|
|
15
19
|
`error` | string
|
|
@@ -26,7 +30,11 @@ import type { WorkflowSummaryResponse } from '@knowledge-stack/ksapi'
|
|
|
26
30
|
const example = {
|
|
27
31
|
"workflowId": null,
|
|
28
32
|
"documentId": null,
|
|
33
|
+
"documentName": null,
|
|
34
|
+
"materializedPath": null,
|
|
29
35
|
"documentVersionId": null,
|
|
36
|
+
"isActiveVersion": null,
|
|
37
|
+
"uploader": null,
|
|
30
38
|
"status": null,
|
|
31
39
|
"lastActivity": null,
|
|
32
40
|
"error": null,
|