@knowledge-stack/ksapi 2.4.3 → 2.6.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 (108) hide show
  1. package/.openapi-generator/FILES +10 -0
  2. package/README.md +7 -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/apis/TenantInvitationsApi.d.ts +67 -0
  8. package/dist/apis/TenantInvitationsApi.js +112 -0
  9. package/dist/apis/TenantsApi.d.ts +4 -4
  10. package/dist/apis/TenantsApi.js +2 -2
  11. package/dist/apis/index.d.ts +1 -0
  12. package/dist/apis/index.js +1 -0
  13. package/dist/esm/apis/DocumentsApi.d.ts +9 -0
  14. package/dist/esm/apis/DocumentsApi.js +9 -0
  15. package/dist/esm/apis/SystemJobsApi.d.ts +4 -4
  16. package/dist/esm/apis/SystemJobsApi.js +2 -2
  17. package/dist/esm/apis/TenantInvitationsApi.d.ts +67 -0
  18. package/dist/esm/apis/TenantInvitationsApi.js +75 -0
  19. package/dist/esm/apis/TenantsApi.d.ts +4 -4
  20. package/dist/esm/apis/TenantsApi.js +2 -2
  21. package/dist/esm/apis/index.d.ts +1 -0
  22. package/dist/esm/apis/index.js +1 -0
  23. package/dist/esm/models/AcceptTenantInvitationRequest.d.ts +53 -0
  24. package/dist/esm/models/AcceptTenantInvitationRequest.js +48 -0
  25. package/dist/esm/models/AcceptTenantInvitationResponse.d.ts +59 -0
  26. package/dist/esm/models/AcceptTenantInvitationResponse.js +52 -0
  27. package/dist/esm/models/ChunkMetadata.d.ts +12 -0
  28. package/dist/esm/models/ChunkMetadata.js +4 -0
  29. package/dist/esm/models/CreateUploadRequest.d.ts +18 -0
  30. package/dist/esm/models/CreateUploadRequest.js +6 -0
  31. package/dist/esm/models/DocumentVersionMetadata.d.ts +7 -0
  32. package/dist/esm/models/DocumentVersionMetadata.js +3 -0
  33. package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +7 -0
  34. package/dist/esm/models/DocumentVersionMetadataUpdate.js +3 -0
  35. package/dist/esm/models/EmailMetadata.d.ts +119 -0
  36. package/dist/esm/models/EmailMetadata.js +65 -0
  37. package/dist/esm/models/EmailParty.d.ts +53 -0
  38. package/dist/esm/models/EmailParty.js +46 -0
  39. package/dist/esm/models/EventResponse.d.ts +6 -0
  40. package/dist/esm/models/EventResponse.js +2 -0
  41. package/dist/esm/models/ImageTaxonomy.d.ts +1 -0
  42. package/dist/esm/models/ImageTaxonomy.js +1 -0
  43. package/dist/esm/models/IngestDocumentResponse.d.ts +18 -0
  44. package/dist/esm/models/IngestDocumentResponse.js +6 -0
  45. package/dist/esm/models/SegmentSpan.d.ts +9 -2
  46. package/dist/esm/models/SegmentSpan.js +2 -0
  47. package/dist/esm/models/index.d.ts +4 -0
  48. package/dist/esm/models/index.js +4 -0
  49. package/dist/models/AcceptTenantInvitationRequest.d.ts +53 -0
  50. package/dist/models/AcceptTenantInvitationRequest.js +56 -0
  51. package/dist/models/AcceptTenantInvitationResponse.d.ts +59 -0
  52. package/dist/models/AcceptTenantInvitationResponse.js +60 -0
  53. package/dist/models/ChunkMetadata.d.ts +12 -0
  54. package/dist/models/ChunkMetadata.js +4 -0
  55. package/dist/models/CreateUploadRequest.d.ts +18 -0
  56. package/dist/models/CreateUploadRequest.js +6 -0
  57. package/dist/models/DocumentVersionMetadata.d.ts +7 -0
  58. package/dist/models/DocumentVersionMetadata.js +3 -0
  59. package/dist/models/DocumentVersionMetadataUpdate.d.ts +7 -0
  60. package/dist/models/DocumentVersionMetadataUpdate.js +3 -0
  61. package/dist/models/EmailMetadata.d.ts +119 -0
  62. package/dist/models/EmailMetadata.js +73 -0
  63. package/dist/models/EmailParty.d.ts +53 -0
  64. package/dist/models/EmailParty.js +54 -0
  65. package/dist/models/EventResponse.d.ts +6 -0
  66. package/dist/models/EventResponse.js +2 -0
  67. package/dist/models/ImageTaxonomy.d.ts +1 -0
  68. package/dist/models/ImageTaxonomy.js +1 -0
  69. package/dist/models/IngestDocumentResponse.d.ts +18 -0
  70. package/dist/models/IngestDocumentResponse.js +6 -0
  71. package/dist/models/SegmentSpan.d.ts +9 -2
  72. package/dist/models/SegmentSpan.js +2 -0
  73. package/dist/models/index.d.ts +4 -0
  74. package/dist/models/index.js +4 -0
  75. package/docs/AcceptTenantInvitationRequest.md +36 -0
  76. package/docs/AcceptTenantInvitationResponse.md +38 -0
  77. package/docs/ChunkMetadata.md +4 -0
  78. package/docs/CreateUploadRequest.md +6 -0
  79. package/docs/DocumentVersionMetadata.md +2 -0
  80. package/docs/DocumentVersionMetadataUpdate.md +2 -0
  81. package/docs/DocumentsApi.md +13 -4
  82. package/docs/EmailMetadata.md +57 -0
  83. package/docs/EmailParty.md +37 -0
  84. package/docs/EventResponse.md +2 -0
  85. package/docs/IngestDocumentResponse.md +6 -0
  86. package/docs/SegmentSpan.md +3 -1
  87. package/docs/SystemJobsApi.md +1 -1
  88. package/docs/TenantInvitationsApi.md +85 -0
  89. package/docs/TenantsApi.md +1 -1
  90. package/package.json +1 -1
  91. package/src/apis/DocumentsApi.ts +21 -0
  92. package/src/apis/SystemJobsApi.ts +4 -4
  93. package/src/apis/TenantInvitationsApi.ts +136 -0
  94. package/src/apis/TenantsApi.ts +4 -4
  95. package/src/apis/index.ts +1 -0
  96. package/src/models/AcceptTenantInvitationRequest.ts +93 -0
  97. package/src/models/AcceptTenantInvitationResponse.ts +101 -0
  98. package/src/models/ChunkMetadata.ts +16 -0
  99. package/src/models/CreateUploadRequest.ts +24 -0
  100. package/src/models/DocumentVersionMetadata.ts +15 -0
  101. package/src/models/DocumentVersionMetadataUpdate.ts +15 -0
  102. package/src/models/EmailMetadata.ts +183 -0
  103. package/src/models/EmailParty.ts +91 -0
  104. package/src/models/EventResponse.ts +8 -0
  105. package/src/models/ImageTaxonomy.ts +1 -0
  106. package/src/models/IngestDocumentResponse.ts +24 -0
  107. package/src/models/SegmentSpan.ts +11 -2
  108. package/src/models/index.ts +4 -0
