@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.
Files changed (57) hide show
  1. package/.openapi-generator/FILES +2 -0
  2. package/README.md +3 -2
  3. package/dist/apis/DocumentVersionsApi.d.ts +2 -2
  4. package/dist/apis/DocumentsApi.d.ts +2 -2
  5. package/dist/esm/apis/DocumentVersionsApi.d.ts +2 -2
  6. package/dist/esm/apis/DocumentsApi.d.ts +2 -2
  7. package/dist/esm/models/ChunkMetadata.d.ts +7 -0
  8. package/dist/esm/models/ChunkMetadata.js +3 -0
  9. package/dist/esm/models/DocumentVersionMetadata.d.ts +12 -0
  10. package/dist/esm/models/DocumentVersionMetadata.js +4 -0
  11. package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +12 -0
  12. package/dist/esm/models/DocumentVersionMetadataUpdate.js +4 -0
  13. package/dist/esm/models/DocumentVersionResponse.d.ts +6 -0
  14. package/dist/esm/models/DocumentVersionResponse.js +2 -0
  15. package/dist/esm/models/DownloadArtifact.d.ts +1 -0
  16. package/dist/esm/models/DownloadArtifact.js +2 -1
  17. package/dist/esm/models/SegmentSpan.d.ts +62 -0
  18. package/dist/esm/models/SegmentSpan.js +52 -0
  19. package/dist/esm/models/UploadConstraints.d.ts +12 -0
  20. package/dist/esm/models/UploadConstraints.js +8 -0
  21. package/dist/esm/models/index.d.ts +1 -0
  22. package/dist/esm/models/index.js +1 -0
  23. package/dist/models/ChunkMetadata.d.ts +7 -0
  24. package/dist/models/ChunkMetadata.js +3 -0
  25. package/dist/models/DocumentVersionMetadata.d.ts +12 -0
  26. package/dist/models/DocumentVersionMetadata.js +4 -0
  27. package/dist/models/DocumentVersionMetadataUpdate.d.ts +12 -0
  28. package/dist/models/DocumentVersionMetadataUpdate.js +4 -0
  29. package/dist/models/DocumentVersionResponse.d.ts +6 -0
  30. package/dist/models/DocumentVersionResponse.js +2 -0
  31. package/dist/models/DownloadArtifact.d.ts +1 -0
  32. package/dist/models/DownloadArtifact.js +2 -1
  33. package/dist/models/SegmentSpan.d.ts +62 -0
  34. package/dist/models/SegmentSpan.js +60 -0
  35. package/dist/models/UploadConstraints.d.ts +12 -0
  36. package/dist/models/UploadConstraints.js +8 -0
  37. package/dist/models/index.d.ts +1 -0
  38. package/dist/models/index.js +1 -0
  39. package/docs/ChunkMetadata.md +2 -0
  40. package/docs/DocumentVersionMetadata.md +4 -0
  41. package/docs/DocumentVersionMetadataUpdate.md +4 -0
  42. package/docs/DocumentVersionResponse.md +2 -0
  43. package/docs/DocumentVersionsApi.md +2 -2
  44. package/docs/DocumentsApi.md +2 -2
  45. package/docs/SegmentSpan.md +39 -0
  46. package/docs/UploadConstraints.md +4 -0
  47. package/package.json +1 -1
  48. package/src/apis/DocumentVersionsApi.ts +2 -2
  49. package/src/apis/DocumentsApi.ts +2 -2
  50. package/src/models/ChunkMetadata.ts +15 -0
  51. package/src/models/DocumentVersionMetadata.ts +16 -0
  52. package/src/models/DocumentVersionMetadataUpdate.ts +16 -0
  53. package/src/models/DocumentVersionResponse.ts +8 -0
  54. package/src/models/DownloadArtifact.ts +2 -1
  55. package/src/models/SegmentSpan.ts +104 -0
  56. package/src/models/UploadConstraints.ts +18 -0
  57. package/src/models/index.ts +1 -0
