@knowledge-stack/ksapi 3.6.2 → 3.8.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 (74) hide show
  1. package/.openapi-generator/FILES +0 -4
  2. package/README.md +2 -4
  3. package/dist/apis/DocumentsApi.d.ts +4 -7
  4. package/dist/apis/DocumentsApi.js +2 -5
  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 +4 -7
  8. package/dist/esm/apis/DocumentsApi.js +2 -5
  9. package/dist/esm/apis/SystemJobsApi.d.ts +4 -4
  10. package/dist/esm/apis/SystemJobsApi.js +2 -2
  11. package/dist/esm/models/AskRequest.d.ts +7 -0
  12. package/dist/esm/models/AskRequest.js +3 -0
  13. package/dist/esm/models/DocumentVersionMetadata.d.ts +0 -7
  14. package/dist/esm/models/DocumentVersionMetadata.js +0 -3
  15. package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +0 -7
  16. package/dist/esm/models/DocumentVersionMetadataUpdate.js +0 -3
  17. package/dist/esm/models/IngestDocumentResponse.d.ts +0 -18
  18. package/dist/esm/models/IngestDocumentResponse.js +0 -6
  19. package/dist/esm/models/PipelineState.d.ts +8 -1
  20. package/dist/esm/models/PipelineState.js +3 -0
  21. package/dist/esm/models/UploadFormat.d.ts +6 -0
  22. package/dist/esm/models/UploadFormat.js +4 -0
  23. package/dist/esm/models/UserMessageRequest.d.ts +7 -0
  24. package/dist/esm/models/UserMessageRequest.js +3 -0
  25. package/dist/esm/models/index.d.ts +0 -2
  26. package/dist/esm/models/index.js +0 -2
  27. package/dist/models/AskRequest.d.ts +7 -0
  28. package/dist/models/AskRequest.js +3 -0
  29. package/dist/models/DocumentVersionMetadata.d.ts +0 -7
  30. package/dist/models/DocumentVersionMetadata.js +0 -3
  31. package/dist/models/DocumentVersionMetadataUpdate.d.ts +0 -7
  32. package/dist/models/DocumentVersionMetadataUpdate.js +0 -3
  33. package/dist/models/IngestDocumentResponse.d.ts +0 -18
  34. package/dist/models/IngestDocumentResponse.js +0 -6
  35. package/dist/models/PipelineState.d.ts +8 -1
  36. package/dist/models/PipelineState.js +3 -0
  37. package/dist/models/UploadFormat.d.ts +6 -0
  38. package/dist/models/UploadFormat.js +4 -0
  39. package/dist/models/UserMessageRequest.d.ts +7 -0
  40. package/dist/models/UserMessageRequest.js +3 -0
  41. package/dist/models/index.d.ts +0 -2
  42. package/dist/models/index.js +0 -2
  43. package/docs/AskRequest.md +2 -0
  44. package/docs/DocumentVersionMetadata.md +0 -2
  45. package/docs/DocumentVersionMetadataUpdate.md +0 -2
  46. package/docs/DocumentsApi.md +2 -5
  47. package/docs/IngestDocumentResponse.md +0 -6
  48. package/docs/PipelineState.md +2 -0
  49. package/docs/SystemJobsApi.md +1 -1
  50. package/docs/UploadFormat.md +2 -0
  51. package/docs/UserMessageRequest.md +2 -0
  52. package/package.json +1 -1
  53. package/src/apis/DocumentsApi.ts +4 -11
  54. package/src/apis/SystemJobsApi.ts +4 -4
  55. package/src/models/AskRequest.ts +18 -0
  56. package/src/models/DocumentVersionMetadata.ts +0 -15
  57. package/src/models/DocumentVersionMetadataUpdate.ts +0 -15
  58. package/src/models/IngestDocumentResponse.ts +0 -24
  59. package/src/models/PipelineState.ts +16 -1
  60. package/src/models/UploadFormat.ts +9 -0
  61. package/src/models/UserMessageRequest.ts +18 -0
  62. package/src/models/index.ts +0 -2
  63. package/dist/esm/models/EmailMetadata.d.ts +0 -119
  64. package/dist/esm/models/EmailMetadata.js +0 -65
  65. package/dist/esm/models/EmailParty.d.ts +0 -53
  66. package/dist/esm/models/EmailParty.js +0 -46
  67. package/dist/models/EmailMetadata.d.ts +0 -119
  68. package/dist/models/EmailMetadata.js +0 -73
  69. package/dist/models/EmailParty.d.ts +0 -53
  70. package/dist/models/EmailParty.js +0 -54
  71. package/docs/EmailMetadata.md +0 -57
  72. package/docs/EmailParty.md +0 -37
  73. package/src/models/EmailMetadata.ts +0 -183
  74. package/src/models/EmailParty.ts +0 -91
@@ -1,183 +0,0 @@
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
- import type { EmailParty } from './EmailParty';
17
- import {
18
- EmailPartyFromJSON,
19
- EmailPartyFromJSONTyped,
20
- EmailPartyToJSON,
21
- EmailPartyToJSONTyped,
22
- } from './EmailParty';
23
-
24
- /**
25
- * Structured headers of an ingested email (EMAIL document type only).
26
- *
27
- * Populated by ``document_preparation_activity`` from the same parse that
28
- * renders the message body, so the stored metadata and the rendered document
29
- * cannot disagree. Null on a multi-message archive: its messages are ingested
30
- * as their own documents, and each carries its own block.
31
- * @export
32
- * @interface EmailMetadata
33
- */
34
- export interface EmailMetadata {
35
- /**
36
- * Message subject
37
- * @type {string}
38
- * @memberof EmailMetadata
39
- */
40
- subject?: string;
41
- /**
42
- * Sender; null if unparseable
43
- * @type {EmailParty}
44
- * @memberof EmailMetadata
45
- */
46
- sender?: EmailParty | null;
47
- /**
48
- * To recipients
49
- * @type {Array<EmailParty>}
50
- * @memberof EmailMetadata
51
- */
52
- to?: Array<EmailParty>;
53
- /**
54
- * Cc recipients
55
- * @type {Array<EmailParty>}
56
- * @memberof EmailMetadata
57
- */
58
- cc?: Array<EmailParty>;
59
- /**
60
- * 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.
61
- * @type {Array<EmailParty>}
62
- * @memberof EmailMetadata
63
- */
64
- bcc?: Array<EmailParty>;
65
- /**
66
- * Date header, as written
67
- * @type {string}
68
- * @memberof EmailMetadata
69
- */
70
- sentAt?: string;
71
- /**
72
- * RFC 5322 Message-ID
73
- * @type {string}
74
- * @memberof EmailMetadata
75
- */
76
- messageId?: string;
77
- /**
78
- * Message-ID being replied to
79
- * @type {string}
80
- * @memberof EmailMetadata
81
- */
82
- inReplyTo?: string;
83
- /**
84
- * Reply chain, oldest first
85
- * @type {Array<string>}
86
- * @memberof EmailMetadata
87
- */
88
- references?: Array<string>;
89
- /**
90
- * Outlook PidTagConversationTopic (.msg only)
91
- * @type {string}
92
- * @memberof EmailMetadata
93
- */
94
- conversationTopic?: string;
95
- /**
96
- * Message-ID that started the thread — the first References entry, or this message's own id. Group by this to reconstruct a thread.
97
- * @type {string}
98
- * @memberof EmailMetadata
99
- */
100
- threadRootId?: string;
101
- /**
102
- * The verbatim header block, so a header this schema does not model stays recoverable without re-reading the source file.
103
- * @type {string}
104
- * @memberof EmailMetadata
105
- */
106
- rawHeaders?: string;
107
- }
108
- export const EmailMetadataPropertyValidationAttributesMap: {
109
- [property: string]: {
110
- maxLength?: number,
111
- minLength?: number,
112
- pattern?: string,
113
- maximum?: number,
114
- exclusiveMaximum?: boolean,
115
- minimum?: number,
116
- exclusiveMinimum?: boolean,
117
- multipleOf?: number,
118
- maxItems?: number,
119
- minItems?: number,
120
- uniqueItems?: boolean
121
- }
122
- } = {
123
- }
124
-
125
-
126
- /**
127
- * Check if a given object implements the EmailMetadata interface.
128
- */
129
- export function instanceOfEmailMetadata(value: object): value is EmailMetadata {
130
- return true;
131
- }
132
-
133
- export function EmailMetadataFromJSON(json: any): EmailMetadata {
134
- return EmailMetadataFromJSONTyped(json, false);
135
- }
136
-
137
- export function EmailMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmailMetadata {
138
- if (json == null) {
139
- return json;
140
- }
141
- return {
142
-
143
- 'subject': json['subject'] == null ? undefined : json['subject'],
144
- 'sender': json['sender'] == null ? undefined : EmailPartyFromJSON(json['sender']),
145
- 'to': json['to'] == null ? undefined : ((json['to'] as Array<any>).map(EmailPartyFromJSON)),
146
- 'cc': json['cc'] == null ? undefined : ((json['cc'] as Array<any>).map(EmailPartyFromJSON)),
147
- 'bcc': json['bcc'] == null ? undefined : ((json['bcc'] as Array<any>).map(EmailPartyFromJSON)),
148
- 'sentAt': json['sent_at'] == null ? undefined : json['sent_at'],
149
- 'messageId': json['message_id'] == null ? undefined : json['message_id'],
150
- 'inReplyTo': json['in_reply_to'] == null ? undefined : json['in_reply_to'],
151
- 'references': json['references'] == null ? undefined : json['references'],
152
- 'conversationTopic': json['conversation_topic'] == null ? undefined : json['conversation_topic'],
153
- 'threadRootId': json['thread_root_id'] == null ? undefined : json['thread_root_id'],
154
- 'rawHeaders': json['raw_headers'] == null ? undefined : json['raw_headers'],
155
- };
156
- }
157
-
158
- export function EmailMetadataToJSON(json: any): EmailMetadata {
159
- return EmailMetadataToJSONTyped(json, false);
160
- }
161
-
162
- export function EmailMetadataToJSONTyped(value?: EmailMetadata | null, ignoreDiscriminator: boolean = false): any {
163
- if (value == null) {
164
- return value;
165
- }
166
-
167
- return {
168
-
169
- 'subject': value['subject'],
170
- 'sender': EmailPartyToJSON(value['sender']),
171
- 'to': value['to'] == null ? undefined : ((value['to'] as Array<any>).map(EmailPartyToJSON)),
172
- 'cc': value['cc'] == null ? undefined : ((value['cc'] as Array<any>).map(EmailPartyToJSON)),
173
- 'bcc': value['bcc'] == null ? undefined : ((value['bcc'] as Array<any>).map(EmailPartyToJSON)),
174
- 'sent_at': value['sentAt'],
175
- 'message_id': value['messageId'],
176
- 'in_reply_to': value['inReplyTo'],
177
- 'references': value['references'],
178
- 'conversation_topic': value['conversationTopic'],
179
- 'thread_root_id': value['threadRootId'],
180
- 'raw_headers': value['rawHeaders'],
181
- };
182
- }
183
-
@@ -1,91 +0,0 @@
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 email participant.
18
- * @export
19
- * @interface EmailParty
20
- */
21
- export interface EmailParty {
22
- /**
23
- * Display name; empty if unnamed
24
- * @type {string}
25
- * @memberof EmailParty
26
- */
27
- name?: string;
28
- /**
29
- * Email address
30
- * @type {string}
31
- * @memberof EmailParty
32
- */
33
- address: string;
34
- }
35
- export const EmailPartyPropertyValidationAttributesMap: {
36
- [property: string]: {
37
- maxLength?: number,
38
- minLength?: number,
39
- pattern?: string,
40
- maximum?: number,
41
- exclusiveMaximum?: boolean,
42
- minimum?: number,
43
- exclusiveMinimum?: boolean,
44
- multipleOf?: number,
45
- maxItems?: number,
46
- minItems?: number,
47
- uniqueItems?: boolean
48
- }
49
- } = {
50
- }
51
-
52
-
53
- /**
54
- * Check if a given object implements the EmailParty interface.
55
- */
56
- export function instanceOfEmailParty(value: object): value is EmailParty {
57
- if (!('address' in value) || value['address'] === undefined) return false;
58
- return true;
59
- }
60
-
61
- export function EmailPartyFromJSON(json: any): EmailParty {
62
- return EmailPartyFromJSONTyped(json, false);
63
- }
64
-
65
- export function EmailPartyFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmailParty {
66
- if (json == null) {
67
- return json;
68
- }
69
- return {
70
-
71
- 'name': json['name'] == null ? undefined : json['name'],
72
- 'address': json['address'],
73
- };
74
- }
75
-
76
- export function EmailPartyToJSON(json: any): EmailParty {
77
- return EmailPartyToJSONTyped(json, false);
78
- }
79
-
80
- export function EmailPartyToJSONTyped(value?: EmailParty | null, ignoreDiscriminator: boolean = false): any {
81
- if (value == null) {
82
- return value;
83
- }
84
-
85
- return {
86
-
87
- 'name': value['name'],
88
- 'address': value['address'],
89
- };
90
- }
91
-