@knowledge-stack/ksapi 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/.openapi-generator/FILES +10 -0
  2. package/README.md +2 -2
  3. package/dist/apis/DocumentVersionsApi.d.ts +146 -0
  4. package/dist/apis/DocumentVersionsApi.js +168 -0
  5. package/dist/apis/DocumentsApi.d.ts +179 -0
  6. package/dist/apis/DocumentsApi.js +206 -0
  7. package/dist/apis/index.d.ts +2 -0
  8. package/dist/apis/index.js +2 -0
  9. package/dist/esm/apis/DocumentVersionsApi.d.ts +146 -0
  10. package/dist/esm/apis/DocumentVersionsApi.js +164 -0
  11. package/dist/esm/apis/DocumentsApi.d.ts +179 -0
  12. package/dist/esm/apis/DocumentsApi.js +202 -0
  13. package/dist/esm/apis/index.d.ts +2 -0
  14. package/dist/esm/apis/index.js +2 -0
  15. package/dist/esm/models/CreateDocumentRequest.d.ts +67 -0
  16. package/dist/esm/models/CreateDocumentRequest.js +63 -0
  17. package/dist/esm/models/DocumentOrigin.d.ts +25 -0
  18. package/dist/esm/models/DocumentOrigin.js +43 -0
  19. package/dist/esm/models/DocumentResponse.d.ts +110 -0
  20. package/dist/esm/models/DocumentResponse.js +87 -0
  21. package/dist/esm/models/DocumentType.d.ts +25 -0
  22. package/dist/esm/models/DocumentType.js +43 -0
  23. package/dist/esm/models/DocumentVersionResponse.d.ts +92 -0
  24. package/dist/esm/models/DocumentVersionResponse.js +72 -0
  25. package/dist/esm/models/PaginatedResponseDocumentResponse.d.ts +66 -0
  26. package/dist/esm/models/PaginatedResponseDocumentResponse.js +70 -0
  27. package/dist/esm/models/PaginatedResponseDocumentVersionResponse.d.ts +66 -0
  28. package/dist/esm/models/PaginatedResponseDocumentVersionResponse.js +70 -0
  29. package/dist/esm/models/UpdateDocumentRequest.d.ts +59 -0
  30. package/dist/esm/models/UpdateDocumentRequest.js +51 -0
  31. package/dist/esm/models/index.d.ts +8 -0
  32. package/dist/esm/models/index.js +8 -0
  33. package/dist/models/CreateDocumentRequest.d.ts +67 -0
  34. package/dist/models/CreateDocumentRequest.js +71 -0
  35. package/dist/models/DocumentOrigin.d.ts +25 -0
  36. package/dist/models/DocumentOrigin.js +51 -0
  37. package/dist/models/DocumentResponse.d.ts +110 -0
  38. package/dist/models/DocumentResponse.js +95 -0
  39. package/dist/models/DocumentType.d.ts +25 -0
  40. package/dist/models/DocumentType.js +51 -0
  41. package/dist/models/DocumentVersionResponse.d.ts +92 -0
  42. package/dist/models/DocumentVersionResponse.js +80 -0
  43. package/dist/models/PaginatedResponseDocumentResponse.d.ts +66 -0
  44. package/dist/models/PaginatedResponseDocumentResponse.js +78 -0
  45. package/dist/models/PaginatedResponseDocumentVersionResponse.d.ts +66 -0
  46. package/dist/models/PaginatedResponseDocumentVersionResponse.js +78 -0
  47. package/dist/models/UpdateDocumentRequest.d.ts +59 -0
  48. package/dist/models/UpdateDocumentRequest.js +59 -0
  49. package/dist/models/index.d.ts +8 -0
  50. package/dist/models/index.js +8 -0
  51. package/package.json +1 -1
  52. package/src/apis/DocumentVersionsApi.ts +303 -0
  53. package/src/apis/DocumentsApi.ts +386 -0
  54. package/src/apis/index.ts +2 -0
  55. package/src/models/CreateDocumentRequest.ts +131 -0
  56. package/src/models/DocumentOrigin.ts +53 -0
  57. package/src/models/DocumentResponse.ts +197 -0
  58. package/src/models/DocumentType.ts +53 -0
  59. package/src/models/DocumentVersionResponse.ts +149 -0
  60. package/src/models/PaginatedResponseDocumentResponse.ts +130 -0
  61. package/src/models/PaginatedResponseDocumentVersionResponse.ts +130 -0
  62. package/src/models/UpdateDocumentRequest.ts +102 -0
  63. package/src/models/index.ts +8 -0