@@ -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.AcceptTenantInvitationResponsePropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfAcceptTenantInvitationResponse = instanceOfAcceptTenantInvitationResponse;
18
+ exports.AcceptTenantInvitationResponseFromJSON = AcceptTenantInvitationResponseFromJSON;
19
+ exports.AcceptTenantInvitationResponseFromJSONTyped = AcceptTenantInvitationResponseFromJSONTyped;
20
+ exports.AcceptTenantInvitationResponseToJSON = AcceptTenantInvitationResponseToJSON;
21
+ exports.AcceptTenantInvitationResponseToJSONTyped = AcceptTenantInvitationResponseToJSONTyped;
22
+ exports.AcceptTenantInvitationResponsePropertyValidationAttributesMap = {};
23
+ /**
24
+ * Check if a given object implements the AcceptTenantInvitationResponse interface.
25
+ */
26
+ function instanceOfAcceptTenantInvitationResponse(value) {
27
+ if (!('tenantId' in value) || value['tenantId'] === undefined)
28
+ return false;
29
+ if (!('tenantName' in value) || value['tenantName'] === undefined)
30
+ return false;
31
+ if (!('userId' in value) || value['userId'] === undefined)
32
+ return false;
33
+ return true;
34
+ }
35
+ function AcceptTenantInvitationResponseFromJSON(json) {
36
+ return AcceptTenantInvitationResponseFromJSONTyped(json, false);
37
+ }
38
+ function AcceptTenantInvitationResponseFromJSONTyped(json, ignoreDiscriminator) {
39
+ if (json == null) {
40
+ return json;
41
+ }
42
+ return {
43
+ 'tenantId': json['tenant_id'],
44
+ 'tenantName': json['tenant_name'],
45
+ 'userId': json['user_id'],
46
+ };
47
+ }
48
+ function AcceptTenantInvitationResponseToJSON(json) {
49
+ return AcceptTenantInvitationResponseToJSONTyped(json, false);
50
+ }
51
+ function AcceptTenantInvitationResponseToJSONTyped(value, ignoreDiscriminator = false) {
52
+ if (value == null) {
53
+ return value;
54
+ }
55
+ return {
56
+ 'tenant_id': value['tenantId'],
57
+ 'tenant_name': value['tenantName'],
58
+ 'user_id': value['userId'],
59
+ };
60
+ }
@@ -66,6 +66,18 @@ export interface ChunkMetadata {
66
66
  * @memberof ChunkMetadata
67
67
  */
68
68
  endMs?: number | null;
69
+ /**
70
+ * Every speaker label appearing in this chunk's segments, sorted. Lets a citation say which turn it came from. None when the provider does not diarize.
71
+ * @type {Array<number>}
72
+ * @memberof ChunkMetadata
73
+ */
74
+ speakers?: Array<number> | null;
75
+ /**
76
+ * Every language the ASR recognised across this chunk's segments, sorted. A meeting routinely code-switches, so a chunk can hold more than one; the document-level language is only the majority label and misreports a bilingual recording. None for non-media chunks and for media ingested before this field existed.
77
+ * @type {Array<string>}
78
+ * @memberof ChunkMetadata
79
+ */
80
+ languages?: Array<string> | null;
69
81
  /**
70
82
  * 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.
71
83
  * @type {Array<SegmentSpan>}
@@ -45,6 +45,8 @@ function ChunkMetadataFromJSONTyped(json, ignoreDiscriminator) {
45
45
  'secondaryTaxonomy': json['secondary_taxonomy'] == null ? undefined : (0, ImageTaxonomy_1.ImageTaxonomyFromJSON)(json['secondary_taxonomy']),
46
46
  'startMs': json['start_ms'] == null ? undefined : json['start_ms'],
47
47
  'endMs': json['end_ms'] == null ? undefined : json['end_ms'],
48
+ 'speakers': json['speakers'] == null ? undefined : json['speakers'],
49
+ 'languages': json['languages'] == null ? undefined : json['languages'],
48
50
  'segments': json['segments'] == null ? undefined : (json['segments'].map(SegmentSpan_1.SegmentSpanFromJSON)),
49
51
  'sheetName': json['sheet_name'] == null ? undefined : json['sheet_name'],
50
52
  'blockType': json['block_type'] == null ? undefined : json['block_type'],
@@ -73,6 +75,8 @@ function ChunkMetadataToJSONTyped(value, ignoreDiscriminator = false) {
73
75
  'secondary_taxonomy': (0, ImageTaxonomy_1.ImageTaxonomyToJSON)(value['secondaryTaxonomy']),
74
76
  'start_ms': value['startMs'],
75
77
  'end_ms': value['endMs'],
78
+ 'speakers': value['speakers'],
79
+ 'languages': value['languages'],
76
80
  'segments': value['segments'] == null ? undefined : (value['segments'].map(SegmentSpan_1.SegmentSpanToJSON)),
77
81
  'sheet_name': value['sheetName'],
78
82
  'block_type': value['blockType'],
@@ -45,6 +45,24 @@ export interface CreateUploadRequest {
45
45
  * @memberof CreateUploadRequest
46
46
  */
47
47
  tagIds?: Array<string>;
48
+ /**
49
+ * Workflow run this upload belongs to; attributes the resulting document to the run in the audit log. Must be sent together with workflow_definition_id, and only by an assumed identity.
50
+ * @type {string}
51
+ * @memberof CreateUploadRequest
52
+ */
53
+ workflowRunId?: string | null;
54
+ /**
55
+ * Workflow definition for workflow_run_id.
56
+ * @type {string}
57
+ * @memberof CreateUploadRequest
58
+ */
59
+ workflowDefinitionId?: string | null;
60
+ /**
61
+ * Replay key for callers that retry (e.g. the ZIP fan-out); completing twice with the same key replays the existing document instead of creating a duplicate.
62
+ * @type {string}
63
+ * @memberof CreateUploadRequest
64
+ */
65
+ idempotencyKey?: string | null;
48
66
  }
