@knowledge-stack/ksapi 1.21.0 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @knowledge-stack/ksapi@1.21.0
1
+ ## @knowledge-stack/ksapi@1.23.0
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @knowledge-stack/ksapi@1.21.0 --save
39
+ npm install @knowledge-stack/ksapi@1.23.0 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -21,6 +21,7 @@ export interface DeleteDocumentRequest {
21
21
  }
22
22
  export interface GetDocumentRequest {
23
23
  documentId: string;
24
+ withTags?: boolean;
24
25
  ksUat?: string | null;
25
26
  }
26
27
  export interface IngestDocumentRequest {
@@ -32,6 +33,7 @@ export interface IngestDocumentRequest {
32
33
  export interface ListDocumentsRequest {
33
34
  parentPathPartId?: string | null;
34
35
  sortOrder?: PathOrder;
36
+ withTags?: boolean;
35
37
  limit?: number;
36
38
  offset?: number;
37
39
  ksUat?: string | null;
@@ -82,6 +84,7 @@ export interface DocumentsApiInterface {
82
84
  * Get a document by its document ID.
83
85
  * @summary Get Document Handler
84
86
  * @param {string} documentId
87
+ * @param {boolean} [withTags] Include tags in the response (default: false)
85
88
  * @param {string} [ksUat]
86
89
  * @param {*} [options] Override http request option.
87
90
  * @throws {RequiredError}
@@ -115,6 +118,7 @@ export interface DocumentsApiInterface {
115
118
  * @summary List Documents Handler
116
119
  * @param {string} [parentPathPartId] Parent PathPart ID (defaults to root)
117
120
  * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
121
+ * @param {boolean} [withTags] Include tags in the response (default: false)
118
122
  * @param {number} [limit] Number of items per page
119
123
  * @param {number} [offset] Number of items to skip
120
124
  * @param {string} [ksUat]
@@ -103,6 +103,9 @@ class DocumentsApi extends runtime.BaseAPI {
103
103
  throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling getDocument().');
104
104
  }
105
105
  const queryParameters = {};
106
+ if (requestParameters['withTags'] != null) {
107
+ queryParameters['with_tags'] = requestParameters['withTags'];
108
+ }
106
109
  const headerParameters = {};
107
110
  let urlPath = `/v1/documents/{document_id}`;
108
111
  urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
@@ -197,6 +200,9 @@ class DocumentsApi extends runtime.BaseAPI {
197
200
  if (requestParameters['sortOrder'] != null) {
198
201
  queryParameters['sort_order'] = requestParameters['sortOrder'];
199
202
  }
203
+ if (requestParameters['withTags'] != null) {
204
+ queryParameters['with_tags'] = requestParameters['withTags'];
205
+ }
200
206
  if (requestParameters['limit'] != null) {
201
207
  queryParameters['limit'] = requestParameters['limit'];
202
208
  }
@@ -21,6 +21,7 @@ export interface DeleteFolderRequest {
21
21
  }
22
22
  export interface GetFolderRequest {
23
23
  folderId: string;
24
+ withTags?: boolean;
24
25
  ksUat?: string | null;
25
26
  }
26
27
  export interface ListFolderContentsRequest {
@@ -35,6 +36,7 @@ export interface ListFolderContentsRequest {
35
36
  export interface ListFoldersRequest {
36
37
  parentPathPartId?: string | null;
37
38
  sortOrder?: PathOrder;
39
+ withTags?: boolean;
38
40
  limit?: number;
39
41
  offset?: number;
40
42
  ksUat?: string | null;
@@ -85,6 +87,7 @@ export interface FoldersApiInterface {
85
87
  * Get a folder by its folder ID.
86
88
  * @summary Get Folder Handler
87
89
  * @param {string} folderId
90
+ * @param {boolean} [withTags] Include tags in the response (default: false)
88
91
  * @param {string} [ksUat]
89
92
  * @param {*} [options] Override http request option.
90
93
  * @throws {RequiredError}
@@ -121,6 +124,7 @@ export interface FoldersApiInterface {
121
124
  * @summary List Folders Handler
122
125
  * @param {string} [parentPathPartId] Parent PathPart ID (defaults to root)
123
126
  * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
127
+ * @param {boolean} [withTags] Include tags in the response (default: false)
124
128
  * @param {number} [limit] Number of items per page
125
129
  * @param {number} [offset] Number of items to skip
126
130
  * @param {string} [ksUat]
@@ -103,6 +103,9 @@ class FoldersApi extends runtime.BaseAPI {
103
103
  throw new runtime.RequiredError('folderId', 'Required parameter "folderId" was null or undefined when calling getFolder().');
104
104
  }
105
105
  const queryParameters = {};
106
+ if (requestParameters['withTags'] != null) {
107
+ queryParameters['with_tags'] = requestParameters['withTags'];
108
+ }
106
109
  const headerParameters = {};
107
110
  let urlPath = `/v1/folders/{folder_id}`;
108
111
  urlPath = urlPath.replace(`{${"folder_id"}}`, encodeURIComponent(String(requestParameters['folderId'])));
@@ -185,6 +188,9 @@ class FoldersApi extends runtime.BaseAPI {
185
188
  if (requestParameters['sortOrder'] != null) {
186
189
  queryParameters['sort_order'] = requestParameters['sortOrder'];
187
190
  }
191
+ if (requestParameters['withTags'] != null) {
192
+ queryParameters['with_tags'] = requestParameters['withTags'];
193
+ }
188
194
  if (requestParameters['limit'] != null) {
189
195
  queryParameters['limit'] = requestParameters['limit'];
190
196
  }
@@ -29,6 +29,12 @@ export interface ListThreadsRequest {
29
29
  offset?: number;
30
30
  ksUat?: string | null;
31
31
  }
32
+ export interface StreamThreadRequest {
33
+ threadId: string;
34
+ lastMessageId?: string | null;
35
+ lastEntryId?: string | null;
36
+ ksUat?: string | null;
37
+ }
32
38
  export interface UpdateThreadOperationRequest {
33
39
  threadId: string;
34
40
  updateThreadRequest: UpdateThreadRequest;
@@ -103,6 +109,23 @@ export interface ThreadsApiInterface {
103
109
  * List Threads Handler
104
110
  */
105
111
  listThreads(requestParameters: ListThreadsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseThreadResponse>;
112
+ /**
113
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
114
+ * @summary Stream Thread Handler
115
+ * @param {string} threadId
116
+ * @param {string} [lastMessageId]
117
+ * @param {string} [lastEntryId]
118
+ * @param {string} [ksUat]
119
+ * @param {*} [options] Override http request option.
120
+ * @throws {RequiredError}
121
+ * @memberof ThreadsApiInterface
122
+ */
123
+ streamThreadRaw(requestParameters: StreamThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
124
+ /**
125
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
126
+ * Stream Thread Handler
127
+ */
128
+ streamThread(requestParameters: StreamThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
106
129
  /**
107
130
  * Update a thread\'s title and/or parent_thread_id.
108
131
  * @summary Update Thread Handler
@@ -164,6 +187,16 @@ export declare class ThreadsApi extends runtime.BaseAPI implements ThreadsApiInt
164
187
  * List Threads Handler
165
188
  */
166
189
  listThreads(requestParameters?: ListThreadsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseThreadResponse>;
190
+ /**
191
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
192
+ * Stream Thread Handler
193
+ */
194
+ streamThreadRaw(requestParameters: StreamThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
195
+ /**
196
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
197
+ * Stream Thread Handler
198
+ */
199
+ streamThread(requestParameters: StreamThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
167
200
  /**
168
201
  * Update a thread\'s title and/or parent_thread_id.
169
202
  * Update Thread Handler
@@ -162,6 +162,43 @@ class ThreadsApi extends runtime.BaseAPI {
162
162
  return yield response.value();
163
163
  });
164
164
  }
165
+ /**
166
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
167
+ * Stream Thread Handler
168
+ */
169
+ streamThreadRaw(requestParameters, initOverrides) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ if (requestParameters['threadId'] == null) {
172
+ throw new runtime.RequiredError('threadId', 'Required parameter "threadId" was null or undefined when calling streamThread().');
173
+ }
174
+ const queryParameters = {};
175
+ if (requestParameters['lastMessageId'] != null) {
176
+ queryParameters['last_message_id'] = requestParameters['lastMessageId'];
177
+ }
178
+ if (requestParameters['lastEntryId'] != null) {
179
+ queryParameters['last_entry_id'] = requestParameters['lastEntryId'];
180
+ }
181
+ const headerParameters = {};
182
+ let urlPath = `/v1/threads/{thread_id}/stream`;
183
+ urlPath = urlPath.replace(`{${"thread_id"}}`, encodeURIComponent(String(requestParameters['threadId'])));
184
+ const response = yield this.request({
185
+ path: urlPath,
186
+ method: 'GET',
187
+ headers: headerParameters,
188
+ query: queryParameters,
189
+ }, initOverrides);
190
+ return new runtime.VoidApiResponse(response);
191
+ });
192
+ }
193
+ /**
194
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
195
+ * Stream Thread Handler
196
+ */
197
+ streamThread(requestParameters, initOverrides) {
198
+ return __awaiter(this, void 0, void 0, function* () {
199
+ yield this.streamThreadRaw(requestParameters, initOverrides);
200
+ });
201
+ }
165
202
  /**
166
203
  * Update a thread\'s title and/or parent_thread_id.
167
204
  * Update Thread Handler
@@ -21,6 +21,7 @@ export interface DeleteDocumentRequest {
21
21
  }
22
22
  export interface GetDocumentRequest {
23
23
  documentId: string;
24
+ withTags?: boolean;
24
25
  ksUat?: string | null;
25
26
  }
26
27
  export interface IngestDocumentRequest {
@@ -32,6 +33,7 @@ export interface IngestDocumentRequest {
32
33
  export interface ListDocumentsRequest {
33
34
  parentPathPartId?: string | null;
34
35
  sortOrder?: PathOrder;
36
+ withTags?: boolean;
35
37
  limit?: number;
36
38
  offset?: number;
37
39
  ksUat?: string | null;
@@ -82,6 +84,7 @@ export interface DocumentsApiInterface {
82
84
  * Get a document by its document ID.
83
85
  * @summary Get Document Handler
84
86
  * @param {string} documentId
87
+ * @param {boolean} [withTags] Include tags in the response (default: false)
85
88
  * @param {string} [ksUat]
86
89
  * @param {*} [options] Override http request option.
87
90
  * @throws {RequiredError}
@@ -115,6 +118,7 @@ export interface DocumentsApiInterface {
115
118
  * @summary List Documents Handler
116
119
  * @param {string} [parentPathPartId] Parent PathPart ID (defaults to root)
117
120
  * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
121
+ * @param {boolean} [withTags] Include tags in the response (default: false)
118
122
  * @param {number} [limit] Number of items per page
119
123
  * @param {number} [offset] Number of items to skip
120
124
  * @param {string} [ksUat]
@@ -100,6 +100,9 @@ export class DocumentsApi extends runtime.BaseAPI {
100
100
  throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling getDocument().');
101
101
  }
102
102
  const queryParameters = {};
103
+ if (requestParameters['withTags'] != null) {
104
+ queryParameters['with_tags'] = requestParameters['withTags'];
105
+ }
103
106
  const headerParameters = {};
104
107
  let urlPath = `/v1/documents/{document_id}`;
105
108
  urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
@@ -194,6 +197,9 @@ export class DocumentsApi extends runtime.BaseAPI {
194
197
  if (requestParameters['sortOrder'] != null) {
195
198
  queryParameters['sort_order'] = requestParameters['sortOrder'];
196
199
  }
200
+ if (requestParameters['withTags'] != null) {
201
+ queryParameters['with_tags'] = requestParameters['withTags'];
202
+ }
197
203
  if (requestParameters['limit'] != null) {
198
204
  queryParameters['limit'] = requestParameters['limit'];
199
205
  }
@@ -21,6 +21,7 @@ export interface DeleteFolderRequest {
21
21
  }
22
22
  export interface GetFolderRequest {
23
23
  folderId: string;
24
+ withTags?: boolean;
24
25
  ksUat?: string | null;
25
26
  }
26
27
  export interface ListFolderContentsRequest {
@@ -35,6 +36,7 @@ export interface ListFolderContentsRequest {
35
36
  export interface ListFoldersRequest {
36
37
  parentPathPartId?: string | null;
37
38
  sortOrder?: PathOrder;
39
+ withTags?: boolean;
38
40
  limit?: number;
39
41
  offset?: number;
40
42
  ksUat?: string | null;
@@ -85,6 +87,7 @@ export interface FoldersApiInterface {
85
87
  * Get a folder by its folder ID.
86
88
  * @summary Get Folder Handler
87
89
  * @param {string} folderId
90
+ * @param {boolean} [withTags] Include tags in the response (default: false)
88
91
  * @param {string} [ksUat]
89
92
  * @param {*} [options] Override http request option.
90
93
  * @throws {RequiredError}
@@ -121,6 +124,7 @@ export interface FoldersApiInterface {
121
124
  * @summary List Folders Handler
122
125
  * @param {string} [parentPathPartId] Parent PathPart ID (defaults to root)
123
126
  * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
127
+ * @param {boolean} [withTags] Include tags in the response (default: false)
124
128
  * @param {number} [limit] Number of items per page
125
129
  * @param {number} [offset] Number of items to skip
126
130
  * @param {string} [ksUat]
@@ -100,6 +100,9 @@ export class FoldersApi extends runtime.BaseAPI {
100
100
  throw new runtime.RequiredError('folderId', 'Required parameter "folderId" was null or undefined when calling getFolder().');
101
101
  }
102
102
  const queryParameters = {};
103
+ if (requestParameters['withTags'] != null) {
104
+ queryParameters['with_tags'] = requestParameters['withTags'];
105
+ }
103
106
  const headerParameters = {};
104
107
  let urlPath = `/v1/folders/{folder_id}`;
105
108
  urlPath = urlPath.replace(`{${"folder_id"}}`, encodeURIComponent(String(requestParameters['folderId'])));
@@ -182,6 +185,9 @@ export class FoldersApi extends runtime.BaseAPI {
182
185
  if (requestParameters['sortOrder'] != null) {
183
186
  queryParameters['sort_order'] = requestParameters['sortOrder'];
184
187
  }
188
+ if (requestParameters['withTags'] != null) {
189
+ queryParameters['with_tags'] = requestParameters['withTags'];
190
+ }
185
191
  if (requestParameters['limit'] != null) {
186
192
  queryParameters['limit'] = requestParameters['limit'];
187
193
  }
@@ -29,6 +29,12 @@ export interface ListThreadsRequest {
29
29
  offset?: number;
30
30
  ksUat?: string | null;
31
31
  }
32
+ export interface StreamThreadRequest {
33
+ threadId: string;
34
+ lastMessageId?: string | null;
35
+ lastEntryId?: string | null;
36
+ ksUat?: string | null;
37
+ }
32
38
  export interface UpdateThreadOperationRequest {
33
39
  threadId: string;
34
40
  updateThreadRequest: UpdateThreadRequest;
@@ -103,6 +109,23 @@ export interface ThreadsApiInterface {
103
109
  * List Threads Handler
104
110
  */
105
111
  listThreads(requestParameters: ListThreadsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseThreadResponse>;
112
+ /**
113
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
114
+ * @summary Stream Thread Handler
115
+ * @param {string} threadId
116
+ * @param {string} [lastMessageId]
117
+ * @param {string} [lastEntryId]
118
+ * @param {string} [ksUat]
119
+ * @param {*} [options] Override http request option.
120
+ * @throws {RequiredError}
121
+ * @memberof ThreadsApiInterface
122
+ */
123
+ streamThreadRaw(requestParameters: StreamThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
124
+ /**
125
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
126
+ * Stream Thread Handler
127
+ */
128
+ streamThread(requestParameters: StreamThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
106
129
  /**
107
130
  * Update a thread\'s title and/or parent_thread_id.
108
131
  * @summary Update Thread Handler
@@ -164,6 +187,16 @@ export declare class ThreadsApi extends runtime.BaseAPI implements ThreadsApiInt
164
187
  * List Threads Handler
165
188
  */
166
189
  listThreads(requestParameters?: ListThreadsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseThreadResponse>;
190
+ /**
191
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
192
+ * Stream Thread Handler
193
+ */
194
+ streamThreadRaw(requestParameters: StreamThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
195
+ /**
196
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
197
+ * Stream Thread Handler
198
+ */
199
+ streamThread(requestParameters: StreamThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
167
200
  /**
168
201
  * Update a thread\'s title and/or parent_thread_id.
169
202
  * Update Thread Handler
@@ -159,6 +159,43 @@ export class ThreadsApi extends runtime.BaseAPI {
159
159
  return yield response.value();
160
160
  });
161
161
  }
162
+ /**
163
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
164
+ * Stream Thread Handler
165
+ */
166
+ streamThreadRaw(requestParameters, initOverrides) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ if (requestParameters['threadId'] == null) {
169
+ throw new runtime.RequiredError('threadId', 'Required parameter "threadId" was null or undefined when calling streamThread().');
170
+ }
171
+ const queryParameters = {};
172
+ if (requestParameters['lastMessageId'] != null) {
173
+ queryParameters['last_message_id'] = requestParameters['lastMessageId'];
174
+ }
175
+ if (requestParameters['lastEntryId'] != null) {
176
+ queryParameters['last_entry_id'] = requestParameters['lastEntryId'];
177
+ }
178
+ const headerParameters = {};
179
+ let urlPath = `/v1/threads/{thread_id}/stream`;
180
+ urlPath = urlPath.replace(`{${"thread_id"}}`, encodeURIComponent(String(requestParameters['threadId'])));
181
+ const response = yield this.request({
182
+ path: urlPath,
183
+ method: 'GET',
184
+ headers: headerParameters,
185
+ query: queryParameters,
186
+ }, initOverrides);
187
+ return new runtime.VoidApiResponse(response);
188
+ });
189
+ }
190
+ /**
191
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
192
+ * Stream Thread Handler
193
+ */
194
+ streamThread(requestParameters, initOverrides) {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ yield this.streamThreadRaw(requestParameters, initOverrides);
197
+ });
198
+ }
162
199
  /**
163
200
  * Update a thread\'s title and/or parent_thread_id.
164
201
  * Update Thread Handler
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import type { DocumentOrigin } from './DocumentOrigin';
13
+ import type { TagResponse } from './TagResponse';
13
14
  import type { DocumentType } from './DocumentType';
14
15
  import type { DocumentVersionResponse } from './DocumentVersionResponse';
15
16
  /**
@@ -96,6 +97,12 @@ export interface DocumentResponse {
96
97
  * @memberof DocumentResponse
97
98
  */
98
99
  updatedAt: Date;
100
+ /**
101
+ * Tags attached to this document
102
+ * @type {Array<TagResponse>}
103
+ * @memberof DocumentResponse
104
+ */
105
+ tags?: Array<TagResponse> | null;
99
106
  }
100
107
  /**
101
108
  * Check if a given object implements the DocumentResponse interface.
@@ -12,6 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import { DocumentOriginFromJSON, DocumentOriginToJSON, } from './DocumentOrigin';
15
+ import { TagResponseFromJSON, TagResponseToJSON, } from './TagResponse';
15
16
  import { DocumentTypeFromJSON, DocumentTypeToJSON, } from './DocumentType';
16
17
  import { DocumentVersionResponseFromJSON, DocumentVersionResponseToJSON, } from './DocumentVersionResponse';
17
18
  /**
@@ -67,6 +68,7 @@ export function DocumentResponseFromJSONTyped(json, ignoreDiscriminator) {
67
68
  'tenantId': json['tenant_id'],
68
69
  'createdAt': (new Date(json['created_at'])),
69
70
  'updatedAt': (new Date(json['updated_at'])),
71
+ 'tags': json['tags'] == null ? undefined : (json['tags'].map(TagResponseFromJSON)),
70
72
  };
71
73
  }
72
74
  export function DocumentResponseToJSON(json) {
@@ -90,6 +92,7 @@ export function DocumentResponseToJSONTyped(value, ignoreDiscriminator = false)
90
92
  'tenant_id': value['tenantId'],
91
93
  'created_at': value['createdAt'].toISOString(),
92
94
  'updated_at': value['updatedAt'].toISOString(),
95
+ 'tags': value['tags'] == null ? undefined : (value['tags'].map(TagResponseToJSON)),
93
96
  };
94
97
  }
95
98
  export const DocumentResponsePropertyValidationAttributesMap = {};
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { TagResponse } from './TagResponse';
12
13
  /**
13
14
  * Folder response model.
14
15
  * @export
@@ -69,6 +70,12 @@ export interface FolderResponse {
69
70
  * @memberof FolderResponse
70
71
  */
71
72
  updatedAt: Date;
73
+ /**
74
+ * Tags attached to this folder
75
+ * @type {Array<TagResponse>}
76
+ * @memberof FolderResponse
77
+ */
78
+ tags?: Array<TagResponse> | null;
72
79
  }
73
80
  /**
74
81
  * Check if a given object implements the FolderResponse interface.
@@ -11,6 +11,7 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
+ import { TagResponseFromJSON, TagResponseToJSON, } from './TagResponse';
14
15
  /**
15
16
  * Check if a given object implements the FolderResponse interface.
16
17
  */
@@ -52,6 +53,7 @@ export function FolderResponseFromJSONTyped(json, ignoreDiscriminator) {
52
53
  'tenantId': json['tenant_id'],
53
54
  'createdAt': (new Date(json['created_at'])),
54
55
  'updatedAt': (new Date(json['updated_at'])),
56
+ 'tags': json['tags'] == null ? undefined : (json['tags'].map(TagResponseFromJSON)),
55
57
  };
56
58
  }
57
59
  export function FolderResponseToJSON(json) {
@@ -71,6 +73,7 @@ export function FolderResponseToJSONTyped(value, ignoreDiscriminator = false) {
71
73
  'tenant_id': value['tenantId'],
72
74
  'created_at': value['createdAt'].toISOString(),
73
75
  'updated_at': value['updatedAt'].toISOString(),
76
+ 'tags': value['tags'] == null ? undefined : (value['tags'].map(TagResponseToJSON)),
74
77
  };
75
78
  }
76
79
  export const FolderResponsePropertyValidationAttributesMap = {};
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import type { DocumentOrigin } from './DocumentOrigin';
13
+ import type { TagResponse } from './TagResponse';
13
14
  import type { DocumentType } from './DocumentType';
14
15
  import type { DocumentVersionResponse } from './DocumentVersionResponse';
15
16
  /**
@@ -96,6 +97,12 @@ export interface DocumentResponse {
96
97
  * @memberof DocumentResponse
97
98
  */
98
99
  updatedAt: Date;
100
+ /**
101
+ * Tags attached to this document
102
+ * @type {Array<TagResponse>}
103
+ * @memberof DocumentResponse
104
+ */
105
+ tags?: Array<TagResponse> | null;
99
106
  }
100
107
  /**
101
108
  * Check if a given object implements the DocumentResponse interface.
@@ -20,6 +20,7 @@ exports.DocumentResponseFromJSONTyped = DocumentResponseFromJSONTyped;
20
20
  exports.DocumentResponseToJSON = DocumentResponseToJSON;
21
21
  exports.DocumentResponseToJSONTyped = DocumentResponseToJSONTyped;
22
22
  const DocumentOrigin_1 = require("./DocumentOrigin");
23
+ const TagResponse_1 = require("./TagResponse");
23
24
  const DocumentType_1 = require("./DocumentType");
24
25
  const DocumentVersionResponse_1 = require("./DocumentVersionResponse");
25
26
  /**
@@ -75,6 +76,7 @@ function DocumentResponseFromJSONTyped(json, ignoreDiscriminator) {
75
76
  'tenantId': json['tenant_id'],
76
77
  'createdAt': (new Date(json['created_at'])),
77
78
  'updatedAt': (new Date(json['updated_at'])),
79
+ 'tags': json['tags'] == null ? undefined : (json['tags'].map(TagResponse_1.TagResponseFromJSON)),
78
80
  };
79
81
  }
80
82
  function DocumentResponseToJSON(json) {
@@ -98,6 +100,7 @@ function DocumentResponseToJSONTyped(value, ignoreDiscriminator = false) {
98
100
  'tenant_id': value['tenantId'],
99
101
  'created_at': value['createdAt'].toISOString(),
100
102
  'updated_at': value['updatedAt'].toISOString(),
103
+ 'tags': value['tags'] == null ? undefined : (value['tags'].map(TagResponse_1.TagResponseToJSON)),
101
104
  };
102
105
  }
103
106
  exports.DocumentResponsePropertyValidationAttributesMap = {};
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { TagResponse } from './TagResponse';
12
13
  /**
13
14
  * Folder response model.
14
15
  * @export
@@ -69,6 +70,12 @@ export interface FolderResponse {
69
70
  * @memberof FolderResponse
70
71
  */
71
72
  updatedAt: Date;
73
+ /**
74
+ * Tags attached to this folder
75
+ * @type {Array<TagResponse>}
76
+ * @memberof FolderResponse
77
+ */
78
+ tags?: Array<TagResponse> | null;
72
79
  }
73
80
  /**
74
81
  * Check if a given object implements the FolderResponse interface.
@@ -19,6 +19,7 @@ exports.FolderResponseFromJSON = FolderResponseFromJSON;
19
19
  exports.FolderResponseFromJSONTyped = FolderResponseFromJSONTyped;
20
20
  exports.FolderResponseToJSON = FolderResponseToJSON;
21
21
  exports.FolderResponseToJSONTyped = FolderResponseToJSONTyped;
22
+ const TagResponse_1 = require("./TagResponse");
22
23
  /**
23
24
  * Check if a given object implements the FolderResponse interface.
24
25
  */
@@ -60,6 +61,7 @@ function FolderResponseFromJSONTyped(json, ignoreDiscriminator) {
60
61
  'tenantId': json['tenant_id'],
61
62
  'createdAt': (new Date(json['created_at'])),
62
63
  'updatedAt': (new Date(json['updated_at'])),
64
+ 'tags': json['tags'] == null ? undefined : (json['tags'].map(TagResponse_1.TagResponseFromJSON)),
63
65
  };
64
66
  }
65
67
  function FolderResponseToJSON(json) {
@@ -79,6 +81,7 @@ function FolderResponseToJSONTyped(value, ignoreDiscriminator = false) {
79
81
  'tenant_id': value['tenantId'],
80
82
  'created_at': value['createdAt'].toISOString(),
81
83
  'updated_at': value['updatedAt'].toISOString(),
84
+ 'tags': value['tags'] == null ? undefined : (value['tags'].map(TagResponse_1.TagResponseToJSON)),
82
85
  };
83
86
  }
84
87
  exports.FolderResponsePropertyValidationAttributesMap = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "1.21.0",
3
+ "version": "1.23.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -52,6 +52,7 @@ export interface DeleteDocumentRequest {
52
52
 
53
53
  export interface GetDocumentRequest {
54
54
  documentId: string;
55
+ withTags?: boolean;
55
56
  ksUat?: string | null;
56
57
  }
57
58
 
@@ -65,6 +66,7 @@ export interface IngestDocumentRequest {
65
66
  export interface ListDocumentsRequest {
66
67
  parentPathPartId?: string | null;
67
68
  sortOrder?: PathOrder;
69
+ withTags?: boolean;
68
70
  limit?: number;
69
71
  offset?: number;
70
72
  ksUat?: string | null;
@@ -121,6 +123,7 @@ export interface DocumentsApiInterface {
121
123
  * Get a document by its document ID.
122
124
  * @summary Get Document Handler
123
125
  * @param {string} documentId
126
+ * @param {boolean} [withTags] Include tags in the response (default: false)
124
127
  * @param {string} [ksUat]
125
128
  * @param {*} [options] Override http request option.
126
129
  * @throws {RequiredError}
@@ -158,6 +161,7 @@ export interface DocumentsApiInterface {
158
161
  * @summary List Documents Handler
159
162
  * @param {string} [parentPathPartId] Parent PathPart ID (defaults to root)
160
163
  * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
164
+ * @param {boolean} [withTags] Include tags in the response (default: false)
161
165
  * @param {number} [limit] Number of items per page
162
166
  * @param {number} [offset] Number of items to skip
163
167
  * @param {string} [ksUat]
@@ -291,6 +295,10 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
291
295
 
292
296
  const queryParameters: any = {};
293
297
 
298
+ if (requestParameters['withTags'] != null) {
299
+ queryParameters['with_tags'] = requestParameters['withTags'];
300
+ }
301
+
294
302
  const headerParameters: runtime.HTTPHeaders = {};
295
303
 
296
304
 
@@ -405,6 +413,10 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
405
413
  queryParameters['sort_order'] = requestParameters['sortOrder'];
406
414
  }
407
415
 
416
+ if (requestParameters['withTags'] != null) {
417
+ queryParameters['with_tags'] = requestParameters['withTags'];
418
+ }
419
+
408
420
  if (requestParameters['limit'] != null) {
409
421
  queryParameters['limit'] = requestParameters['limit'];
410
422
  }
@@ -52,6 +52,7 @@ export interface DeleteFolderRequest {
52
52
 
53
53
  export interface GetFolderRequest {
54
54
  folderId: string;
55
+ withTags?: boolean;
55
56
  ksUat?: string | null;
56
57
  }
57
58
 
@@ -68,6 +69,7 @@ export interface ListFolderContentsRequest {
68
69
  export interface ListFoldersRequest {
69
70
  parentPathPartId?: string | null;
70
71
  sortOrder?: PathOrder;
72
+ withTags?: boolean;
71
73
  limit?: number;
72
74
  offset?: number;
73
75
  ksUat?: string | null;
@@ -124,6 +126,7 @@ export interface FoldersApiInterface {
124
126
  * Get a folder by its folder ID.
125
127
  * @summary Get Folder Handler
126
128
  * @param {string} folderId
129
+ * @param {boolean} [withTags] Include tags in the response (default: false)
127
130
  * @param {string} [ksUat]
128
131
  * @param {*} [options] Override http request option.
129
132
  * @throws {RequiredError}
@@ -164,6 +167,7 @@ export interface FoldersApiInterface {
164
167
  * @summary List Folders Handler
165
168
  * @param {string} [parentPathPartId] Parent PathPart ID (defaults to root)
166
169
  * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
170
+ * @param {boolean} [withTags] Include tags in the response (default: false)
167
171
  * @param {number} [limit] Number of items per page
168
172
  * @param {number} [offset] Number of items to skip
169
173
  * @param {string} [ksUat]
@@ -297,6 +301,10 @@ export class FoldersApi extends runtime.BaseAPI implements FoldersApiInterface {
297
301
 
298
302
  const queryParameters: any = {};
299
303
 
304
+ if (requestParameters['withTags'] != null) {
305
+ queryParameters['with_tags'] = requestParameters['withTags'];
306
+ }
307
+
300
308
  const headerParameters: runtime.HTTPHeaders = {};
301
309
 
302
310
 
@@ -396,6 +404,10 @@ export class FoldersApi extends runtime.BaseAPI implements FoldersApiInterface {
396
404
  queryParameters['sort_order'] = requestParameters['sortOrder'];
397
405
  }
398
406
 
407
+ if (requestParameters['withTags'] != null) {
408
+ queryParameters['with_tags'] = requestParameters['withTags'];
409
+ }
410
+
399
411
  if (requestParameters['limit'] != null) {
400
412
  queryParameters['limit'] = requestParameters['limit'];
401
413
  }
@@ -56,6 +56,13 @@ export interface ListThreadsRequest {
56
56
  ksUat?: string | null;
57
57
  }
58
58
 
59
+ export interface StreamThreadRequest {
60
+ threadId: string;
61
+ lastMessageId?: string | null;
62
+ lastEntryId?: string | null;
63
+ ksUat?: string | null;
64
+ }
65
+
59
66
  export interface UpdateThreadOperationRequest {
60
67
  threadId: string;
61
68
  updateThreadRequest: UpdateThreadRequest;
@@ -139,6 +146,25 @@ export interface ThreadsApiInterface {
139
146
  */
140
147
  listThreads(requestParameters: ListThreadsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseThreadResponse>;
141
148
 
149
+ /**
150
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
151
+ * @summary Stream Thread Handler
152
+ * @param {string} threadId
153
+ * @param {string} [lastMessageId]
154
+ * @param {string} [lastEntryId]
155
+ * @param {string} [ksUat]
156
+ * @param {*} [options] Override http request option.
157
+ * @throws {RequiredError}
158
+ * @memberof ThreadsApiInterface
159
+ */
160
+ streamThreadRaw(requestParameters: StreamThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
161
+
162
+ /**
163
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
164
+ * Stream Thread Handler
165
+ */
166
+ streamThread(requestParameters: StreamThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
167
+
142
168
  /**
143
169
  * Update a thread\'s title and/or parent_thread_id.
144
170
  * @summary Update Thread Handler
@@ -325,6 +351,52 @@ export class ThreadsApi extends runtime.BaseAPI implements ThreadsApiInterface {
325
351
  return await response.value();
326
352
  }
327
353
 
354
+ /**
355
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
356
+ * Stream Thread Handler
357
+ */
358
+ async streamThreadRaw(requestParameters: StreamThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
359
+ if (requestParameters['threadId'] == null) {
360
+ throw new runtime.RequiredError(
361
+ 'threadId',
362
+ 'Required parameter "threadId" was null or undefined when calling streamThread().'
363
+ );
364
+ }
365
+
366
+ const queryParameters: any = {};
367
+
368
+ if (requestParameters['lastMessageId'] != null) {
369
+ queryParameters['last_message_id'] = requestParameters['lastMessageId'];
370
+ }
371
+
372
+ if (requestParameters['lastEntryId'] != null) {
373
+ queryParameters['last_entry_id'] = requestParameters['lastEntryId'];
374
+ }
375
+
376
+ const headerParameters: runtime.HTTPHeaders = {};
377
+
378
+
379
+ let urlPath = `/v1/threads/{thread_id}/stream`;
380
+ urlPath = urlPath.replace(`{${"thread_id"}}`, encodeURIComponent(String(requestParameters['threadId'])));
381
+
382
+ const response = await this.request({
383
+ path: urlPath,
384
+ method: 'GET',
385
+ headers: headerParameters,
386
+ query: queryParameters,
387
+ }, initOverrides);
388
+
389
+ return new runtime.VoidApiResponse(response);
390
+ }
391
+
392
+ /**
393
+ * SSE endpoint for streaming thread messages. Opens a server-sent event stream for the given thread. Optionally replays missed entries if last_message_id and last_entry_id are provided.
394
+ * Stream Thread Handler
395
+ */
396
+ async streamThread(requestParameters: StreamThreadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
397
+ await this.streamThreadRaw(requestParameters, initOverrides);
398
+ }
399
+
328
400
  /**
329
401
  * Update a thread\'s title and/or parent_thread_id.
330
402
  * Update Thread Handler
@@ -20,6 +20,13 @@ import {
20
20
  DocumentOriginToJSON,
21
21
  DocumentOriginToJSONTyped,
22
22
  } from './DocumentOrigin';
23
+ import type { TagResponse } from './TagResponse';
24
+ import {
25
+ TagResponseFromJSON,
26
+ TagResponseFromJSONTyped,
27
+ TagResponseToJSON,
28
+ TagResponseToJSONTyped,
29
+ } from './TagResponse';
23
30
  import type { DocumentType } from './DocumentType';
24
31
  import {
25
32
  DocumentTypeFromJSON,
@@ -119,6 +126,12 @@ export interface DocumentResponse {
119
126
  * @memberof DocumentResponse
120
127
  */
121
128
  updatedAt: Date;
129
+ /**
130
+ * Tags attached to this document
131
+ * @type {Array<TagResponse>}
132
+ * @memberof DocumentResponse
133
+ */
134
+ tags?: Array<TagResponse> | null;
122
135
  }
123
136
 
124
137
 
@@ -166,6 +179,7 @@ export function DocumentResponseFromJSONTyped(json: any, ignoreDiscriminator: bo
166
179
  'tenantId': json['tenant_id'],
167
180
  'createdAt': (new Date(json['created_at'])),
168
181
  'updatedAt': (new Date(json['updated_at'])),
182
+ 'tags': json['tags'] == null ? undefined : ((json['tags'] as Array<any>).map(TagResponseFromJSON)),
169
183
  };
170
184
  }
171
185
 
@@ -193,6 +207,7 @@ export function DocumentResponseToJSONTyped(value?: DocumentResponse | null, ign
193
207
  'tenant_id': value['tenantId'],
194
208
  'created_at': value['createdAt'].toISOString(),
195
209
  'updated_at': value['updatedAt'].toISOString(),
210
+ 'tags': value['tags'] == null ? undefined : ((value['tags'] as Array<any>).map(TagResponseToJSON)),
196
211
  };
197
212
  }
198
213
 
@@ -13,6 +13,14 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { TagResponse } from './TagResponse';
17
+ import {
18
+ TagResponseFromJSON,
19
+ TagResponseFromJSONTyped,
20
+ TagResponseToJSON,
21
+ TagResponseToJSONTyped,
22
+ } from './TagResponse';
23
+
16
24
  /**
17
25
  * Folder response model.
18
26
  * @export
@@ -73,6 +81,12 @@ export interface FolderResponse {
73
81
  * @memberof FolderResponse
74
82
  */
75
83
  updatedAt: Date;
84
+ /**
85
+ * Tags attached to this folder
86
+ * @type {Array<TagResponse>}
87
+ * @memberof FolderResponse
88
+ */
89
+ tags?: Array<TagResponse> | null;
76
90
  }
77
91
 
78
92
  /**
@@ -110,6 +124,7 @@ export function FolderResponseFromJSONTyped(json: any, ignoreDiscriminator: bool
110
124
  'tenantId': json['tenant_id'],
111
125
  'createdAt': (new Date(json['created_at'])),
112
126
  'updatedAt': (new Date(json['updated_at'])),
127
+ 'tags': json['tags'] == null ? undefined : ((json['tags'] as Array<any>).map(TagResponseFromJSON)),
113
128
  };
114
129
  }
115
130
 
@@ -133,6 +148,7 @@ export function FolderResponseToJSONTyped(value?: FolderResponse | null, ignoreD
133
148
  'tenant_id': value['tenantId'],
134
149
  'created_at': value['createdAt'].toISOString(),
135
150
  'updated_at': value['updatedAt'].toISOString(),
151
+ 'tags': value['tags'] == null ? undefined : ((value['tags'] as Array<any>).map(TagResponseToJSON)),
136
152
  };
137
153
  }
138
154