@knowledge-stack/ksapi 1.149.1 → 1.151.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 -2
- package/README.md +5 -3
- package/dist/apis/DocumentsApi.d.ts +13 -4
- package/dist/apis/DocumentsApi.js +11 -2
- package/dist/apis/MemoryApi.d.ts +5 -5
- package/dist/apis/MemoryApi.js +1 -1
- 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/MemoryApi.d.ts +5 -5
- package/dist/esm/apis/MemoryApi.js +2 -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/{ProposedMemoryChunkResponse.js → ZipIngestionStatusResponse.js} +19 -40
- package/dist/esm/models/{ProposedMemoryChunkResponse.d.ts → ZipMemberStatusResponse.d.ts} +23 -37
- package/dist/esm/models/ZipMemberStatusResponse.js +54 -0
- package/dist/esm/models/index.d.ts +2 -1
- package/dist/esm/models/index.js +2 -1
- 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/{ProposedMemoryChunkResponse.js → ZipIngestionStatusResponse.js} +25 -46
- package/dist/models/{ProposedMemoryChunkResponse.d.ts → ZipMemberStatusResponse.d.ts} +23 -37
- package/dist/models/ZipMemberStatusResponse.js +62 -0
- package/dist/models/index.d.ts +2 -1
- package/dist/models/index.js +2 -1
- package/docs/DocumentVersionMetadata.md +2 -0
- package/docs/DocumentsApi.md +12 -3
- package/docs/IngestZipResponse.md +4 -10
- package/docs/MemoryApi.md +2 -2
- 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/MemoryApi.ts +8 -8
- 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 -1
- package/docs/ProposedMemoryChunkResponse.md +0 -48
- package/src/models/ProposedMemoryChunkResponse.ts +0 -163
|
@@ -11,41 +11,28 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { ZipFileResult } from './ZipFileResult';
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Response from dispatching a ZIP archive to async ingestion.
|
|
15
|
+
*
|
|
16
|
+
* ``workflow_id`` is the fan-out workflow to poll at
|
|
17
|
+
* ``GET /v1/system-jobs/zip-ingestions/{workflow_id}`` for per-member outcomes;
|
|
18
|
+
* it is None when the archive held no ingestible members. ``skipped`` are the
|
|
19
|
+
* artifact/error entries resolved synchronously during classification.
|
|
15
20
|
* @export
|
|
16
21
|
* @interface IngestZipResponse
|
|
17
22
|
*/
|
|
18
23
|
export interface IngestZipResponse {
|
|
19
24
|
/**
|
|
20
25
|
*
|
|
21
|
-
* @type {
|
|
22
|
-
* @memberof IngestZipResponse
|
|
23
|
-
*/
|
|
24
|
-
files: Array<ZipFileResult>;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @type {number}
|
|
26
|
+
* @type {string}
|
|
28
27
|
* @memberof IngestZipResponse
|
|
29
28
|
*/
|
|
30
|
-
|
|
29
|
+
workflowId: string | null;
|
|
31
30
|
/**
|
|
32
31
|
*
|
|
33
|
-
* @type {
|
|
34
|
-
* @memberof IngestZipResponse
|
|
35
|
-
*/
|
|
36
|
-
succeeded: number;
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @type {number}
|
|
40
|
-
* @memberof IngestZipResponse
|
|
41
|
-
*/
|
|
42
|
-
skipped: number;
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @type {number}
|
|
32
|
+
* @type {Array<ZipFileResult>}
|
|
46
33
|
* @memberof IngestZipResponse
|
|
47
34
|
*/
|
|
48
|
-
|
|
35
|
+
skipped: Array<ZipFileResult>;
|
|
49
36
|
}
|
|
50
37
|
export declare const IngestZipResponsePropertyValidationAttributesMap: {
|
|
51
38
|
[property: string]: {
|
|
@@ -25,16 +25,10 @@ exports.IngestZipResponsePropertyValidationAttributesMap = {};
|
|
|
25
25
|
* Check if a given object implements the IngestZipResponse interface.
|
|
26
26
|
*/
|
|
27
27
|
function instanceOfIngestZipResponse(value) {
|
|
28
|
-
if (!('
|
|
29
|
-
return false;
|
|
30
|
-
if (!('totalFound' in value) || value['totalFound'] === undefined)
|
|
31
|
-
return false;
|
|
32
|
-
if (!('succeeded' in value) || value['succeeded'] === undefined)
|
|
28
|
+
if (!('workflowId' in value) || value['workflowId'] === undefined)
|
|
33
29
|
return false;
|
|
34
30
|
if (!('skipped' in value) || value['skipped'] === undefined)
|
|
35
31
|
return false;
|
|
36
|
-
if (!('failed' in value) || value['failed'] === undefined)
|
|
37
|
-
return false;
|
|
38
32
|
return true;
|
|
39
33
|
}
|
|
40
34
|
function IngestZipResponseFromJSON(json) {
|
|
@@ -45,11 +39,8 @@ function IngestZipResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
45
39
|
return json;
|
|
46
40
|
}
|
|
47
41
|
return {
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'succeeded': json['succeeded'],
|
|
51
|
-
'skipped': json['skipped'],
|
|
52
|
-
'failed': json['failed'],
|
|
42
|
+
'workflowId': json['workflow_id'],
|
|
43
|
+
'skipped': (json['skipped'].map(ZipFileResult_1.ZipFileResultFromJSON)),
|
|
53
44
|
};
|
|
54
45
|
}
|
|
55
46
|
function IngestZipResponseToJSON(json) {
|
|
@@ -60,10 +51,7 @@ function IngestZipResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
60
51
|
return value;
|
|
61
52
|
}
|
|
62
53
|
return {
|
|
63
|
-
'
|
|
64
|
-
'
|
|
65
|
-
'succeeded': value['succeeded'],
|
|
66
|
-
'skipped': value['skipped'],
|
|
67
|
-
'failed': value['failed'],
|
|
54
|
+
'workflow_id': value['workflowId'],
|
|
55
|
+
'skipped': (value['skipped'].map(ZipFileResult_1.ZipFileResultToJSON)),
|
|
68
56
|
};
|
|
69
57
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Stack API
|
|
3
|
+
* 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.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { ZipMemberStatusResponse } from './ZipMemberStatusResponse';
|
|
13
|
+
/**
|
|
14
|
+
* Status of a ZIP fan-out: live Temporal state + per-member outcomes.
|
|
15
|
+
*
|
|
16
|
+
* ``files`` reflects progress so far — members that have been dispatched
|
|
17
|
+
* (``workflow_id`` set), failed to dispatch (``error`` set), or were skipped as
|
|
18
|
+
* artifacts. Poll until ``temporal_status`` is terminal (e.g. ``COMPLETED``).
|
|
19
|
+
* @export
|
|
20
|
+
* @interface ZipIngestionStatusResponse
|
|
21
|
+
*/
|
|
22
|
+
export interface ZipIngestionStatusResponse {
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @type {string}
|
|
26
|
+
* @memberof ZipIngestionStatusResponse
|
|
27
|
+
*/
|
|
28
|
+
workflowId: string;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @memberof ZipIngestionStatusResponse
|
|
33
|
+
*/
|
|
34
|
+
temporalStatus: string;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @type {Array<ZipMemberStatusResponse>}
|
|
38
|
+
* @memberof ZipIngestionStatusResponse
|
|
39
|
+
*/
|
|
40
|
+
files: Array<ZipMemberStatusResponse>;
|
|
41
|
+
}
|
|
42
|
+
export declare const ZipIngestionStatusResponsePropertyValidationAttributesMap: {
|
|
43
|
+
[property: string]: {
|
|
44
|
+
maxLength?: number;
|
|
45
|
+
minLength?: number;
|
|
46
|
+
pattern?: string;
|
|
47
|
+
maximum?: number;
|
|
48
|
+
exclusiveMaximum?: boolean;
|
|
49
|
+
minimum?: number;
|
|
50
|
+
exclusiveMinimum?: boolean;
|
|
51
|
+
multipleOf?: number;
|
|
52
|
+
maxItems?: number;
|
|
53
|
+
minItems?: number;
|
|
54
|
+
uniqueItems?: boolean;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Check if a given object implements the ZipIngestionStatusResponse interface.
|
|
59
|
+
*/
|
|
60
|
+
export declare function instanceOfZipIngestionStatusResponse(value: object): value is ZipIngestionStatusResponse;
|
|
61
|
+
export declare function ZipIngestionStatusResponseFromJSON(json: any): ZipIngestionStatusResponse;
|
|
62
|
+
export declare function ZipIngestionStatusResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ZipIngestionStatusResponse;
|
|
63
|
+
export declare function ZipIngestionStatusResponseToJSON(json: any): ZipIngestionStatusResponse;
|
|
64
|
+
export declare function ZipIngestionStatusResponseToJSONTyped(value?: ZipIngestionStatusResponse | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -13,70 +13,49 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
exports.ProposedMemoryChunkResponsePropertyValidationAttributesMap = {};
|
|
16
|
+
exports.ZipIngestionStatusResponsePropertyValidationAttributesMap = void 0;
|
|
17
|
+
exports.instanceOfZipIngestionStatusResponse = instanceOfZipIngestionStatusResponse;
|
|
18
|
+
exports.ZipIngestionStatusResponseFromJSON = ZipIngestionStatusResponseFromJSON;
|
|
19
|
+
exports.ZipIngestionStatusResponseFromJSONTyped = ZipIngestionStatusResponseFromJSONTyped;
|
|
20
|
+
exports.ZipIngestionStatusResponseToJSON = ZipIngestionStatusResponseToJSON;
|
|
21
|
+
exports.ZipIngestionStatusResponseToJSONTyped = ZipIngestionStatusResponseToJSONTyped;
|
|
22
|
+
const ZipMemberStatusResponse_1 = require("./ZipMemberStatusResponse");
|
|
23
|
+
exports.ZipIngestionStatusResponsePropertyValidationAttributesMap = {};
|
|
25
24
|
/**
|
|
26
|
-
* Check if a given object implements the
|
|
25
|
+
* Check if a given object implements the ZipIngestionStatusResponse interface.
|
|
27
26
|
*/
|
|
28
|
-
function
|
|
29
|
-
if (!('
|
|
27
|
+
function instanceOfZipIngestionStatusResponse(value) {
|
|
28
|
+
if (!('workflowId' in value) || value['workflowId'] === undefined)
|
|
30
29
|
return false;
|
|
31
|
-
if (!('
|
|
30
|
+
if (!('temporalStatus' in value) || value['temporalStatus'] === undefined)
|
|
32
31
|
return false;
|
|
33
|
-
if (!('
|
|
34
|
-
return false;
|
|
35
|
-
if (!('kind' in value) || value['kind'] === undefined)
|
|
36
|
-
return false;
|
|
37
|
-
if (!('rationale' in value) || value['rationale'] === undefined)
|
|
38
|
-
return false;
|
|
39
|
-
if (!('body' in value) || value['body'] === undefined)
|
|
40
|
-
return false;
|
|
41
|
-
if (!('proposerTenantUserId' in value) || value['proposerTenantUserId'] === undefined)
|
|
42
|
-
return false;
|
|
43
|
-
if (!('runId' in value) || value['runId'] === undefined)
|
|
32
|
+
if (!('files' in value) || value['files'] === undefined)
|
|
44
33
|
return false;
|
|
45
34
|
return true;
|
|
46
35
|
}
|
|
47
|
-
function
|
|
48
|
-
return
|
|
36
|
+
function ZipIngestionStatusResponseFromJSON(json) {
|
|
37
|
+
return ZipIngestionStatusResponseFromJSONTyped(json, false);
|
|
49
38
|
}
|
|
50
|
-
function
|
|
39
|
+
function ZipIngestionStatusResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
51
40
|
if (json == null) {
|
|
52
41
|
return json;
|
|
53
42
|
}
|
|
54
43
|
return {
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'kind': (0, MemoryKind_1.MemoryKindFromJSON)(json['kind']),
|
|
59
|
-
'rationale': json['rationale'],
|
|
60
|
-
'body': json['body'],
|
|
61
|
-
'proposerTenantUserId': json['proposer_tenant_user_id'],
|
|
62
|
-
'runId': json['run_id'],
|
|
44
|
+
'workflowId': json['workflow_id'],
|
|
45
|
+
'temporalStatus': json['temporal_status'],
|
|
46
|
+
'files': (json['files'].map(ZipMemberStatusResponse_1.ZipMemberStatusResponseFromJSON)),
|
|
63
47
|
};
|
|
64
48
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
49
|
+
function ZipIngestionStatusResponseToJSON(json) {
|
|
50
|
+
return ZipIngestionStatusResponseToJSONTyped(json, false);
|
|
67
51
|
}
|
|
68
|
-
function
|
|
52
|
+
function ZipIngestionStatusResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
69
53
|
if (value == null) {
|
|
70
54
|
return value;
|
|
71
55
|
}
|
|
72
56
|
return {
|
|
73
|
-
'
|
|
74
|
-
'
|
|
75
|
-
'
|
|
76
|
-
'kind': (0, MemoryKind_1.MemoryKindToJSON)(value['kind']),
|
|
77
|
-
'rationale': value['rationale'],
|
|
78
|
-
'body': value['body'],
|
|
79
|
-
'proposer_tenant_user_id': value['proposerTenantUserId'],
|
|
80
|
-
'run_id': value['runId'],
|
|
57
|
+
'workflow_id': value['workflowId'],
|
|
58
|
+
'temporal_status': value['temporalStatus'],
|
|
59
|
+
'files': (value['files'].map(ZipMemberStatusResponse_1.ZipMemberStatusResponseToJSON)),
|
|
81
60
|
};
|
|
82
61
|
}
|
|
@@ -9,64 +9,50 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import type { MemoryScope } from './MemoryScope';
|
|
13
|
-
import type { MemoryKind } from './MemoryKind';
|
|
14
12
|
/**
|
|
15
|
-
*
|
|
13
|
+
* One member's outcome within a ZIP fan-out (from the workflow query).
|
|
16
14
|
* @export
|
|
17
|
-
* @interface
|
|
15
|
+
* @interface ZipMemberStatusResponse
|
|
18
16
|
*/
|
|
19
|
-
export interface
|
|
17
|
+
export interface ZipMemberStatusResponse {
|
|
20
18
|
/**
|
|
21
19
|
*
|
|
22
20
|
* @type {string}
|
|
23
|
-
* @memberof
|
|
24
|
-
*/
|
|
25
|
-
chunkId: string;
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @type {MemoryScope}
|
|
29
|
-
* @memberof ProposedMemoryChunkResponse
|
|
21
|
+
* @memberof ZipMemberStatusResponse
|
|
30
22
|
*/
|
|
31
|
-
|
|
23
|
+
zipPath: string;
|
|
32
24
|
/**
|
|
33
25
|
*
|
|
34
26
|
* @type {string}
|
|
35
|
-
* @memberof
|
|
27
|
+
* @memberof ZipMemberStatusResponse
|
|
36
28
|
*/
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @type {MemoryKind}
|
|
41
|
-
* @memberof ProposedMemoryChunkResponse
|
|
42
|
-
*/
|
|
43
|
-
kind: MemoryKind;
|
|
29
|
+
documentId?: string | null;
|
|
44
30
|
/**
|
|
45
31
|
*
|
|
46
32
|
* @type {string}
|
|
47
|
-
* @memberof
|
|
33
|
+
* @memberof ZipMemberStatusResponse
|
|
48
34
|
*/
|
|
49
|
-
|
|
35
|
+
documentVersionId?: string | null;
|
|
50
36
|
/**
|
|
51
37
|
*
|
|
52
38
|
* @type {string}
|
|
53
|
-
* @memberof
|
|
39
|
+
* @memberof ZipMemberStatusResponse
|
|
54
40
|
*/
|
|
55
|
-
|
|
41
|
+
workflowId?: string | null;
|
|
56
42
|
/**
|
|
57
43
|
*
|
|
58
44
|
* @type {string}
|
|
59
|
-
* @memberof
|
|
45
|
+
* @memberof ZipMemberStatusResponse
|
|
60
46
|
*/
|
|
61
|
-
|
|
47
|
+
error?: string | null;
|
|
62
48
|
/**
|
|
63
49
|
*
|
|
64
|
-
* @type {
|
|
65
|
-
* @memberof
|
|
50
|
+
* @type {boolean}
|
|
51
|
+
* @memberof ZipMemberStatusResponse
|
|
66
52
|
*/
|
|
67
|
-
|
|
53
|
+
skipped?: boolean;
|
|
68
54
|
}
|
|
69
|
-
export declare const
|
|
55
|
+
export declare const ZipMemberStatusResponsePropertyValidationAttributesMap: {
|
|
70
56
|
[property: string]: {
|
|
71
57
|
maxLength?: number;
|
|
72
58
|
minLength?: number;
|
|
@@ -82,10 +68,10 @@ export declare const ProposedMemoryChunkResponsePropertyValidationAttributesMap:
|
|
|
82
68
|
};
|
|
83
69
|
};
|
|
84
70
|
/**
|
|
85
|
-
* Check if a given object implements the
|
|
71
|
+
* Check if a given object implements the ZipMemberStatusResponse interface.
|
|
86
72
|
*/
|
|
87
|
-
export declare function
|
|
88
|
-
export declare function
|
|
89
|
-
export declare function
|
|
90
|
-
export declare function
|
|
91
|
-
export declare function
|
|
73
|
+
export declare function instanceOfZipMemberStatusResponse(value: object): value is ZipMemberStatusResponse;
|
|
74
|
+
export declare function ZipMemberStatusResponseFromJSON(json: any): ZipMemberStatusResponse;
|
|
75
|
+
export declare function ZipMemberStatusResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ZipMemberStatusResponse;
|
|
76
|
+
export declare function ZipMemberStatusResponseToJSON(json: any): ZipMemberStatusResponse;
|
|
77
|
+
export declare function ZipMemberStatusResponseToJSONTyped(value?: ZipMemberStatusResponse | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Knowledge Stack API
|
|
6
|
+
* Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.ZipMemberStatusResponsePropertyValidationAttributesMap = void 0;
|
|
17
|
+
exports.instanceOfZipMemberStatusResponse = instanceOfZipMemberStatusResponse;
|
|
18
|
+
exports.ZipMemberStatusResponseFromJSON = ZipMemberStatusResponseFromJSON;
|
|
19
|
+
exports.ZipMemberStatusResponseFromJSONTyped = ZipMemberStatusResponseFromJSONTyped;
|
|
20
|
+
exports.ZipMemberStatusResponseToJSON = ZipMemberStatusResponseToJSON;
|
|
21
|
+
exports.ZipMemberStatusResponseToJSONTyped = ZipMemberStatusResponseToJSONTyped;
|
|
22
|
+
exports.ZipMemberStatusResponsePropertyValidationAttributesMap = {};
|
|
23
|
+
/**
|
|
24
|
+
* Check if a given object implements the ZipMemberStatusResponse interface.
|
|
25
|
+
*/
|
|
26
|
+
function instanceOfZipMemberStatusResponse(value) {
|
|
27
|
+
if (!('zipPath' in value) || value['zipPath'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
function ZipMemberStatusResponseFromJSON(json) {
|
|
32
|
+
return ZipMemberStatusResponseFromJSONTyped(json, false);
|
|
33
|
+
}
|
|
34
|
+
function ZipMemberStatusResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
35
|
+
if (json == null) {
|
|
36
|
+
return json;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
'zipPath': json['zip_path'],
|
|
40
|
+
'documentId': json['document_id'] == null ? undefined : json['document_id'],
|
|
41
|
+
'documentVersionId': json['document_version_id'] == null ? undefined : json['document_version_id'],
|
|
42
|
+
'workflowId': json['workflow_id'] == null ? undefined : json['workflow_id'],
|
|
43
|
+
'error': json['error'] == null ? undefined : json['error'],
|
|
44
|
+
'skipped': json['skipped'] == null ? undefined : json['skipped'],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function ZipMemberStatusResponseToJSON(json) {
|
|
48
|
+
return ZipMemberStatusResponseToJSONTyped(json, false);
|
|
49
|
+
}
|
|
50
|
+
function ZipMemberStatusResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
51
|
+
if (value == null) {
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
'zip_path': value['zipPath'],
|
|
56
|
+
'document_id': value['documentId'],
|
|
57
|
+
'document_version_id': value['documentVersionId'],
|
|
58
|
+
'workflow_id': value['workflowId'],
|
|
59
|
+
'error': value['error'],
|
|
60
|
+
'skipped': value['skipped'],
|
|
61
|
+
};
|
|
62
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -223,7 +223,6 @@ export * from './PixelRegion';
|
|
|
223
223
|
export * from './Polygon';
|
|
224
224
|
export * from './PolygonReference';
|
|
225
225
|
export * from './ProposeMemoryChunkRequest';
|
|
226
|
-
export * from './ProposedMemoryChunkResponse';
|
|
227
226
|
export * from './ReasoningPart';
|
|
228
227
|
export * from './ReferenceType';
|
|
229
228
|
export * from './ReorderPathPartRequest';
|
|
@@ -361,3 +360,5 @@ export * from './XlsxCellAnchorInputOrDocxParagraphAnchorInput';
|
|
|
361
360
|
export * from './XlsxCellAnchorOutput';
|
|
362
361
|
export * from './XlsxCellAnchorOutputOrDocxParagraphAnchorOutput';
|
|
363
362
|
export * from './ZipFileResult';
|
|
363
|
+
export * from './ZipIngestionStatusResponse';
|
|
364
|
+
export * from './ZipMemberStatusResponse';
|
package/dist/models/index.js
CHANGED
|
@@ -241,7 +241,6 @@ __exportStar(require("./PixelRegion"), exports);
|
|
|
241
241
|
__exportStar(require("./Polygon"), exports);
|
|
242
242
|
__exportStar(require("./PolygonReference"), exports);
|
|
243
243
|
__exportStar(require("./ProposeMemoryChunkRequest"), exports);
|
|
244
|
-
__exportStar(require("./ProposedMemoryChunkResponse"), exports);
|
|
245
244
|
__exportStar(require("./ReasoningPart"), exports);
|
|
246
245
|
__exportStar(require("./ReferenceType"), exports);
|
|
247
246
|
__exportStar(require("./ReorderPathPartRequest"), exports);
|
|
@@ -379,3 +378,5 @@ __exportStar(require("./XlsxCellAnchorInputOrDocxParagraphAnchorInput"), exports
|
|
|
379
378
|
__exportStar(require("./XlsxCellAnchorOutput"), exports);
|
|
380
379
|
__exportStar(require("./XlsxCellAnchorOutputOrDocxParagraphAnchorOutput"), exports);
|
|
381
380
|
__exportStar(require("./ZipFileResult"), exports);
|
|
381
|
+
__exportStar(require("./ZipIngestionStatusResponse"), exports);
|
|
382
|
+
__exportStar(require("./ZipMemberStatusResponse"), exports);
|
|
@@ -27,6 +27,7 @@ Name | Type
|
|
|
27
27
|
`quotaPageCount` | number
|
|
28
28
|
`quotaIdempotencyKey` | string
|
|
29
29
|
`fileMd5` | string
|
|
30
|
+
`idempotencyKey` | string
|
|
30
31
|
|
|
31
32
|
## Example
|
|
32
33
|
|
|
@@ -55,6 +56,7 @@ const example = {
|
|
|
55
56
|
"quotaPageCount": null,
|
|
56
57
|
"quotaIdempotencyKey": null,
|
|
57
58
|
"fileMd5": null,
|
|
59
|
+
"idempotencyKey": null,
|
|
58
60
|
} satisfies DocumentVersionMetadata
|
|
59
61
|
|
|
60
62
|
console.log(example)
|
package/docs/DocumentsApi.md
CHANGED
|
@@ -322,7 +322,7 @@ example().catch(console.error);
|
|
|
322
322
|
|
|
323
323
|
## ingestDocument
|
|
324
324
|
|
|
325
|
-
> IngestDocumentResponse ingestDocument(file, pathPartId, name, ingestionMode, chunkType, secondaryTaxonomy, pageDpi, workflowRunId, workflowDefinitionId)
|
|
325
|
+
> IngestDocumentResponse ingestDocument(file, pathPartId, name, ingestionMode, chunkType, secondaryTaxonomy, pageDpi, workflowRunId, tagIds, idempotencyKey, workflowDefinitionId)
|
|
326
326
|
|
|
327
327
|
Ingest Document Handler
|
|
328
328
|
|
|
@@ -364,6 +364,10 @@ async function example() {
|
|
|
364
364
|
pageDpi: 56,
|
|
365
365
|
// string | Workflow run context for assumed agent uploads. (optional)
|
|
366
366
|
workflowRunId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
367
|
+
// Array<string> | Tag IDs applied to the created document. (optional)
|
|
368
|
+
tagIds: ...,
|
|
369
|
+
// string | Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409. (optional)
|
|
370
|
+
idempotencyKey: idempotencyKey_example,
|
|
367
371
|
// string | Workflow definition context for assumed agent uploads. (optional)
|
|
368
372
|
workflowDefinitionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
369
373
|
} satisfies IngestDocumentRequest;
|
|
@@ -393,6 +397,8 @@ example().catch(console.error);
|
|
|
393
397
|
| **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, flowchart] |
|
|
394
398
|
| **pageDpi** | `number` | DPI for PDF page screenshots (default 72, min 36, max 216). | [Optional] [Defaults to `72`] |
|
|
395
399
|
| **workflowRunId** | `string` | Workflow run context for assumed agent uploads. | [Optional] [Defaults to `undefined`] |
|
|
400
|
+
| **tagIds** | `Array<string>` | Tag IDs applied to the created document. | [Optional] |
|
|
401
|
+
| **idempotencyKey** | `string` | Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409. | [Optional] [Defaults to `undefined`] |
|
|
396
402
|
| **workflowDefinitionId** | `string` | Workflow definition context for assumed agent uploads. | [Optional] [Defaults to `undefined`] |
|
|
397
403
|
|
|
398
404
|
### Return type
|
|
@@ -517,11 +523,11 @@ example().catch(console.error);
|
|
|
517
523
|
|
|
518
524
|
## ingestZip
|
|
519
525
|
|
|
520
|
-
> IngestZipResponse ingestZip(file, pathPartId, ingestionMode)
|
|
526
|
+
> IngestZipResponse ingestZip(file, pathPartId, ingestionMode, tagIds)
|
|
521
527
|
|
|
522
528
|
Ingest Zip Handler
|
|
523
529
|
|
|
524
|
-
Upload a ZIP archive
|
|
530
|
+
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) plus the artifacts ``skipped`` during classification. 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. Per-member failures (unsupported type, oversized) 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.
|
|
525
531
|
|
|
526
532
|
### Example
|
|
527
533
|
|
|
@@ -549,6 +555,8 @@ async function example() {
|
|
|
549
555
|
pathPartId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
550
556
|
// IngestionMode (optional)
|
|
551
557
|
ingestionMode: ...,
|
|
558
|
+
// Array<string> | Tag IDs applied to every ingested member document. (optional)
|
|
559
|
+
tagIds: ...,
|
|
552
560
|
} satisfies IngestZipRequest;
|
|
553
561
|
|
|
554
562
|
try {
|
|
@@ -571,6 +579,7 @@ example().catch(console.error);
|
|
|
571
579
|
| **file** | `Blob` | | [Defaults to `undefined`] |
|
|
572
580
|
| **pathPartId** | `string` | Parent path part ID (must be a FOLDER type) | [Defaults to `undefined`] |
|
|
573
581
|
| **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk] |
|
|
582
|
+
| **tagIds** | `Array<string>` | Tag IDs applied to every ingested member document. | [Optional] |
|
|
574
583
|
|
|
575
584
|
### Return type
|
|
576
585
|
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
# IngestZipResponse
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Response from dispatching a ZIP archive to async ingestion. ``workflow_id`` is the fan-out workflow to poll at ``GET /v1/system-jobs/zip-ingestions/{workflow_id}`` for per-member outcomes; it is None when the archive held no ingestible members. ``skipped`` are the artifact/error entries resolved synchronously during classification.
|
|
5
5
|
|
|
6
6
|
## Properties
|
|
7
7
|
|
|
8
8
|
Name | Type
|
|
9
9
|
------------ | -------------
|
|
10
|
-
`
|
|
11
|
-
`
|
|
12
|
-
`succeeded` | number
|
|
13
|
-
`skipped` | number
|
|
14
|
-
`failed` | number
|
|
10
|
+
`workflowId` | string
|
|
11
|
+
`skipped` | [Array<ZipFileResult>](ZipFileResult.md)
|
|
15
12
|
|
|
16
13
|
## Example
|
|
17
14
|
|
|
@@ -20,11 +17,8 @@ import type { IngestZipResponse } from '@knowledge-stack/ksapi'
|
|
|
20
17
|
|
|
21
18
|
// TODO: Update the object below with actual values
|
|
22
19
|
const example = {
|
|
23
|
-
"
|
|
24
|
-
"totalFound": null,
|
|
25
|
-
"succeeded": null,
|
|
20
|
+
"workflowId": null,
|
|
26
21
|
"skipped": null,
|
|
27
|
-
"failed": null,
|
|
28
22
|
} satisfies IngestZipResponse
|
|
29
23
|
|
|
30
24
|
console.log(example)
|
package/docs/MemoryApi.md
CHANGED
|
@@ -239,7 +239,7 @@ example().catch(console.error);
|
|
|
239
239
|
|
|
240
240
|
## proposeMemoryChunk
|
|
241
241
|
|
|
242
|
-
>
|
|
242
|
+
> PendingMemoryChunkResponse proposeMemoryChunk(proposeMemoryChunkRequest)
|
|
243
243
|
|
|
244
244
|
Propose Memory Chunk Handler
|
|
245
245
|
|
|
@@ -288,7 +288,7 @@ example().catch(console.error);
|
|
|
288
288
|
|
|
289
289
|
### Return type
|
|
290
290
|
|
|
291
|
-
[**
|
|
291
|
+
[**PendingMemoryChunkResponse**](PendingMemoryChunkResponse.md)
|
|
292
292
|
|
|
293
293
|
### Authorization
|
|
294
294
|
|