@knowledge-stack/ksapi 2.5.0 → 2.7.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 (73) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/README.md +4 -2
  3. package/dist/apis/DocumentsApi.d.ts +9 -0
  4. package/dist/apis/DocumentsApi.js +9 -0
  5. package/dist/apis/SystemJobsApi.d.ts +4 -4
  6. package/dist/apis/SystemJobsApi.js +2 -2
  7. package/dist/esm/apis/DocumentsApi.d.ts +9 -0
  8. package/dist/esm/apis/DocumentsApi.js +9 -0
  9. package/dist/esm/apis/SystemJobsApi.d.ts +4 -4
  10. package/dist/esm/apis/SystemJobsApi.js +2 -2
  11. package/dist/esm/models/ChunkMetadata.d.ts +12 -0
  12. package/dist/esm/models/ChunkMetadata.js +4 -0
  13. package/dist/esm/models/CreateUploadRequest.d.ts +18 -0
  14. package/dist/esm/models/CreateUploadRequest.js +6 -0
  15. package/dist/esm/models/DocumentVersionMetadata.d.ts +7 -0
  16. package/dist/esm/models/DocumentVersionMetadata.js +3 -0
  17. package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +7 -0
  18. package/dist/esm/models/DocumentVersionMetadataUpdate.js +3 -0
  19. package/dist/esm/models/EmailMetadata.d.ts +119 -0
  20. package/dist/esm/models/EmailMetadata.js +65 -0
  21. package/dist/esm/models/EmailParty.d.ts +53 -0
  22. package/dist/esm/models/EmailParty.js +46 -0
  23. package/dist/esm/models/ImageTaxonomy.d.ts +1 -0
  24. package/dist/esm/models/ImageTaxonomy.js +1 -0
  25. package/dist/esm/models/IngestDocumentResponse.d.ts +18 -0
  26. package/dist/esm/models/IngestDocumentResponse.js +6 -0
  27. package/dist/esm/models/SegmentSpan.d.ts +9 -2
  28. package/dist/esm/models/SegmentSpan.js +2 -0
  29. package/dist/esm/models/index.d.ts +2 -0
  30. package/dist/esm/models/index.js +2 -0
  31. package/dist/models/ChunkMetadata.d.ts +12 -0
  32. package/dist/models/ChunkMetadata.js +4 -0
  33. package/dist/models/CreateUploadRequest.d.ts +18 -0
  34. package/dist/models/CreateUploadRequest.js +6 -0
  35. package/dist/models/DocumentVersionMetadata.d.ts +7 -0
  36. package/dist/models/DocumentVersionMetadata.js +3 -0
  37. package/dist/models/DocumentVersionMetadataUpdate.d.ts +7 -0
  38. package/dist/models/DocumentVersionMetadataUpdate.js +3 -0
  39. package/dist/models/EmailMetadata.d.ts +119 -0
  40. package/dist/models/EmailMetadata.js +73 -0
  41. package/dist/models/EmailParty.d.ts +53 -0
  42. package/dist/models/EmailParty.js +54 -0
  43. package/dist/models/ImageTaxonomy.d.ts +1 -0
  44. package/dist/models/ImageTaxonomy.js +1 -0
  45. package/dist/models/IngestDocumentResponse.d.ts +18 -0
  46. package/dist/models/IngestDocumentResponse.js +6 -0
  47. package/dist/models/SegmentSpan.d.ts +9 -2
  48. package/dist/models/SegmentSpan.js +2 -0
  49. package/dist/models/index.d.ts +2 -0
  50. package/dist/models/index.js +2 -0
  51. package/docs/ChunkMetadata.md +4 -0
  52. package/docs/CreateUploadRequest.md +6 -0
  53. package/docs/DocumentVersionMetadata.md +2 -0
  54. package/docs/DocumentVersionMetadataUpdate.md +2 -0
  55. package/docs/DocumentsApi.md +13 -4
  56. package/docs/EmailMetadata.md +57 -0
  57. package/docs/EmailParty.md +37 -0
  58. package/docs/IngestDocumentResponse.md +6 -0
  59. package/docs/SegmentSpan.md +3 -1
  60. package/docs/SystemJobsApi.md +1 -1
  61. package/package.json +1 -1
  62. package/src/apis/DocumentsApi.ts +21 -0
  63. package/src/apis/SystemJobsApi.ts +4 -4
  64. package/src/models/ChunkMetadata.ts +16 -0
  65. package/src/models/CreateUploadRequest.ts +24 -0
  66. package/src/models/DocumentVersionMetadata.ts +15 -0
  67. package/src/models/DocumentVersionMetadataUpdate.ts +15 -0
  68. package/src/models/EmailMetadata.ts +183 -0
  69. package/src/models/EmailParty.ts +91 -0
  70. package/src/models/ImageTaxonomy.ts +1 -0
  71. package/src/models/IngestDocumentResponse.ts +24 -0
  72. package/src/models/SegmentSpan.ts +11 -2
  73. package/src/models/index.ts +2 -0