@@ -80,6 +80,12 @@ export interface DocumentVersionMetadataUpdate {
80
80
  * @memberof DocumentVersionMetadataUpdate
81
81
  */
82
82
  fastPlaintextS3?: string | null;
83
+ /**
84
+ *
85
+ * @type {string}
86
+ * @memberof DocumentVersionMetadataUpdate
87
+ */
88
+ transcriptS3?: string | null;
83
89
  /**
84
90
  *
85
91
  * @type {string}
@@ -188,6 +194,12 @@ export interface DocumentVersionMetadataUpdate {
188
194
  * @memberof DocumentVersionMetadataUpdate
189
195
  */
190
196
  quotaPageCount?: number | null;
197
+ /**
198
+ *
199
+ * @type {number}
200
+ * @memberof DocumentVersionMetadataUpdate
201
+ */
202
+ quotaMediaMinutes?: number | null;
191
203
  /**
192
204
  *
193
205
  * @type {string}
@@ -242,6 +254,7 @@ export function DocumentVersionMetadataUpdateFromJSONTyped(json: any, ignoreDisc
242
254
  'citedSourceS3': json['cited_source_s3'] == null ? undefined : json['cited_source_s3'],
243
255
  'standardPipelineJsonS3': json['standard_pipeline_json_s3'] == null ? undefined : json['standard_pipeline_json_s3'],
244
256
  'fastPlaintextS3': json['fast_plaintext_s3'] == null ? undefined : json['fast_plaintext_s3'],
257
+ 'transcriptS3': json['transcript_s3'] == null ? undefined : json['transcript_s3'],
245
258
  'highAccuracyContentListS3': json['high_accuracy_content_list_s3'] == null ? undefined : json['high_accuracy_content_list_s3'],
246
259
  'highAccuracyMiddleS3': json['high_accuracy_middle_s3'] == null ? undefined : json['high_accuracy_middle_s3'],
247
260
  'hash': json['hash'] == null ? undefined : json['hash'],
@@ -260,6 +273,7 @@ export function DocumentVersionMetadataUpdateFromJSONTyped(json: any, ignoreDisc
260
273
  'informationStatistics': json['information_statistics'] == null ? undefined : InformationStatisticsFromJSON(json['information_statistics']),
261
274
  'quotaCharged': json['quota_charged'] == null ? undefined : json['quota_charged'],
262
275
  'quotaPageCount': json['quota_page_count'] == null ? undefined : json['quota_page_count'],
276
+ 'quotaMediaMinutes': json['quota_media_minutes'] == null ? undefined : json['quota_media_minutes'],
263
277
  'quotaIdempotencyKey': json['quota_idempotency_key'] == null ? undefined : json['quota_idempotency_key'],
264
278
  'fileMd5': json['file_md5'] == null ? undefined : json['file_md5'],
265
279
  };
@@ -282,6 +296,7 @@ export function DocumentVersionMetadataUpdateToJSONTyped(value?: DocumentVersion
282
296
  'cited_source_s3': value['citedSourceS3'],
283
297
  'standard_pipeline_json_s3': value['standardPipelineJsonS3'],
284
298
  'fast_plaintext_s3': value['fastPlaintextS3'],
299
+ 'transcript_s3': value['transcriptS3'],
285
300
  'high_accuracy_content_list_s3': value['highAccuracyContentListS3'],
286
301
  'high_accuracy_middle_s3': value['highAccuracyMiddleS3'],
287
302
  'hash': value['hash'],
@@ -300,6 +315,7 @@ export function DocumentVersionMetadataUpdateToJSONTyped(value?: DocumentVersion
300
315
  'information_statistics': InformationStatisticsToJSON(value['informationStatistics']),
301
316
  'quota_charged': value['quotaCharged'],
302
317
  'quota_page_count': value['quotaPageCount'],
318
+ 'quota_media_minutes': value['quotaMediaMinutes'],
303
319
  'quota_idempotency_key': value['quotaIdempotencyKey'],
304
320
  'file_md5': value['fileMd5'],
305
321
  };
@@ -121,6 +121,12 @@ export interface DocumentVersionResponse {
121
121
  * @memberof DocumentVersionResponse
122
122
  */
123
123
  fastPlaintextUrl?: string | null;
124
+ /**
125
+ * 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.
126
+ * @type {string}
127
+ * @memberof DocumentVersionResponse
128
+ */
129
+ transcriptUrl?: string | null;
124
130
  /**
125
131
  * 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.
126
132
  * @type {Array<string>}
@@ -194,6 +200,7 @@ export function DocumentVersionResponseFromJSONTyped(json: any, ignoreDiscrimina
194
200
  'assetS3Url': json['asset_s3_url'] == null ? undefined : json['asset_s3_url'],
195
201
  'citedAssetS3Url': json['cited_asset_s3_url'] == null ? undefined : json['cited_asset_s3_url'],
196
202
  'fastPlaintextUrl': json['fast_plaintext_url'] == null ? undefined : json['fast_plaintext_url'],
203
+ 'transcriptUrl': json['transcript_url'] == null ? undefined : json['transcript_url'],
197
204
  'pageScreenshotUrls': json['page_screenshot_urls'] == null ? undefined : json['page_screenshot_urls'],
198
205
  'systemMetadata': json['system_metadata'] == null ? undefined : DocumentVersionMetadataFromJSON(json['system_metadata']),
199
206
  };
@@ -224,6 +231,7 @@ export function DocumentVersionResponseToJSONTyped(value?: DocumentVersionRespon
224
231
  'asset_s3_url': value['assetS3Url'],
225
232
  'cited_asset_s3_url': value['citedAssetS3Url'],
226
233
  'fast_plaintext_url': value['fastPlaintextUrl'],
234
+ 'transcript_url': value['transcriptUrl'],
227
235
  'page_screenshot_urls': value['pageScreenshotUrls'],
228
236
  'system_metadata': DocumentVersionMetadataToJSON(value['systemMetadata']),
229
237
  };
@@ -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
+
@@ -45,6 +45,18 @@ export interface UploadConstraints {
45
45
  * @memberof UploadConstraints
46
46
  */
47
47
  maxImageBytes: number;
48
+ /**
49
+ *
50
+ * @type {number}
51
+ * @memberof UploadConstraints
52
+ */
53
+ maxMediaBytes: number;
54
+ /**
55
+ *
56
+ * @type {number}
57
+ * @memberof UploadConstraints
58
+ */
59
+ maxVideoBytes: number;
48
60
  }
