@knowledge-stack/ksapi 1.151.1 → 1.153.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/DocumentsApi.d.ts +197 -1
- package/dist/apis/DocumentsApi.js +256 -0
- package/dist/esm/apis/DocumentsApi.d.ts +197 -1
- package/dist/esm/apis/DocumentsApi.js +257 -1
- package/dist/esm/models/ChunkMetadata.d.ts +12 -0
- package/dist/esm/models/ChunkMetadata.js +4 -0
- package/dist/esm/models/Citation.d.ts +12 -0
- package/dist/esm/models/Citation.js +4 -0
- package/dist/esm/models/CompleteUploadRequest.d.ts +47 -0
- package/dist/esm/models/CompleteUploadRequest.js +44 -0
- package/dist/esm/models/CreateUploadRequest.d.ts +65 -0
- package/dist/esm/models/CreateUploadRequest.js +56 -0
- package/dist/esm/models/CreateUploadResponse.d.ts +65 -0
- package/dist/esm/models/CreateUploadResponse.js +56 -0
- package/dist/esm/models/DocumentType.d.ts +2 -0
- package/dist/esm/models/DocumentType.js +2 -0
- package/dist/esm/models/EnrichedCitation.d.ts +12 -0
- package/dist/esm/models/EnrichedCitation.js +4 -0
- package/dist/esm/models/IngestionMode.d.ts +1 -0
- package/dist/esm/models/IngestionMode.js +2 -1
- package/dist/esm/models/SubscriptionPlanResponse.d.ts +6 -0
- package/dist/esm/models/SubscriptionPlanResponse.js +4 -0
- package/dist/esm/models/UploadPartResponse.d.ts +59 -0
- package/dist/esm/models/UploadPartResponse.js +52 -0
- package/dist/esm/models/UploadStatusResponse.d.ts +54 -0
- package/dist/esm/models/UploadStatusResponse.js +49 -0
- package/dist/esm/models/UsageMetric.d.ts +1 -0
- package/dist/esm/models/UsageMetric.js +2 -1
- package/dist/esm/models/index.d.ts +5 -0
- package/dist/esm/models/index.js +5 -0
- package/dist/models/ChunkMetadata.d.ts +12 -0
- package/dist/models/ChunkMetadata.js +4 -0
- package/dist/models/Citation.d.ts +12 -0
- package/dist/models/Citation.js +4 -0
- package/dist/models/CompleteUploadRequest.d.ts +47 -0
- package/dist/models/CompleteUploadRequest.js +52 -0
- package/dist/models/CreateUploadRequest.d.ts +65 -0
- package/dist/models/CreateUploadRequest.js +64 -0
- package/dist/models/CreateUploadResponse.d.ts +65 -0
- package/dist/models/CreateUploadResponse.js +64 -0
- package/dist/models/DocumentType.d.ts +2 -0
- package/dist/models/DocumentType.js +2 -0
- package/dist/models/EnrichedCitation.d.ts +12 -0
- package/dist/models/EnrichedCitation.js +4 -0
- package/dist/models/IngestionMode.d.ts +1 -0
- package/dist/models/IngestionMode.js +2 -1
- package/dist/models/SubscriptionPlanResponse.d.ts +6 -0
- package/dist/models/SubscriptionPlanResponse.js +4 -0
- package/dist/models/UploadPartResponse.d.ts +59 -0
- package/dist/models/UploadPartResponse.js +60 -0
- package/dist/models/UploadStatusResponse.d.ts +54 -0
- package/dist/models/UploadStatusResponse.js +57 -0
- package/dist/models/UsageMetric.d.ts +1 -0
- package/dist/models/UsageMetric.js +2 -1
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +5 -0
- package/docs/ChunkMetadata.md +4 -0
- package/docs/Citation.md +4 -0
- package/docs/CompleteUploadRequest.md +35 -0
- package/docs/CreateUploadRequest.md +41 -0
- package/docs/CreateUploadResponse.md +41 -0
- package/docs/DocumentsApi.md +390 -4
- package/docs/EnrichedCitation.md +4 -0
- package/docs/SubscriptionPlanResponse.md +2 -0
- package/docs/UploadPartResponse.md +39 -0
- package/docs/UploadStatusResponse.md +37 -0
- package/package.json +1 -1
- package/src/apis/DocumentsApi.ts +466 -0
- package/src/models/ChunkMetadata.ts +16 -0
- package/src/models/Citation.ts +16 -0
- package/src/models/CompleteUploadRequest.ts +83 -0
- package/src/models/CreateUploadRequest.ts +110 -0
- package/src/models/CreateUploadResponse.ts +110 -0
- package/src/models/DocumentType.ts +2 -0
- package/src/models/EnrichedCitation.ts +16 -0
- package/src/models/IngestionMode.ts +2 -1
- package/src/models/SubscriptionPlanResponse.ts +9 -0
- package/src/models/UploadPartResponse.ts +101 -0
- package/src/models/UploadStatusResponse.ts +100 -0
- package/src/models/UsageMetric.ts +2 -1
- package/src/models/index.ts +5 -0
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
* Finalize a resumable upload and start ingestion.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface CompleteUploadRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface CompleteUploadRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Token from create-upload
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof CompleteUploadRequest
|
|
26
|
+
*/
|
|
27
|
+
uploadToken: string;
|
|
28
|
+
}
|
|
29
|
+
export const CompleteUploadRequestPropertyValidationAttributesMap: {
|
|
30
|
+
[property: string]: {
|
|
31
|
+
maxLength?: number,
|
|
32
|
+
minLength?: number,
|
|
33
|
+
pattern?: string,
|
|
34
|
+
maximum?: number,
|
|
35
|
+
exclusiveMaximum?: boolean,
|
|
36
|
+
minimum?: number,
|
|
37
|
+
exclusiveMinimum?: boolean,
|
|
38
|
+
multipleOf?: number,
|
|
39
|
+
maxItems?: number,
|
|
40
|
+
minItems?: number,
|
|
41
|
+
uniqueItems?: boolean
|
|
42
|
+
}
|
|
43
|
+
} = {
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Check if a given object implements the CompleteUploadRequest interface.
|
|
49
|
+
*/
|
|
50
|
+
export function instanceOfCompleteUploadRequest(value: object): value is CompleteUploadRequest {
|
|
51
|
+
if (!('uploadToken' in value) || value['uploadToken'] === undefined) return false;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function CompleteUploadRequestFromJSON(json: any): CompleteUploadRequest {
|
|
56
|
+
return CompleteUploadRequestFromJSONTyped(json, false);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function CompleteUploadRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompleteUploadRequest {
|
|
60
|
+
if (json == null) {
|
|
61
|
+
return json;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
|
|
65
|
+
'uploadToken': json['upload_token'],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function CompleteUploadRequestToJSON(json: any): CompleteUploadRequest {
|
|
70
|
+
return CompleteUploadRequestToJSONTyped(json, false);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function CompleteUploadRequestToJSONTyped(value?: CompleteUploadRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
74
|
+
if (value == null) {
|
|
75
|
+
return value;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
|
|
80
|
+
'upload_token': value['uploadToken'],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
* Begin a resumable upload.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface CreateUploadRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface CreateUploadRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Parent folder path part ID (FOLDER)
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof CreateUploadRequest
|
|
26
|
+
*/
|
|
27
|
+
parentPathId: string;
|
|
28
|
+
/**
|
|
29
|
+
* Document name
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof CreateUploadRequest
|
|
32
|
+
*/
|
|
33
|
+
name: string;
|
|
34
|
+
/**
|
|
35
|
+
* Original filename; its extension selects the type + size cap
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof CreateUploadRequest
|
|
38
|
+
*/
|
|
39
|
+
filename: string;
|
|
40
|
+
/**
|
|
41
|
+
* Declared total size; fast-rejected against the type cap
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof CreateUploadRequest
|
|
44
|
+
*/
|
|
45
|
+
sizeBytes: number;
|
|
46
|
+
}
|
|
47
|
+
export const CreateUploadRequestPropertyValidationAttributesMap: {
|
|
48
|
+
[property: string]: {
|
|
49
|
+
maxLength?: number,
|
|
50
|
+
minLength?: number,
|
|
51
|
+
pattern?: string,
|
|
52
|
+
maximum?: number,
|
|
53
|
+
exclusiveMaximum?: boolean,
|
|
54
|
+
minimum?: number,
|
|
55
|
+
exclusiveMinimum?: boolean,
|
|
56
|
+
multipleOf?: number,
|
|
57
|
+
maxItems?: number,
|
|
58
|
+
minItems?: number,
|
|
59
|
+
uniqueItems?: boolean
|
|
60
|
+
}
|
|
61
|
+
} = {
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Check if a given object implements the CreateUploadRequest interface.
|
|
67
|
+
*/
|
|
68
|
+
export function instanceOfCreateUploadRequest(value: object): value is CreateUploadRequest {
|
|
69
|
+
if (!('parentPathId' in value) || value['parentPathId'] === undefined) return false;
|
|
70
|
+
if (!('name' in value) || value['name'] === undefined) return false;
|
|
71
|
+
if (!('filename' in value) || value['filename'] === undefined) return false;
|
|
72
|
+
if (!('sizeBytes' in value) || value['sizeBytes'] === undefined) return false;
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function CreateUploadRequestFromJSON(json: any): CreateUploadRequest {
|
|
77
|
+
return CreateUploadRequestFromJSONTyped(json, false);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function CreateUploadRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateUploadRequest {
|
|
81
|
+
if (json == null) {
|
|
82
|
+
return json;
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
|
|
86
|
+
'parentPathId': json['parent_path_id'],
|
|
87
|
+
'name': json['name'],
|
|
88
|
+
'filename': json['filename'],
|
|
89
|
+
'sizeBytes': json['size_bytes'],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function CreateUploadRequestToJSON(json: any): CreateUploadRequest {
|
|
94
|
+
return CreateUploadRequestToJSONTyped(json, false);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function CreateUploadRequestToJSONTyped(value?: CreateUploadRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
98
|
+
if (value == null) {
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
|
|
104
|
+
'parent_path_id': value['parentPathId'],
|
|
105
|
+
'name': value['name'],
|
|
106
|
+
'filename': value['filename'],
|
|
107
|
+
'size_bytes': value['sizeBytes'],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
* Handles for a started resumable upload.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface CreateUploadResponse
|
|
20
|
+
*/
|
|
21
|
+
export interface CreateUploadResponse {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof CreateUploadResponse
|
|
26
|
+
*/
|
|
27
|
+
documentId: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof CreateUploadResponse
|
|
32
|
+
*/
|
|
33
|
+
documentVersionId: string;
|
|
34
|
+
/**
|
|
35
|
+
* Opaque token; return it on every part/status/complete/abort
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof CreateUploadResponse
|
|
38
|
+
*/
|
|
39
|
+
uploadToken: string;
|
|
40
|
+
/**
|
|
41
|
+
* Recommended part size in bytes; every part except the last must be at least 5 MiB
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof CreateUploadResponse
|
|
44
|
+
*/
|
|
45
|
+
partSize: number;
|
|
46
|
+
}
|
|
47
|
+
export const CreateUploadResponsePropertyValidationAttributesMap: {
|
|
48
|
+
[property: string]: {
|
|
49
|
+
maxLength?: number,
|
|
50
|
+
minLength?: number,
|
|
51
|
+
pattern?: string,
|
|
52
|
+
maximum?: number,
|
|
53
|
+
exclusiveMaximum?: boolean,
|
|
54
|
+
minimum?: number,
|
|
55
|
+
exclusiveMinimum?: boolean,
|
|
56
|
+
multipleOf?: number,
|
|
57
|
+
maxItems?: number,
|
|
58
|
+
minItems?: number,
|
|
59
|
+
uniqueItems?: boolean
|
|
60
|
+
}
|
|
61
|
+
} = {
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Check if a given object implements the CreateUploadResponse interface.
|
|
67
|
+
*/
|
|
68
|
+
export function instanceOfCreateUploadResponse(value: object): value is CreateUploadResponse {
|
|
69
|
+
if (!('documentId' in value) || value['documentId'] === undefined) return false;
|
|
70
|
+
if (!('documentVersionId' in value) || value['documentVersionId'] === undefined) return false;
|
|
71
|
+
if (!('uploadToken' in value) || value['uploadToken'] === undefined) return false;
|
|
72
|
+
if (!('partSize' in value) || value['partSize'] === undefined) return false;
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function CreateUploadResponseFromJSON(json: any): CreateUploadResponse {
|
|
77
|
+
return CreateUploadResponseFromJSONTyped(json, false);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function CreateUploadResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateUploadResponse {
|
|
81
|
+
if (json == null) {
|
|
82
|
+
return json;
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
|
|
86
|
+
'documentId': json['document_id'],
|
|
87
|
+
'documentVersionId': json['document_version_id'],
|
|
88
|
+
'uploadToken': json['upload_token'],
|
|
89
|
+
'partSize': json['part_size'],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function CreateUploadResponseToJSON(json: any): CreateUploadResponse {
|
|
94
|
+
return CreateUploadResponseToJSONTyped(json, false);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function CreateUploadResponseToJSONTyped(value?: CreateUploadResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
98
|
+
if (value == null) {
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
|
|
104
|
+
'document_id': value['documentId'],
|
|
105
|
+
'document_version_id': value['documentVersionId'],
|
|
106
|
+
'upload_token': value['uploadToken'],
|
|
107
|
+
'part_size': value['partSize'],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
@@ -43,6 +43,18 @@ export interface EnrichedCitation {
|
|
|
43
43
|
* @memberof EnrichedCitation
|
|
44
44
|
*/
|
|
45
45
|
length: number;
|
|
46
|
+
/**
|
|
47
|
+
* Start time (ms) of the cited chunk in the source media, for AUDIO/VIDEO — lets the client deep-link playback to the moment. None for non-media chunks.
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof EnrichedCitation
|
|
50
|
+
*/
|
|
51
|
+
startMs?: number | null;
|
|
52
|
+
/**
|
|
53
|
+
* End time (ms) of the cited chunk in the source media (AUDIO/VIDEO); None for non-media chunks.
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof EnrichedCitation
|
|
56
|
+
*/
|
|
57
|
+
endMs?: number | null;
|
|
46
58
|
/**
|
|
47
59
|
*
|
|
48
60
|
* @type {string}
|
|
@@ -127,6 +139,8 @@ export function EnrichedCitationFromJSONTyped(json: any, ignoreDiscriminator: bo
|
|
|
127
139
|
'quote': json['quote'],
|
|
128
140
|
'startChar': json['start_char'],
|
|
129
141
|
'length': json['length'],
|
|
142
|
+
'startMs': json['start_ms'] == null ? undefined : json['start_ms'],
|
|
143
|
+
'endMs': json['end_ms'] == null ? undefined : json['end_ms'],
|
|
130
144
|
'documentId': json['document_id'] == null ? undefined : json['document_id'],
|
|
131
145
|
'documentVersionId': json['document_version_id'] == null ? undefined : json['document_version_id'],
|
|
132
146
|
'documentName': json['document_name'] == null ? undefined : json['document_name'],
|
|
@@ -151,6 +165,8 @@ export function EnrichedCitationToJSONTyped(value?: EnrichedCitation | null, ign
|
|
|
151
165
|
'quote': value['quote'],
|
|
152
166
|
'start_char': value['startChar'],
|
|
153
167
|
'length': value['length'],
|
|
168
|
+
'start_ms': value['startMs'],
|
|
169
|
+
'end_ms': value['endMs'],
|
|
154
170
|
'document_id': value['documentId'],
|
|
155
171
|
'document_version_id': value['documentVersionId'],
|
|
156
172
|
'document_name': value['documentName'],
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
export const IngestionMode = {
|
|
21
21
|
HighAccuracy: 'high_accuracy',
|
|
22
22
|
Standard: 'standard',
|
|
23
|
-
SingleChunk: 'single_chunk'
|
|
23
|
+
SingleChunk: 'single_chunk',
|
|
24
|
+
Media: 'media'
|
|
24
25
|
} as const;
|
|
25
26
|
export type IngestionMode = typeof IngestionMode[keyof typeof IngestionMode];
|
|
26
27
|
|
|
@@ -55,6 +55,12 @@ export interface SubscriptionPlanResponse {
|
|
|
55
55
|
* @memberof SubscriptionPlanResponse
|
|
56
56
|
*/
|
|
57
57
|
searches: number;
|
|
58
|
+
/**
|
|
59
|
+
* Per-period cap on transcribed media minutes (MEDIA_MINUTE).
|
|
60
|
+
* @type {number}
|
|
61
|
+
* @memberof SubscriptionPlanResponse
|
|
62
|
+
*/
|
|
63
|
+
mediaMinutes: number;
|
|
58
64
|
/**
|
|
59
65
|
* Upper bound on num_seats accepted by the upgrade endpoint. Admin PATCH may set tenant.seats above this value.
|
|
60
66
|
* @type {number}
|
|
@@ -107,6 +113,7 @@ export function instanceOfSubscriptionPlanResponse(value: object): value is Subs
|
|
|
107
113
|
if (!('ingestedPages' in value) || value['ingestedPages'] === undefined) return false;
|
|
108
114
|
if (!('messages' in value) || value['messages'] === undefined) return false;
|
|
109
115
|
if (!('searches' in value) || value['searches'] === undefined) return false;
|
|
116
|
+
if (!('mediaMinutes' in value) || value['mediaMinutes'] === undefined) return false;
|
|
110
117
|
if (!('maxSeats' in value) || value['maxSeats'] === undefined) return false;
|
|
111
118
|
if (!('_public' in value) || value['_public'] === undefined) return false;
|
|
112
119
|
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
@@ -129,6 +136,7 @@ export function SubscriptionPlanResponseFromJSONTyped(json: any, ignoreDiscrimin
|
|
|
129
136
|
'ingestedPages': json['ingested_pages'],
|
|
130
137
|
'messages': json['messages'],
|
|
131
138
|
'searches': json['searches'],
|
|
139
|
+
'mediaMinutes': json['media_minutes'],
|
|
132
140
|
'maxSeats': json['max_seats'],
|
|
133
141
|
'_public': json['public'],
|
|
134
142
|
'createdAt': (new Date(json['created_at'])),
|
|
@@ -152,6 +160,7 @@ export function SubscriptionPlanResponseToJSONTyped(value?: SubscriptionPlanResp
|
|
|
152
160
|
'ingested_pages': value['ingestedPages'],
|
|
153
161
|
'messages': value['messages'],
|
|
154
162
|
'searches': value['searches'],
|
|
163
|
+
'media_minutes': value['mediaMinutes'],
|
|
155
164
|
'max_seats': value['maxSeats'],
|
|
156
165
|
'public': value['_public'],
|
|
157
166
|
'created_at': value['createdAt'].toISOString(),
|
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
* Acknowledgement of one stored part.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface UploadPartResponse
|
|
20
|
+
*/
|
|
21
|
+
export interface UploadPartResponse {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof UploadPartResponse
|
|
26
|
+
*/
|
|
27
|
+
partNumber: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof UploadPartResponse
|
|
32
|
+
*/
|
|
33
|
+
etag: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @memberof UploadPartResponse
|
|
38
|
+
*/
|
|
39
|
+
size: number;
|
|
40
|
+
}
|
|
41
|
+
export const UploadPartResponsePropertyValidationAttributesMap: {
|
|
42
|
+
[property: string]: {
|
|
43
|
+
maxLength?: number,
|
|
44
|
+
minLength?: number,
|
|
45
|
+
pattern?: string,
|
|
46
|
+
maximum?: number,
|
|
47
|
+
exclusiveMaximum?: boolean,
|
|
48
|
+
minimum?: number,
|
|
49
|
+
exclusiveMinimum?: boolean,
|
|
50
|
+
multipleOf?: number,
|
|
51
|
+
maxItems?: number,
|
|
52
|
+
minItems?: number,
|
|
53
|
+
uniqueItems?: boolean
|
|
54
|
+
}
|
|
55
|
+
} = {
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Check if a given object implements the UploadPartResponse interface.
|
|
61
|
+
*/
|
|
62
|
+
export function instanceOfUploadPartResponse(value: object): value is UploadPartResponse {
|
|
63
|
+
if (!('partNumber' in value) || value['partNumber'] === undefined) return false;
|
|
64
|
+
if (!('etag' in value) || value['etag'] === undefined) return false;
|
|
65
|
+
if (!('size' in value) || value['size'] === undefined) return false;
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function UploadPartResponseFromJSON(json: any): UploadPartResponse {
|
|
70
|
+
return UploadPartResponseFromJSONTyped(json, false);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function UploadPartResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UploadPartResponse {
|
|
74
|
+
if (json == null) {
|
|
75
|
+
return json;
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
|
|
79
|
+
'partNumber': json['part_number'],
|
|
80
|
+
'etag': json['etag'],
|
|
81
|
+
'size': json['size'],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function UploadPartResponseToJSON(json: any): UploadPartResponse {
|
|
86
|
+
return UploadPartResponseToJSONTyped(json, false);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function UploadPartResponseToJSONTyped(value?: UploadPartResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
90
|
+
if (value == null) {
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
|
|
96
|
+
'part_number': value['partNumber'],
|
|
97
|
+
'etag': value['etag'],
|
|
98
|
+
'size': value['size'],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
@@ -0,0 +1,100 @@
|
|
|
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 { UploadPartResponse } from './UploadPartResponse';
|
|
17
|
+
import {
|
|
18
|
+
UploadPartResponseFromJSON,
|
|
19
|
+
UploadPartResponseFromJSONTyped,
|
|
20
|
+
UploadPartResponseToJSON,
|
|
21
|
+
UploadPartResponseToJSONTyped,
|
|
22
|
+
} from './UploadPartResponse';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Parts S3 already holds — resume by re-sending the rest.
|
|
26
|
+
* @export
|
|
27
|
+
* @interface UploadStatusResponse
|
|
28
|
+
*/
|
|
29
|
+
export interface UploadStatusResponse {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {Array<UploadPartResponse>}
|
|
33
|
+
* @memberof UploadStatusResponse
|
|
34
|
+
*/
|
|
35
|
+
parts: Array<UploadPartResponse>;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof UploadStatusResponse
|
|
40
|
+
*/
|
|
41
|
+
uploadedBytes: number;
|
|
42
|
+
}
|
|
43
|
+
export const UploadStatusResponsePropertyValidationAttributesMap: {
|
|
44
|
+
[property: string]: {
|
|
45
|
+
maxLength?: number,
|
|
46
|
+
minLength?: number,
|
|
47
|
+
pattern?: string,
|
|
48
|
+
maximum?: number,
|
|
49
|
+
exclusiveMaximum?: boolean,
|
|
50
|
+
minimum?: number,
|
|
51
|
+
exclusiveMinimum?: boolean,
|
|
52
|
+
multipleOf?: number,
|
|
53
|
+
maxItems?: number,
|
|
54
|
+
minItems?: number,
|
|
55
|
+
uniqueItems?: boolean
|
|
56
|
+
}
|
|
57
|
+
} = {
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Check if a given object implements the UploadStatusResponse interface.
|
|
63
|
+
*/
|
|
64
|
+
export function instanceOfUploadStatusResponse(value: object): value is UploadStatusResponse {
|
|
65
|
+
if (!('parts' in value) || value['parts'] === undefined) return false;
|
|
66
|
+
if (!('uploadedBytes' in value) || value['uploadedBytes'] === undefined) return false;
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function UploadStatusResponseFromJSON(json: any): UploadStatusResponse {
|
|
71
|
+
return UploadStatusResponseFromJSONTyped(json, false);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function UploadStatusResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UploadStatusResponse {
|
|
75
|
+
if (json == null) {
|
|
76
|
+
return json;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
|
|
80
|
+
'parts': ((json['parts'] as Array<any>).map(UploadPartResponseFromJSON)),
|
|
81
|
+
'uploadedBytes': json['uploaded_bytes'],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function UploadStatusResponseToJSON(json: any): UploadStatusResponse {
|
|
86
|
+
return UploadStatusResponseToJSONTyped(json, false);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function UploadStatusResponseToJSONTyped(value?: UploadStatusResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
90
|
+
if (value == null) {
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
|
|
96
|
+
'parts': ((value['parts'] as Array<any>).map(UploadPartResponseToJSON)),
|
|
97
|
+
'uploaded_bytes': value['uploadedBytes'],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -49,6 +49,7 @@ export * from './CloneWorkflowRunRequest';
|
|
|
49
49
|
export * from './ColumnConfig';
|
|
50
50
|
export * from './ColumnReference';
|
|
51
51
|
export * from './CommonFileExclusionReason';
|
|
52
|
+
export * from './CompleteUploadRequest';
|
|
52
53
|
export * from './ConnectionConfig';
|
|
53
54
|
export * from './ContentsSortOrder';
|
|
54
55
|
export * from './CreateApiConnectionRequest';
|
|
@@ -69,6 +70,8 @@ export * from './CreateSkillRequest';
|
|
|
69
70
|
export * from './CreateTagRequest';
|
|
70
71
|
export * from './CreateThreadMessageRequest';
|
|
71
72
|
export * from './CreateThreadRequest';
|
|
73
|
+
export * from './CreateUploadRequest';
|
|
74
|
+
export * from './CreateUploadResponse';
|
|
72
75
|
export * from './CreateWorkflowDefinitionRequest';
|
|
73
76
|
export * from './DataSourceCatalogResponse';
|
|
74
77
|
export * from './DataSourceDescribeResponse';
|
|
@@ -330,6 +333,8 @@ export * from './UpdateWorkflowDefinitionRequest';
|
|
|
330
333
|
export * from './UpdateWorkflowRunRequest';
|
|
331
334
|
export * from './UploadConstraints';
|
|
332
335
|
export * from './UploadFormat';
|
|
336
|
+
export * from './UploadPartResponse';
|
|
337
|
+
export * from './UploadStatusResponse';
|
|
333
338
|
export * from './UsageMetric';
|
|
334
339
|
export * from './UserInfo';
|
|
335
340
|
export * from './UserMessageRequest';
|