@@ -0,0 +1,73 @@
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.EmailMetadataPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfEmailMetadata = instanceOfEmailMetadata;
18
+ exports.EmailMetadataFromJSON = EmailMetadataFromJSON;
19
+ exports.EmailMetadataFromJSONTyped = EmailMetadataFromJSONTyped;
20
+ exports.EmailMetadataToJSON = EmailMetadataToJSON;
21
+ exports.EmailMetadataToJSONTyped = EmailMetadataToJSONTyped;
22
+ const EmailParty_1 = require("./EmailParty");
23
+ exports.EmailMetadataPropertyValidationAttributesMap = {};
24
+ /**
25
+ * Check if a given object implements the EmailMetadata interface.
26
+ */
27
+ function instanceOfEmailMetadata(value) {
28
+ return true;
29
+ }
30
+ function EmailMetadataFromJSON(json) {
31
+ return EmailMetadataFromJSONTyped(json, false);
32
+ }
33
+ function EmailMetadataFromJSONTyped(json, ignoreDiscriminator) {
34
+ if (json == null) {
35
+ return json;
36
+ }
37
+ return {
38
+ 'subject': json['subject'] == null ? undefined : json['subject'],
39
+ 'sender': json['sender'] == null ? undefined : (0, EmailParty_1.EmailPartyFromJSON)(json['sender']),
40
+ 'to': json['to'] == null ? undefined : (json['to'].map(EmailParty_1.EmailPartyFromJSON)),
41
+ 'cc': json['cc'] == null ? undefined : (json['cc'].map(EmailParty_1.EmailPartyFromJSON)),
42
+ 'bcc': json['bcc'] == null ? undefined : (json['bcc'].map(EmailParty_1.EmailPartyFromJSON)),
43
+ 'sentAt': json['sent_at'] == null ? undefined : json['sent_at'],
44
+ 'messageId': json['message_id'] == null ? undefined : json['message_id'],
45
+ 'inReplyTo': json['in_reply_to'] == null ? undefined : json['in_reply_to'],
46
+ 'references': json['references'] == null ? undefined : json['references'],
47
+ 'conversationTopic': json['conversation_topic'] == null ? undefined : json['conversation_topic'],
48
+ 'threadRootId': json['thread_root_id'] == null ? undefined : json['thread_root_id'],
49
+ 'rawHeaders': json['raw_headers'] == null ? undefined : json['raw_headers'],
50
+ };
51
+ }
52
+ function EmailMetadataToJSON(json) {
53
+ return EmailMetadataToJSONTyped(json, false);
54
+ }
55
+ function EmailMetadataToJSONTyped(value, ignoreDiscriminator = false) {
56
+ if (value == null) {
57
+ return value;
58
+ }
59
+ return {
60
+ 'subject': value['subject'],
61
+ 'sender': (0, EmailParty_1.EmailPartyToJSON)(value['sender']),
62
+ 'to': value['to'] == null ? undefined : (value['to'].map(EmailParty_1.EmailPartyToJSON)),
63
+ 'cc': value['cc'] == null ? undefined : (value['cc'].map(EmailParty_1.EmailPartyToJSON)),
64
+ 'bcc': value['bcc'] == null ? undefined : (value['bcc'].map(EmailParty_1.EmailPartyToJSON)),
65
+ 'sent_at': value['sentAt'],
66
+ 'message_id': value['messageId'],
67
+ 'in_reply_to': value['inReplyTo'],
68
+ 'references': value['references'],
69
+ 'conversation_topic': value['conversationTopic'],
70
+ 'thread_root_id': value['threadRootId'],
71
+ 'raw_headers': value['rawHeaders'],
72
+ };
73
+ }
@@ -0,0 +1,53 @@
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 email participant.
14
+ * @export
15
+ * @interface EmailParty
16
+ */
17
+ export interface EmailParty {
18
+ /**
19
+ * Display name; empty if unnamed
20
+ * @type {string}
21
+ * @memberof EmailParty
22
+ */
23
+ name?: string;
24
+ /**
25
+ * Email address
26
+ * @type {string}
27
+ * @memberof EmailParty
28
+ */
29
+ address: string;
30
+ }
31
+ export declare const EmailPartyPropertyValidationAttributesMap: {
32
+ [property: string]: {
33
+ maxLength?: number;
34
+ minLength?: number;
35
+ pattern?: string;
36
+ maximum?: number;
37
+ exclusiveMaximum?: boolean;
38
+ minimum?: number;
39
+ exclusiveMinimum?: boolean;
40
+ multipleOf?: number;
41
+ maxItems?: number;
42
+ minItems?: number;
43
+ uniqueItems?: boolean;
44
+ };
45
+ };
46
+ /**
47
+ * Check if a given object implements the EmailParty interface.
48
+ */
49
+ export declare function instanceOfEmailParty(value: object): value is EmailParty;
50
+ export declare function EmailPartyFromJSON(json: any): EmailParty;
51
+ export declare function EmailPartyFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmailParty;
52
+ export declare function EmailPartyToJSON(json: any): EmailParty;
53
+ export declare function EmailPartyToJSONTyped(value?: EmailParty | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,54 @@
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.EmailPartyPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfEmailParty = instanceOfEmailParty;
18
+ exports.EmailPartyFromJSON = EmailPartyFromJSON;
19
+ exports.EmailPartyFromJSONTyped = EmailPartyFromJSONTyped;
20
+ exports.EmailPartyToJSON = EmailPartyToJSON;
21
+ exports.EmailPartyToJSONTyped = EmailPartyToJSONTyped;
22
+ exports.EmailPartyPropertyValidationAttributesMap = {};
23
+ /**
24
+ * Check if a given object implements the EmailParty interface.
25
+ */
26
+ function instanceOfEmailParty(value) {
27
+ if (!('address' in value) || value['address'] === undefined)
28
+ return false;
29
+ return true;
30
+ }
31
+ function EmailPartyFromJSON(json) {
32
+ return EmailPartyFromJSONTyped(json, false);
33
+ }
34
+ function EmailPartyFromJSONTyped(json, ignoreDiscriminator) {
35
+ if (json == null) {
36
+ return json;
37
+ }
38
+ return {
39
+ 'name': json['name'] == null ? undefined : json['name'],
40
+ 'address': json['address'],
41
+ };
42
+ }
43
+ function EmailPartyToJSON(json) {
44
+ return EmailPartyToJSONTyped(json, false);
45
+ }
46
+ function EmailPartyToJSONTyped(value, ignoreDiscriminator = false) {
47
+ if (value == null) {
48
+ return value;
49
+ }
50
+ return {
51
+ 'name': value['name'],
52
+ 'address': value['address'],
53
+ };
54
+ }
@@ -15,6 +15,7 @@
15
15
  */
16
16
  export declare const ImageTaxonomy: {
17
17
  readonly Picture: 'picture';
18
+ readonly Slide: 'slide';
18
19
  readonly Flowchart: 'flowchart';
19
20
  };
20
21
  export type ImageTaxonomy = typeof ImageTaxonomy[keyof typeof ImageTaxonomy];
@@ -25,6 +25,7 @@ exports.ImageTaxonomyToJSONTyped = ImageTaxonomyToJSONTyped;
25
25
  */
26
26
  exports.ImageTaxonomy = {
27
27
  Picture: 'picture',
28
+ Slide: 'slide',
28
29
  Flowchart: 'flowchart'
29
30
  };
30
31
  function instanceOfImageTaxonomy(value) {
@@ -33,6 +33,24 @@ export interface IngestDocumentResponse {
33
33
  * @memberof IngestDocumentResponse
34
34
  */
35
35
  documentVersionId: string;
36
+ /**
37
+ * Folder created to hold this upload and its members. Set for email uploads, which always nest inside their own folder; null for every other type, which ingest directly into path_part_id.
38
+ * @type {string}
39
+ * @memberof IngestDocumentResponse
40
+ */
41
+ folderId?: string | null;
42
+ /**
43
+ * Members found on an email upload, each becoming its own document beside the email: the attachments of a single message, or the messages of an .mbox archive (whose own attachments are then expanded one level deeper). Always 0 for non-email uploads. Null for a .pst, whose members are enumerated only by the worker fan-out — poll attachment_workflow_id for per-member outcomes.
44
+ * @type {number}
45
+ * @memberof IngestDocumentResponse
46
+ */
47
+ attachmentCount?: number | null;
48
+ /**
49
+ * Fan-out workflow ingesting the members. Poll GET /v1/system-jobs/zip-ingestions/{id} for per-member outcomes. Null when the upload had no ingestible members.
50
+ * @type {string}
51
+ * @memberof IngestDocumentResponse
52
+ */
53
+ attachmentWorkflowId?: string | null;
36
54
  }
37
55
  export declare const IngestDocumentResponsePropertyValidationAttributesMap: {
38
56
  [property: string]: {
@@ -43,6 +43,9 @@ function IngestDocumentResponseFromJSONTyped(json, ignoreDiscriminator) {
43
43
  'workflowId': json['workflow_id'],
44
44
  'documentId': json['document_id'],
45
45
  'documentVersionId': json['document_version_id'],
46
+ 'folderId': json['folder_id'] == null ? undefined : json['folder_id'],
47
+ 'attachmentCount': json['attachment_count'] == null ? undefined : json['attachment_count'],
48
+ 'attachmentWorkflowId': json['attachment_workflow_id'] == null ? undefined : json['attachment_workflow_id'],
46
49
  };
47
50
  }
48
51
  function IngestDocumentResponseToJSON(json) {
@@ -56,5 +59,8 @@ function IngestDocumentResponseToJSONTyped(value, ignoreDiscriminator = false) {
56
59
  'workflow_id': value['workflowId'],
57
60
  'document_id': value['documentId'],
58
61
  'document_version_id': value['documentVersionId'],
62
+ 'folder_id': value['folderId'],
63
+ 'attachment_count': value['attachmentCount'],
64
+ 'attachment_workflow_id': value['attachmentWorkflowId'],
59
65
  };
60
66
  }
@@ -12,8 +12,9 @@
12
12
  /**
13
13
  * One ASR segment's span inside a media chunk (media chunks only).
14
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.
15
+ * Field names are deliberately compact — a media document stores hundreds of
16
+ * chunks x tens of spans each in ``chunk_metadata`` JSONB. Measured worst
17
+ * case is a 4-hour Mandarin recording: 175 chunks x ~33 spans, ~190 KB total.
17
18
  * @export
18
19
  * @interface SegmentSpan
19
20
  */
@@ -36,6 +37,12 @@ export interface SegmentSpan {
36
37
  * @memberof SegmentSpan
37
38
  */
38
39
  c: number;
40
+ /**
41
+ * Speaker label for this segment, 0-indexed within the recording. It identifies turns, not people — there is no voiceprint enrollment, so label 0 in one meeting is unrelated to label 0 in another. None when the ASR provider does not diarize.
42
+ * @type {number}
43
+ * @memberof SegmentSpan
44
+ */
45
+ k?: number | null;
39
46
  }
40
47
  export declare const SegmentSpanPropertyValidationAttributesMap: {
41
48
  [property: string]: {
@@ -43,6 +43,7 @@ function SegmentSpanFromJSONTyped(json, ignoreDiscriminator) {
43
43
  's': json['s'],
44
44
  'e': json['e'],
45
45
  'c': json['c'],
46
+ 'k': json['k'] == null ? undefined : json['k'],
46
47
  };
47
48
  }
48
49
  function SegmentSpanToJSON(json) {
@@ -56,5 +57,6 @@ function SegmentSpanToJSONTyped(value, ignoreDiscriminator = false) {
56
57
  's': value['s'],
57
58
  'e': value['e'],
58
59
  'c': value['c'],
60
+ 'k': value['k'],
59
61
  };
60
62
  }
@@ -127,6 +127,8 @@ export * from './DocxParagraphAnchorInput';
127
127
  export * from './DocxParagraphAnchorOutput';
128
128
  export * from './DownloadArtifact';
129
129
  export * from './EditMemoryChunkRequest';
130
+ export * from './EmailMetadata';
131
+ export * from './EmailParty';
130
132
  export * from './EmailSentResponse';
131
133
  export * from './EmailVerificationRequest';
132
134
  export * from './EnrichedCitation';
@@ -145,6 +145,8 @@ __exportStar(require("./DocxParagraphAnchorInput"), exports);
145
145
  __exportStar(require("./DocxParagraphAnchorOutput"), exports);
146
146
  __exportStar(require("./DownloadArtifact"), exports);
147
147
  __exportStar(require("./EditMemoryChunkRequest"), exports);
148
+ __exportStar(require("./EmailMetadata"), exports);
149
+ __exportStar(require("./EmailParty"), exports);
148
150
  __exportStar(require("./EmailSentResponse"), exports);
149
151
  __exportStar(require("./EmailVerificationRequest"), exports);
150
152
  __exportStar(require("./EnrichedCitation"), exports);
@@ -15,6 +15,8 @@ Name | Type
15
15
  `secondaryTaxonomy` | [ImageTaxonomy](ImageTaxonomy.md)
16
16
  `startMs` | number
17
17
  `endMs` | number
18
+ `speakers` | Array&lt;number&gt;
19
+ `languages` | Array&lt;string&gt;
18
20
  `segments` | [Array&lt;SegmentSpan&gt;](SegmentSpan.md)
19
21
  `sheetName` | string
20
22
  `blockType` | string
@@ -41,6 +43,8 @@ const example = {
41
43
  "secondaryTaxonomy": null,
42
44
  "startMs": null,
43
45
  "endMs": null,
46
+ "speakers": null,
47
+ "languages": null,
44
48
  "segments": null,
45
49
  "sheetName": null,
46
50
  "blockType": null,
@@ -12,6 +12,9 @@ Name | Type
12
12
  `filename` | string
13
13
  `sizeBytes` | number
14
14
  `tagIds` | Array&lt;string&gt;
15
+ `workflowRunId` | string
16
+ `workflowDefinitionId` | string
17
+ `idempotencyKey` | string
15
18
 
16
19
  ## Example
17
20
 
@@ -25,6 +28,9 @@ const example = {
25
28
  "filename": null,
26
29
  "sizeBytes": null,
27
30
  "tagIds": null,
31
+ "workflowRunId": null,
32
+ "workflowDefinitionId": null,
33
+ "idempotencyKey": null,
28
34
  } satisfies CreateUploadRequest
29
35
 
30
36
  console.log(example)
@@ -21,6 +21,7 @@ Name | Type
21
21
  `durationMs` | number
22
22
  `language` | string
23
23
  `segmentCount` | number
24
+ `email` | [EmailMetadata](EmailMetadata.md)
24
25
  `totalFormulas` | number
25
26
  `xlsxParseResultS3` | string
26
27
  `xlsxNamedRanges` | Array&lt;{ [key: string]: any; }&gt;
@@ -55,6 +56,7 @@ const example = {
55
56
  "durationMs": null,
56
57
  "language": null,
57
58
  "segmentCount": null,
59
+ "email": null,
58
60
  "totalFormulas": null,
59
61
  "xlsxParseResultS3": null,
60
62
  "xlsxNamedRanges": null,
@@ -24,6 +24,7 @@ Name | Type
24
24
  `durationMs` | number
25
25
  `language` | string
26
26
  `segmentCount` | number
27
+ `email` | [EmailMetadata](EmailMetadata.md)
27
28
  `totalFormulas` | number
28
29
  `xlsxParseResultS3` | string
29
30
  `xlsxNamedRanges` | Array&lt;{ [key: string]: any; }&gt;
@@ -60,6 +61,7 @@ const example = {
60
61
  "durationMs": null,
61
62
  "language": null,
62
63
  "segmentCount": null,
64
+ "email": null,
63
65
  "totalFormulas": null,
64
66
  "xlsxParseResultS3": null,
65
67
  "xlsxNamedRanges": null,
@@ -627,7 +627,7 @@ example().catch(console.error);
627
627
 
628
628
  ## ingestDocument
629
629
 
630
- > IngestDocumentResponse ingestDocument(file, pathPartId, name, tagIds, idempotencyKey, ingestionMode, chunkType, secondaryTaxonomy, pageDpi, workflowRunId, workflowDefinitionId)
630
+ > IngestDocumentResponse ingestDocument(file, pathPartId, name, tagIds, idempotencyKey, emailNestingDepth, ingestionMode, chunkType, secondaryTaxonomy, pageDpi, workflowRunId, workflowDefinitionId)
631
631
 
632
632
  Ingest Document Handler
633
633
 
@@ -663,6 +663,8 @@ async function example() {
663
663
  tagIds: ...,
664
664
  // string | Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409. (optional)
665
665
  idempotencyKey: idempotencyKey_example,
666
+ // number | Internal: set by the email member fan-out when a nested email re-enters this endpoint. Leave at 0 for direct uploads. (optional)
667
+ emailNestingDepth: 56,
666
668
  // IngestionMode (optional)
667
669
  ingestionMode: ...,
668
670
  // ChunkType (optional)
@@ -699,9 +701,10 @@ example().catch(console.error);
699
701
  | **name** | `string` | Document name (defaults to filename) | [Optional] [Defaults to `undefined`] |
700
702
  | **tagIds** | `Array<string>` | Tag IDs applied to the created document. | [Optional] |
701
703
  | **idempotencyKey** | `string` | Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409. | [Optional] [Defaults to `undefined`] |
704
+ | **emailNestingDepth** | `number` | Internal: set by the email member fan-out when a nested email re-enters this endpoint. Leave at 0 for direct uploads. | [Optional] [Defaults to `0`] |
702
705
  | **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk, media] |
703
706
  | **chunkType** | `ChunkType` | | [Optional] [Defaults to `undefined`] [Enum: TEXT, TABLE, IMAGE, HTML, UNKNOWN] |
704
- | **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, flowchart] |
707
+ | **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, slide, flowchart] |
705
708
  | **pageDpi** | `number` | DPI for PDF page screenshots (default 72, min 36, max 216). | [Optional] [Defaults to `72`] |
706
709
  | **workflowRunId** | `string` | Workflow run context for assumed agent uploads. | [Optional] [Defaults to `undefined`] |
707
710
  | **workflowDefinitionId** | `string` | Workflow definition context for assumed agent uploads. | [Optional] [Defaults to `undefined`] |
@@ -797,7 +800,7 @@ example().catch(console.error);
797
800
  | **file** | `Blob` | | [Defaults to `undefined`] |
798
801
  | **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk, media] |
799
802
  | **chunkType** | `ChunkType` | | [Optional] [Defaults to `undefined`] [Enum: TEXT, TABLE, IMAGE, HTML, UNKNOWN] |
800
- | **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, flowchart] |
803
+ | **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, slide, flowchart] |
801
804
  | **pageDpi** | `number` | DPI for PDF page screenshots (default 72, min 36, max 216). | [Optional] [Defaults to `72`] |
802
805
  | **workflowRunId** | `string` | Workflow run context for assumed agent uploads. | [Optional] [Defaults to `undefined`] |
803
806
  | **workflowDefinitionId** | `string` | Workflow definition context for assumed agent uploads. | [Optional] [Defaults to `undefined`] |
@@ -912,7 +915,7 @@ example().catch(console.error);
912
915
 
913
916
  ## listDocuments
914
917
 
915
- > PaginatedResponseDocumentResponse listDocuments(parentPathPartId, sortOrder, sortDir, ownerId, documentType, withTags, limit, offset, createdAfter, createdBefore, updatedAfter, updatedBefore)
918
+ > PaginatedResponseDocumentResponse listDocuments(parentPathPartId, sortOrder, sortDir, ownerId, documentType, durationMinMs, durationMaxMs, withTags, limit, offset, createdAfter, createdBefore, updatedAfter, updatedBefore)
916
919
 
917
920
  List Documents Handler
918
921
 
@@ -948,6 +951,10 @@ async function example() {
948
951
  ownerId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
949
952
  // DocumentType | Filter to documents of this type (optional)
950
953
  documentType: ...,
954
+ // number | Only media whose active version is at least this long (milliseconds). Non-media documents have no duration and are excluded. (optional)
955
+ durationMinMs: 56,
956
+ // number | Only media whose active version is at most this long. (optional)
957
+ durationMaxMs: 56,
951
958
  // boolean | Include tags in the response (default: false) (optional)
952
959
  withTags: true,
953
960
  // number | Number of items per page (optional)
@@ -986,6 +993,8 @@ example().catch(console.error);
986
993
  | **sortDir** | `SortDirection` | Sort direction; overrides the column\&#39;s natural default | [Optional] [Defaults to `undefined`] [Enum: ASC, DESC] |
987
994
  | **ownerId** | `string` | Filter to documents owned by this user | [Optional] [Defaults to `undefined`] |
988
995
  | **documentType** | `DocumentType` | Filter to documents of this type | [Optional] [Defaults to `undefined`] [Enum: PDF, DOCX, PLAINTEXT, IMAGE, XLSX, CSV, PPTX, JSON, YAML, CODE, AUDIO, VIDEO, EMAIL, UNKNOWN] |
996
+ | **durationMinMs** | `number` | Only media whose active version is at least this long (milliseconds). Non-media documents have no duration and are excluded. | [Optional] [Defaults to `undefined`] |
997
+ | **durationMaxMs** | `number` | Only media whose active version is at most this long. | [Optional] [Defaults to `undefined`] |
989
998
  | **withTags** | `boolean` | Include tags in the response (default: false) | [Optional] [Defaults to `false`] |
990
999
  | **limit** | `number` | Number of items per page | [Optional] [Defaults to `20`] |
991
1000
  | **offset** | `number` | Number of items to skip | [Optional] [Defaults to `0`] |
@@ -0,0 +1,57 @@
1
+
2
+ # EmailMetadata
3
+
4
+ Structured headers of an ingested email (EMAIL document type only). Populated by ``document_preparation_activity`` from the same parse that renders the message body, so the stored metadata and the rendered document cannot disagree. Null on a multi-message archive: its messages are ingested as their own documents, and each carries its own block.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `subject` | string
11
+ `sender` | [EmailParty](EmailParty.md)
12
+ `to` | [Array&lt;EmailParty&gt;](EmailParty.md)
13
+ `cc` | [Array&lt;EmailParty&gt;](EmailParty.md)
14
+ `bcc` | [Array&lt;EmailParty&gt;](EmailParty.md)
15
+ `sentAt` | string
16
+ `messageId` | string
17
+ `inReplyTo` | string
18
+ `references` | Array&lt;string&gt;
19
+ `conversationTopic` | string
20
+ `threadRootId` | string
21
+ `rawHeaders` | string
22
+
23
+ ## Example
24
+
25
+ ```typescript
26
+ import type { EmailMetadata } from '@knowledge-stack/ksapi'
27
+
28
+ // TODO: Update the object below with actual values
29
+ const example = {
30
+ "subject": null,
31
+ "sender": null,
32
+ "to": null,
33
+ "cc": null,
34
+ "bcc": null,
35
+ "sentAt": null,
36
+ "messageId": null,
37
+ "inReplyTo": null,
38
+ "references": null,
39
+ "conversationTopic": null,
40
+ "threadRootId": null,
41
+ "rawHeaders": null,
42
+ } satisfies EmailMetadata
43
+
44
+ console.log(example)
45
+
46
+ // Convert the instance to a JSON string
47
+ const exampleJSON: string = JSON.stringify(example)
48
+ console.log(exampleJSON)
49
+
50
+ // Parse the JSON string back to an object
51
+ const exampleParsed = JSON.parse(exampleJSON) as EmailMetadata
52
+ console.log(exampleParsed)
53
+ ```
54
+
55
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
56
+
57
+
@@ -0,0 +1,37 @@
1
+
2
+ # EmailParty
3
+
4
+ One email participant.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `name` | string
11
+ `address` | string
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { EmailParty } from '@knowledge-stack/ksapi'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "name": null,
21
+ "address": null,
22
+ } satisfies EmailParty
23
+
24
+ console.log(example)
25
+
26
+ // Convert the instance to a JSON string
27
+ const exampleJSON: string = JSON.stringify(example)
28
+ console.log(exampleJSON)
29
+
30
+ // Parse the JSON string back to an object
31
+ const exampleParsed = JSON.parse(exampleJSON) as EmailParty
32
+ console.log(exampleParsed)
33
+ ```
34
+
35
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
36
+
37
+
@@ -10,6 +10,9 @@ Name | Type
10
10
  `workflowId` | string
11
11
  `documentId` | string
12
12
  `documentVersionId` | string
13
+ `folderId` | string
14
+ `attachmentCount` | number
15
+ `attachmentWorkflowId` | string
13
16
 
14
17
  ## Example
15
18
 
@@ -21,6 +24,9 @@ const example = {
21
24
  "workflowId": null,
22
25
  "documentId": null,
23
26
  "documentVersionId": null,
27
+ "folderId": null,
28
+ "attachmentCount": null,
29
+ "attachmentWorkflowId": null,
24
30
  } satisfies IngestDocumentResponse
25
31
 
26
32
  console.log(example)
@@ -1,7 +1,7 @@
1
1
 
2
2
  # SegmentSpan
3
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.
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 tens of spans each in ``chunk_metadata`` JSONB. Measured worst case is a 4-hour Mandarin recording: 175 chunks x ~33 spans, ~190 KB total.
5
5
 
6
6
  ## Properties
7
7
 
@@ -10,6 +10,7 @@ Name | Type
10
10
  `s` | number
11
11
  `e` | number
12
12
  `c` | number
13
+ `k` | number
13
14
 
14
15
  ## Example
15
16
 
@@ -21,6 +22,7 @@ const example = {
21
22
  "s": null,
22
23
  "e": null,
23
24
  "c": null,
25
+ "k": null,
24
26
  } satisfies SegmentSpan
25
27
 
26
28
  console.log(example)
@@ -319,7 +319,7 @@ example().catch(console.error);
319
319
 
320
320
  Get Zip Ingestion Status Handler
321
321
 
322
- Get a ZIP fan-out\&#39;s live status + per-member outcomes. Tenant-scoped via the TenantId search attribute (no per-path can_read check — intentionally consistent with the sibling generic Temporal endpoints below; the opaque workflow_id is only handed to the uploader, who had can_write on the target). The per-member results come from the workflow\&#39;s &#x60;&#x60;results&#x60;&#x60; query (served from retained history), so once Temporal retention expires this 404s.
322
+ Get a fan-out\&#39;s live status + per-member outcomes. Serves both container fan-outs: a ZIP archive\&#39;s members and an email\&#39;s attachments. Both expose the same &#x60;&#x60;results&#x60;&#x60; query, so one endpoint covers them rather than duplicating the tenant check and hydration. Tenant-scoped via the TenantId search attribute (no per-path can_read check — intentionally consistent with the sibling generic Temporal endpoints below; the opaque workflow_id is only handed to the uploader, who had can_write on the target). The per-member results come from the workflow\&#39;s &#x60;&#x60;results&#x60;&#x60; query (served from retained history), so once Temporal retention expires this 404s.
323
323
 
324
324
  ### Example
325
325
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "2.5.0",
3
+ "version": "2.7.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {