@knowledge-stack/ksapi 1.20.1 → 1.22.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/.openapi-generator/FILES +2 -1
- package/README.md +2 -2
- package/dist/apis/DocumentsApi.d.ts +4 -0
- package/dist/apis/DocumentsApi.js +6 -0
- package/dist/apis/FoldersApi.d.ts +10 -4
- package/dist/apis/FoldersApi.js +11 -2
- package/dist/apis/PathPartsApi.d.ts +67 -5
- package/dist/apis/PathPartsApi.js +76 -2
- package/dist/apis/TagsApi.d.ts +1 -63
- package/dist/apis/TagsApi.js +0 -72
- package/dist/apis/ThreadsApi.d.ts +33 -0
- package/dist/apis/ThreadsApi.js +37 -0
- package/dist/esm/apis/DocumentsApi.d.ts +4 -0
- package/dist/esm/apis/DocumentsApi.js +6 -0
- package/dist/esm/apis/FoldersApi.d.ts +10 -4
- package/dist/esm/apis/FoldersApi.js +11 -2
- package/dist/esm/apis/PathPartsApi.d.ts +67 -5
- package/dist/esm/apis/PathPartsApi.js +77 -3
- package/dist/esm/apis/TagsApi.d.ts +1 -63
- package/dist/esm/apis/TagsApi.js +1 -73
- package/dist/esm/apis/ThreadsApi.d.ts +33 -0
- package/dist/esm/apis/ThreadsApi.js +37 -0
- package/dist/esm/models/BulkTagRequest.d.ts +47 -0
- package/dist/esm/models/BulkTagRequest.js +49 -0
- package/dist/esm/models/DocumentResponse.d.ts +7 -0
- package/dist/esm/models/DocumentResponse.js +3 -0
- package/dist/esm/models/FolderDocumentResponse.d.ts +7 -0
- package/dist/esm/models/FolderDocumentResponse.js +3 -0
- package/dist/esm/models/FolderResponse.d.ts +7 -0
- package/dist/esm/models/FolderResponse.js +3 -0
- package/dist/esm/models/PathPartResponse.d.ts +7 -0
- package/dist/esm/models/PathPartResponse.js +3 -0
- package/dist/esm/models/PathPartTagsResponse.d.ts +48 -0
- package/dist/esm/models/PathPartTagsResponse.js +45 -0
- package/dist/esm/models/index.d.ts +2 -1
- package/dist/esm/models/index.js +2 -1
- package/dist/models/BulkTagRequest.d.ts +47 -0
- package/dist/models/BulkTagRequest.js +57 -0
- package/dist/models/DocumentResponse.d.ts +7 -0
- package/dist/models/DocumentResponse.js +3 -0
- package/dist/models/FolderDocumentResponse.d.ts +7 -0
- package/dist/models/FolderDocumentResponse.js +3 -0
- package/dist/models/FolderResponse.d.ts +7 -0
- package/dist/models/FolderResponse.js +3 -0
- package/dist/models/PathPartResponse.d.ts +7 -0
- package/dist/models/PathPartResponse.js +3 -0
- package/dist/models/PathPartTagsResponse.d.ts +48 -0
- package/dist/models/PathPartTagsResponse.js +53 -0
- package/dist/models/index.d.ts +2 -1
- package/dist/models/index.js +2 -1
- package/package.json +1 -1
- package/src/apis/DocumentsApi.ts +12 -0
- package/src/apis/FoldersApi.ts +22 -4
- package/src/apis/PathPartsApi.ts +156 -4
- package/src/apis/TagsApi.ts +0 -146
- package/src/apis/ThreadsApi.ts +72 -0
- package/src/models/BulkTagRequest.ts +87 -0
- package/src/models/DocumentResponse.ts +15 -0
- package/src/models/FolderDocumentResponse.ts +15 -0
- package/src/models/FolderResponse.ts +16 -0
- package/src/models/PathPartResponse.ts +15 -0
- package/src/models/PathPartTagsResponse.ts +91 -0
- package/src/models/index.ts +2 -1
- package/dist/esm/models/TagPathPartRequest.d.ts +0 -47
- package/dist/esm/models/TagPathPartRequest.js +0 -44
- package/dist/models/TagPathPartRequest.d.ts +0 -47
- package/dist/models/TagPathPartRequest.js +0 -52
- package/src/models/TagPathPartRequest.ts +0 -83
package/src/apis/PathPartsApi.ts
CHANGED
|
@@ -15,12 +15,16 @@
|
|
|
15
15
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
|
+
BulkTagRequest,
|
|
18
19
|
HTTPValidationError,
|
|
19
20
|
PaginatedResponsePathPartResponse,
|
|
20
21
|
PathOrder,
|
|
21
22
|
PathPartResponse,
|
|
23
|
+
PathPartTagsResponse,
|
|
22
24
|
} from '../models/index';
|
|
23
25
|
import {
|
|
26
|
+
BulkTagRequestFromJSON,
|
|
27
|
+
BulkTagRequestToJSON,
|
|
24
28
|
HTTPValidationErrorFromJSON,
|
|
25
29
|
HTTPValidationErrorToJSON,
|
|
26
30
|
PaginatedResponsePathPartResponseFromJSON,
|
|
@@ -29,8 +33,22 @@ import {
|
|
|
29
33
|
PathOrderToJSON,
|
|
30
34
|
PathPartResponseFromJSON,
|
|
31
35
|
PathPartResponseToJSON,
|
|
36
|
+
PathPartTagsResponseFromJSON,
|
|
37
|
+
PathPartTagsResponseToJSON,
|
|
32
38
|
} from '../models/index';
|
|
33
39
|
|
|
40
|
+
export interface BulkAddPathPartTagsRequest {
|
|
41
|
+
pathPartId: string;
|
|
42
|
+
bulkTagRequest: BulkTagRequest;
|
|
43
|
+
ksUat?: string | null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface BulkRemovePathPartTagsRequest {
|
|
47
|
+
pathPartId: string;
|
|
48
|
+
bulkTagRequest: BulkTagRequest;
|
|
49
|
+
ksUat?: string | null;
|
|
50
|
+
}
|
|
51
|
+
|
|
34
52
|
export interface GetPathPartRequest {
|
|
35
53
|
pathPartId: string;
|
|
36
54
|
ksUat?: string | null;
|
|
@@ -53,7 +71,43 @@ export interface ListPathPartsRequest {
|
|
|
53
71
|
*/
|
|
54
72
|
export interface PathPartsApiInterface {
|
|
55
73
|
/**
|
|
56
|
-
*
|
|
74
|
+
* Bulk add tags to a path part. Idempotent — already-attached tags are skipped. Returns 400 if any tag_id doesn\'t exist (FK violation). Requires write permission on the target path part.
|
|
75
|
+
* @summary Bulk Add Path Part Tags Handler
|
|
76
|
+
* @param {string} pathPartId
|
|
77
|
+
* @param {BulkTagRequest} bulkTagRequest
|
|
78
|
+
* @param {string} [ksUat]
|
|
79
|
+
* @param {*} [options] Override http request option.
|
|
80
|
+
* @throws {RequiredError}
|
|
81
|
+
* @memberof PathPartsApiInterface
|
|
82
|
+
*/
|
|
83
|
+
bulkAddPathPartTagsRaw(requestParameters: BulkAddPathPartTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartTagsResponse>>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Bulk add tags to a path part. Idempotent — already-attached tags are skipped. Returns 400 if any tag_id doesn\'t exist (FK violation). Requires write permission on the target path part.
|
|
87
|
+
* Bulk Add Path Part Tags Handler
|
|
88
|
+
*/
|
|
89
|
+
bulkAddPathPartTags(requestParameters: BulkAddPathPartTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartTagsResponse>;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Bulk remove tags from a path part. Silently ignores tags that aren\'t attached. Requires write permission on the target path part.
|
|
93
|
+
* @summary Bulk Remove Path Part Tags Handler
|
|
94
|
+
* @param {string} pathPartId
|
|
95
|
+
* @param {BulkTagRequest} bulkTagRequest
|
|
96
|
+
* @param {string} [ksUat]
|
|
97
|
+
* @param {*} [options] Override http request option.
|
|
98
|
+
* @throws {RequiredError}
|
|
99
|
+
* @memberof PathPartsApiInterface
|
|
100
|
+
*/
|
|
101
|
+
bulkRemovePathPartTagsRaw(requestParameters: BulkRemovePathPartTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartTagsResponse>>;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Bulk remove tags from a path part. Silently ignores tags that aren\'t attached. Requires write permission on the target path part.
|
|
105
|
+
* Bulk Remove Path Part Tags Handler
|
|
106
|
+
*/
|
|
107
|
+
bulkRemovePathPartTags(requestParameters: BulkRemovePathPartTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartTagsResponse>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Get a path part by its ID. Returns the path part with its attached tag IDs.
|
|
57
111
|
* @summary Get Path Part Handler
|
|
58
112
|
* @param {string} pathPartId
|
|
59
113
|
* @param {string} [ksUat]
|
|
@@ -64,7 +118,7 @@ export interface PathPartsApiInterface {
|
|
|
64
118
|
getPathPartRaw(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartResponse>>;
|
|
65
119
|
|
|
66
120
|
/**
|
|
67
|
-
* Get a path part by its ID. Returns the path part
|
|
121
|
+
* Get a path part by its ID. Returns the path part with its attached tag IDs.
|
|
68
122
|
* Get Path Part Handler
|
|
69
123
|
*/
|
|
70
124
|
getPathPart(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartResponse>;
|
|
@@ -98,7 +152,105 @@ export interface PathPartsApiInterface {
|
|
|
98
152
|
export class PathPartsApi extends runtime.BaseAPI implements PathPartsApiInterface {
|
|
99
153
|
|
|
100
154
|
/**
|
|
101
|
-
*
|
|
155
|
+
* Bulk add tags to a path part. Idempotent — already-attached tags are skipped. Returns 400 if any tag_id doesn\'t exist (FK violation). Requires write permission on the target path part.
|
|
156
|
+
* Bulk Add Path Part Tags Handler
|
|
157
|
+
*/
|
|
158
|
+
async bulkAddPathPartTagsRaw(requestParameters: BulkAddPathPartTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartTagsResponse>> {
|
|
159
|
+
if (requestParameters['pathPartId'] == null) {
|
|
160
|
+
throw new runtime.RequiredError(
|
|
161
|
+
'pathPartId',
|
|
162
|
+
'Required parameter "pathPartId" was null or undefined when calling bulkAddPathPartTags().'
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (requestParameters['bulkTagRequest'] == null) {
|
|
167
|
+
throw new runtime.RequiredError(
|
|
168
|
+
'bulkTagRequest',
|
|
169
|
+
'Required parameter "bulkTagRequest" was null or undefined when calling bulkAddPathPartTags().'
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const queryParameters: any = {};
|
|
174
|
+
|
|
175
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
176
|
+
|
|
177
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
let urlPath = `/v1/path-parts/{path_part_id}/tags`;
|
|
181
|
+
urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
|
|
182
|
+
|
|
183
|
+
const response = await this.request({
|
|
184
|
+
path: urlPath,
|
|
185
|
+
method: 'POST',
|
|
186
|
+
headers: headerParameters,
|
|
187
|
+
query: queryParameters,
|
|
188
|
+
body: BulkTagRequestToJSON(requestParameters['bulkTagRequest']),
|
|
189
|
+
}, initOverrides);
|
|
190
|
+
|
|
191
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PathPartTagsResponseFromJSON(jsonValue));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Bulk add tags to a path part. Idempotent — already-attached tags are skipped. Returns 400 if any tag_id doesn\'t exist (FK violation). Requires write permission on the target path part.
|
|
196
|
+
* Bulk Add Path Part Tags Handler
|
|
197
|
+
*/
|
|
198
|
+
async bulkAddPathPartTags(requestParameters: BulkAddPathPartTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartTagsResponse> {
|
|
199
|
+
const response = await this.bulkAddPathPartTagsRaw(requestParameters, initOverrides);
|
|
200
|
+
return await response.value();
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Bulk remove tags from a path part. Silently ignores tags that aren\'t attached. Requires write permission on the target path part.
|
|
205
|
+
* Bulk Remove Path Part Tags Handler
|
|
206
|
+
*/
|
|
207
|
+
async bulkRemovePathPartTagsRaw(requestParameters: BulkRemovePathPartTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartTagsResponse>> {
|
|
208
|
+
if (requestParameters['pathPartId'] == null) {
|
|
209
|
+
throw new runtime.RequiredError(
|
|
210
|
+
'pathPartId',
|
|
211
|
+
'Required parameter "pathPartId" was null or undefined when calling bulkRemovePathPartTags().'
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if (requestParameters['bulkTagRequest'] == null) {
|
|
216
|
+
throw new runtime.RequiredError(
|
|
217
|
+
'bulkTagRequest',
|
|
218
|
+
'Required parameter "bulkTagRequest" was null or undefined when calling bulkRemovePathPartTags().'
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const queryParameters: any = {};
|
|
223
|
+
|
|
224
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
225
|
+
|
|
226
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
let urlPath = `/v1/path-parts/{path_part_id}/tags`;
|
|
230
|
+
urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
|
|
231
|
+
|
|
232
|
+
const response = await this.request({
|
|
233
|
+
path: urlPath,
|
|
234
|
+
method: 'DELETE',
|
|
235
|
+
headers: headerParameters,
|
|
236
|
+
query: queryParameters,
|
|
237
|
+
body: BulkTagRequestToJSON(requestParameters['bulkTagRequest']),
|
|
238
|
+
}, initOverrides);
|
|
239
|
+
|
|
240
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PathPartTagsResponseFromJSON(jsonValue));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Bulk remove tags from a path part. Silently ignores tags that aren\'t attached. Requires write permission on the target path part.
|
|
245
|
+
* Bulk Remove Path Part Tags Handler
|
|
246
|
+
*/
|
|
247
|
+
async bulkRemovePathPartTags(requestParameters: BulkRemovePathPartTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartTagsResponse> {
|
|
248
|
+
const response = await this.bulkRemovePathPartTagsRaw(requestParameters, initOverrides);
|
|
249
|
+
return await response.value();
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Get a path part by its ID. Returns the path part with its attached tag IDs.
|
|
102
254
|
* Get Path Part Handler
|
|
103
255
|
*/
|
|
104
256
|
async getPathPartRaw(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartResponse>> {
|
|
@@ -128,7 +280,7 @@ export class PathPartsApi extends runtime.BaseAPI implements PathPartsApiInterfa
|
|
|
128
280
|
}
|
|
129
281
|
|
|
130
282
|
/**
|
|
131
|
-
* Get a path part by its ID. Returns the path part
|
|
283
|
+
* Get a path part by its ID. Returns the path part with its attached tag IDs.
|
|
132
284
|
* Get Path Part Handler
|
|
133
285
|
*/
|
|
134
286
|
async getPathPart(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartResponse> {
|
package/src/apis/TagsApi.ts
CHANGED
|
@@ -18,7 +18,6 @@ import type {
|
|
|
18
18
|
CreateTagRequest,
|
|
19
19
|
HTTPValidationError,
|
|
20
20
|
PaginatedResponseTagResponse,
|
|
21
|
-
TagPathPartRequest,
|
|
22
21
|
TagResponse,
|
|
23
22
|
UpdateTagRequest,
|
|
24
23
|
} from '../models/index';
|
|
@@ -29,20 +28,12 @@ import {
|
|
|
29
28
|
HTTPValidationErrorToJSON,
|
|
30
29
|
PaginatedResponseTagResponseFromJSON,
|
|
31
30
|
PaginatedResponseTagResponseToJSON,
|
|
32
|
-
TagPathPartRequestFromJSON,
|
|
33
|
-
TagPathPartRequestToJSON,
|
|
34
31
|
TagResponseFromJSON,
|
|
35
32
|
TagResponseToJSON,
|
|
36
33
|
UpdateTagRequestFromJSON,
|
|
37
34
|
UpdateTagRequestToJSON,
|
|
38
35
|
} from '../models/index';
|
|
39
36
|
|
|
40
|
-
export interface AttachTagToPathPartRequest {
|
|
41
|
-
tagId: string;
|
|
42
|
-
tagPathPartRequest: TagPathPartRequest;
|
|
43
|
-
ksUat?: string | null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
37
|
export interface CreateTagOperationRequest {
|
|
47
38
|
createTagRequest: CreateTagRequest;
|
|
48
39
|
ksUat?: string | null;
|
|
@@ -53,12 +44,6 @@ export interface DeleteTagRequest {
|
|
|
53
44
|
ksUat?: string | null;
|
|
54
45
|
}
|
|
55
46
|
|
|
56
|
-
export interface DetachTagFromPathPartRequest {
|
|
57
|
-
tagId: string;
|
|
58
|
-
pathPartId: string;
|
|
59
|
-
ksUat?: string | null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
47
|
export interface GetTagRequest {
|
|
63
48
|
tagId: string;
|
|
64
49
|
ksUat?: string | null;
|
|
@@ -83,24 +68,6 @@ export interface UpdateTagOperationRequest {
|
|
|
83
68
|
* @interface TagsApiInterface
|
|
84
69
|
*/
|
|
85
70
|
export interface TagsApiInterface {
|
|
86
|
-
/**
|
|
87
|
-
* Attach a tag to a path part. Requires ADMIN or OWNER role.
|
|
88
|
-
* @summary Attach Tag Handler
|
|
89
|
-
* @param {string} tagId
|
|
90
|
-
* @param {TagPathPartRequest} tagPathPartRequest
|
|
91
|
-
* @param {string} [ksUat]
|
|
92
|
-
* @param {*} [options] Override http request option.
|
|
93
|
-
* @throws {RequiredError}
|
|
94
|
-
* @memberof TagsApiInterface
|
|
95
|
-
*/
|
|
96
|
-
attachTagToPathPartRaw(requestParameters: AttachTagToPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TagResponse>>;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Attach a tag to a path part. Requires ADMIN or OWNER role.
|
|
100
|
-
* Attach Tag Handler
|
|
101
|
-
*/
|
|
102
|
-
attachTagToPathPart(requestParameters: AttachTagToPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TagResponse>;
|
|
103
|
-
|
|
104
71
|
/**
|
|
105
72
|
* Create a new tag for the current tenant. Requires ADMIN or OWNER role.
|
|
106
73
|
* @summary Create Tag Handler
|
|
@@ -135,24 +102,6 @@ export interface TagsApiInterface {
|
|
|
135
102
|
*/
|
|
136
103
|
deleteTag(requestParameters: DeleteTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
137
104
|
|
|
138
|
-
/**
|
|
139
|
-
* Detach a tag from a path part. Requires ADMIN or OWNER role.
|
|
140
|
-
* @summary Detach Tag Handler
|
|
141
|
-
* @param {string} tagId
|
|
142
|
-
* @param {string} pathPartId
|
|
143
|
-
* @param {string} [ksUat]
|
|
144
|
-
* @param {*} [options] Override http request option.
|
|
145
|
-
* @throws {RequiredError}
|
|
146
|
-
* @memberof TagsApiInterface
|
|
147
|
-
*/
|
|
148
|
-
detachTagFromPathPartRaw(requestParameters: DetachTagFromPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Detach a tag from a path part. Requires ADMIN or OWNER role.
|
|
152
|
-
* Detach Tag Handler
|
|
153
|
-
*/
|
|
154
|
-
detachTagFromPathPart(requestParameters: DetachTagFromPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
155
|
-
|
|
156
105
|
/**
|
|
157
106
|
* Get a tag by its ID.
|
|
158
107
|
* @summary Get Tag Handler
|
|
@@ -213,55 +162,6 @@ export interface TagsApiInterface {
|
|
|
213
162
|
*/
|
|
214
163
|
export class TagsApi extends runtime.BaseAPI implements TagsApiInterface {
|
|
215
164
|
|
|
216
|
-
/**
|
|
217
|
-
* Attach a tag to a path part. Requires ADMIN or OWNER role.
|
|
218
|
-
* Attach Tag Handler
|
|
219
|
-
*/
|
|
220
|
-
async attachTagToPathPartRaw(requestParameters: AttachTagToPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TagResponse>> {
|
|
221
|
-
if (requestParameters['tagId'] == null) {
|
|
222
|
-
throw new runtime.RequiredError(
|
|
223
|
-
'tagId',
|
|
224
|
-
'Required parameter "tagId" was null or undefined when calling attachTagToPathPart().'
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
if (requestParameters['tagPathPartRequest'] == null) {
|
|
229
|
-
throw new runtime.RequiredError(
|
|
230
|
-
'tagPathPartRequest',
|
|
231
|
-
'Required parameter "tagPathPartRequest" was null or undefined when calling attachTagToPathPart().'
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
const queryParameters: any = {};
|
|
236
|
-
|
|
237
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
238
|
-
|
|
239
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
let urlPath = `/v1/tags/{tag_id}/path-parts`;
|
|
243
|
-
urlPath = urlPath.replace(`{${"tag_id"}}`, encodeURIComponent(String(requestParameters['tagId'])));
|
|
244
|
-
|
|
245
|
-
const response = await this.request({
|
|
246
|
-
path: urlPath,
|
|
247
|
-
method: 'POST',
|
|
248
|
-
headers: headerParameters,
|
|
249
|
-
query: queryParameters,
|
|
250
|
-
body: TagPathPartRequestToJSON(requestParameters['tagPathPartRequest']),
|
|
251
|
-
}, initOverrides);
|
|
252
|
-
|
|
253
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => TagResponseFromJSON(jsonValue));
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Attach a tag to a path part. Requires ADMIN or OWNER role.
|
|
258
|
-
* Attach Tag Handler
|
|
259
|
-
*/
|
|
260
|
-
async attachTagToPathPart(requestParameters: AttachTagToPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TagResponse> {
|
|
261
|
-
const response = await this.attachTagToPathPartRaw(requestParameters, initOverrides);
|
|
262
|
-
return await response.value();
|
|
263
|
-
}
|
|
264
|
-
|
|
265
165
|
/**
|
|
266
166
|
* Create a new tag for the current tenant. Requires ADMIN or OWNER role.
|
|
267
167
|
* Create Tag Handler
|
|
@@ -341,52 +241,6 @@ export class TagsApi extends runtime.BaseAPI implements TagsApiInterface {
|
|
|
341
241
|
await this.deleteTagRaw(requestParameters, initOverrides);
|
|
342
242
|
}
|
|
343
243
|
|
|
344
|
-
/**
|
|
345
|
-
* Detach a tag from a path part. Requires ADMIN or OWNER role.
|
|
346
|
-
* Detach Tag Handler
|
|
347
|
-
*/
|
|
348
|
-
async detachTagFromPathPartRaw(requestParameters: DetachTagFromPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
349
|
-
if (requestParameters['tagId'] == null) {
|
|
350
|
-
throw new runtime.RequiredError(
|
|
351
|
-
'tagId',
|
|
352
|
-
'Required parameter "tagId" was null or undefined when calling detachTagFromPathPart().'
|
|
353
|
-
);
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
if (requestParameters['pathPartId'] == null) {
|
|
357
|
-
throw new runtime.RequiredError(
|
|
358
|
-
'pathPartId',
|
|
359
|
-
'Required parameter "pathPartId" was null or undefined when calling detachTagFromPathPart().'
|
|
360
|
-
);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
const queryParameters: any = {};
|
|
364
|
-
|
|
365
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
let urlPath = `/v1/tags/{tag_id}/path-parts/{path_part_id}`;
|
|
369
|
-
urlPath = urlPath.replace(`{${"tag_id"}}`, encodeURIComponent(String(requestParameters['tagId'])));
|
|
370
|
-
urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
|
|
371
|
-
|
|
372
|
-
const response = await this.request({
|
|
373
|
-
path: urlPath,
|
|
374
|
-
method: 'DELETE',
|
|
375
|
-
headers: headerParameters,
|
|
376
|
-
query: queryParameters,
|
|
377
|
-
}, initOverrides);
|
|
378
|
-
|
|
379
|
-
return new runtime.VoidApiResponse(response);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Detach a tag from a path part. Requires ADMIN or OWNER role.
|
|
384
|
-
* Detach Tag Handler
|
|
385
|
-
*/
|
|
386
|
-
async detachTagFromPathPart(requestParameters: DetachTagFromPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
387
|
-
await this.detachTagFromPathPartRaw(requestParameters, initOverrides);
|
|
388
|
-
}
|
|
389
|
-
|
|
390
244
|
/**
|
|
391
245
|
* Get a tag by its ID.
|
|
392
246
|
* Get Tag Handler
|
package/src/apis/ThreadsApi.ts
CHANGED
|
@@ -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
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
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
|
+
* Request to bulk add or remove tags from a path part.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface BulkTagRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface BulkTagRequest {
|
|
22
|
+
/**
|
|
23
|
+
* List of tag IDs to add/remove
|
|
24
|
+
* @type {Array<string>}
|
|
25
|
+
* @memberof BulkTagRequest
|
|
26
|
+
*/
|
|
27
|
+
tagIds: Array<string>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the BulkTagRequest interface.
|
|
32
|
+
*/
|
|
33
|
+
export function instanceOfBulkTagRequest(value: object): value is BulkTagRequest {
|
|
34
|
+
if (!('tagIds' in value) || value['tagIds'] === undefined) return false;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function BulkTagRequestFromJSON(json: any): BulkTagRequest {
|
|
39
|
+
return BulkTagRequestFromJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function BulkTagRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkTagRequest {
|
|
43
|
+
if (json == null) {
|
|
44
|
+
return json;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
|
|
48
|
+
'tagIds': json['tag_ids'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function BulkTagRequestToJSON(json: any): BulkTagRequest {
|
|
53
|
+
return BulkTagRequestToJSONTyped(json, false);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function BulkTagRequestToJSONTyped(value?: BulkTagRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
57
|
+
if (value == null) {
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'tag_ids': value['tagIds'],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const BulkTagRequestPropertyValidationAttributesMap: {
|
|
68
|
+
[property: string]: {
|
|
69
|
+
maxLength?: number,
|
|
70
|
+
minLength?: number,
|
|
71
|
+
pattern?: string,
|
|
72
|
+
maximum?: number,
|
|
73
|
+
exclusiveMaximum?: boolean,
|
|
74
|
+
minimum?: number,
|
|
75
|
+
exclusiveMinimum?: boolean,
|
|
76
|
+
multipleOf?: number,
|
|
77
|
+
maxItems?: number,
|
|
78
|
+
minItems?: number,
|
|
79
|
+
uniqueItems?: boolean
|
|
80
|
+
}
|
|
81
|
+
} = {
|
|
82
|
+
tagIds: {
|
|
83
|
+
maxItems: 10,
|
|
84
|
+
uniqueItems: false,
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
|
|
@@ -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
|
|
|
@@ -27,6 +27,13 @@ import {
|
|
|
27
27
|
PartTypeToJSON,
|
|
28
28
|
PartTypeToJSONTyped,
|
|
29
29
|
} from './PartType';
|
|
30
|
+
import type { TagResponse } from './TagResponse';
|
|
31
|
+
import {
|
|
32
|
+
TagResponseFromJSON,
|
|
33
|
+
TagResponseFromJSONTyped,
|
|
34
|
+
TagResponseToJSON,
|
|
35
|
+
TagResponseToJSONTyped,
|
|
36
|
+
} from './TagResponse';
|
|
30
37
|
import type { DocumentType } from './DocumentType';
|
|
31
38
|
import {
|
|
32
39
|
DocumentTypeFromJSON,
|
|
@@ -99,6 +106,12 @@ export interface FolderDocumentResponse {
|
|
|
99
106
|
* @memberof FolderDocumentResponse
|
|
100
107
|
*/
|
|
101
108
|
systemManaged: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Tags attached to this path part
|
|
111
|
+
* @type {Array<TagResponse>}
|
|
112
|
+
* @memberof FolderDocumentResponse
|
|
113
|
+
*/
|
|
114
|
+
tags?: Array<TagResponse> | null;
|
|
102
115
|
/**
|
|
103
116
|
* Creation timestamp
|
|
104
117
|
* @type {Date}
|
|
@@ -191,6 +204,7 @@ export function FolderDocumentResponseFromJSONTyped(json: any, ignoreDiscriminat
|
|
|
191
204
|
'metadataObjId': json['metadata_obj_id'],
|
|
192
205
|
'materializedPath': json['materialized_path'],
|
|
193
206
|
'systemManaged': json['system_managed'],
|
|
207
|
+
'tags': json['tags'] == null ? undefined : ((json['tags'] as Array<any>).map(TagResponseFromJSON)),
|
|
194
208
|
'createdAt': (new Date(json['created_at'])),
|
|
195
209
|
'updatedAt': (new Date(json['updated_at'])),
|
|
196
210
|
'folderId': json['folder_id'] == null ? undefined : json['folder_id'],
|
|
@@ -221,6 +235,7 @@ export function FolderDocumentResponseToJSONTyped(value?: FolderDocumentResponse
|
|
|
221
235
|
'metadata_obj_id': value['metadataObjId'],
|
|
222
236
|
'materialized_path': value['materializedPath'],
|
|
223
237
|
'system_managed': value['systemManaged'],
|
|
238
|
+
'tags': value['tags'] == null ? undefined : ((value['tags'] as Array<any>).map(TagResponseToJSON)),
|
|
224
239
|
'created_at': value['createdAt'].toISOString(),
|
|
225
240
|
'updated_at': value['updatedAt'].toISOString(),
|
|
226
241
|
'folder_id': value['folderId'],
|