@knowledge-stack/ksapi 1.156.1 → 1.158.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 +2 -0
- package/README.md +3 -2
- package/dist/apis/DocumentVersionsApi.d.ts +2 -2
- package/dist/apis/DocumentsApi.d.ts +2 -2
- package/dist/esm/apis/DocumentVersionsApi.d.ts +2 -2
- package/dist/esm/apis/DocumentsApi.d.ts +2 -2
- package/dist/esm/models/ChunkMetadata.d.ts +7 -0
- package/dist/esm/models/ChunkMetadata.js +3 -0
- package/dist/esm/models/DocumentVersionMetadata.d.ts +6 -0
- package/dist/esm/models/DocumentVersionMetadata.js +2 -0
- package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +6 -0
- package/dist/esm/models/DocumentVersionMetadataUpdate.js +2 -0
- package/dist/esm/models/DownloadArtifact.d.ts +1 -0
- package/dist/esm/models/DownloadArtifact.js +2 -1
- package/dist/esm/models/SegmentSpan.d.ts +62 -0
- package/dist/esm/models/SegmentSpan.js +52 -0
- package/dist/esm/models/UploadConstraints.d.ts +12 -0
- package/dist/esm/models/UploadConstraints.js +8 -0
- package/dist/esm/models/UserMessageRequest.d.ts +6 -0
- package/dist/esm/models/UserMessageRequest.js +2 -0
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.js +1 -0
- package/dist/models/ChunkMetadata.d.ts +7 -0
- package/dist/models/ChunkMetadata.js +3 -0
- package/dist/models/DocumentVersionMetadata.d.ts +6 -0
- package/dist/models/DocumentVersionMetadata.js +2 -0
- package/dist/models/DocumentVersionMetadataUpdate.d.ts +6 -0
- package/dist/models/DocumentVersionMetadataUpdate.js +2 -0
- package/dist/models/DownloadArtifact.d.ts +1 -0
- package/dist/models/DownloadArtifact.js +2 -1
- package/dist/models/SegmentSpan.d.ts +62 -0
- package/dist/models/SegmentSpan.js +60 -0
- package/dist/models/UploadConstraints.d.ts +12 -0
- package/dist/models/UploadConstraints.js +8 -0
- package/dist/models/UserMessageRequest.d.ts +6 -0
- package/dist/models/UserMessageRequest.js +2 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/docs/ChunkMetadata.md +2 -0
- package/docs/DocumentVersionMetadata.md +2 -0
- package/docs/DocumentVersionMetadataUpdate.md +2 -0
- package/docs/DocumentVersionsApi.md +2 -2
- package/docs/DocumentsApi.md +2 -2
- package/docs/SegmentSpan.md +39 -0
- package/docs/UploadConstraints.md +4 -0
- package/docs/UserMessageRequest.md +2 -0
- package/package.json +1 -1
- package/src/apis/DocumentVersionsApi.ts +2 -2
- package/src/apis/DocumentsApi.ts +2 -2
- package/src/models/ChunkMetadata.ts +15 -0
- package/src/models/DocumentVersionMetadata.ts +8 -0
- package/src/models/DocumentVersionMetadataUpdate.ts +8 -0
- package/src/models/DownloadArtifact.ts +2 -1
- package/src/models/SegmentSpan.ts +104 -0
- package/src/models/UploadConstraints.ts +18 -0
- package/src/models/UserMessageRequest.ts +8 -0
- package/src/models/index.ts +1 -0
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
/**
|
|
13
|
+
* One ASR segment's span inside a media chunk (media chunks only).
|
|
14
|
+
*
|
|
15
|
+
* Field names are deliberately compact — a media document stores hundreds
|
|
16
|
+
* of chunks x up to ~15 spans each in ``chunk_metadata`` JSONB.
|
|
17
|
+
* @export
|
|
18
|
+
* @interface SegmentSpan
|
|
19
|
+
*/
|
|
20
|
+
export interface SegmentSpan {
|
|
21
|
+
/**
|
|
22
|
+
* Segment start in the media, ms from start.
|
|
23
|
+
* @type {number}
|
|
24
|
+
* @memberof SegmentSpan
|
|
25
|
+
*/
|
|
26
|
+
s: number;
|
|
27
|
+
/**
|
|
28
|
+
* Segment end in the media, ms from start.
|
|
29
|
+
* @type {number}
|
|
30
|
+
* @memberof SegmentSpan
|
|
31
|
+
*/
|
|
32
|
+
e: number;
|
|
33
|
+
/**
|
|
34
|
+
* Character offset of this segment's text within the chunk's joined content — maps a position in the chunk text back to a moment in the recording.
|
|
35
|
+
* @type {number}
|
|
36
|
+
* @memberof SegmentSpan
|
|
37
|
+
*/
|
|
38
|
+
c: number;
|
|
39
|
+
}
|
|
40
|
+
export declare const SegmentSpanPropertyValidationAttributesMap: {
|
|
41
|
+
[property: string]: {
|
|
42
|
+
maxLength?: number;
|
|
43
|
+
minLength?: number;
|
|
44
|
+
pattern?: string;
|
|
45
|
+
maximum?: number;
|
|
46
|
+
exclusiveMaximum?: boolean;
|
|
47
|
+
minimum?: number;
|
|
48
|
+
exclusiveMinimum?: boolean;
|
|
49
|
+
multipleOf?: number;
|
|
50
|
+
maxItems?: number;
|
|
51
|
+
minItems?: number;
|
|
52
|
+
uniqueItems?: boolean;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Check if a given object implements the SegmentSpan interface.
|
|
57
|
+
*/
|
|
58
|
+
export declare function instanceOfSegmentSpan(value: object): value is SegmentSpan;
|
|
59
|
+
export declare function SegmentSpanFromJSON(json: any): SegmentSpan;
|
|
60
|
+
export declare function SegmentSpanFromJSONTyped(json: any, ignoreDiscriminator: boolean): SegmentSpan;
|
|
61
|
+
export declare function SegmentSpanToJSON(json: any): SegmentSpan;
|
|
62
|
+
export declare function SegmentSpanToJSONTyped(value?: SegmentSpan | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,60 @@
|
|
|
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.SegmentSpanPropertyValidationAttributesMap = void 0;
|
|
17
|
+
exports.instanceOfSegmentSpan = instanceOfSegmentSpan;
|
|
18
|
+
exports.SegmentSpanFromJSON = SegmentSpanFromJSON;
|
|
19
|
+
exports.SegmentSpanFromJSONTyped = SegmentSpanFromJSONTyped;
|
|
20
|
+
exports.SegmentSpanToJSON = SegmentSpanToJSON;
|
|
21
|
+
exports.SegmentSpanToJSONTyped = SegmentSpanToJSONTyped;
|
|
22
|
+
exports.SegmentSpanPropertyValidationAttributesMap = {};
|
|
23
|
+
/**
|
|
24
|
+
* Check if a given object implements the SegmentSpan interface.
|
|
25
|
+
*/
|
|
26
|
+
function instanceOfSegmentSpan(value) {
|
|
27
|
+
if (!('s' in value) || value['s'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
if (!('e' in value) || value['e'] === undefined)
|
|
30
|
+
return false;
|
|
31
|
+
if (!('c' in value) || value['c'] === undefined)
|
|
32
|
+
return false;
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
function SegmentSpanFromJSON(json) {
|
|
36
|
+
return SegmentSpanFromJSONTyped(json, false);
|
|
37
|
+
}
|
|
38
|
+
function SegmentSpanFromJSONTyped(json, ignoreDiscriminator) {
|
|
39
|
+
if (json == null) {
|
|
40
|
+
return json;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
's': json['s'],
|
|
44
|
+
'e': json['e'],
|
|
45
|
+
'c': json['c'],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function SegmentSpanToJSON(json) {
|
|
49
|
+
return SegmentSpanToJSONTyped(json, false);
|
|
50
|
+
}
|
|
51
|
+
function SegmentSpanToJSONTyped(value, ignoreDiscriminator = false) {
|
|
52
|
+
if (value == null) {
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
's': value['s'],
|
|
57
|
+
'e': value['e'],
|
|
58
|
+
'c': value['c'],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -34,6 +34,18 @@ export interface UploadConstraints {
|
|
|
34
34
|
* @memberof UploadConstraints
|
|
35
35
|
*/
|
|
36
36
|
maxImageBytes: number;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @memberof UploadConstraints
|
|
41
|
+
*/
|
|
42
|
+
maxMediaBytes: number;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {number}
|
|
46
|
+
* @memberof UploadConstraints
|
|
47
|
+
*/
|
|
48
|
+
maxVideoBytes: number;
|
|
37
49
|
}
|
|
38
50
|
export declare const UploadConstraintsPropertyValidationAttributesMap: {
|
|
39
51
|
[property: string]: {
|
|
@@ -31,6 +31,10 @@ function instanceOfUploadConstraints(value) {
|
|
|
31
31
|
return false;
|
|
32
32
|
if (!('maxImageBytes' in value) || value['maxImageBytes'] === undefined)
|
|
33
33
|
return false;
|
|
34
|
+
if (!('maxMediaBytes' in value) || value['maxMediaBytes'] === undefined)
|
|
35
|
+
return false;
|
|
36
|
+
if (!('maxVideoBytes' in value) || value['maxVideoBytes'] === undefined)
|
|
37
|
+
return false;
|
|
34
38
|
return true;
|
|
35
39
|
}
|
|
36
40
|
function UploadConstraintsFromJSON(json) {
|
|
@@ -44,6 +48,8 @@ function UploadConstraintsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
44
48
|
'formats': (json['formats'].map(UploadFormat_1.UploadFormatFromJSON)),
|
|
45
49
|
'maxBytes': json['max_bytes'],
|
|
46
50
|
'maxImageBytes': json['max_image_bytes'],
|
|
51
|
+
'maxMediaBytes': json['max_media_bytes'],
|
|
52
|
+
'maxVideoBytes': json['max_video_bytes'],
|
|
47
53
|
};
|
|
48
54
|
}
|
|
49
55
|
function UploadConstraintsToJSON(json) {
|
|
@@ -57,5 +63,7 @@ function UploadConstraintsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
57
63
|
'formats': (value['formats'].map(UploadFormat_1.UploadFormatToJSON)),
|
|
58
64
|
'max_bytes': value['maxBytes'],
|
|
59
65
|
'max_image_bytes': value['maxImageBytes'],
|
|
66
|
+
'max_media_bytes': value['maxMediaBytes'],
|
|
67
|
+
'max_video_bytes': value['maxVideoBytes'],
|
|
60
68
|
};
|
|
61
69
|
}
|
|
@@ -21,6 +21,12 @@ export interface UserMessageRequest {
|
|
|
21
21
|
* @memberof UserMessageRequest
|
|
22
22
|
*/
|
|
23
23
|
inputText?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Answer with the faster, lower-cost chat profile. Ignored when the tenant pins a chat profile and on workflow-run threads.
|
|
26
|
+
* @type {boolean}
|
|
27
|
+
* @memberof UserMessageRequest
|
|
28
|
+
*/
|
|
29
|
+
fastMode?: boolean;
|
|
24
30
|
}
|
|
25
31
|
export declare const UserMessageRequestPropertyValidationAttributesMap: {
|
|
26
32
|
[property: string]: {
|
|
@@ -35,6 +35,7 @@ function UserMessageRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
35
35
|
}
|
|
36
36
|
return {
|
|
37
37
|
'inputText': json['input_text'] == null ? undefined : json['input_text'],
|
|
38
|
+
'fastMode': json['fast_mode'] == null ? undefined : json['fast_mode'],
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
function UserMessageRequestToJSON(json) {
|
|
@@ -46,5 +47,6 @@ function UserMessageRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
46
47
|
}
|
|
47
48
|
return {
|
|
48
49
|
'input_text': value['inputText'],
|
|
50
|
+
'fast_mode': value['fastMode'],
|
|
49
51
|
};
|
|
50
52
|
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -265,6 +265,7 @@ export * from './SectionContentItem';
|
|
|
265
265
|
export * from './SectionContentItemOrChunkContentItem';
|
|
266
266
|
export * from './SectionResponse';
|
|
267
267
|
export * from './SectionSystemMetadata';
|
|
268
|
+
export * from './SegmentSpan';
|
|
268
269
|
export * from './SendPasswordResetRequest';
|
|
269
270
|
export * from './SetApprovalStateRequest';
|
|
270
271
|
export * from './SetWorkflowRunApprovalRequest';
|
package/dist/models/index.js
CHANGED
|
@@ -283,6 +283,7 @@ __exportStar(require("./SectionContentItem"), exports);
|
|
|
283
283
|
__exportStar(require("./SectionContentItemOrChunkContentItem"), exports);
|
|
284
284
|
__exportStar(require("./SectionResponse"), exports);
|
|
285
285
|
__exportStar(require("./SectionSystemMetadata"), exports);
|
|
286
|
+
__exportStar(require("./SegmentSpan"), exports);
|
|
286
287
|
__exportStar(require("./SendPasswordResetRequest"), exports);
|
|
287
288
|
__exportStar(require("./SetApprovalStateRequest"), exports);
|
|
288
289
|
__exportStar(require("./SetWorkflowRunApprovalRequest"), exports);
|
package/docs/ChunkMetadata.md
CHANGED
|
@@ -15,6 +15,7 @@ Name | Type
|
|
|
15
15
|
`secondaryTaxonomy` | [ImageTaxonomy](ImageTaxonomy.md)
|
|
16
16
|
`startMs` | number
|
|
17
17
|
`endMs` | number
|
|
18
|
+
`segments` | [Array<SegmentSpan>](SegmentSpan.md)
|
|
18
19
|
`sheetName` | string
|
|
19
20
|
`blockType` | string
|
|
20
21
|
`sourceUri` | string
|
|
@@ -40,6 +41,7 @@ const example = {
|
|
|
40
41
|
"secondaryTaxonomy": null,
|
|
41
42
|
"startMs": null,
|
|
42
43
|
"endMs": null,
|
|
44
|
+
"segments": null,
|
|
43
45
|
"sheetName": null,
|
|
44
46
|
"blockType": null,
|
|
45
47
|
"sourceUri": null,
|
|
@@ -29,6 +29,7 @@ Name | Type
|
|
|
29
29
|
`informationStatistics` | [InformationStatistics](InformationStatistics.md)
|
|
30
30
|
`quotaCharged` | boolean
|
|
31
31
|
`quotaPageCount` | number
|
|
32
|
+
`quotaMediaMinutes` | number
|
|
32
33
|
`quotaIdempotencyKey` | string
|
|
33
34
|
`fileMd5` | string
|
|
34
35
|
`idempotencyKey` | string
|
|
@@ -62,6 +63,7 @@ const example = {
|
|
|
62
63
|
"informationStatistics": null,
|
|
63
64
|
"quotaCharged": null,
|
|
64
65
|
"quotaPageCount": null,
|
|
66
|
+
"quotaMediaMinutes": null,
|
|
65
67
|
"quotaIdempotencyKey": null,
|
|
66
68
|
"fileMd5": null,
|
|
67
69
|
"idempotencyKey": null,
|
|
@@ -32,6 +32,7 @@ Name | Type
|
|
|
32
32
|
`informationStatistics` | [InformationStatistics](InformationStatistics.md)
|
|
33
33
|
`quotaCharged` | boolean
|
|
34
34
|
`quotaPageCount` | number
|
|
35
|
+
`quotaMediaMinutes` | number
|
|
35
36
|
`quotaIdempotencyKey` | string
|
|
36
37
|
`fileMd5` | string
|
|
37
38
|
|
|
@@ -67,6 +68,7 @@ const example = {
|
|
|
67
68
|
"informationStatistics": null,
|
|
68
69
|
"quotaCharged": null,
|
|
69
70
|
"quotaPageCount": null,
|
|
71
|
+
"quotaMediaMinutes": null,
|
|
70
72
|
"quotaIdempotencyKey": null,
|
|
71
73
|
"fileMd5": null,
|
|
72
74
|
} satisfies DocumentVersionMetadataUpdate
|
|
@@ -429,7 +429,7 @@ async function example() {
|
|
|
429
429
|
const body = {
|
|
430
430
|
// string | DocumentVersion ID
|
|
431
431
|
versionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
432
|
-
// DownloadArtifact | Artifact to download: source or
|
|
432
|
+
// DownloadArtifact | Artifact to download: source, fast_plaintext, or transcript (media only) (optional)
|
|
433
433
|
artifact: ...,
|
|
434
434
|
} satisfies DownloadDocumentVersionRequest;
|
|
435
435
|
|
|
@@ -451,7 +451,7 @@ example().catch(console.error);
|
|
|
451
451
|
| Name | Type | Description | Notes |
|
|
452
452
|
|------------- | ------------- | ------------- | -------------|
|
|
453
453
|
| **versionId** | `string` | DocumentVersion ID | [Defaults to `undefined`] |
|
|
454
|
-
| **artifact** | `DownloadArtifact` | Artifact to download: source or
|
|
454
|
+
| **artifact** | `DownloadArtifact` | Artifact to download: source, fast_plaintext, or transcript (media only) | [Optional] [Defaults to `undefined`] [Enum: source, fast_plaintext, transcript] |
|
|
455
455
|
|
|
456
456
|
### Return type
|
|
457
457
|
|
package/docs/DocumentsApi.md
CHANGED
|
@@ -426,7 +426,7 @@ async function example() {
|
|
|
426
426
|
const body = {
|
|
427
427
|
// string
|
|
428
428
|
documentId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
429
|
-
// DownloadArtifact | Artifact to download: source or
|
|
429
|
+
// DownloadArtifact | Artifact to download: source, fast_plaintext, or transcript (media only) (optional)
|
|
430
430
|
artifact: ...,
|
|
431
431
|
} satisfies DownloadDocumentRequest;
|
|
432
432
|
|
|
@@ -448,7 +448,7 @@ example().catch(console.error);
|
|
|
448
448
|
| Name | Type | Description | Notes |
|
|
449
449
|
|------------- | ------------- | ------------- | -------------|
|
|
450
450
|
| **documentId** | `string` | | [Defaults to `undefined`] |
|
|
451
|
-
| **artifact** | `DownloadArtifact` | Artifact to download: source or
|
|
451
|
+
| **artifact** | `DownloadArtifact` | Artifact to download: source, fast_plaintext, or transcript (media only) | [Optional] [Defaults to `undefined`] [Enum: source, fast_plaintext, transcript] |
|
|
452
452
|
|
|
453
453
|
### Return type
|
|
454
454
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
# SegmentSpan
|
|
3
|
+
|
|
4
|
+
One ASR segment\'s span inside a media chunk (media chunks only). Field names are deliberately compact — a media document stores hundreds of chunks x up to ~15 spans each in ``chunk_metadata`` JSONB.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`s` | number
|
|
11
|
+
`e` | number
|
|
12
|
+
`c` | number
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { SegmentSpan } from '@knowledge-stack/ksapi'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"s": null,
|
|
22
|
+
"e": null,
|
|
23
|
+
"c": null,
|
|
24
|
+
} satisfies SegmentSpan
|
|
25
|
+
|
|
26
|
+
console.log(example)
|
|
27
|
+
|
|
28
|
+
// Convert the instance to a JSON string
|
|
29
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
30
|
+
console.log(exampleJSON)
|
|
31
|
+
|
|
32
|
+
// Parse the JSON string back to an object
|
|
33
|
+
const exampleParsed = JSON.parse(exampleJSON) as SegmentSpan
|
|
34
|
+
console.log(exampleParsed)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
38
|
+
|
|
39
|
+
|
|
@@ -9,6 +9,8 @@ Name | Type
|
|
|
9
9
|
`formats` | [Array<UploadFormat>](UploadFormat.md)
|
|
10
10
|
`maxBytes` | number
|
|
11
11
|
`maxImageBytes` | number
|
|
12
|
+
`maxMediaBytes` | number
|
|
13
|
+
`maxVideoBytes` | number
|
|
12
14
|
|
|
13
15
|
## Example
|
|
14
16
|
|
|
@@ -20,6 +22,8 @@ const example = {
|
|
|
20
22
|
"formats": null,
|
|
21
23
|
"maxBytes": null,
|
|
22
24
|
"maxImageBytes": null,
|
|
25
|
+
"maxMediaBytes": null,
|
|
26
|
+
"maxVideoBytes": null,
|
|
23
27
|
} satisfies UploadConstraints
|
|
24
28
|
|
|
25
29
|
console.log(example)
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
Name | Type
|
|
8
8
|
------------ | -------------
|
|
9
9
|
`inputText` | string
|
|
10
|
+
`fastMode` | boolean
|
|
10
11
|
|
|
11
12
|
## Example
|
|
12
13
|
|
|
@@ -16,6 +17,7 @@ import type { UserMessageRequest } from '@knowledge-stack/ksapi'
|
|
|
16
17
|
// TODO: Update the object below with actual values
|
|
17
18
|
const example = {
|
|
18
19
|
"inputText": null,
|
|
20
|
+
"fastMode": null,
|
|
19
21
|
} satisfies UserMessageRequest
|
|
20
22
|
|
|
21
23
|
console.log(example)
|
package/package.json
CHANGED
|
@@ -261,7 +261,7 @@ export interface DocumentVersionsApiInterface {
|
|
|
261
261
|
/**
|
|
262
262
|
* Creates request options for downloadDocumentVersion without sending the request
|
|
263
263
|
* @param {string} versionId DocumentVersion ID
|
|
264
|
-
* @param {DownloadArtifact} [artifact] Artifact to download: source or
|
|
264
|
+
* @param {DownloadArtifact} [artifact] Artifact to download: source, fast_plaintext, or transcript (media only)
|
|
265
265
|
* @throws {RequiredError}
|
|
266
266
|
* @memberof DocumentVersionsApiInterface
|
|
267
267
|
*/
|
|
@@ -271,7 +271,7 @@ export interface DocumentVersionsApiInterface {
|
|
|
271
271
|
* Issue a short-lived, audited download link for a specific version. Records a ``document.downloaded`` audit event anchored to the document so the customer audit log captures who downloaded which version and when.
|
|
272
272
|
* @summary Download Document Version Handler
|
|
273
273
|
* @param {string} versionId DocumentVersion ID
|
|
274
|
-
* @param {DownloadArtifact} [artifact] Artifact to download: source or
|
|
274
|
+
* @param {DownloadArtifact} [artifact] Artifact to download: source, fast_plaintext, or transcript (media only)
|
|
275
275
|
* @param {*} [options] Override http request option.
|
|
276
276
|
* @throws {RequiredError}
|
|
277
277
|
* @memberof DocumentVersionsApiInterface
|
package/src/apis/DocumentsApi.ts
CHANGED
|
@@ -304,7 +304,7 @@ export interface DocumentsApiInterface {
|
|
|
304
304
|
/**
|
|
305
305
|
* Creates request options for downloadDocument without sending the request
|
|
306
306
|
* @param {string} documentId
|
|
307
|
-
* @param {DownloadArtifact} [artifact] Artifact to download: source or
|
|
307
|
+
* @param {DownloadArtifact} [artifact] Artifact to download: source, fast_plaintext, or transcript (media only)
|
|
308
308
|
* @throws {RequiredError}
|
|
309
309
|
* @memberof DocumentsApiInterface
|
|
310
310
|
*/
|
|
@@ -314,7 +314,7 @@ export interface DocumentsApiInterface {
|
|
|
314
314
|
* Issue a short-lived, audited download link for a document\'s active version. Records a ``document.downloaded`` audit event so the customer audit log captures who downloaded which document/version and when.
|
|
315
315
|
* @summary Download Document Handler
|
|
316
316
|
* @param {string} documentId
|
|
317
|
-
* @param {DownloadArtifact} [artifact] Artifact to download: source or
|
|
317
|
+
* @param {DownloadArtifact} [artifact] Artifact to download: source, fast_plaintext, or transcript (media only)
|
|
318
318
|
* @param {*} [options] Override http request option.
|
|
319
319
|
* @throws {RequiredError}
|
|
320
320
|
* @memberof DocumentsApiInterface
|
|
@@ -13,6 +13,13 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
+
import type { SegmentSpan } from './SegmentSpan';
|
|
17
|
+
import {
|
|
18
|
+
SegmentSpanFromJSON,
|
|
19
|
+
SegmentSpanFromJSONTyped,
|
|
20
|
+
SegmentSpanToJSON,
|
|
21
|
+
SegmentSpanToJSONTyped,
|
|
22
|
+
} from './SegmentSpan';
|
|
16
23
|
import type { ImageTaxonomy } from './ImageTaxonomy';
|
|
17
24
|
import {
|
|
18
25
|
ImageTaxonomyFromJSON,
|
|
@@ -82,6 +89,12 @@ export interface ChunkMetadata {
|
|
|
82
89
|
* @memberof ChunkMetadata
|
|
83
90
|
*/
|
|
84
91
|
endMs?: number | null;
|
|
92
|
+
/**
|
|
93
|
+
* Per-ASR-segment spans inside this media chunk, in order, each carrying its char offset in the chunk content. Lets citation resolution narrow a chunk-level timeframe to the enclosing segment. None for non-media chunks and media ingested before this field existed.
|
|
94
|
+
* @type {Array<SegmentSpan>}
|
|
95
|
+
* @memberof ChunkMetadata
|
|
96
|
+
*/
|
|
97
|
+
segments?: Array<SegmentSpan> | null;
|
|
85
98
|
/**
|
|
86
99
|
* Worksheet name this chunk was extracted from (XLSX only)
|
|
87
100
|
* @type {string}
|
|
@@ -182,6 +195,7 @@ export function ChunkMetadataFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
182
195
|
'secondaryTaxonomy': json['secondary_taxonomy'] == null ? undefined : ImageTaxonomyFromJSON(json['secondary_taxonomy']),
|
|
183
196
|
'startMs': json['start_ms'] == null ? undefined : json['start_ms'],
|
|
184
197
|
'endMs': json['end_ms'] == null ? undefined : json['end_ms'],
|
|
198
|
+
'segments': json['segments'] == null ? undefined : ((json['segments'] as Array<any>).map(SegmentSpanFromJSON)),
|
|
185
199
|
'sheetName': json['sheet_name'] == null ? undefined : json['sheet_name'],
|
|
186
200
|
'blockType': json['block_type'] == null ? undefined : json['block_type'],
|
|
187
201
|
'sourceUri': json['source_uri'] == null ? undefined : json['source_uri'],
|
|
@@ -213,6 +227,7 @@ export function ChunkMetadataToJSONTyped(value?: ChunkMetadata | null, ignoreDis
|
|
|
213
227
|
'secondary_taxonomy': ImageTaxonomyToJSON(value['secondaryTaxonomy']),
|
|
214
228
|
'start_ms': value['startMs'],
|
|
215
229
|
'end_ms': value['endMs'],
|
|
230
|
+
'segments': value['segments'] == null ? undefined : ((value['segments'] as Array<any>).map(SegmentSpanToJSON)),
|
|
216
231
|
'sheet_name': value['sheetName'],
|
|
217
232
|
'block_type': value['blockType'],
|
|
218
233
|
'source_uri': value['sourceUri'],
|
|
@@ -182,6 +182,12 @@ export interface DocumentVersionMetadata {
|
|
|
182
182
|
* @memberof DocumentVersionMetadata
|
|
183
183
|
*/
|
|
184
184
|
quotaPageCount?: number;
|
|
185
|
+
/**
|
|
186
|
+
* MEDIA_MINUTE quantity charged at media preparation; 0 if not yet charged
|
|
187
|
+
* @type {number}
|
|
188
|
+
* @memberof DocumentVersionMetadata
|
|
189
|
+
*/
|
|
190
|
+
quotaMediaMinutes?: number;
|
|
185
191
|
/**
|
|
186
192
|
* Stable consume key (matches workflow_id); 'UNSET' for pre-Phase-2 docs so refund logic short-circuits
|
|
187
193
|
* @type {string}
|
|
@@ -258,6 +264,7 @@ export function DocumentVersionMetadataFromJSONTyped(json: any, ignoreDiscrimina
|
|
|
258
264
|
'informationStatistics': json['information_statistics'] == null ? undefined : InformationStatisticsFromJSON(json['information_statistics']),
|
|
259
265
|
'quotaCharged': json['quota_charged'] == null ? undefined : json['quota_charged'],
|
|
260
266
|
'quotaPageCount': json['quota_page_count'] == null ? undefined : json['quota_page_count'],
|
|
267
|
+
'quotaMediaMinutes': json['quota_media_minutes'] == null ? undefined : json['quota_media_minutes'],
|
|
261
268
|
'quotaIdempotencyKey': json['quota_idempotency_key'] == null ? undefined : json['quota_idempotency_key'],
|
|
262
269
|
'fileMd5': json['file_md5'] == null ? undefined : json['file_md5'],
|
|
263
270
|
'idempotencyKey': json['idempotency_key'] == null ? undefined : json['idempotency_key'],
|
|
@@ -297,6 +304,7 @@ export function DocumentVersionMetadataToJSONTyped(value?: DocumentVersionMetada
|
|
|
297
304
|
'information_statistics': InformationStatisticsToJSON(value['informationStatistics']),
|
|
298
305
|
'quota_charged': value['quotaCharged'],
|
|
299
306
|
'quota_page_count': value['quotaPageCount'],
|
|
307
|
+
'quota_media_minutes': value['quotaMediaMinutes'],
|
|
300
308
|
'quota_idempotency_key': value['quotaIdempotencyKey'],
|
|
301
309
|
'file_md5': value['fileMd5'],
|
|
302
310
|
'idempotency_key': value['idempotencyKey'],
|
|
@@ -194,6 +194,12 @@ export interface DocumentVersionMetadataUpdate {
|
|
|
194
194
|
* @memberof DocumentVersionMetadataUpdate
|
|
195
195
|
*/
|
|
196
196
|
quotaPageCount?: number | null;
|
|
197
|
+
/**
|
|
198
|
+
*
|
|
199
|
+
* @type {number}
|
|
200
|
+
* @memberof DocumentVersionMetadataUpdate
|
|
201
|
+
*/
|
|
202
|
+
quotaMediaMinutes?: number | null;
|
|
197
203
|
/**
|
|
198
204
|
*
|
|
199
205
|
* @type {string}
|
|
@@ -267,6 +273,7 @@ export function DocumentVersionMetadataUpdateFromJSONTyped(json: any, ignoreDisc
|
|
|
267
273
|
'informationStatistics': json['information_statistics'] == null ? undefined : InformationStatisticsFromJSON(json['information_statistics']),
|
|
268
274
|
'quotaCharged': json['quota_charged'] == null ? undefined : json['quota_charged'],
|
|
269
275
|
'quotaPageCount': json['quota_page_count'] == null ? undefined : json['quota_page_count'],
|
|
276
|
+
'quotaMediaMinutes': json['quota_media_minutes'] == null ? undefined : json['quota_media_minutes'],
|
|
270
277
|
'quotaIdempotencyKey': json['quota_idempotency_key'] == null ? undefined : json['quota_idempotency_key'],
|
|
271
278
|
'fileMd5': json['file_md5'] == null ? undefined : json['file_md5'],
|
|
272
279
|
};
|
|
@@ -308,6 +315,7 @@ export function DocumentVersionMetadataUpdateToJSONTyped(value?: DocumentVersion
|
|
|
308
315
|
'information_statistics': InformationStatisticsToJSON(value['informationStatistics']),
|
|
309
316
|
'quota_charged': value['quotaCharged'],
|
|
310
317
|
'quota_page_count': value['quotaPageCount'],
|
|
318
|
+
'quota_media_minutes': value['quotaMediaMinutes'],
|
|
311
319
|
'quota_idempotency_key': value['quotaIdempotencyKey'],
|
|
312
320
|
'file_md5': value['fileMd5'],
|
|
313
321
|
};
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
*/
|
|
20
20
|
export const DownloadArtifact = {
|
|
21
21
|
Source: 'source',
|
|
22
|
-
FastPlaintext: 'fast_plaintext'
|
|
22
|
+
FastPlaintext: 'fast_plaintext',
|
|
23
|
+
Transcript: 'transcript'
|
|
23
24
|
} as const;
|
|
24
25
|
export type DownloadArtifact = typeof DownloadArtifact[keyof typeof DownloadArtifact];
|
|
25
26
|
|
|
@@ -0,0 +1,104 @@
|
|
|
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 ASR segment's span inside a media chunk (media chunks only).
|
|
18
|
+
*
|
|
19
|
+
* Field names are deliberately compact — a media document stores hundreds
|
|
20
|
+
* of chunks x up to ~15 spans each in ``chunk_metadata`` JSONB.
|
|
21
|
+
* @export
|
|
22
|
+
* @interface SegmentSpan
|
|
23
|
+
*/
|
|
24
|
+
export interface SegmentSpan {
|
|
25
|
+
/**
|
|
26
|
+
* Segment start in the media, ms from start.
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @memberof SegmentSpan
|
|
29
|
+
*/
|
|
30
|
+
s: number;
|
|
31
|
+
/**
|
|
32
|
+
* Segment end in the media, ms from start.
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @memberof SegmentSpan
|
|
35
|
+
*/
|
|
36
|
+
e: number;
|
|
37
|
+
/**
|
|
38
|
+
* Character offset of this segment's text within the chunk's joined content — maps a position in the chunk text back to a moment in the recording.
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @memberof SegmentSpan
|
|
41
|
+
*/
|
|
42
|
+
c: number;
|
|
43
|
+
}
|
|
44
|
+
export const SegmentSpanPropertyValidationAttributesMap: {
|
|
45
|
+
[property: string]: {
|
|
46
|
+
maxLength?: number,
|
|
47
|
+
minLength?: number,
|
|
48
|
+
pattern?: string,
|
|
49
|
+
maximum?: number,
|
|
50
|
+
exclusiveMaximum?: boolean,
|
|
51
|
+
minimum?: number,
|
|
52
|
+
exclusiveMinimum?: boolean,
|
|
53
|
+
multipleOf?: number,
|
|
54
|
+
maxItems?: number,
|
|
55
|
+
minItems?: number,
|
|
56
|
+
uniqueItems?: boolean
|
|
57
|
+
}
|
|
58
|
+
} = {
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Check if a given object implements the SegmentSpan interface.
|
|
64
|
+
*/
|
|
65
|
+
export function instanceOfSegmentSpan(value: object): value is SegmentSpan {
|
|
66
|
+
if (!('s' in value) || value['s'] === undefined) return false;
|
|
67
|
+
if (!('e' in value) || value['e'] === undefined) return false;
|
|
68
|
+
if (!('c' in value) || value['c'] === undefined) return false;
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function SegmentSpanFromJSON(json: any): SegmentSpan {
|
|
73
|
+
return SegmentSpanFromJSONTyped(json, false);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function SegmentSpanFromJSONTyped(json: any, ignoreDiscriminator: boolean): SegmentSpan {
|
|
77
|
+
if (json == null) {
|
|
78
|
+
return json;
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
|
|
82
|
+
's': json['s'],
|
|
83
|
+
'e': json['e'],
|
|
84
|
+
'c': json['c'],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function SegmentSpanToJSON(json: any): SegmentSpan {
|
|
89
|
+
return SegmentSpanToJSONTyped(json, false);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function SegmentSpanToJSONTyped(value?: SegmentSpan | null, ignoreDiscriminator: boolean = false): any {
|
|
93
|
+
if (value == null) {
|
|
94
|
+
return value;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
|
|
99
|
+
's': value['s'],
|
|
100
|
+
'e': value['e'],
|
|
101
|
+
'c': value['c'],
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|