@knowledge-stack/ksapi 1.11.2 → 1.12.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 +6 -0
- package/README.md +2 -2
- package/dist/apis/TagsApi.d.ts +237 -0
- package/dist/apis/TagsApi.js +272 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/TagsApi.d.ts +237 -0
- package/dist/esm/apis/TagsApi.js +268 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/CreateTagRequest.d.ts +59 -0
- package/dist/esm/models/CreateTagRequest.js +61 -0
- package/dist/esm/models/PaginatedResponseTagResponse.d.ts +66 -0
- package/dist/esm/models/PaginatedResponseTagResponse.js +70 -0
- package/dist/esm/models/TagPathPartRequest.d.ts +47 -0
- package/dist/esm/models/TagPathPartRequest.js +44 -0
- package/dist/esm/models/TagResponse.d.ts +83 -0
- package/dist/esm/models/TagResponse.js +66 -0
- package/dist/esm/models/UpdateTagRequest.d.ts +59 -0
- package/dist/esm/models/UpdateTagRequest.js +59 -0
- package/dist/esm/models/index.d.ts +5 -0
- package/dist/esm/models/index.js +5 -0
- package/dist/models/CreateTagRequest.d.ts +59 -0
- package/dist/models/CreateTagRequest.js +69 -0
- package/dist/models/PaginatedResponseTagResponse.d.ts +66 -0
- package/dist/models/PaginatedResponseTagResponse.js +78 -0
- package/dist/models/TagPathPartRequest.d.ts +47 -0
- package/dist/models/TagPathPartRequest.js +52 -0
- package/dist/models/TagResponse.d.ts +83 -0
- package/dist/models/TagResponse.js +74 -0
- package/dist/models/UpdateTagRequest.d.ts +59 -0
- package/dist/models/UpdateTagRequest.js +67 -0
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +5 -0
- package/package.json +1 -1
- package/src/apis/TagsApi.ts +517 -0
- package/src/apis/index.ts +1 -0
- package/src/models/CreateTagRequest.ts +111 -0
- package/src/models/PaginatedResponseTagResponse.ts +130 -0
- package/src/models/TagPathPartRequest.ts +83 -0
- package/src/models/TagResponse.ts +136 -0
- package/src/models/UpdateTagRequest.ts +110 -0
- package/src/models/index.ts +5 -0
|
@@ -0,0 +1,517 @@
|
|
|
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
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
CreateTagRequest,
|
|
19
|
+
HTTPValidationError,
|
|
20
|
+
PaginatedResponseTagResponse,
|
|
21
|
+
TagPathPartRequest,
|
|
22
|
+
TagResponse,
|
|
23
|
+
UpdateTagRequest,
|
|
24
|
+
} from '../models/index';
|
|
25
|
+
import {
|
|
26
|
+
CreateTagRequestFromJSON,
|
|
27
|
+
CreateTagRequestToJSON,
|
|
28
|
+
HTTPValidationErrorFromJSON,
|
|
29
|
+
HTTPValidationErrorToJSON,
|
|
30
|
+
PaginatedResponseTagResponseFromJSON,
|
|
31
|
+
PaginatedResponseTagResponseToJSON,
|
|
32
|
+
TagPathPartRequestFromJSON,
|
|
33
|
+
TagPathPartRequestToJSON,
|
|
34
|
+
TagResponseFromJSON,
|
|
35
|
+
TagResponseToJSON,
|
|
36
|
+
UpdateTagRequestFromJSON,
|
|
37
|
+
UpdateTagRequestToJSON,
|
|
38
|
+
} from '../models/index';
|
|
39
|
+
|
|
40
|
+
export interface AttachTagToPathPartRequest {
|
|
41
|
+
tagId: string;
|
|
42
|
+
tagPathPartRequest: TagPathPartRequest;
|
|
43
|
+
ksUat?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface CreateTagOperationRequest {
|
|
47
|
+
createTagRequest: CreateTagRequest;
|
|
48
|
+
ksUat?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface DeleteTagRequest {
|
|
52
|
+
tagId: string;
|
|
53
|
+
ksUat?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface DetachTagFromPathPartRequest {
|
|
57
|
+
tagId: string;
|
|
58
|
+
pathPartId: string;
|
|
59
|
+
ksUat?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface GetTagRequest {
|
|
63
|
+
tagId: string;
|
|
64
|
+
ksUat?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface ListTagsRequest {
|
|
68
|
+
limit?: number;
|
|
69
|
+
offset?: number;
|
|
70
|
+
ksUat?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface UpdateTagOperationRequest {
|
|
74
|
+
tagId: string;
|
|
75
|
+
updateTagRequest: UpdateTagRequest;
|
|
76
|
+
ksUat?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* TagsApi - interface
|
|
81
|
+
*
|
|
82
|
+
* @export
|
|
83
|
+
* @interface TagsApiInterface
|
|
84
|
+
*/
|
|
85
|
+
export interface TagsApiInterface {
|
|
86
|
+
/**
|
|
87
|
+
* Attach a tag to a path part.
|
|
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.
|
|
100
|
+
* Attach Tag Handler
|
|
101
|
+
*/
|
|
102
|
+
attachTagToPathPart(requestParameters: AttachTagToPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TagResponse>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Create a new tag for the current tenant.
|
|
106
|
+
* @summary Create Tag Handler
|
|
107
|
+
* @param {CreateTagRequest} createTagRequest
|
|
108
|
+
* @param {string} [ksUat]
|
|
109
|
+
* @param {*} [options] Override http request option.
|
|
110
|
+
* @throws {RequiredError}
|
|
111
|
+
* @memberof TagsApiInterface
|
|
112
|
+
*/
|
|
113
|
+
createTagRaw(requestParameters: CreateTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TagResponse>>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Create a new tag for the current tenant.
|
|
117
|
+
* Create Tag Handler
|
|
118
|
+
*/
|
|
119
|
+
createTag(requestParameters: CreateTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TagResponse>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Delete a tag and all its path_part associations.
|
|
123
|
+
* @summary Delete Tag Handler
|
|
124
|
+
* @param {string} tagId
|
|
125
|
+
* @param {string} [ksUat]
|
|
126
|
+
* @param {*} [options] Override http request option.
|
|
127
|
+
* @throws {RequiredError}
|
|
128
|
+
* @memberof TagsApiInterface
|
|
129
|
+
*/
|
|
130
|
+
deleteTagRaw(requestParameters: DeleteTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Delete a tag and all its path_part associations.
|
|
134
|
+
* Delete Tag Handler
|
|
135
|
+
*/
|
|
136
|
+
deleteTag(requestParameters: DeleteTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Detach a tag from a path part.
|
|
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.
|
|
152
|
+
* Detach Tag Handler
|
|
153
|
+
*/
|
|
154
|
+
detachTagFromPathPart(requestParameters: DetachTagFromPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Get a tag by its ID.
|
|
158
|
+
* @summary Get Tag Handler
|
|
159
|
+
* @param {string} tagId
|
|
160
|
+
* @param {string} [ksUat]
|
|
161
|
+
* @param {*} [options] Override http request option.
|
|
162
|
+
* @throws {RequiredError}
|
|
163
|
+
* @memberof TagsApiInterface
|
|
164
|
+
*/
|
|
165
|
+
getTagRaw(requestParameters: GetTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TagResponse>>;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Get a tag by its ID.
|
|
169
|
+
* Get Tag Handler
|
|
170
|
+
*/
|
|
171
|
+
getTag(requestParameters: GetTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TagResponse>;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* List all tags for the current tenant.
|
|
175
|
+
* @summary List Tags Handler
|
|
176
|
+
* @param {number} [limit] Number of items per page
|
|
177
|
+
* @param {number} [offset] Number of items to skip
|
|
178
|
+
* @param {string} [ksUat]
|
|
179
|
+
* @param {*} [options] Override http request option.
|
|
180
|
+
* @throws {RequiredError}
|
|
181
|
+
* @memberof TagsApiInterface
|
|
182
|
+
*/
|
|
183
|
+
listTagsRaw(requestParameters: ListTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseTagResponse>>;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* List all tags for the current tenant.
|
|
187
|
+
* List Tags Handler
|
|
188
|
+
*/
|
|
189
|
+
listTags(requestParameters: ListTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseTagResponse>;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Update a tag (name, color, and/or description).
|
|
193
|
+
* @summary Update Tag Handler
|
|
194
|
+
* @param {string} tagId
|
|
195
|
+
* @param {UpdateTagRequest} updateTagRequest
|
|
196
|
+
* @param {string} [ksUat]
|
|
197
|
+
* @param {*} [options] Override http request option.
|
|
198
|
+
* @throws {RequiredError}
|
|
199
|
+
* @memberof TagsApiInterface
|
|
200
|
+
*/
|
|
201
|
+
updateTagRaw(requestParameters: UpdateTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TagResponse>>;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Update a tag (name, color, and/or description).
|
|
205
|
+
* Update Tag Handler
|
|
206
|
+
*/
|
|
207
|
+
updateTag(requestParameters: UpdateTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TagResponse>;
|
|
208
|
+
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
*
|
|
213
|
+
*/
|
|
214
|
+
export class TagsApi extends runtime.BaseAPI implements TagsApiInterface {
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Attach a tag to a path part.
|
|
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.
|
|
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
|
+
/**
|
|
266
|
+
* Create a new tag for the current tenant.
|
|
267
|
+
* Create Tag Handler
|
|
268
|
+
*/
|
|
269
|
+
async createTagRaw(requestParameters: CreateTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TagResponse>> {
|
|
270
|
+
if (requestParameters['createTagRequest'] == null) {
|
|
271
|
+
throw new runtime.RequiredError(
|
|
272
|
+
'createTagRequest',
|
|
273
|
+
'Required parameter "createTagRequest" was null or undefined when calling createTag().'
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const queryParameters: any = {};
|
|
278
|
+
|
|
279
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
280
|
+
|
|
281
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
let urlPath = `/v1/tags`;
|
|
285
|
+
|
|
286
|
+
const response = await this.request({
|
|
287
|
+
path: urlPath,
|
|
288
|
+
method: 'POST',
|
|
289
|
+
headers: headerParameters,
|
|
290
|
+
query: queryParameters,
|
|
291
|
+
body: CreateTagRequestToJSON(requestParameters['createTagRequest']),
|
|
292
|
+
}, initOverrides);
|
|
293
|
+
|
|
294
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TagResponseFromJSON(jsonValue));
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Create a new tag for the current tenant.
|
|
299
|
+
* Create Tag Handler
|
|
300
|
+
*/
|
|
301
|
+
async createTag(requestParameters: CreateTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TagResponse> {
|
|
302
|
+
const response = await this.createTagRaw(requestParameters, initOverrides);
|
|
303
|
+
return await response.value();
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Delete a tag and all its path_part associations.
|
|
308
|
+
* Delete Tag Handler
|
|
309
|
+
*/
|
|
310
|
+
async deleteTagRaw(requestParameters: DeleteTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
311
|
+
if (requestParameters['tagId'] == null) {
|
|
312
|
+
throw new runtime.RequiredError(
|
|
313
|
+
'tagId',
|
|
314
|
+
'Required parameter "tagId" was null or undefined when calling deleteTag().'
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const queryParameters: any = {};
|
|
319
|
+
|
|
320
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
let urlPath = `/v1/tags/{tag_id}`;
|
|
324
|
+
urlPath = urlPath.replace(`{${"tag_id"}}`, encodeURIComponent(String(requestParameters['tagId'])));
|
|
325
|
+
|
|
326
|
+
const response = await this.request({
|
|
327
|
+
path: urlPath,
|
|
328
|
+
method: 'DELETE',
|
|
329
|
+
headers: headerParameters,
|
|
330
|
+
query: queryParameters,
|
|
331
|
+
}, initOverrides);
|
|
332
|
+
|
|
333
|
+
return new runtime.VoidApiResponse(response);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Delete a tag and all its path_part associations.
|
|
338
|
+
* Delete Tag Handler
|
|
339
|
+
*/
|
|
340
|
+
async deleteTag(requestParameters: DeleteTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
341
|
+
await this.deleteTagRaw(requestParameters, initOverrides);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Detach a tag from a path part.
|
|
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.
|
|
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
|
+
/**
|
|
391
|
+
* Get a tag by its ID.
|
|
392
|
+
* Get Tag Handler
|
|
393
|
+
*/
|
|
394
|
+
async getTagRaw(requestParameters: GetTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TagResponse>> {
|
|
395
|
+
if (requestParameters['tagId'] == null) {
|
|
396
|
+
throw new runtime.RequiredError(
|
|
397
|
+
'tagId',
|
|
398
|
+
'Required parameter "tagId" was null or undefined when calling getTag().'
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
const queryParameters: any = {};
|
|
403
|
+
|
|
404
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
let urlPath = `/v1/tags/{tag_id}`;
|
|
408
|
+
urlPath = urlPath.replace(`{${"tag_id"}}`, encodeURIComponent(String(requestParameters['tagId'])));
|
|
409
|
+
|
|
410
|
+
const response = await this.request({
|
|
411
|
+
path: urlPath,
|
|
412
|
+
method: 'GET',
|
|
413
|
+
headers: headerParameters,
|
|
414
|
+
query: queryParameters,
|
|
415
|
+
}, initOverrides);
|
|
416
|
+
|
|
417
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TagResponseFromJSON(jsonValue));
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Get a tag by its ID.
|
|
422
|
+
* Get Tag Handler
|
|
423
|
+
*/
|
|
424
|
+
async getTag(requestParameters: GetTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TagResponse> {
|
|
425
|
+
const response = await this.getTagRaw(requestParameters, initOverrides);
|
|
426
|
+
return await response.value();
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* List all tags for the current tenant.
|
|
431
|
+
* List Tags Handler
|
|
432
|
+
*/
|
|
433
|
+
async listTagsRaw(requestParameters: ListTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseTagResponse>> {
|
|
434
|
+
const queryParameters: any = {};
|
|
435
|
+
|
|
436
|
+
if (requestParameters['limit'] != null) {
|
|
437
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if (requestParameters['offset'] != null) {
|
|
441
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
let urlPath = `/v1/tags`;
|
|
448
|
+
|
|
449
|
+
const response = await this.request({
|
|
450
|
+
path: urlPath,
|
|
451
|
+
method: 'GET',
|
|
452
|
+
headers: headerParameters,
|
|
453
|
+
query: queryParameters,
|
|
454
|
+
}, initOverrides);
|
|
455
|
+
|
|
456
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseTagResponseFromJSON(jsonValue));
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* List all tags for the current tenant.
|
|
461
|
+
* List Tags Handler
|
|
462
|
+
*/
|
|
463
|
+
async listTags(requestParameters: ListTagsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseTagResponse> {
|
|
464
|
+
const response = await this.listTagsRaw(requestParameters, initOverrides);
|
|
465
|
+
return await response.value();
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Update a tag (name, color, and/or description).
|
|
470
|
+
* Update Tag Handler
|
|
471
|
+
*/
|
|
472
|
+
async updateTagRaw(requestParameters: UpdateTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TagResponse>> {
|
|
473
|
+
if (requestParameters['tagId'] == null) {
|
|
474
|
+
throw new runtime.RequiredError(
|
|
475
|
+
'tagId',
|
|
476
|
+
'Required parameter "tagId" was null or undefined when calling updateTag().'
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
if (requestParameters['updateTagRequest'] == null) {
|
|
481
|
+
throw new runtime.RequiredError(
|
|
482
|
+
'updateTagRequest',
|
|
483
|
+
'Required parameter "updateTagRequest" was null or undefined when calling updateTag().'
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
const queryParameters: any = {};
|
|
488
|
+
|
|
489
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
490
|
+
|
|
491
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
let urlPath = `/v1/tags/{tag_id}`;
|
|
495
|
+
urlPath = urlPath.replace(`{${"tag_id"}}`, encodeURIComponent(String(requestParameters['tagId'])));
|
|
496
|
+
|
|
497
|
+
const response = await this.request({
|
|
498
|
+
path: urlPath,
|
|
499
|
+
method: 'PATCH',
|
|
500
|
+
headers: headerParameters,
|
|
501
|
+
query: queryParameters,
|
|
502
|
+
body: UpdateTagRequestToJSON(requestParameters['updateTagRequest']),
|
|
503
|
+
}, initOverrides);
|
|
504
|
+
|
|
505
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TagResponseFromJSON(jsonValue));
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Update a tag (name, color, and/or description).
|
|
510
|
+
* Update Tag Handler
|
|
511
|
+
*/
|
|
512
|
+
async updateTag(requestParameters: UpdateTagOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TagResponse> {
|
|
513
|
+
const response = await this.updateTagRaw(requestParameters, initOverrides);
|
|
514
|
+
return await response.value();
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
}
|
package/src/apis/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './FoldersApi';
|
|
|
10
10
|
export * from './InvitesApi';
|
|
11
11
|
export * from './PathPartsApi';
|
|
12
12
|
export * from './SectionsApi';
|
|
13
|
+
export * from './TagsApi';
|
|
13
14
|
export * from './TenantsApi';
|
|
14
15
|
export * from './ThreadMessagesApi';
|
|
15
16
|
export * from './ThreadsApi';
|
|
@@ -0,0 +1,111 @@
|
|
|
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 create a new tag.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface CreateTagRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface CreateTagRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Tag name
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof CreateTagRequest
|
|
26
|
+
*/
|
|
27
|
+
name: string;
|
|
28
|
+
/**
|
|
29
|
+
* Tag color as 6-character hex string (e.g. 'FF5733')
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof CreateTagRequest
|
|
32
|
+
*/
|
|
33
|
+
color?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Optional tag description
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof CreateTagRequest
|
|
38
|
+
*/
|
|
39
|
+
description?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Check if a given object implements the CreateTagRequest interface.
|
|
44
|
+
*/
|
|
45
|
+
export function instanceOfCreateTagRequest(value: object): value is CreateTagRequest {
|
|
46
|
+
if (!('name' in value) || value['name'] === undefined) return false;
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function CreateTagRequestFromJSON(json: any): CreateTagRequest {
|
|
51
|
+
return CreateTagRequestFromJSONTyped(json, false);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function CreateTagRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTagRequest {
|
|
55
|
+
if (json == null) {
|
|
56
|
+
return json;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
|
|
60
|
+
'name': json['name'],
|
|
61
|
+
'color': json['color'] == null ? undefined : json['color'],
|
|
62
|
+
'description': json['description'] == null ? undefined : json['description'],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function CreateTagRequestToJSON(json: any): CreateTagRequest {
|
|
67
|
+
return CreateTagRequestToJSONTyped(json, false);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function CreateTagRequestToJSONTyped(value?: CreateTagRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
71
|
+
if (value == null) {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
|
|
77
|
+
'name': value['name'],
|
|
78
|
+
'color': value['color'],
|
|
79
|
+
'description': value['description'],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const CreateTagRequestPropertyValidationAttributesMap: {
|
|
84
|
+
[property: string]: {
|
|
85
|
+
maxLength?: number,
|
|
86
|
+
minLength?: number,
|
|
87
|
+
pattern?: string,
|
|
88
|
+
maximum?: number,
|
|
89
|
+
exclusiveMaximum?: boolean,
|
|
90
|
+
minimum?: number,
|
|
91
|
+
exclusiveMinimum?: boolean,
|
|
92
|
+
multipleOf?: number,
|
|
93
|
+
maxItems?: number,
|
|
94
|
+
minItems?: number,
|
|
95
|
+
uniqueItems?: boolean
|
|
96
|
+
}
|
|
97
|
+
} = {
|
|
98
|
+
name: {
|
|
99
|
+
maxLength: 100,
|
|
100
|
+
minLength: 1,
|
|
101
|
+
},
|
|
102
|
+
color: {
|
|
103
|
+
maxLength: 6,
|
|
104
|
+
minLength: 6,
|
|
105
|
+
pattern: '/^[0-9A-Fa-f]{6}$/',
|
|
106
|
+
},
|
|
107
|
+
description: {
|
|
108
|
+
maxLength: 500,
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
|