49
67
  export declare const CreateUploadRequestPropertyValidationAttributesMap: {
50
68
  [property: string]: {
@@ -47,6 +47,9 @@ function CreateUploadRequestFromJSONTyped(json, ignoreDiscriminator) {
47
47
  'filename': json['filename'],
48
48
  'sizeBytes': json['size_bytes'],
49
49
  'tagIds': json['tag_ids'] == null ? undefined : json['tag_ids'],
50
+ 'workflowRunId': json['workflow_run_id'] == null ? undefined : json['workflow_run_id'],
51
+ 'workflowDefinitionId': json['workflow_definition_id'] == null ? undefined : json['workflow_definition_id'],
52
+ 'idempotencyKey': json['idempotency_key'] == null ? undefined : json['idempotency_key'],
50
53
  };
51
54
  }
52
55
  function CreateUploadRequestToJSON(json) {
@@ -62,5 +65,8 @@ function CreateUploadRequestToJSONTyped(value, ignoreDiscriminator = false) {
62
65
  'filename': value['filename'],
63
66
  'size_bytes': value['sizeBytes'],
64
67
  'tag_ids': value['tagIds'],
68
+ 'workflow_run_id': value['workflowRunId'],
69
+ 'workflow_definition_id': value['workflowDefinitionId'],
70
+ 'idempotency_key': value['idempotencyKey'],
65
71
  };
66
72
  }
@@ -12,6 +12,7 @@
12
12
  import type { PipelineState } from './PipelineState';
13
13
  import type { XlsxCellAnchorOutputOrDocxParagraphAnchorOutput } from './XlsxCellAnchorOutputOrDocxParagraphAnchorOutput';
14
14
  import type { InformationStatistics } from './InformationStatistics';
15
+ import type { EmailMetadata } from './EmailMetadata';
15
16
  /**
16
17
  * Schema for document_version.system_metadata JSONB field.
17
18
  *
@@ -111,6 +112,12 @@ export interface DocumentVersionMetadata {
111
112
  * @memberof DocumentVersionMetadata
112
113
  */
113
114
  segmentCount?: number | null;
115
+ /**
116
+ * Structured email headers; null for non-email documents
117
+ * @type {EmailMetadata}
118
+ * @memberof DocumentVersionMetadata
119
+ */
120
+ email?: EmailMetadata | null;
114
121
  /**
115
122
  * Total formula cells in the workbook (XLSX only)
116
123
  * @type {number}
@@ -22,6 +22,7 @@ exports.DocumentVersionMetadataToJSONTyped = DocumentVersionMetadataToJSONTyped;
22
22
  const PipelineState_1 = require("./PipelineState");
23
23
  const XlsxCellAnchorOutputOrDocxParagraphAnchorOutput_1 = require("./XlsxCellAnchorOutputOrDocxParagraphAnchorOutput");
24
24
  const InformationStatistics_1 = require("./InformationStatistics");
25
+ const EmailMetadata_1 = require("./EmailMetadata");
25
26
  exports.DocumentVersionMetadataPropertyValidationAttributesMap = {};
26
27
  /**
27
28
  * Check if a given object implements the DocumentVersionMetadata interface.
@@ -51,6 +52,7 @@ function DocumentVersionMetadataFromJSONTyped(json, ignoreDiscriminator) {
51
52
  'durationMs': json['duration_ms'] == null ? undefined : json['duration_ms'],
52
53
  'language': json['language'] == null ? undefined : json['language'],
53
54
  'segmentCount': json['segment_count'] == null ? undefined : json['segment_count'],
55
+ 'email': json['email'] == null ? undefined : (0, EmailMetadata_1.EmailMetadataFromJSON)(json['email']),
54
56
  'totalFormulas': json['total_formulas'] == null ? undefined : json['total_formulas'],
55
57
  'xlsxParseResultS3': json['xlsx_parse_result_s3'] == null ? undefined : json['xlsx_parse_result_s3'],
56
58
  'xlsxNamedRanges': json['xlsx_named_ranges'] == null ? undefined : json['xlsx_named_ranges'],
@@ -87,6 +89,7 @@ function DocumentVersionMetadataToJSONTyped(value, ignoreDiscriminator = false)
87
89
  'duration_ms': value['durationMs'],
88
90
  'language': value['language'],
89
91
  'segment_count': value['segmentCount'],
92
+ 'email': (0, EmailMetadata_1.EmailMetadataToJSON)(value['email']),
90
93
  'total_formulas': value['totalFormulas'],
91
94
  'xlsx_parse_result_s3': value['xlsxParseResultS3'],
92
95
  'xlsx_named_ranges': value['xlsxNamedRanges'],
@@ -12,6 +12,7 @@
12
12
  import type { PipelineState } from './PipelineState';
13
13
  import type { XlsxCellAnchorInputOrDocxParagraphAnchorInput } from './XlsxCellAnchorInputOrDocxParagraphAnchorInput';
14
14
  import type { InformationStatistics } from './InformationStatistics';
15
+ import type { EmailMetadata } from './EmailMetadata';
15
16
  /**
16
17
  * Partial update schema for document version metadata.
17
18
  *
@@ -123,6 +124,12 @@ export interface DocumentVersionMetadataUpdate {
123
124
  * @memberof DocumentVersionMetadataUpdate
124
125
  */
125
126
  segmentCount?: number | null;
127
+ /**
128
+ *
129
+ * @type {EmailMetadata}
130
+ * @memberof DocumentVersionMetadataUpdate
131
+ */
132
+ email?: EmailMetadata | null;
126
133
  /**
127
134
  *
128
135
  * @type {number}
@@ -22,6 +22,7 @@ exports.DocumentVersionMetadataUpdateToJSONTyped = DocumentVersionMetadataUpdate
22
22
  const PipelineState_1 = require("./PipelineState");
23
23
  const XlsxCellAnchorInputOrDocxParagraphAnchorInput_1 = require("./XlsxCellAnchorInputOrDocxParagraphAnchorInput");
24
24
  const InformationStatistics_1 = require("./InformationStatistics");
25
+ const EmailMetadata_1 = require("./EmailMetadata");
25
26
  exports.DocumentVersionMetadataUpdatePropertyValidationAttributesMap = {};
26
27
  /**
27
28
  * Check if a given object implements the DocumentVersionMetadataUpdate interface.
@@ -54,6 +55,7 @@ function DocumentVersionMetadataUpdateFromJSONTyped(json, ignoreDiscriminator) {
54
55
  'durationMs': json['duration_ms'] == null ? undefined : json['duration_ms'],
55
56
  'language': json['language'] == null ? undefined : json['language'],
56
57
  'segmentCount': json['segment_count'] == null ? undefined : json['segment_count'],
58
+ 'email': json['email'] == null ? undefined : (0, EmailMetadata_1.EmailMetadataFromJSON)(json['email']),
57
59
  'totalFormulas': json['total_formulas'] == null ? undefined : json['total_formulas'],
58
60
  'xlsxParseResultS3': json['xlsx_parse_result_s3'] == null ? undefined : json['xlsx_parse_result_s3'],
59
61
  'xlsxNamedRanges': json['xlsx_named_ranges'] == null ? undefined : json['xlsx_named_ranges'],
@@ -92,6 +94,7 @@ function DocumentVersionMetadataUpdateToJSONTyped(value, ignoreDiscriminator = f
92
94
  'duration_ms': value['durationMs'],
93
95
  'language': value['language'],
94
96
  'segment_count': value['segmentCount'],
97
+ 'email': (0, EmailMetadata_1.EmailMetadataToJSON)(value['email']),
95
98
  'total_formulas': value['totalFormulas'],
96
99
  'xlsx_parse_result_s3': value['xlsxParseResultS3'],
97
100
  'xlsx_named_ranges': value['xlsxNamedRanges'],
@@ -0,0 +1,119 @@
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
+ import type { EmailParty } from './EmailParty';
13
+ /**
14
+ * Structured headers of an ingested email (EMAIL document type only).
15
+ *
16
+ * Populated by ``document_preparation_activity`` from the same parse that
17
+ * renders the message body, so the stored metadata and the rendered document
18
+ * cannot disagree. Null on a multi-message archive: its messages are ingested
19
+ * as their own documents, and each carries its own block.
20
+ * @export
21
+ * @interface EmailMetadata
22
+ */
23
+ export interface EmailMetadata {
24
+ /**
25
+ * Message subject
26
+ * @type {string}
27
+ * @memberof EmailMetadata
28
+ */
29
+ subject?: string;
30
+ /**
31
+ * Sender; null if unparseable
32
+ * @type {EmailParty}
33
+ * @memberof EmailMetadata
34
+ */
35
+ sender?: EmailParty | null;
36
+ /**
37
+ * To recipients
38
+ * @type {Array<EmailParty>}
39
+ * @memberof EmailMetadata
40
+ */
41
+ to?: Array<EmailParty>;
42
+ /**
43
+ * Cc recipients
44
+ * @type {Array<EmailParty>}
45
+ * @memberof EmailMetadata
46
+ */
47
+ cc?: Array<EmailParty>;
48
+ /**
49
+ * Bcc recipients. Present only when the source file carries them — a sending MTA strips Bcc, so it survives in the sender's own copy (a .msg exported from Sent Items) but never in a received .eml.
50
+ * @type {Array<EmailParty>}
51
+ * @memberof EmailMetadata
52
+ */
53
+ bcc?: Array<EmailParty>;
54
+ /**
55
+ * Date header, as written
56
+ * @type {string}
57
+ * @memberof EmailMetadata
58
+ */
59
+ sentAt?: string;
60
+ /**
61
+ * RFC 5322 Message-ID
62
+ * @type {string}
63
+ * @memberof EmailMetadata
64
+ */
65
+ messageId?: string;
66
+ /**
67
+ * Message-ID being replied to
68
+ * @type {string}
69
+ * @memberof EmailMetadata
70
+ */
71
+ inReplyTo?: string;
72
+ /**
73
+ * Reply chain, oldest first
74
+ * @type {Array<string>}
75
+ * @memberof EmailMetadata
76
+ */
77
+ references?: Array<string>;
78
+ /**
79
+ * Outlook PidTagConversationTopic (.msg only)
80
+ * @type {string}
81
+ * @memberof EmailMetadata
82
+ */
83
+ conversationTopic?: string;
84
+ /**
85
+ * Message-ID that started the thread — the first References entry, or this message's own id. Group by this to reconstruct a thread.
86
+ * @type {string}
87
+ * @memberof EmailMetadata
88
+ */
89
+ threadRootId?: string;
90
+ /**
91
+ * The verbatim header block, so a header this schema does not model stays recoverable without re-reading the source file.
92
+ * @type {string}
93
+ * @memberof EmailMetadata
94
+ */
95
+ rawHeaders?: string;
96
+ }
97
+ export declare const EmailMetadataPropertyValidationAttributesMap: {
98
+ [property: string]: {
99
+ maxLength?: number;
100
+ minLength?: number;
101
+ pattern?: string;
102
+ maximum?: number;
103
+ exclusiveMaximum?: boolean;
104
+ minimum?: number;
105
+ exclusiveMinimum?: boolean;
106
+ multipleOf?: number;
107
+ maxItems?: number;
108
+ minItems?: number;
109
+ uniqueItems?: boolean;
110
+ };
111
+ };
112
+ /**
113
+ * Check if a given object implements the EmailMetadata interface.
114
+ */
115
+ export declare function instanceOfEmailMetadata(value: object): value is EmailMetadata;
116
+ export declare function EmailMetadataFromJSON(json: any): EmailMetadata;
117
+ export declare function EmailMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmailMetadata;
118
+ export declare function EmailMetadataToJSON(json: any): EmailMetadata;
119
+ export declare function EmailMetadataToJSONTyped(value?: EmailMetadata | null, ignoreDiscriminator?: boolean): any;
@@ -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
+ }
@@ -52,6 +52,12 @@ export interface EventResponse {
52
52
  * @memberof EventResponse
53
53
  */
54
54
  actorUserId: string | null;
55
+ /**
56
+ *
57
+ * @type {string}
58
+ * @memberof EventResponse
59
+ */
60
+ actorOnBehalfOf?: string | null;
55
61
  /**
56
62
  *
57
63
  * @type {{ [key: string]: any; }}
@@ -54,6 +54,7 @@ function EventResponseFromJSONTyped(json, ignoreDiscriminator) {
54
54
  'kind': json['kind'],
55
55
  'ts': (new Date(json['ts'])),
56
56
  'actorUserId': json['actor_user_id'],
57
+ 'actorOnBehalfOf': json['actor_on_behalf_of'] == null ? undefined : json['actor_on_behalf_of'],
57
58
  'payload': json['payload'],
58
59
  'actor': json['actor'] == null ? undefined : (0, UserInfo_1.UserInfoFromJSON)(json['actor']),
59
60
  'subjectName': json['subject_name'] == null ? undefined : json['subject_name'],
@@ -76,6 +77,7 @@ function EventResponseToJSONTyped(value, ignoreDiscriminator = false) {
76
77
  'kind': value['kind'],
77
78
  'ts': value['ts'].toISOString(),
78
79
  'actor_user_id': value['actorUserId'],
80
+ 'actor_on_behalf_of': value['actorOnBehalfOf'],
79
81
  'payload': value['payload'],
80
82
  'actor': (0, UserInfo_1.UserInfoToJSON)(value['actor']),
81
83
  'subject_name': value['subjectName'],
@@ -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
  }