49
61
  export const UploadConstraintsPropertyValidationAttributesMap: {
50
62
  [property: string]: {
@@ -71,6 +83,8 @@ export function instanceOfUploadConstraints(value: object): value is UploadConst
71
83
  if (!('formats' in value) || value['formats'] === undefined) return false;
72
84
  if (!('maxBytes' in value) || value['maxBytes'] === undefined) return false;
73
85
  if (!('maxImageBytes' in value) || value['maxImageBytes'] === undefined) return false;
86
+ if (!('maxMediaBytes' in value) || value['maxMediaBytes'] === undefined) return false;
87
+ if (!('maxVideoBytes' in value) || value['maxVideoBytes'] === undefined) return false;
74
88
  return true;
75
89
  }
76
90
 
@@ -87,6 +101,8 @@ export function UploadConstraintsFromJSONTyped(json: any, ignoreDiscriminator: b
87
101
  'formats': ((json['formats'] as Array<any>).map(UploadFormatFromJSON)),
88
102
  'maxBytes': json['max_bytes'],
89
103
  'maxImageBytes': json['max_image_bytes'],
104
+ 'maxMediaBytes': json['max_media_bytes'],
105
+ 'maxVideoBytes': json['max_video_bytes'],
90
106
  };
91
107
  }
92
108
 
@@ -104,6 +120,8 @@ export function UploadConstraintsToJSONTyped(value?: UploadConstraints | null, i
104
120
  'formats': ((value['formats'] as Array<any>).map(UploadFormatToJSON)),
105
121
  'max_bytes': value['maxBytes'],
106
122
  'max_image_bytes': value['maxImageBytes'],
123
+ 'max_media_bytes': value['maxMediaBytes'],
124
+ 'max_video_bytes': value['maxVideoBytes'],
107
125
  };
108
126
  }
109
127
 
@@ -267,6 +267,7 @@ export * from './SectionContentItem';
267
267
  export * from './SectionContentItemOrChunkContentItem';
268
268
  export * from './SectionResponse';
269
269
  export * from './SectionSystemMetadata';
270
+ export * from './SegmentSpan';
270
271
  export * from './SendPasswordResetRequest';
271
272
  export * from './SetApprovalStateRequest';
272
273
  export * from './SetWorkflowRunApprovalRequest';