@knowledge-stack/ksapi 1.81.0 → 1.83.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 +10 -0
- package/README.md +12 -2
- package/dist/apis/WorkflowDefinitionsApi.d.ts +4 -1
- package/dist/apis/WorkflowDefinitionsApi.js +2 -0
- package/dist/apis/WorkflowRunsApi.d.ts +233 -1
- package/dist/apis/WorkflowRunsApi.js +236 -0
- package/dist/esm/apis/WorkflowDefinitionsApi.d.ts +4 -1
- package/dist/esm/apis/WorkflowDefinitionsApi.js +2 -0
- package/dist/esm/apis/WorkflowRunsApi.d.ts +233 -1
- package/dist/esm/apis/WorkflowRunsApi.js +237 -1
- package/dist/esm/models/CreateWorkflowDefinitionRequest.d.ts +14 -1
- package/dist/esm/models/CreateWorkflowDefinitionRequest.js +3 -4
- package/dist/esm/models/InstructionSnapshot.d.ts +71 -0
- package/dist/esm/models/InstructionSnapshot.js +57 -0
- package/dist/esm/models/InvokeWorkflowRequest.d.ts +6 -0
- package/dist/esm/models/InvokeWorkflowRequest.js +6 -0
- package/dist/esm/models/PathPartApprovalDecision.d.ts +30 -0
- package/dist/esm/models/PathPartApprovalDecision.js +48 -0
- package/dist/esm/models/PathPartApprovalResponse.d.ts +111 -0
- package/dist/esm/models/PathPartApprovalResponse.js +85 -0
- package/dist/esm/models/RejectFileRequest.d.ts +47 -0
- package/dist/esm/models/RejectFileRequest.js +49 -0
- package/dist/esm/models/RunLockResponse.d.ts +59 -0
- package/dist/esm/models/RunLockResponse.js +52 -0
- package/dist/esm/models/UpdateWorkflowDefinitionRequest.d.ts +12 -1
- package/dist/esm/models/UpdateWorkflowDefinitionRequest.js +2 -0
- package/dist/esm/models/WorkflowDefinitionResponse.d.ts +6 -0
- package/dist/esm/models/WorkflowDefinitionResponse.js +4 -0
- package/dist/esm/models/WorkflowRunResponse.d.ts +17 -0
- package/dist/esm/models/WorkflowRunResponse.js +8 -0
- package/dist/esm/models/WorkflowRunSnapshot.d.ts +3 -2
- package/dist/esm/models/WorkflowRunSnapshot.js +3 -2
- package/dist/esm/models/WorkflowRunStatus.d.ts +20 -2
- package/dist/esm/models/WorkflowRunStatus.js +20 -2
- package/dist/esm/models/WorkflowRunnerType.d.ts +1 -0
- package/dist/esm/models/WorkflowRunnerType.js +2 -1
- package/dist/esm/models/index.d.ts +5 -0
- package/dist/esm/models/index.js +5 -0
- package/dist/models/CreateWorkflowDefinitionRequest.d.ts +14 -1
- package/dist/models/CreateWorkflowDefinitionRequest.js +3 -4
- package/dist/models/InstructionSnapshot.d.ts +71 -0
- package/dist/models/InstructionSnapshot.js +65 -0
- package/dist/models/InvokeWorkflowRequest.d.ts +6 -0
- package/dist/models/InvokeWorkflowRequest.js +6 -0
- package/dist/models/PathPartApprovalDecision.d.ts +30 -0
- package/dist/models/PathPartApprovalDecision.js +56 -0
- package/dist/models/PathPartApprovalResponse.d.ts +111 -0
- package/dist/models/PathPartApprovalResponse.js +93 -0
- package/dist/models/RejectFileRequest.d.ts +47 -0
- package/dist/models/RejectFileRequest.js +57 -0
- package/dist/models/RunLockResponse.d.ts +59 -0
- package/dist/models/RunLockResponse.js +60 -0
- package/dist/models/UpdateWorkflowDefinitionRequest.d.ts +12 -1
- package/dist/models/UpdateWorkflowDefinitionRequest.js +2 -0
- package/dist/models/WorkflowDefinitionResponse.d.ts +6 -0
- package/dist/models/WorkflowDefinitionResponse.js +4 -0
- package/dist/models/WorkflowRunResponse.d.ts +17 -0
- package/dist/models/WorkflowRunResponse.js +8 -0
- package/dist/models/WorkflowRunSnapshot.d.ts +3 -2
- package/dist/models/WorkflowRunSnapshot.js +3 -2
- package/dist/models/WorkflowRunStatus.d.ts +20 -2
- package/dist/models/WorkflowRunStatus.js +20 -2
- package/dist/models/WorkflowRunnerType.d.ts +1 -0
- package/dist/models/WorkflowRunnerType.js +2 -1
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +5 -0
- package/docs/CreateWorkflowDefinitionRequest.md +3 -1
- package/docs/InstructionSnapshot.md +41 -0
- package/docs/InvokeWorkflowRequest.md +2 -0
- package/docs/PathPartApprovalDecision.md +33 -0
- package/docs/PathPartApprovalResponse.md +55 -0
- package/docs/RejectFileRequest.md +35 -0
- package/docs/RunLockResponse.md +39 -0
- package/docs/UpdateWorkflowDefinitionRequest.md +3 -1
- package/docs/WorkflowDefinitionResponse.md +2 -0
- package/docs/WorkflowDefinitionsApi.md +2 -0
- package/docs/WorkflowRunResponse.md +5 -1
- package/docs/WorkflowRunSnapshot.md +1 -1
- package/docs/WorkflowRunStatus.md +1 -1
- package/docs/WorkflowRunsApi.md +387 -0
- package/package.json +1 -1
- package/src/apis/WorkflowDefinitionsApi.ts +4 -1
- package/src/apis/WorkflowRunsApi.ts +479 -0
- package/src/models/CreateWorkflowDefinitionRequest.ts +17 -4
- package/src/models/InstructionSnapshot.ts +125 -0
- package/src/models/InvokeWorkflowRequest.ts +12 -0
- package/src/models/PathPartApprovalDecision.ts +58 -0
- package/src/models/PathPartApprovalResponse.ts +186 -0
- package/src/models/RejectFileRequest.ts +87 -0
- package/src/models/RunLockResponse.ts +101 -0
- package/src/models/UpdateWorkflowDefinitionRequest.ts +14 -1
- package/src/models/WorkflowDefinitionResponse.ts +9 -0
- package/src/models/WorkflowRunResponse.ts +23 -0
- package/src/models/WorkflowRunSnapshot.ts +11 -4
- package/src/models/WorkflowRunStatus.ts +20 -2
- package/src/models/WorkflowRunnerType.ts +2 -1
- package/src/models/index.ts +5 -0
|
@@ -37,6 +37,11 @@ import {
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Workflow run response.
|
|
40
|
+
*
|
|
41
|
+
* Note: ``run_token_jti`` is intentionally NOT exposed. It's an
|
|
42
|
+
* internal token identifier persisted on the run row for callback
|
|
43
|
+
* auth — clients should treat run dispatch state as observable via
|
|
44
|
+
* ``status`` (RUNNING => dispatched), not via JTI presence.
|
|
40
45
|
* @export
|
|
41
46
|
* @interface WorkflowRunResponse
|
|
42
47
|
*/
|
|
@@ -95,6 +100,18 @@ export interface WorkflowRunResponse {
|
|
|
95
100
|
* @memberof WorkflowRunResponse
|
|
96
101
|
*/
|
|
97
102
|
error: string | null;
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
* @type {Array<string>}
|
|
106
|
+
* @memberof WorkflowRunResponse
|
|
107
|
+
*/
|
|
108
|
+
inputPathPartIds: Array<string>;
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
* @type {Array<string>}
|
|
112
|
+
* @memberof WorkflowRunResponse
|
|
113
|
+
*/
|
|
114
|
+
inputVersionIds: Array<string>;
|
|
98
115
|
/**
|
|
99
116
|
*
|
|
100
117
|
* @type {Date}
|
|
@@ -141,6 +158,8 @@ export function instanceOfWorkflowRunResponse(value: object): value is WorkflowR
|
|
|
141
158
|
if (!('completedAt' in value) || value['completedAt'] === undefined) return false;
|
|
142
159
|
if (!('runSnapshot' in value) || value['runSnapshot'] === undefined) return false;
|
|
143
160
|
if (!('error' in value) || value['error'] === undefined) return false;
|
|
161
|
+
if (!('inputPathPartIds' in value) || value['inputPathPartIds'] === undefined) return false;
|
|
162
|
+
if (!('inputVersionIds' in value) || value['inputVersionIds'] === undefined) return false;
|
|
144
163
|
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
145
164
|
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
|
|
146
165
|
return true;
|
|
@@ -165,6 +184,8 @@ export function WorkflowRunResponseFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
165
184
|
'completedAt': (json['completed_at'] == null ? null : new Date(json['completed_at'])),
|
|
166
185
|
'runSnapshot': WorkflowRunSnapshotFromJSON(json['run_snapshot']),
|
|
167
186
|
'error': json['error'],
|
|
187
|
+
'inputPathPartIds': json['input_path_part_ids'],
|
|
188
|
+
'inputVersionIds': json['input_version_ids'],
|
|
168
189
|
'createdAt': (new Date(json['created_at'])),
|
|
169
190
|
'updatedAt': (new Date(json['updated_at'])),
|
|
170
191
|
};
|
|
@@ -190,6 +211,8 @@ export function WorkflowRunResponseToJSONTyped(value?: WorkflowRunResponse | nul
|
|
|
190
211
|
'completed_at': value['completedAt'] == null ? value['completedAt'] : value['completedAt'].toISOString(),
|
|
191
212
|
'run_snapshot': WorkflowRunSnapshotToJSON(value['runSnapshot']),
|
|
192
213
|
'error': value['error'],
|
|
214
|
+
'input_path_part_ids': value['inputPathPartIds'],
|
|
215
|
+
'input_version_ids': value['inputVersionIds'],
|
|
193
216
|
'created_at': value['createdAt'].toISOString(),
|
|
194
217
|
'updated_at': value['updatedAt'].toISOString(),
|
|
195
218
|
};
|
|
@@ -20,6 +20,13 @@ import {
|
|
|
20
20
|
ABCDPathSnapshotToJSON,
|
|
21
21
|
ABCDPathSnapshotToJSONTyped,
|
|
22
22
|
} from './ABCDPathSnapshot';
|
|
23
|
+
import type { InstructionSnapshot } from './InstructionSnapshot';
|
|
24
|
+
import {
|
|
25
|
+
InstructionSnapshotFromJSON,
|
|
26
|
+
InstructionSnapshotFromJSONTyped,
|
|
27
|
+
InstructionSnapshotToJSON,
|
|
28
|
+
InstructionSnapshotToJSONTyped,
|
|
29
|
+
} from './InstructionSnapshot';
|
|
23
30
|
import type { WorkflowRunnerType } from './WorkflowRunnerType';
|
|
24
31
|
import {
|
|
25
32
|
WorkflowRunnerTypeFromJSON,
|
|
@@ -72,10 +79,10 @@ export interface WorkflowRunSnapshot {
|
|
|
72
79
|
sources: Array<ABCDPathSnapshot>;
|
|
73
80
|
/**
|
|
74
81
|
*
|
|
75
|
-
* @type {Array<
|
|
82
|
+
* @type {Array<InstructionSnapshot>}
|
|
76
83
|
* @memberof WorkflowRunSnapshot
|
|
77
84
|
*/
|
|
78
|
-
instructions: Array<
|
|
85
|
+
instructions: Array<InstructionSnapshot>;
|
|
79
86
|
/**
|
|
80
87
|
*
|
|
81
88
|
* @type {Array<ABCDPathSnapshot>}
|
|
@@ -141,7 +148,7 @@ export function WorkflowRunSnapshotFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
141
148
|
'userId': json['user_id'],
|
|
142
149
|
'maxRunDurationSeconds': json['max_run_duration_seconds'],
|
|
143
150
|
'sources': ((json['sources'] as Array<any>).map(ABCDPathSnapshotFromJSON)),
|
|
144
|
-
'instructions': ((json['instructions'] as Array<any>).map(
|
|
151
|
+
'instructions': ((json['instructions'] as Array<any>).map(InstructionSnapshotFromJSON)),
|
|
145
152
|
'outputs': ((json['outputs'] as Array<any>).map(ABCDPathSnapshotFromJSON)),
|
|
146
153
|
'template': ABCDPathSnapshotFromJSON(json['template']),
|
|
147
154
|
};
|
|
@@ -164,7 +171,7 @@ export function WorkflowRunSnapshotToJSONTyped(value?: WorkflowRunSnapshot | nul
|
|
|
164
171
|
'user_id': value['userId'],
|
|
165
172
|
'max_run_duration_seconds': value['maxRunDurationSeconds'],
|
|
166
173
|
'sources': ((value['sources'] as Array<any>).map(ABCDPathSnapshotToJSON)),
|
|
167
|
-
'instructions': ((value['instructions'] as Array<any>).map(
|
|
174
|
+
'instructions': ((value['instructions'] as Array<any>).map(InstructionSnapshotToJSON)),
|
|
168
175
|
'outputs': ((value['outputs'] as Array<any>).map(ABCDPathSnapshotToJSON)),
|
|
169
176
|
'template': ABCDPathSnapshotToJSON(value['template']),
|
|
170
177
|
};
|
|
@@ -14,13 +14,31 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Combined lifecycle + approval-rollup status of a workflow run.
|
|
18
|
+
*
|
|
19
|
+
* Absorbs the prior split between ``status`` (PENDING/RUNNING/COMPLETED/
|
|
20
|
+
* FAILED) and ``approval_state`` (in_progress/awaiting_review/approved/
|
|
21
|
+
* rejected/failed). One state field per run.
|
|
22
|
+
*
|
|
23
|
+
* Allowed transitions::
|
|
24
|
+
*
|
|
25
|
+
* PENDING -> IN_PROGRESS (agent dispatched)
|
|
26
|
+
* IN_PROGRESS -> COMPLETED (workflow.approval_required=FALSE)
|
|
27
|
+
* IN_PROGRESS -> NEEDS_APPROVAL (workflow.approval_required=TRUE, agent done)
|
|
28
|
+
* NEEDS_APPROVAL -> APPROVED (run folder approved by reviewer)
|
|
29
|
+
* NEEDS_APPROVAL -> REJECTED (run folder or any child rejected)
|
|
30
|
+
* APPROVED -> NEEDS_APPROVAL (run folder unapproved)
|
|
31
|
+
* REJECTED -> NEEDS_APPROVAL (rejection reversed; mutable)
|
|
32
|
+
* any non-terminal -> FAILED (agent error)
|
|
18
33
|
* @export
|
|
19
34
|
*/
|
|
20
35
|
export const WorkflowRunStatus = {
|
|
21
36
|
Pending: 'PENDING',
|
|
22
|
-
|
|
37
|
+
InProgress: 'IN_PROGRESS',
|
|
23
38
|
Completed: 'COMPLETED',
|
|
39
|
+
NeedsApproval: 'NEEDS_APPROVAL',
|
|
40
|
+
Approved: 'APPROVED',
|
|
41
|
+
Rejected: 'REJECTED',
|
|
24
42
|
Failed: 'FAILED'
|
|
25
43
|
} as const;
|
|
26
44
|
export type WorkflowRunStatus = typeof WorkflowRunStatus[keyof typeof WorkflowRunStatus];
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
* @export
|
|
19
19
|
*/
|
|
20
20
|
export const WorkflowRunnerType = {
|
|
21
|
-
SelfHosted: 'SELF_HOSTED'
|
|
21
|
+
SelfHosted: 'SELF_HOSTED',
|
|
22
|
+
KsInternal: 'KS_INTERNAL'
|
|
22
23
|
} as const;
|
|
23
24
|
export type WorkflowRunnerType = typeof WorkflowRunnerType[keyof typeof WorkflowRunnerType];
|
|
24
25
|
|
package/src/models/index.ts
CHANGED
|
@@ -76,6 +76,7 @@ export * from './ImageTaxonomy';
|
|
|
76
76
|
export * from './InformationStatistics';
|
|
77
77
|
export * from './IngestDocumentResponse';
|
|
78
78
|
export * from './IngestionMode';
|
|
79
|
+
export * from './InstructionSnapshot';
|
|
79
80
|
export * from './InviteLinkSettingsRequest';
|
|
80
81
|
export * from './InviteLinkSettingsResponse';
|
|
81
82
|
export * from './InviteResponse';
|
|
@@ -117,6 +118,8 @@ export * from './PasswordResetRequest';
|
|
|
117
118
|
export * from './PasswordResetWithTokenRequest';
|
|
118
119
|
export * from './PathOrder';
|
|
119
120
|
export * from './PathPartAncestorItem';
|
|
121
|
+
export * from './PathPartApprovalDecision';
|
|
122
|
+
export * from './PathPartApprovalResponse';
|
|
120
123
|
export * from './PathPartResponse';
|
|
121
124
|
export * from './PathPartTagsResponse';
|
|
122
125
|
export * from './PermissionCapability';
|
|
@@ -126,9 +129,11 @@ export * from './PipelineStatus';
|
|
|
126
129
|
export * from './Polygon';
|
|
127
130
|
export * from './PolygonReference';
|
|
128
131
|
export * from './ReferenceType';
|
|
132
|
+
export * from './RejectFileRequest';
|
|
129
133
|
export * from './ResolvedReferenceInput';
|
|
130
134
|
export * from './ResolvedReferenceOutput';
|
|
131
135
|
export * from './RootResponse';
|
|
136
|
+
export * from './RunLockResponse';
|
|
132
137
|
export * from './SSOInitiateResponse';
|
|
133
138
|
export * from './ScoredChunkResponse';
|
|
134
139
|
export * from './SearchSortOrder';
|