@knowledge-stack/ksapi 1.156.0 → 1.157.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 +12 -0
- package/dist/esm/models/DocumentVersionMetadata.js +4 -0
- package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +12 -0
- package/dist/esm/models/DocumentVersionMetadataUpdate.js +4 -0
- package/dist/esm/models/DocumentVersionResponse.d.ts +6 -0
- package/dist/esm/models/DocumentVersionResponse.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/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 +12 -0
- package/dist/models/DocumentVersionMetadata.js +4 -0
- package/dist/models/DocumentVersionMetadataUpdate.d.ts +12 -0
- package/dist/models/DocumentVersionMetadataUpdate.js +4 -0
- package/dist/models/DocumentVersionResponse.d.ts +6 -0
- package/dist/models/DocumentVersionResponse.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/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/docs/ChunkMetadata.md +2 -0
- package/docs/DocumentVersionMetadata.md +4 -0
- package/docs/DocumentVersionMetadataUpdate.md +4 -0
- package/docs/DocumentVersionResponse.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/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 +16 -0
- package/src/models/DocumentVersionMetadataUpdate.ts +16 -0
- package/src/models/DocumentVersionResponse.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/index.ts +1 -0
|
@@ -57,6 +57,12 @@ export interface DocumentVersionMetadataUpdate {
|
|
|
57
57
|
* @memberof DocumentVersionMetadataUpdate
|
|
58
58
|
*/
|
|
59
59
|
fastPlaintextS3?: string | null;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @type {string}
|
|
63
|
+
* @memberof DocumentVersionMetadataUpdate
|
|
64
|
+
*/
|
|
65
|
+
transcriptS3?: string | null;
|
|
60
66
|
/**
|
|
61
67
|
*
|
|
62
68
|
* @type {string}
|
|
@@ -169,6 +175,12 @@ export interface DocumentVersionMetadataUpdate {
|
|
|
169
175
|
* @memberof DocumentVersionMetadataUpdate
|
|
170
176
|
*/
|
|
171
177
|
quotaPageCount?: number | null;
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
* @type {number}
|
|
181
|
+
* @memberof DocumentVersionMetadataUpdate
|
|
182
|
+
*/
|
|
183
|
+
quotaMediaMinutes?: number | null;
|
|
172
184
|
/**
|
|
173
185
|
*
|
|
174
186
|
* @type {string}
|
|
@@ -43,6 +43,7 @@ function DocumentVersionMetadataUpdateFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
43
43
|
'citedSourceS3': json['cited_source_s3'] == null ? undefined : json['cited_source_s3'],
|
|
44
44
|
'standardPipelineJsonS3': json['standard_pipeline_json_s3'] == null ? undefined : json['standard_pipeline_json_s3'],
|
|
45
45
|
'fastPlaintextS3': json['fast_plaintext_s3'] == null ? undefined : json['fast_plaintext_s3'],
|
|
46
|
+
'transcriptS3': json['transcript_s3'] == null ? undefined : json['transcript_s3'],
|
|
46
47
|
'highAccuracyContentListS3': json['high_accuracy_content_list_s3'] == null ? undefined : json['high_accuracy_content_list_s3'],
|
|
47
48
|
'highAccuracyMiddleS3': json['high_accuracy_middle_s3'] == null ? undefined : json['high_accuracy_middle_s3'],
|
|
48
49
|
'hash': json['hash'] == null ? undefined : json['hash'],
|
|
@@ -61,6 +62,7 @@ function DocumentVersionMetadataUpdateFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
61
62
|
'informationStatistics': json['information_statistics'] == null ? undefined : (0, InformationStatistics_1.InformationStatisticsFromJSON)(json['information_statistics']),
|
|
62
63
|
'quotaCharged': json['quota_charged'] == null ? undefined : json['quota_charged'],
|
|
63
64
|
'quotaPageCount': json['quota_page_count'] == null ? undefined : json['quota_page_count'],
|
|
65
|
+
'quotaMediaMinutes': json['quota_media_minutes'] == null ? undefined : json['quota_media_minutes'],
|
|
64
66
|
'quotaIdempotencyKey': json['quota_idempotency_key'] == null ? undefined : json['quota_idempotency_key'],
|
|
65
67
|
'fileMd5': json['file_md5'] == null ? undefined : json['file_md5'],
|
|
66
68
|
};
|
|
@@ -79,6 +81,7 @@ function DocumentVersionMetadataUpdateToJSONTyped(value, ignoreDiscriminator = f
|
|
|
79
81
|
'cited_source_s3': value['citedSourceS3'],
|
|
80
82
|
'standard_pipeline_json_s3': value['standardPipelineJsonS3'],
|
|
81
83
|
'fast_plaintext_s3': value['fastPlaintextS3'],
|
|
84
|
+
'transcript_s3': value['transcriptS3'],
|
|
82
85
|
'high_accuracy_content_list_s3': value['highAccuracyContentListS3'],
|
|
83
86
|
'high_accuracy_middle_s3': value['highAccuracyMiddleS3'],
|
|
84
87
|
'hash': value['hash'],
|
|
@@ -97,6 +100,7 @@ function DocumentVersionMetadataUpdateToJSONTyped(value, ignoreDiscriminator = f
|
|
|
97
100
|
'information_statistics': (0, InformationStatistics_1.InformationStatisticsToJSON)(value['informationStatistics']),
|
|
98
101
|
'quota_charged': value['quotaCharged'],
|
|
99
102
|
'quota_page_count': value['quotaPageCount'],
|
|
103
|
+
'quota_media_minutes': value['quotaMediaMinutes'],
|
|
100
104
|
'quota_idempotency_key': value['quotaIdempotencyKey'],
|
|
101
105
|
'file_md5': value['fileMd5'],
|
|
102
106
|
};
|
|
@@ -104,6 +104,12 @@ export interface DocumentVersionResponse {
|
|
|
104
104
|
* @memberof DocumentVersionResponse
|
|
105
105
|
*/
|
|
106
106
|
fastPlaintextUrl?: string | null;
|
|
107
|
+
/**
|
|
108
|
+
* Presigned URL (6-hour validity) to the ASR transcript JSON with per-segment start_ms/end_ms/text; null for non-media. Chunks pack many segments into one, so this is what a client reads to follow a recording line by line.
|
|
109
|
+
* @type {string}
|
|
110
|
+
* @memberof DocumentVersionResponse
|
|
111
|
+
*/
|
|
112
|
+
transcriptUrl?: string | null;
|
|
107
113
|
/**
|
|
108
114
|
* Presigned URLs (6-hour validity) to per-page WEBP screenshots in page order: index 0 is page 1, index N-1 is page N. Populated only when the request includes include_page_screenshots=true; null otherwise.
|
|
109
115
|
* @type {Array<string>}
|
|
@@ -72,6 +72,7 @@ function DocumentVersionResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
72
72
|
'assetS3Url': json['asset_s3_url'] == null ? undefined : json['asset_s3_url'],
|
|
73
73
|
'citedAssetS3Url': json['cited_asset_s3_url'] == null ? undefined : json['cited_asset_s3_url'],
|
|
74
74
|
'fastPlaintextUrl': json['fast_plaintext_url'] == null ? undefined : json['fast_plaintext_url'],
|
|
75
|
+
'transcriptUrl': json['transcript_url'] == null ? undefined : json['transcript_url'],
|
|
75
76
|
'pageScreenshotUrls': json['page_screenshot_urls'] == null ? undefined : json['page_screenshot_urls'],
|
|
76
77
|
'systemMetadata': json['system_metadata'] == null ? undefined : (0, DocumentVersionMetadata_1.DocumentVersionMetadataFromJSON)(json['system_metadata']),
|
|
77
78
|
};
|
|
@@ -98,6 +99,7 @@ function DocumentVersionResponseToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
98
99
|
'asset_s3_url': value['assetS3Url'],
|
|
99
100
|
'cited_asset_s3_url': value['citedAssetS3Url'],
|
|
100
101
|
'fast_plaintext_url': value['fastPlaintextUrl'],
|
|
102
|
+
'transcript_url': value['transcriptUrl'],
|
|
101
103
|
'page_screenshot_urls': value['pageScreenshotUrls'],
|
|
102
104
|
'system_metadata': (0, DocumentVersionMetadata_1.DocumentVersionMetadataToJSON)(value['systemMetadata']),
|
|
103
105
|
};
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
export declare const DownloadArtifact: {
|
|
17
17
|
readonly Source: 'source';
|
|
18
18
|
readonly FastPlaintext: 'fast_plaintext';
|
|
19
|
+
readonly Transcript: 'transcript';
|
|
19
20
|
};
|
|
20
21
|
export type DownloadArtifact = typeof DownloadArtifact[keyof typeof DownloadArtifact];
|
|
21
22
|
export declare function instanceOfDownloadArtifact(value: any): boolean;
|
|
@@ -25,7 +25,8 @@ exports.DownloadArtifactToJSONTyped = DownloadArtifactToJSONTyped;
|
|
|
25
25
|
*/
|
|
26
26
|
exports.DownloadArtifact = {
|
|
27
27
|
Source: 'source',
|
|
28
|
-
FastPlaintext: 'fast_plaintext'
|
|
28
|
+
FastPlaintext: 'fast_plaintext',
|
|
29
|
+
Transcript: 'transcript'
|
|
29
30
|
};
|
|
30
31
|
function instanceOfDownloadArtifact(value) {
|
|
31
32
|
for (const key in exports.DownloadArtifact) {
|
|
@@ -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
|
}
|
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,
|
|
@@ -12,6 +12,7 @@ Name | Type
|
|
|
12
12
|
`preconversionSourceS3` | string
|
|
13
13
|
`citedSourceS3` | string
|
|
14
14
|
`fastPlaintextS3` | string
|
|
15
|
+
`transcriptS3` | string
|
|
15
16
|
`hash` | string
|
|
16
17
|
`pipelineState` | [PipelineState](PipelineState.md)
|
|
17
18
|
`totalPages` | number
|
|
@@ -28,6 +29,7 @@ Name | Type
|
|
|
28
29
|
`informationStatistics` | [InformationStatistics](InformationStatistics.md)
|
|
29
30
|
`quotaCharged` | boolean
|
|
30
31
|
`quotaPageCount` | number
|
|
32
|
+
`quotaMediaMinutes` | number
|
|
31
33
|
`quotaIdempotencyKey` | string
|
|
32
34
|
`fileMd5` | string
|
|
33
35
|
`idempotencyKey` | string
|
|
@@ -44,6 +46,7 @@ const example = {
|
|
|
44
46
|
"preconversionSourceS3": null,
|
|
45
47
|
"citedSourceS3": null,
|
|
46
48
|
"fastPlaintextS3": null,
|
|
49
|
+
"transcriptS3": null,
|
|
47
50
|
"hash": null,
|
|
48
51
|
"pipelineState": null,
|
|
49
52
|
"totalPages": null,
|
|
@@ -60,6 +63,7 @@ const example = {
|
|
|
60
63
|
"informationStatistics": null,
|
|
61
64
|
"quotaCharged": null,
|
|
62
65
|
"quotaPageCount": null,
|
|
66
|
+
"quotaMediaMinutes": null,
|
|
63
67
|
"quotaIdempotencyKey": null,
|
|
64
68
|
"fileMd5": null,
|
|
65
69
|
"idempotencyKey": null,
|
|
@@ -13,6 +13,7 @@ Name | Type
|
|
|
13
13
|
`citedSourceS3` | string
|
|
14
14
|
`standardPipelineJsonS3` | string
|
|
15
15
|
`fastPlaintextS3` | string
|
|
16
|
+
`transcriptS3` | string
|
|
16
17
|
`highAccuracyContentListS3` | string
|
|
17
18
|
`highAccuracyMiddleS3` | string
|
|
18
19
|
`hash` | string
|
|
@@ -31,6 +32,7 @@ Name | Type
|
|
|
31
32
|
`informationStatistics` | [InformationStatistics](InformationStatistics.md)
|
|
32
33
|
`quotaCharged` | boolean
|
|
33
34
|
`quotaPageCount` | number
|
|
35
|
+
`quotaMediaMinutes` | number
|
|
34
36
|
`quotaIdempotencyKey` | string
|
|
35
37
|
`fileMd5` | string
|
|
36
38
|
|
|
@@ -47,6 +49,7 @@ const example = {
|
|
|
47
49
|
"citedSourceS3": null,
|
|
48
50
|
"standardPipelineJsonS3": null,
|
|
49
51
|
"fastPlaintextS3": null,
|
|
52
|
+
"transcriptS3": null,
|
|
50
53
|
"highAccuracyContentListS3": null,
|
|
51
54
|
"highAccuracyMiddleS3": null,
|
|
52
55
|
"hash": null,
|
|
@@ -65,6 +68,7 @@ const example = {
|
|
|
65
68
|
"informationStatistics": null,
|
|
66
69
|
"quotaCharged": null,
|
|
67
70
|
"quotaPageCount": null,
|
|
71
|
+
"quotaMediaMinutes": null,
|
|
68
72
|
"quotaIdempotencyKey": null,
|
|
69
73
|
"fileMd5": null,
|
|
70
74
|
} satisfies DocumentVersionMetadataUpdate
|
|
@@ -21,6 +21,7 @@ Name | Type
|
|
|
21
21
|
`assetS3Url` | string
|
|
22
22
|
`citedAssetS3Url` | string
|
|
23
23
|
`fastPlaintextUrl` | string
|
|
24
|
+
`transcriptUrl` | string
|
|
24
25
|
`pageScreenshotUrls` | Array<string>
|
|
25
26
|
`systemMetadata` | [DocumentVersionMetadata](DocumentVersionMetadata.md)
|
|
26
27
|
|
|
@@ -45,6 +46,7 @@ const example = {
|
|
|
45
46
|
"assetS3Url": null,
|
|
46
47
|
"citedAssetS3Url": null,
|
|
47
48
|
"fastPlaintextUrl": null,
|
|
49
|
+
"transcriptUrl": null,
|
|
48
50
|
"pageScreenshotUrls": null,
|
|
49
51
|
"systemMetadata": null,
|
|
50
52
|
} satisfies DocumentVersionResponse
|
|
@@ -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)
|
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'],
|
|
@@ -80,6 +80,12 @@ export interface DocumentVersionMetadata {
|
|
|
80
80
|
* @memberof DocumentVersionMetadata
|
|
81
81
|
*/
|
|
82
82
|
fastPlaintextS3?: string | null;
|
|
83
|
+
/**
|
|
84
|
+
* S3 URI of the ASR transcript JSON (per-segment start_ms/end_ms/text); null for non-media. Chunks carry timings too, but at merged-chunk granularity, so this is the only per-segment source.
|
|
85
|
+
* @type {string}
|
|
86
|
+
* @memberof DocumentVersionMetadata
|
|
87
|
+
*/
|
|
88
|
+
transcriptS3?: string | null;
|
|
83
89
|
/**
|
|
84
90
|
* Base64-encoded SHA256 hash of the uploaded source file
|
|
85
91
|
* @type {string}
|
|
@@ -176,6 +182,12 @@ export interface DocumentVersionMetadata {
|
|
|
176
182
|
* @memberof DocumentVersionMetadata
|
|
177
183
|
*/
|
|
178
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;
|
|
179
191
|
/**
|
|
180
192
|
* Stable consume key (matches workflow_id); 'UNSET' for pre-Phase-2 docs so refund logic short-circuits
|
|
181
193
|
* @type {string}
|
|
@@ -235,6 +247,7 @@ export function DocumentVersionMetadataFromJSONTyped(json: any, ignoreDiscrimina
|
|
|
235
247
|
'preconversionSourceS3': json['preconversion_source_s3'] == null ? undefined : json['preconversion_source_s3'],
|
|
236
248
|
'citedSourceS3': json['cited_source_s3'] == null ? undefined : json['cited_source_s3'],
|
|
237
249
|
'fastPlaintextS3': json['fast_plaintext_s3'] == null ? undefined : json['fast_plaintext_s3'],
|
|
250
|
+
'transcriptS3': json['transcript_s3'] == null ? undefined : json['transcript_s3'],
|
|
238
251
|
'hash': json['hash'] == null ? undefined : json['hash'],
|
|
239
252
|
'pipelineState': json['pipeline_state'] == null ? undefined : PipelineStateFromJSON(json['pipeline_state']),
|
|
240
253
|
'totalPages': json['total_pages'] == null ? undefined : json['total_pages'],
|
|
@@ -251,6 +264,7 @@ export function DocumentVersionMetadataFromJSONTyped(json: any, ignoreDiscrimina
|
|
|
251
264
|
'informationStatistics': json['information_statistics'] == null ? undefined : InformationStatisticsFromJSON(json['information_statistics']),
|
|
252
265
|
'quotaCharged': json['quota_charged'] == null ? undefined : json['quota_charged'],
|
|
253
266
|
'quotaPageCount': json['quota_page_count'] == null ? undefined : json['quota_page_count'],
|
|
267
|
+
'quotaMediaMinutes': json['quota_media_minutes'] == null ? undefined : json['quota_media_minutes'],
|
|
254
268
|
'quotaIdempotencyKey': json['quota_idempotency_key'] == null ? undefined : json['quota_idempotency_key'],
|
|
255
269
|
'fileMd5': json['file_md5'] == null ? undefined : json['file_md5'],
|
|
256
270
|
'idempotencyKey': json['idempotency_key'] == null ? undefined : json['idempotency_key'],
|
|
@@ -273,6 +287,7 @@ export function DocumentVersionMetadataToJSONTyped(value?: DocumentVersionMetada
|
|
|
273
287
|
'preconversion_source_s3': value['preconversionSourceS3'],
|
|
274
288
|
'cited_source_s3': value['citedSourceS3'],
|
|
275
289
|
'fast_plaintext_s3': value['fastPlaintextS3'],
|
|
290
|
+
'transcript_s3': value['transcriptS3'],
|
|
276
291
|
'hash': value['hash'],
|
|
277
292
|
'pipeline_state': PipelineStateToJSON(value['pipelineState']),
|
|
278
293
|
'total_pages': value['totalPages'],
|
|
@@ -289,6 +304,7 @@ export function DocumentVersionMetadataToJSONTyped(value?: DocumentVersionMetada
|
|
|
289
304
|
'information_statistics': InformationStatisticsToJSON(value['informationStatistics']),
|
|
290
305
|
'quota_charged': value['quotaCharged'],
|
|
291
306
|
'quota_page_count': value['quotaPageCount'],
|
|
307
|
+
'quota_media_minutes': value['quotaMediaMinutes'],
|
|
292
308
|
'quota_idempotency_key': value['quotaIdempotencyKey'],
|
|
293
309
|
'file_md5': value['fileMd5'],
|
|
294
310
|
'idempotency_key': value['idempotencyKey'],
|