@@ -0,0 +1,386 @@
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
+ CreateDocumentRequest,
19
+ DocumentResponse,
20
+ HTTPValidationError,
21
+ PaginatedResponseDocumentResponse,
22
+ PathOrder,
23
+ UpdateDocumentRequest,
24
+ } from '../models/index';
25
+ import {
26
+ CreateDocumentRequestFromJSON,
27
+ CreateDocumentRequestToJSON,
28
+ DocumentResponseFromJSON,
29
+ DocumentResponseToJSON,
30
+ HTTPValidationErrorFromJSON,
31
+ HTTPValidationErrorToJSON,
32
+ PaginatedResponseDocumentResponseFromJSON,
33
+ PaginatedResponseDocumentResponseToJSON,
34
+ PathOrderFromJSON,
35
+ PathOrderToJSON,
36
+ UpdateDocumentRequestFromJSON,
37
+ UpdateDocumentRequestToJSON,
38
+ } from '../models/index';
39
+
40
+ export interface CreateDocumentOperationRequest {
41
+ createDocumentRequest: CreateDocumentRequest;
42
+ ksUat?: string;
43
+ }
44
+
45
+ export interface DeleteDocumentRequest {
46
+ documentId: string;
47
+ ksUat?: string;
48
+ }
49
+
50
+ export interface GetDocumentRequest {
51
+ documentId: string;
52
+ ksUat?: string;
53
+ }
54
+
55
+ export interface ListDocumentsRequest {
56
+ parentId?: string;
57
+ sortOrder?: PathOrder;
58
+ limit?: number;
59
+ offset?: number;
60
+ ksUat?: string;
61
+ }
62
+
63
+ export interface UpdateDocumentOperationRequest {
64
+ documentId: string;
65
+ updateDocumentRequest: UpdateDocumentRequest;
66
+ ksUat?: string;
67
+ }
68
+
69
+ /**
70
+ * DocumentsApi - interface
71
+ *
72
+ * @export
73
+ * @interface DocumentsApiInterface
74
+ */
75
+ export interface DocumentsApiInterface {
76
+ /**
77
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
78
+ * @summary Create Document Handler
79
+ * @param {CreateDocumentRequest} createDocumentRequest
80
+ * @param {string} [ksUat]
81
+ * @param {*} [options] Override http request option.
82
+ * @throws {RequiredError}
83
+ * @memberof DocumentsApiInterface
84
+ */
85
+ createDocumentRaw(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
86
+
87
+ /**
88
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
89
+ * Create Document Handler
90
+ */
91
+ createDocument(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
92
+
93
+ /**
94
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
95
+ * @summary Delete Document Handler
96
+ * @param {string} documentId
97
+ * @param {string} [ksUat]
98
+ * @param {*} [options] Override http request option.
99
+ * @throws {RequiredError}
100
+ * @memberof DocumentsApiInterface
101
+ */
102
+ deleteDocumentRaw(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
103
+
104
+ /**
105
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
106
+ * Delete Document Handler
107
+ */
108
+ deleteDocument(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
109
+
110
+ /**
111
+ * Get a document by its document ID.
112
+ * @summary Get Document Handler
113
+ * @param {string} documentId
114
+ * @param {string} [ksUat]
115
+ * @param {*} [options] Override http request option.
116
+ * @throws {RequiredError}
117
+ * @memberof DocumentsApiInterface
118
+ */
119
+ getDocumentRaw(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
120
+
121
+ /**
122
+ * Get a document by its document ID.
123
+ * Get Document Handler
124
+ */
125
+ getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
126
+
127
+ /**
128
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
129
+ * @summary List Documents Handler
130
+ * @param {string} [parentId] Parent folder PathPart ID (defaults to root)
131
+ * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
132
+ * @param {number} [limit] Number of items per page
133
+ * @param {number} [offset] Number of items to skip
134
+ * @param {string} [ksUat]
135
+ * @param {*} [options] Override http request option.
136
+ * @throws {RequiredError}
137
+ * @memberof DocumentsApiInterface
138
+ */
139
+ listDocumentsRaw(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentResponse>>;
140
+
141
+ /**
142
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
143
+ * List Documents Handler
144
+ */
145
+ listDocuments(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentResponse>;
146
+
147
+ /**
148
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
149
+ * @summary Update Document Handler
150
+ * @param {string} documentId
151
+ * @param {UpdateDocumentRequest} updateDocumentRequest
152
+ * @param {string} [ksUat]
153
+ * @param {*} [options] Override http request option.
154
+ * @throws {RequiredError}
155
+ * @memberof DocumentsApiInterface
156
+ */
157
+ updateDocumentRaw(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
158
+
159
+ /**
160
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
161
+ * Update Document Handler
162
+ */
163
+ updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
164
+
165
+ }
166
+
167
+ /**
168
+ *
169
+ */
170
+ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterface {
171
+
172
+ /**
173
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
174
+ * Create Document Handler
175
+ */
176
+ async createDocumentRaw(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>> {
177
+ if (requestParameters['createDocumentRequest'] == null) {
178
+ throw new runtime.RequiredError(
179
+ 'createDocumentRequest',
180
+ 'Required parameter "createDocumentRequest" was null or undefined when calling createDocument().'
181
+ );
182
+ }
183
+
184
+ const queryParameters: any = {};
185
+
186
+ const headerParameters: runtime.HTTPHeaders = {};
187
+
188
+ headerParameters['Content-Type'] = 'application/json';
189
+
190
+
191
+ let urlPath = `/v1/documents`;
192
+
193
+ const response = await this.request({
194
+ path: urlPath,
195
+ method: 'POST',
196
+ headers: headerParameters,
197
+ query: queryParameters,
198
+ body: CreateDocumentRequestToJSON(requestParameters['createDocumentRequest']),
199
+ }, initOverrides);
200
+
201
+ return new runtime.JSONApiResponse(response, (jsonValue) => DocumentResponseFromJSON(jsonValue));
202
+ }
203
+
204
+ /**
205
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
206
+ * Create Document Handler
207
+ */
208
+ async createDocument(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse> {
209
+ const response = await this.createDocumentRaw(requestParameters, initOverrides);
210
+ return await response.value();
211
+ }
212
+
213
+ /**
214
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
215
+ * Delete Document Handler
216
+ */
217
+ async deleteDocumentRaw(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
218
+ if (requestParameters['documentId'] == null) {
219
+ throw new runtime.RequiredError(
220
+ 'documentId',
221
+ 'Required parameter "documentId" was null or undefined when calling deleteDocument().'
222
+ );
223
+ }
224
+
225
+ const queryParameters: any = {};
226
+
227
+ const headerParameters: runtime.HTTPHeaders = {};
228
+
229
+
230
+ let urlPath = `/v1/documents/{document_id}`;
231
+ urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
232
+
233
+ const response = await this.request({
234
+ path: urlPath,
235
+ method: 'DELETE',
236
+ headers: headerParameters,
237
+ query: queryParameters,
238
+ }, initOverrides);
239
+
240
+ return new runtime.VoidApiResponse(response);
241
+ }
242
+
243
+ /**
244
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
245
+ * Delete Document Handler
246
+ */
247
+ async deleteDocument(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
248
+ await this.deleteDocumentRaw(requestParameters, initOverrides);
249
+ }
250
+
251
+ /**
252
+ * Get a document by its document ID.
253
+ * Get Document Handler
254
+ */
255
+ async getDocumentRaw(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>> {
256
+ if (requestParameters['documentId'] == null) {
257
+ throw new runtime.RequiredError(
258
+ 'documentId',
259
+ 'Required parameter "documentId" was null or undefined when calling getDocument().'
260
+ );
261
+ }
262
+
263
+ const queryParameters: any = {};
264
+
265
+ const headerParameters: runtime.HTTPHeaders = {};
266
+
267
+
268
+ let urlPath = `/v1/documents/{document_id}`;
269
+ urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
270
+
271
+ const response = await this.request({
272
+ path: urlPath,
273
+ method: 'GET',
274
+ headers: headerParameters,
275
+ query: queryParameters,
276
+ }, initOverrides);
277
+
278
+ return new runtime.JSONApiResponse(response, (jsonValue) => DocumentResponseFromJSON(jsonValue));
279
+ }
280
+
281
+ /**
282
+ * Get a document by its document ID.
283
+ * Get Document Handler
284
+ */
285
+ async getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse> {
286
+ const response = await this.getDocumentRaw(requestParameters, initOverrides);
287
+ return await response.value();
288
+ }
289
+
290
+ /**
291
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
292
+ * List Documents Handler
293
+ */
294
+ async listDocumentsRaw(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentResponse>> {
295
+ const queryParameters: any = {};
296
+
297
+ if (requestParameters['parentId'] != null) {
298
+ queryParameters['parent_id'] = requestParameters['parentId'];
299
+ }
300
+
301
+ if (requestParameters['sortOrder'] != null) {
302
+ queryParameters['sort_order'] = requestParameters['sortOrder'];
303
+ }
304
+
305
+ if (requestParameters['limit'] != null) {
306
+ queryParameters['limit'] = requestParameters['limit'];
307
+ }
308
+
309
+ if (requestParameters['offset'] != null) {
310
+ queryParameters['offset'] = requestParameters['offset'];
311
+ }
312
+
313
+ const headerParameters: runtime.HTTPHeaders = {};
314
+
315
+
316
+ let urlPath = `/v1/documents`;
317
+
318
+ const response = await this.request({
319
+ path: urlPath,
320
+ method: 'GET',
321
+ headers: headerParameters,
322
+ query: queryParameters,
323
+ }, initOverrides);
324
+
325
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseDocumentResponseFromJSON(jsonValue));
326
+ }
327
+
328
+ /**
329
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
330
+ * List Documents Handler
331
+ */
332
+ async listDocuments(requestParameters: ListDocumentsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentResponse> {
333
+ const response = await this.listDocumentsRaw(requestParameters, initOverrides);
334
+ return await response.value();
335
+ }
336
+
337
+ /**
338
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
339
+ * Update Document Handler
340
+ */
341
+ async updateDocumentRaw(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>> {
342
+ if (requestParameters['documentId'] == null) {
343
+ throw new runtime.RequiredError(
344
+ 'documentId',
345
+ 'Required parameter "documentId" was null or undefined when calling updateDocument().'
346
+ );
347
+ }
348
+
349
+ if (requestParameters['updateDocumentRequest'] == null) {
350
+ throw new runtime.RequiredError(
351
+ 'updateDocumentRequest',
352
+ 'Required parameter "updateDocumentRequest" was null or undefined when calling updateDocument().'
353
+ );
354
+ }
355
+
356
+ const queryParameters: any = {};
357
+
358
+ const headerParameters: runtime.HTTPHeaders = {};
359
+
360
+ headerParameters['Content-Type'] = 'application/json';
361
+
362
+
363
+ let urlPath = `/v1/documents/{document_id}`;
364
+ urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
365
+
366
+ const response = await this.request({
367
+ path: urlPath,
368
+ method: 'PATCH',
369
+ headers: headerParameters,
370
+ query: queryParameters,
371
+ body: UpdateDocumentRequestToJSON(requestParameters['updateDocumentRequest']),
372
+ }, initOverrides);
373
+
374
+ return new runtime.JSONApiResponse(response, (jsonValue) => DocumentResponseFromJSON(jsonValue));
375
+ }
376
+
377
+ /**
378
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
379
+ * Update Document Handler
380
+ */
381
+ async updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse> {
382
+ const response = await this.updateDocumentRaw(requestParameters, initOverrides);
383
+ return await response.value();
384
+ }
385
+
386
+ }
package/src/apis/index.ts CHANGED
@@ -2,6 +2,8 @@
2
2
  /* eslint-disable */
3
3
  export * from './AuthApi';
4
4
  export * from './DefaultApi';
5
+ export * from './DocumentVersionsApi';
6
+ export * from './DocumentsApi';
5
7
  export * from './FoldersApi';
6
8
  export * from './InvitesApi';
7
9
  export * from './PathPartsApi';
@@ -0,0 +1,131 @@
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
+ import type { DocumentOrigin } from './DocumentOrigin';
17
+ import {
18
+ DocumentOriginFromJSON,
19
+ DocumentOriginFromJSONTyped,
20
+ DocumentOriginToJSON,
21
+ DocumentOriginToJSONTyped,
22
+ } from './DocumentOrigin';
23
+ import type { DocumentType } from './DocumentType';
24
+ import {
25
+ DocumentTypeFromJSON,
26
+ DocumentTypeFromJSONTyped,
27
+ DocumentTypeToJSON,
28
+ DocumentTypeToJSONTyped,
29
+ } from './DocumentType';
30
+
31
+ /**
32
+ * Request to create a new document.
33
+ * @export
34
+ * @interface CreateDocumentRequest
35
+ */
36
+ export interface CreateDocumentRequest {
37
+ /**
38
+ * Document name
39
+ * @type {string}
40
+ * @memberof CreateDocumentRequest
41
+ */
42
+ name: string;
43
+ /**
44
+ * Parent folder PathPart ID
45
+ * @type {string}
46
+ * @memberof CreateDocumentRequest
47
+ */
48
+ parentId: string;
49
+ /**
50
+ * Type of document (PDF, UNKNOWN, etc.)
51
+ * @type {DocumentType}
52
+ * @memberof CreateDocumentRequest
53
+ */
54
+ documentType: DocumentType;
55
+ /**
56
+ * Origin of document (SOURCE, GENERATED)
57
+ * @type {DocumentOrigin}
58
+ * @memberof CreateDocumentRequest
59
+ */
60
+ documentOrigin: DocumentOrigin;
61
+ }
62
+
63
+
64
+
65
+ /**
66
+ * Check if a given object implements the CreateDocumentRequest interface.
67
+ */
68
+ export function instanceOfCreateDocumentRequest(value: object): value is CreateDocumentRequest {
69
+ if (!('name' in value) || value['name'] === undefined) return false;
70
+ if (!('parentId' in value) || value['parentId'] === undefined) return false;
71
+ if (!('documentType' in value) || value['documentType'] === undefined) return false;
72
+ if (!('documentOrigin' in value) || value['documentOrigin'] === undefined) return false;
73
+ return true;
74
+ }
75
+
76
+ export function CreateDocumentRequestFromJSON(json: any): CreateDocumentRequest {
77
+ return CreateDocumentRequestFromJSONTyped(json, false);
78
+ }
79
+
80
+ export function CreateDocumentRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateDocumentRequest {
81
+ if (json == null) {
82
+ return json;
83
+ }
84
+ return {
85
+
86
+ 'name': json['name'],
87
+ 'parentId': json['parent_id'],
88
+ 'documentType': DocumentTypeFromJSON(json['document_type']),
89
+ 'documentOrigin': DocumentOriginFromJSON(json['document_origin']),
90
+ };
91
+ }
92
+
93
+ export function CreateDocumentRequestToJSON(json: any): CreateDocumentRequest {
94
+ return CreateDocumentRequestToJSONTyped(json, false);
95
+ }
96
+
97
+ export function CreateDocumentRequestToJSONTyped(value?: CreateDocumentRequest | null, ignoreDiscriminator: boolean = false): any {
98
+ if (value == null) {
99
+ return value;
100
+ }
101
+
102
+ return {
103
+
104
+ 'name': value['name'],
105
+ 'parent_id': value['parentId'],
106
+ 'document_type': DocumentTypeToJSON(value['documentType']),
107
+ 'document_origin': DocumentOriginToJSON(value['documentOrigin']),
108
+ };
109
+ }
110
+
111
+ export const CreateDocumentRequestPropertyValidationAttributesMap: {
112
+ [property: string]: {
113
+ maxLength?: number,
114
+ minLength?: number,
115
+ pattern?: string,
116
+ maximum?: number,
117
+ exclusiveMaximum?: boolean,
118
+ minimum?: number,
119
+ exclusiveMinimum?: boolean,
120
+ multipleOf?: number,
121
+ maxItems?: number,
122
+ minItems?: number,
123
+ uniqueItems?: boolean
124
+ }
125
+ } = {
126
+ name: {
127
+ maxLength: 255,
128
+ minLength: 1,
129
+ },
130
+ }
131
+
@@ -0,0 +1,53 @@
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
+ /**
17
+ * Origin of document - source/purpose (all origins are first-class).
18
+ * @export
19
+ */
20
+ export const DocumentOrigin = {
21
+ Source: 'SOURCE',
22
+ Generated: 'GENERATED'
23
+ } as const;
24
+ export type DocumentOrigin = typeof DocumentOrigin[keyof typeof DocumentOrigin];
25
+
26
+
27
+ export function instanceOfDocumentOrigin(value: any): boolean {
28
+ for (const key in DocumentOrigin) {
29
+ if (Object.prototype.hasOwnProperty.call(DocumentOrigin, key)) {
30
+ if (DocumentOrigin[key as keyof typeof DocumentOrigin] === value) {
31
+ return true;
32
+ }
33
+ }
34
+ }
35
+ return false;
36
+ }
37
+
38
+ export function DocumentOriginFromJSON(json: any): DocumentOrigin {
39
+ return DocumentOriginFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function DocumentOriginFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentOrigin {
43
+ return json as DocumentOrigin;
44
+ }
45
+
46
+ export function DocumentOriginToJSON(value?: DocumentOrigin | null): any {
47
+ return value as any;
48
+ }
49
+
50
+ export function DocumentOriginToJSONTyped(value: any, ignoreDiscriminator: boolean): DocumentOrigin {
51
+ return value as DocumentOrigin;
52
+ }
53
+