@knowledge-stack/ksapi 1.149.0 → 1.150.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 +5 -2
- package/dist/apis/DocumentsApi.d.ts +13 -4
- package/dist/apis/DocumentsApi.js +11 -2
- package/dist/apis/SystemJobsApi.d.ts +39 -1
- package/dist/apis/SystemJobsApi.js +48 -0
- package/dist/esm/apis/DocumentsApi.d.ts +13 -4
- package/dist/esm/apis/DocumentsApi.js +11 -2
- package/dist/esm/apis/SystemJobsApi.d.ts +39 -1
- package/dist/esm/apis/SystemJobsApi.js +49 -1
- package/dist/esm/models/DocumentVersionMetadata.d.ts +6 -0
- package/dist/esm/models/DocumentVersionMetadata.js +2 -0
- package/dist/esm/models/IngestZipResponse.d.ts +10 -23
- package/dist/esm/models/IngestZipResponse.js +5 -17
- package/dist/esm/models/ZipIngestionStatusResponse.d.ts +64 -0
- package/dist/esm/models/ZipIngestionStatusResponse.js +53 -0
- package/dist/esm/models/ZipMemberStatusResponse.d.ts +77 -0
- package/dist/esm/models/ZipMemberStatusResponse.js +54 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/models/DocumentVersionMetadata.d.ts +6 -0
- package/dist/models/DocumentVersionMetadata.js +2 -0
- package/dist/models/IngestZipResponse.d.ts +10 -23
- package/dist/models/IngestZipResponse.js +5 -17
- package/dist/models/ZipIngestionStatusResponse.d.ts +64 -0
- package/dist/models/ZipIngestionStatusResponse.js +61 -0
- package/dist/models/ZipMemberStatusResponse.d.ts +77 -0
- package/dist/models/ZipMemberStatusResponse.js +62 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/docs/DocumentVersionMetadata.md +2 -0
- package/docs/DocumentsApi.md +12 -3
- package/docs/IngestZipResponse.md +4 -10
- package/docs/SystemJobsApi.md +76 -0
- package/docs/ZipIngestionStatusResponse.md +39 -0
- package/docs/ZipMemberStatusResponse.md +45 -0
- package/package.json +1 -1
- package/src/apis/DocumentsApi.ts +25 -4
- package/src/apis/SystemJobsApi.ts +86 -0
- package/src/models/DocumentVersionMetadata.ts +8 -0
- package/src/models/IngestZipResponse.ts +15 -37
- package/src/models/ZipIngestionStatusResponse.ts +113 -0
- package/src/models/ZipMemberStatusResponse.ts +123 -0
- package/src/models/index.ts +2 -0
|
@@ -22,6 +22,7 @@ import type {
|
|
|
22
22
|
WorkflowActionResponse,
|
|
23
23
|
WorkflowCancelResponse,
|
|
24
24
|
WorkflowDetailResponse,
|
|
25
|
+
ZipIngestionStatusResponse,
|
|
25
26
|
} from '../models/index';
|
|
26
27
|
import {
|
|
27
28
|
ErrorResponseFromJSON,
|
|
@@ -38,6 +39,8 @@ import {
|
|
|
38
39
|
WorkflowCancelResponseToJSON,
|
|
39
40
|
WorkflowDetailResponseFromJSON,
|
|
40
41
|
WorkflowDetailResponseToJSON,
|
|
42
|
+
ZipIngestionStatusResponseFromJSON,
|
|
43
|
+
ZipIngestionStatusResponseToJSON,
|
|
41
44
|
} from '../models/index';
|
|
42
45
|
|
|
43
46
|
export interface CancelTemporalWorkflowRequest {
|
|
@@ -56,6 +59,10 @@ export interface GetTemporalWorkflowStatusRequest {
|
|
|
56
59
|
workflowId: string;
|
|
57
60
|
}
|
|
58
61
|
|
|
62
|
+
export interface GetZipIngestionStatusRequest {
|
|
63
|
+
workflowId: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
59
66
|
export interface ListDvWorkflowsRequest {
|
|
60
67
|
limit?: number;
|
|
61
68
|
offset?: number;
|
|
@@ -164,6 +171,30 @@ export interface SystemJobsApiInterface {
|
|
|
164
171
|
*/
|
|
165
172
|
getTemporalWorkflowStatus(requestParameters: GetTemporalWorkflowStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TemporalWorkflowStatusResponse>;
|
|
166
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Creates request options for getZipIngestionStatus without sending the request
|
|
176
|
+
* @param {string} workflowId
|
|
177
|
+
* @throws {RequiredError}
|
|
178
|
+
* @memberof SystemJobsApiInterface
|
|
179
|
+
*/
|
|
180
|
+
getZipIngestionStatusRequestOpts(requestParameters: GetZipIngestionStatusRequest): Promise<runtime.RequestOpts>;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Get a ZIP fan-out\'s live status + per-member outcomes. Tenant-scoped via the TenantId search attribute. The per-member results come from the workflow\'s ``results`` query (served from retained history), so once Temporal retention expires this returns 404.
|
|
184
|
+
* @summary Get Zip Ingestion Status Handler
|
|
185
|
+
* @param {string} workflowId
|
|
186
|
+
* @param {*} [options] Override http request option.
|
|
187
|
+
* @throws {RequiredError}
|
|
188
|
+
* @memberof SystemJobsApiInterface
|
|
189
|
+
*/
|
|
190
|
+
getZipIngestionStatusRaw(requestParameters: GetZipIngestionStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ZipIngestionStatusResponse>>;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Get a ZIP fan-out\'s live status + per-member outcomes. Tenant-scoped via the TenantId search attribute. The per-member results come from the workflow\'s ``results`` query (served from retained history), so once Temporal retention expires this returns 404.
|
|
194
|
+
* Get Zip Ingestion Status Handler
|
|
195
|
+
*/
|
|
196
|
+
getZipIngestionStatus(requestParameters: GetZipIngestionStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ZipIngestionStatusResponse>;
|
|
197
|
+
|
|
167
198
|
/**
|
|
168
199
|
* Creates request options for listDvWorkflows without sending the request
|
|
169
200
|
* @param {number} [limit] Number of items per page
|
|
@@ -417,6 +448,61 @@ export class SystemJobsApi extends runtime.BaseAPI implements SystemJobsApiInter
|
|
|
417
448
|
return await response.value();
|
|
418
449
|
}
|
|
419
450
|
|
|
451
|
+
/**
|
|
452
|
+
* Creates request options for getZipIngestionStatus without sending the request
|
|
453
|
+
*/
|
|
454
|
+
async getZipIngestionStatusRequestOpts(requestParameters: GetZipIngestionStatusRequest): Promise<runtime.RequestOpts> {
|
|
455
|
+
if (requestParameters['workflowId'] == null) {
|
|
456
|
+
throw new runtime.RequiredError(
|
|
457
|
+
'workflowId',
|
|
458
|
+
'Required parameter "workflowId" was null or undefined when calling getZipIngestionStatus().'
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
const queryParameters: any = {};
|
|
463
|
+
|
|
464
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
465
|
+
|
|
466
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
467
|
+
const token = this.configuration.accessToken;
|
|
468
|
+
const tokenString = await token("bearerAuth", []);
|
|
469
|
+
|
|
470
|
+
if (tokenString) {
|
|
471
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
let urlPath = `/v1/system-jobs/zip-ingestions/{workflow_id}`;
|
|
476
|
+
urlPath = urlPath.replace(`{${"workflow_id"}}`, encodeURIComponent(String(requestParameters['workflowId'])));
|
|
477
|
+
|
|
478
|
+
return {
|
|
479
|
+
path: urlPath,
|
|
480
|
+
method: 'GET',
|
|
481
|
+
headers: headerParameters,
|
|
482
|
+
query: queryParameters,
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Get a ZIP fan-out\'s live status + per-member outcomes. Tenant-scoped via the TenantId search attribute. The per-member results come from the workflow\'s ``results`` query (served from retained history), so once Temporal retention expires this returns 404.
|
|
488
|
+
* Get Zip Ingestion Status Handler
|
|
489
|
+
*/
|
|
490
|
+
async getZipIngestionStatusRaw(requestParameters: GetZipIngestionStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ZipIngestionStatusResponse>> {
|
|
491
|
+
const requestOptions = await this.getZipIngestionStatusRequestOpts(requestParameters);
|
|
492
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
493
|
+
|
|
494
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ZipIngestionStatusResponseFromJSON(jsonValue));
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Get a ZIP fan-out\'s live status + per-member outcomes. Tenant-scoped via the TenantId search attribute. The per-member results come from the workflow\'s ``results`` query (served from retained history), so once Temporal retention expires this returns 404.
|
|
499
|
+
* Get Zip Ingestion Status Handler
|
|
500
|
+
*/
|
|
501
|
+
async getZipIngestionStatus(requestParameters: GetZipIngestionStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ZipIngestionStatusResponse> {
|
|
502
|
+
const response = await this.getZipIngestionStatusRaw(requestParameters, initOverrides);
|
|
503
|
+
return await response.value();
|
|
504
|
+
}
|
|
505
|
+
|
|
420
506
|
/**
|
|
421
507
|
* Creates request options for listDvWorkflows without sending the request
|
|
422
508
|
*/
|
|
@@ -170,6 +170,12 @@ export interface DocumentVersionMetadata {
|
|
|
170
170
|
* @memberof DocumentVersionMetadata
|
|
171
171
|
*/
|
|
172
172
|
fileMd5?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Opt-in create key. A repeat ingest with the same key at the same (parent, name) replays this document instead of colliding — makes a ZIP fan-out member retry idempotent.
|
|
175
|
+
* @type {string}
|
|
176
|
+
* @memberof DocumentVersionMetadata
|
|
177
|
+
*/
|
|
178
|
+
idempotencyKey?: string | null;
|
|
173
179
|
}
|
|
174
180
|
export const DocumentVersionMetadataPropertyValidationAttributesMap: {
|
|
175
181
|
[property: string]: {
|
|
@@ -226,6 +232,7 @@ export function DocumentVersionMetadataFromJSONTyped(json: any, ignoreDiscrimina
|
|
|
226
232
|
'quotaPageCount': json['quota_page_count'] == null ? undefined : json['quota_page_count'],
|
|
227
233
|
'quotaIdempotencyKey': json['quota_idempotency_key'] == null ? undefined : json['quota_idempotency_key'],
|
|
228
234
|
'fileMd5': json['file_md5'] == null ? undefined : json['file_md5'],
|
|
235
|
+
'idempotencyKey': json['idempotency_key'] == null ? undefined : json['idempotency_key'],
|
|
229
236
|
};
|
|
230
237
|
}
|
|
231
238
|
|
|
@@ -260,6 +267,7 @@ export function DocumentVersionMetadataToJSONTyped(value?: DocumentVersionMetada
|
|
|
260
267
|
'quota_page_count': value['quotaPageCount'],
|
|
261
268
|
'quota_idempotency_key': value['quotaIdempotencyKey'],
|
|
262
269
|
'file_md5': value['fileMd5'],
|
|
270
|
+
'idempotency_key': value['idempotencyKey'],
|
|
263
271
|
};
|
|
264
272
|
}
|
|
265
273
|
|
|
@@ -22,41 +22,28 @@ import {
|
|
|
22
22
|
} from './ZipFileResult';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Response from dispatching a ZIP archive to async ingestion.
|
|
26
|
+
*
|
|
27
|
+
* ``workflow_id`` is the fan-out workflow to poll at
|
|
28
|
+
* ``GET /v1/system-jobs/zip-ingestions/{workflow_id}`` for per-member outcomes;
|
|
29
|
+
* it is None when the archive held no ingestible members. ``skipped`` are the
|
|
30
|
+
* artifact/error entries resolved synchronously during classification.
|
|
26
31
|
* @export
|
|
27
32
|
* @interface IngestZipResponse
|
|
28
33
|
*/
|
|
29
34
|
export interface IngestZipResponse {
|
|
30
35
|
/**
|
|
31
36
|
*
|
|
32
|
-
* @type {
|
|
33
|
-
* @memberof IngestZipResponse
|
|
34
|
-
*/
|
|
35
|
-
files: Array<ZipFileResult>;
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @type {number}
|
|
37
|
+
* @type {string}
|
|
39
38
|
* @memberof IngestZipResponse
|
|
40
39
|
*/
|
|
41
|
-
|
|
40
|
+
workflowId: string | null;
|
|
42
41
|
/**
|
|
43
42
|
*
|
|
44
|
-
* @type {
|
|
45
|
-
* @memberof IngestZipResponse
|
|
46
|
-
*/
|
|
47
|
-
succeeded: number;
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @type {number}
|
|
51
|
-
* @memberof IngestZipResponse
|
|
52
|
-
*/
|
|
53
|
-
skipped: number;
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @type {number}
|
|
43
|
+
* @type {Array<ZipFileResult>}
|
|
57
44
|
* @memberof IngestZipResponse
|
|
58
45
|
*/
|
|
59
|
-
|
|
46
|
+
skipped: Array<ZipFileResult>;
|
|
60
47
|
}
|
|
61
48
|
export const IngestZipResponsePropertyValidationAttributesMap: {
|
|
62
49
|
[property: string]: {
|
|
@@ -80,11 +67,8 @@ export const IngestZipResponsePropertyValidationAttributesMap: {
|
|
|
80
67
|
* Check if a given object implements the IngestZipResponse interface.
|
|
81
68
|
*/
|
|
82
69
|
export function instanceOfIngestZipResponse(value: object): value is IngestZipResponse {
|
|
83
|
-
if (!('
|
|
84
|
-
if (!('totalFound' in value) || value['totalFound'] === undefined) return false;
|
|
85
|
-
if (!('succeeded' in value) || value['succeeded'] === undefined) return false;
|
|
70
|
+
if (!('workflowId' in value) || value['workflowId'] === undefined) return false;
|
|
86
71
|
if (!('skipped' in value) || value['skipped'] === undefined) return false;
|
|
87
|
-
if (!('failed' in value) || value['failed'] === undefined) return false;
|
|
88
72
|
return true;
|
|
89
73
|
}
|
|
90
74
|
|
|
@@ -98,11 +82,8 @@ export function IngestZipResponseFromJSONTyped(json: any, ignoreDiscriminator: b
|
|
|
98
82
|
}
|
|
99
83
|
return {
|
|
100
84
|
|
|
101
|
-
'
|
|
102
|
-
'
|
|
103
|
-
'succeeded': json['succeeded'],
|
|
104
|
-
'skipped': json['skipped'],
|
|
105
|
-
'failed': json['failed'],
|
|
85
|
+
'workflowId': json['workflow_id'],
|
|
86
|
+
'skipped': ((json['skipped'] as Array<any>).map(ZipFileResultFromJSON)),
|
|
106
87
|
};
|
|
107
88
|
}
|
|
108
89
|
|
|
@@ -117,11 +98,8 @@ export function IngestZipResponseToJSONTyped(value?: IngestZipResponse | null, i
|
|
|
117
98
|
|
|
118
99
|
return {
|
|
119
100
|
|
|
120
|
-
'
|
|
121
|
-
'
|
|
122
|
-
'succeeded': value['succeeded'],
|
|
123
|
-
'skipped': value['skipped'],
|
|
124
|
-
'failed': value['failed'],
|
|
101
|
+
'workflow_id': value['workflowId'],
|
|
102
|
+
'skipped': ((value['skipped'] as Array<any>).map(ZipFileResultToJSON)),
|
|
125
103
|
};
|
|
126
104
|
}
|
|
127
105
|
|
|
@@ -0,0 +1,113 @@
|
|
|
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 { ZipMemberStatusResponse } from './ZipMemberStatusResponse';
|
|
17
|
+
import {
|
|
18
|
+
ZipMemberStatusResponseFromJSON,
|
|
19
|
+
ZipMemberStatusResponseFromJSONTyped,
|
|
20
|
+
ZipMemberStatusResponseToJSON,
|
|
21
|
+
ZipMemberStatusResponseToJSONTyped,
|
|
22
|
+
} from './ZipMemberStatusResponse';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Status of a ZIP fan-out: live Temporal state + per-member outcomes.
|
|
26
|
+
*
|
|
27
|
+
* ``files`` reflects progress so far — members that have been dispatched
|
|
28
|
+
* (``workflow_id`` set), failed to dispatch (``error`` set), or were skipped as
|
|
29
|
+
* artifacts. Poll until ``temporal_status`` is terminal (e.g. ``COMPLETED``).
|
|
30
|
+
* @export
|
|
31
|
+
* @interface ZipIngestionStatusResponse
|
|
32
|
+
*/
|
|
33
|
+
export interface ZipIngestionStatusResponse {
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof ZipIngestionStatusResponse
|
|
38
|
+
*/
|
|
39
|
+
workflowId: string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof ZipIngestionStatusResponse
|
|
44
|
+
*/
|
|
45
|
+
temporalStatus: string;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {Array<ZipMemberStatusResponse>}
|
|
49
|
+
* @memberof ZipIngestionStatusResponse
|
|
50
|
+
*/
|
|
51
|
+
files: Array<ZipMemberStatusResponse>;
|
|
52
|
+
}
|
|
53
|
+
export const ZipIngestionStatusResponsePropertyValidationAttributesMap: {
|
|
54
|
+
[property: string]: {
|
|
55
|
+
maxLength?: number,
|
|
56
|
+
minLength?: number,
|
|
57
|
+
pattern?: string,
|
|
58
|
+
maximum?: number,
|
|
59
|
+
exclusiveMaximum?: boolean,
|
|
60
|
+
minimum?: number,
|
|
61
|
+
exclusiveMinimum?: boolean,
|
|
62
|
+
multipleOf?: number,
|
|
63
|
+
maxItems?: number,
|
|
64
|
+
minItems?: number,
|
|
65
|
+
uniqueItems?: boolean
|
|
66
|
+
}
|
|
67
|
+
} = {
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Check if a given object implements the ZipIngestionStatusResponse interface.
|
|
73
|
+
*/
|
|
74
|
+
export function instanceOfZipIngestionStatusResponse(value: object): value is ZipIngestionStatusResponse {
|
|
75
|
+
if (!('workflowId' in value) || value['workflowId'] === undefined) return false;
|
|
76
|
+
if (!('temporalStatus' in value) || value['temporalStatus'] === undefined) return false;
|
|
77
|
+
if (!('files' in value) || value['files'] === undefined) return false;
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function ZipIngestionStatusResponseFromJSON(json: any): ZipIngestionStatusResponse {
|
|
82
|
+
return ZipIngestionStatusResponseFromJSONTyped(json, false);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function ZipIngestionStatusResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ZipIngestionStatusResponse {
|
|
86
|
+
if (json == null) {
|
|
87
|
+
return json;
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
|
|
91
|
+
'workflowId': json['workflow_id'],
|
|
92
|
+
'temporalStatus': json['temporal_status'],
|
|
93
|
+
'files': ((json['files'] as Array<any>).map(ZipMemberStatusResponseFromJSON)),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function ZipIngestionStatusResponseToJSON(json: any): ZipIngestionStatusResponse {
|
|
98
|
+
return ZipIngestionStatusResponseToJSONTyped(json, false);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function ZipIngestionStatusResponseToJSONTyped(value?: ZipIngestionStatusResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
102
|
+
if (value == null) {
|
|
103
|
+
return value;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
|
|
108
|
+
'workflow_id': value['workflowId'],
|
|
109
|
+
'temporal_status': value['temporalStatus'],
|
|
110
|
+
'files': ((value['files'] as Array<any>).map(ZipMemberStatusResponseToJSON)),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* One member's outcome within a ZIP fan-out (from the workflow query).
|
|
18
|
+
* @export
|
|
19
|
+
* @interface ZipMemberStatusResponse
|
|
20
|
+
*/
|
|
21
|
+
export interface ZipMemberStatusResponse {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ZipMemberStatusResponse
|
|
26
|
+
*/
|
|
27
|
+
zipPath: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof ZipMemberStatusResponse
|
|
32
|
+
*/
|
|
33
|
+
documentId?: string | null;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof ZipMemberStatusResponse
|
|
38
|
+
*/
|
|
39
|
+
documentVersionId?: string | null;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof ZipMemberStatusResponse
|
|
44
|
+
*/
|
|
45
|
+
workflowId?: string | null;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof ZipMemberStatusResponse
|
|
50
|
+
*/
|
|
51
|
+
error?: string | null;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {boolean}
|
|
55
|
+
* @memberof ZipMemberStatusResponse
|
|
56
|
+
*/
|
|
57
|
+
skipped?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export const ZipMemberStatusResponsePropertyValidationAttributesMap: {
|
|
60
|
+
[property: string]: {
|
|
61
|
+
maxLength?: number,
|
|
62
|
+
minLength?: number,
|
|
63
|
+
pattern?: string,
|
|
64
|
+
maximum?: number,
|
|
65
|
+
exclusiveMaximum?: boolean,
|
|
66
|
+
minimum?: number,
|
|
67
|
+
exclusiveMinimum?: boolean,
|
|
68
|
+
multipleOf?: number,
|
|
69
|
+
maxItems?: number,
|
|
70
|
+
minItems?: number,
|
|
71
|
+
uniqueItems?: boolean
|
|
72
|
+
}
|
|
73
|
+
} = {
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Check if a given object implements the ZipMemberStatusResponse interface.
|
|
79
|
+
*/
|
|
80
|
+
export function instanceOfZipMemberStatusResponse(value: object): value is ZipMemberStatusResponse {
|
|
81
|
+
if (!('zipPath' in value) || value['zipPath'] === undefined) return false;
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function ZipMemberStatusResponseFromJSON(json: any): ZipMemberStatusResponse {
|
|
86
|
+
return ZipMemberStatusResponseFromJSONTyped(json, false);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function ZipMemberStatusResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ZipMemberStatusResponse {
|
|
90
|
+
if (json == null) {
|
|
91
|
+
return json;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
|
|
95
|
+
'zipPath': json['zip_path'],
|
|
96
|
+
'documentId': json['document_id'] == null ? undefined : json['document_id'],
|
|
97
|
+
'documentVersionId': json['document_version_id'] == null ? undefined : json['document_version_id'],
|
|
98
|
+
'workflowId': json['workflow_id'] == null ? undefined : json['workflow_id'],
|
|
99
|
+
'error': json['error'] == null ? undefined : json['error'],
|
|
100
|
+
'skipped': json['skipped'] == null ? undefined : json['skipped'],
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function ZipMemberStatusResponseToJSON(json: any): ZipMemberStatusResponse {
|
|
105
|
+
return ZipMemberStatusResponseToJSONTyped(json, false);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function ZipMemberStatusResponseToJSONTyped(value?: ZipMemberStatusResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
109
|
+
if (value == null) {
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return {
|
|
114
|
+
|
|
115
|
+
'zip_path': value['zipPath'],
|
|
116
|
+
'document_id': value['documentId'],
|
|
117
|
+
'document_version_id': value['documentVersionId'],
|
|
118
|
+
'workflow_id': value['workflowId'],
|
|
119
|
+
'error': value['error'],
|
|
120
|
+
'skipped': value['skipped'],
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -363,3 +363,5 @@ export * from './XlsxCellAnchorInputOrDocxParagraphAnchorInput';
|
|
|
363
363
|
export * from './XlsxCellAnchorOutput';
|
|
364
364
|
export * from './XlsxCellAnchorOutputOrDocxParagraphAnchorOutput';
|
|
365
365
|
export * from './ZipFileResult';
|
|
366
|
+
export * from './ZipIngestionStatusResponse';
|
|
367
|
+
export * from './ZipMemberStatusResponse';
|