@knowledge-stack/ksapi 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.openapi-generator/FILES +10 -0
  2. package/README.md +2 -2
  3. package/dist/apis/ChunksApi.d.ts +175 -0
  4. package/dist/apis/ChunksApi.js +203 -0
  5. package/dist/apis/index.d.ts +1 -0
  6. package/dist/apis/index.js +1 -0
  7. package/dist/esm/apis/ChunksApi.d.ts +175 -0
  8. package/dist/esm/apis/ChunksApi.js +199 -0
  9. package/dist/esm/apis/index.d.ts +1 -0
  10. package/dist/esm/apis/index.js +1 -0
  11. package/dist/esm/models/ChunkMetadataInput.d.ts +48 -0
  12. package/dist/esm/models/ChunkMetadataInput.js +43 -0
  13. package/dist/esm/models/ChunkMetadataOutput.d.ts +48 -0
  14. package/dist/esm/models/ChunkMetadataOutput.js +43 -0
  15. package/dist/esm/models/ChunkResponse.d.ts +115 -0
  16. package/dist/esm/models/ChunkResponse.js +86 -0
  17. package/dist/esm/models/ChunkType.d.ts +27 -0
  18. package/dist/esm/models/ChunkType.js +45 -0
  19. package/dist/esm/models/CreateChunkRequest.d.ts +73 -0
  20. package/dist/esm/models/CreateChunkRequest.js +64 -0
  21. package/dist/esm/models/PasswordResetWithTokenRequest.d.ts +2 -8
  22. package/dist/esm/models/PasswordResetWithTokenRequest.js +3 -7
  23. package/dist/esm/models/Polygon.d.ts +65 -0
  24. package/dist/esm/models/Polygon.js +56 -0
  25. package/dist/esm/models/PolygonReference.d.ts +54 -0
  26. package/dist/esm/models/PolygonReference.js +49 -0
  27. package/dist/esm/models/UpdateChunkContentRequest.d.ts +54 -0
  28. package/dist/esm/models/UpdateChunkContentRequest.js +51 -0
  29. package/dist/esm/models/UpdateChunkMetadataRequest.d.ts +48 -0
  30. package/dist/esm/models/UpdateChunkMetadataRequest.js +45 -0
  31. package/dist/esm/models/index.d.ts +9 -0
  32. package/dist/esm/models/index.js +9 -0
  33. package/dist/models/ChunkMetadataInput.d.ts +48 -0
  34. package/dist/models/ChunkMetadataInput.js +51 -0
  35. package/dist/models/ChunkMetadataOutput.d.ts +48 -0
  36. package/dist/models/ChunkMetadataOutput.js +51 -0
  37. package/dist/models/ChunkResponse.d.ts +115 -0
  38. package/dist/models/ChunkResponse.js +94 -0
  39. package/dist/models/ChunkType.d.ts +27 -0
  40. package/dist/models/ChunkType.js +53 -0
  41. package/dist/models/CreateChunkRequest.d.ts +73 -0
  42. package/dist/models/CreateChunkRequest.js +72 -0
  43. package/dist/models/PasswordResetWithTokenRequest.d.ts +2 -8
  44. package/dist/models/PasswordResetWithTokenRequest.js +3 -7
  45. package/dist/models/Polygon.d.ts +65 -0
  46. package/dist/models/Polygon.js +64 -0
  47. package/dist/models/PolygonReference.d.ts +54 -0
  48. package/dist/models/PolygonReference.js +57 -0
  49. package/dist/models/UpdateChunkContentRequest.d.ts +54 -0
  50. package/dist/models/UpdateChunkContentRequest.js +59 -0
  51. package/dist/models/UpdateChunkMetadataRequest.d.ts +48 -0
  52. package/dist/models/UpdateChunkMetadataRequest.js +53 -0
  53. package/dist/models/index.d.ts +9 -0
  54. package/dist/models/index.js +9 -0
  55. package/package.json +1 -1
  56. package/src/apis/ChunksApi.ts +381 -0
  57. package/src/apis/index.ts +1 -0
  58. package/src/models/ChunkMetadataInput.ts +90 -0
  59. package/src/models/ChunkMetadataOutput.ts +90 -0
  60. package/src/models/ChunkResponse.ts +197 -0
  61. package/src/models/ChunkType.ts +55 -0
  62. package/src/models/CreateChunkRequest.ts +138 -0
  63. package/src/models/PasswordResetWithTokenRequest.ts +5 -14
  64. package/src/models/Polygon.ts +110 -0
  65. package/src/models/PolygonReference.ts +100 -0
  66. package/src/models/UpdateChunkContentRequest.ts +104 -0
  67. package/src/models/UpdateChunkMetadataRequest.ts +91 -0
  68. package/src/models/index.ts +9 -0
@@ -0,0 +1,381 @@
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
+ ChunkResponse,
19
+ CreateChunkRequest,
20
+ HTTPValidationError,
21
+ UpdateChunkContentRequest,
22
+ UpdateChunkMetadataRequest,
23
+ } from '../models/index';
24
+ import {
25
+ ChunkResponseFromJSON,
26
+ ChunkResponseToJSON,
27
+ CreateChunkRequestFromJSON,
28
+ CreateChunkRequestToJSON,
29
+ HTTPValidationErrorFromJSON,
30
+ HTTPValidationErrorToJSON,
31
+ UpdateChunkContentRequestFromJSON,
32
+ UpdateChunkContentRequestToJSON,
33
+ UpdateChunkMetadataRequestFromJSON,
34
+ UpdateChunkMetadataRequestToJSON,
35
+ } from '../models/index';
36
+
37
+ export interface CreateChunkOperationRequest {
38
+ createChunkRequest: CreateChunkRequest;
39
+ ksUat?: string;
40
+ }
41
+
42
+ export interface DeleteChunkRequest {
43
+ chunkId: string;
44
+ ksUat?: string;
45
+ }
46
+
47
+ export interface GetChunkRequest {
48
+ chunkId: string;
49
+ ksUat?: string;
50
+ }
51
+
52
+ export interface UpdateChunkContentOperationRequest {
53
+ chunkId: string;
54
+ updateChunkContentRequest: UpdateChunkContentRequest;
55
+ ksUat?: string;
56
+ }
57
+
58
+ export interface UpdateChunkMetadataOperationRequest {
59
+ chunkId: string;
60
+ updateChunkMetadataRequest: UpdateChunkMetadataRequest;
61
+ ksUat?: string;
62
+ }
63
+
64
+ /**
65
+ * ChunksApi - interface
66
+ *
67
+ * @export
68
+ * @interface ChunksApiInterface
69
+ */
70
+ export interface ChunksApiInterface {
71
+ /**
72
+ * Create a new chunk with content. The chunk is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). Content is deduplicated by SHA256 hash.
73
+ * @summary Create Chunk Handler
74
+ * @param {CreateChunkRequest} createChunkRequest
75
+ * @param {string} [ksUat]
76
+ * @param {*} [options] Override http request option.
77
+ * @throws {RequiredError}
78
+ * @memberof ChunksApiInterface
79
+ */
80
+ createChunkRaw(requestParameters: CreateChunkOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>>;
81
+
82
+ /**
83
+ * Create a new chunk with content. The chunk is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). Content is deduplicated by SHA256 hash.
84
+ * Create Chunk Handler
85
+ */
86
+ createChunk(requestParameters: CreateChunkOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
87
+
88
+ /**
89
+ * Delete a chunk. The chunk is deleted via its PathPart (cascading delete). The associated ChunkContent may remain if shared by other chunks.
90
+ * @summary Delete Chunk Handler
91
+ * @param {string} chunkId
92
+ * @param {string} [ksUat]
93
+ * @param {*} [options] Override http request option.
94
+ * @throws {RequiredError}
95
+ * @memberof ChunksApiInterface
96
+ */
97
+ deleteChunkRaw(requestParameters: DeleteChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
98
+
99
+ /**
100
+ * Delete a chunk. The chunk is deleted via its PathPart (cascading delete). The associated ChunkContent may remain if shared by other chunks.
101
+ * Delete Chunk Handler
102
+ */
103
+ deleteChunk(requestParameters: DeleteChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
104
+
105
+ /**
106
+ * Get a chunk by its ID, including content.
107
+ * @summary Get Chunk Handler
108
+ * @param {string} chunkId
109
+ * @param {string} [ksUat]
110
+ * @param {*} [options] Override http request option.
111
+ * @throws {RequiredError}
112
+ * @memberof ChunksApiInterface
113
+ */
114
+ getChunkRaw(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>>;
115
+
116
+ /**
117
+ * Get a chunk by its ID, including content.
118
+ * Get Chunk Handler
119
+ */
120
+ getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
121
+
122
+ /**
123
+ * Update chunk content by creating a new content row. The old content row is preserved (not deleted). If the new content matches an existing content hash, it will be deduplicated.
124
+ * @summary Update Chunk Content Handler
125
+ * @param {string} chunkId
126
+ * @param {UpdateChunkContentRequest} updateChunkContentRequest
127
+ * @param {string} [ksUat]
128
+ * @param {*} [options] Override http request option.
129
+ * @throws {RequiredError}
130
+ * @memberof ChunksApiInterface
131
+ */
132
+ updateChunkContentRaw(requestParameters: UpdateChunkContentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>>;
133
+
134
+ /**
135
+ * Update chunk content by creating a new content row. The old content row is preserved (not deleted). If the new content matches an existing content hash, it will be deduplicated.
136
+ * Update Chunk Content Handler
137
+ */
138
+ updateChunkContent(requestParameters: UpdateChunkContentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
139
+
140
+ /**
141
+ * Update chunk metadata by merging with existing metadata. The provided metadata is shallow-merged into the existing chunk_metadata.
142
+ * @summary Update Chunk Metadata Handler
143
+ * @param {string} chunkId
144
+ * @param {UpdateChunkMetadataRequest} updateChunkMetadataRequest
145
+ * @param {string} [ksUat]
146
+ * @param {*} [options] Override http request option.
147
+ * @throws {RequiredError}
148
+ * @memberof ChunksApiInterface
149
+ */
150
+ updateChunkMetadataRaw(requestParameters: UpdateChunkMetadataOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>>;
151
+
152
+ /**
153
+ * Update chunk metadata by merging with existing metadata. The provided metadata is shallow-merged into the existing chunk_metadata.
154
+ * Update Chunk Metadata Handler
155
+ */
156
+ updateChunkMetadata(requestParameters: UpdateChunkMetadataOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
157
+
158
+ }
159
+
160
+ /**
161
+ *
162
+ */
163
+ export class ChunksApi extends runtime.BaseAPI implements ChunksApiInterface {
164
+
165
+ /**
166
+ * Create a new chunk with content. The chunk is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). Content is deduplicated by SHA256 hash.
167
+ * Create Chunk Handler
168
+ */
169
+ async createChunkRaw(requestParameters: CreateChunkOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>> {
170
+ if (requestParameters['createChunkRequest'] == null) {
171
+ throw new runtime.RequiredError(
172
+ 'createChunkRequest',
173
+ 'Required parameter "createChunkRequest" was null or undefined when calling createChunk().'
174
+ );
175
+ }
176
+
177
+ const queryParameters: any = {};
178
+
179
+ const headerParameters: runtime.HTTPHeaders = {};
180
+
181
+ headerParameters['Content-Type'] = 'application/json';
182
+
183
+
184
+ let urlPath = `/v1/chunks`;
185
+
186
+ const response = await this.request({
187
+ path: urlPath,
188
+ method: 'POST',
189
+ headers: headerParameters,
190
+ query: queryParameters,
191
+ body: CreateChunkRequestToJSON(requestParameters['createChunkRequest']),
192
+ }, initOverrides);
193
+
194
+ return new runtime.JSONApiResponse(response, (jsonValue) => ChunkResponseFromJSON(jsonValue));
195
+ }
196
+
197
+ /**
198
+ * Create a new chunk with content. The chunk is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). Content is deduplicated by SHA256 hash.
199
+ * Create Chunk Handler
200
+ */
201
+ async createChunk(requestParameters: CreateChunkOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse> {
202
+ const response = await this.createChunkRaw(requestParameters, initOverrides);
203
+ return await response.value();
204
+ }
205
+
206
+ /**
207
+ * Delete a chunk. The chunk is deleted via its PathPart (cascading delete). The associated ChunkContent may remain if shared by other chunks.
208
+ * Delete Chunk Handler
209
+ */
210
+ async deleteChunkRaw(requestParameters: DeleteChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
211
+ if (requestParameters['chunkId'] == null) {
212
+ throw new runtime.RequiredError(
213
+ 'chunkId',
214
+ 'Required parameter "chunkId" was null or undefined when calling deleteChunk().'
215
+ );
216
+ }
217
+
218
+ const queryParameters: any = {};
219
+
220
+ const headerParameters: runtime.HTTPHeaders = {};
221
+
222
+
223
+ let urlPath = `/v1/chunks/{chunk_id}`;
224
+ urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
225
+
226
+ const response = await this.request({
227
+ path: urlPath,
228
+ method: 'DELETE',
229
+ headers: headerParameters,
230
+ query: queryParameters,
231
+ }, initOverrides);
232
+
233
+ return new runtime.VoidApiResponse(response);
234
+ }
235
+
236
+ /**
237
+ * Delete a chunk. The chunk is deleted via its PathPart (cascading delete). The associated ChunkContent may remain if shared by other chunks.
238
+ * Delete Chunk Handler
239
+ */
240
+ async deleteChunk(requestParameters: DeleteChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
241
+ await this.deleteChunkRaw(requestParameters, initOverrides);
242
+ }
243
+
244
+ /**
245
+ * Get a chunk by its ID, including content.
246
+ * Get Chunk Handler
247
+ */
248
+ async getChunkRaw(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>> {
249
+ if (requestParameters['chunkId'] == null) {
250
+ throw new runtime.RequiredError(
251
+ 'chunkId',
252
+ 'Required parameter "chunkId" was null or undefined when calling getChunk().'
253
+ );
254
+ }
255
+
256
+ const queryParameters: any = {};
257
+
258
+ const headerParameters: runtime.HTTPHeaders = {};
259
+
260
+
261
+ let urlPath = `/v1/chunks/{chunk_id}`;
262
+ urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
263
+
264
+ const response = await this.request({
265
+ path: urlPath,
266
+ method: 'GET',
267
+ headers: headerParameters,
268
+ query: queryParameters,
269
+ }, initOverrides);
270
+
271
+ return new runtime.JSONApiResponse(response, (jsonValue) => ChunkResponseFromJSON(jsonValue));
272
+ }
273
+
274
+ /**
275
+ * Get a chunk by its ID, including content.
276
+ * Get Chunk Handler
277
+ */
278
+ async getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse> {
279
+ const response = await this.getChunkRaw(requestParameters, initOverrides);
280
+ return await response.value();
281
+ }
282
+
283
+ /**
284
+ * Update chunk content by creating a new content row. The old content row is preserved (not deleted). If the new content matches an existing content hash, it will be deduplicated.
285
+ * Update Chunk Content Handler
286
+ */
287
+ async updateChunkContentRaw(requestParameters: UpdateChunkContentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>> {
288
+ if (requestParameters['chunkId'] == null) {
289
+ throw new runtime.RequiredError(
290
+ 'chunkId',
291
+ 'Required parameter "chunkId" was null or undefined when calling updateChunkContent().'
292
+ );
293
+ }
294
+
295
+ if (requestParameters['updateChunkContentRequest'] == null) {
296
+ throw new runtime.RequiredError(
297
+ 'updateChunkContentRequest',
298
+ 'Required parameter "updateChunkContentRequest" was null or undefined when calling updateChunkContent().'
299
+ );
300
+ }
301
+
302
+ const queryParameters: any = {};
303
+
304
+ const headerParameters: runtime.HTTPHeaders = {};
305
+
306
+ headerParameters['Content-Type'] = 'application/json';
307
+
308
+
309
+ let urlPath = `/v1/chunks/{chunk_id}/content`;
310
+ urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
311
+
312
+ const response = await this.request({
313
+ path: urlPath,
314
+ method: 'PATCH',
315
+ headers: headerParameters,
316
+ query: queryParameters,
317
+ body: UpdateChunkContentRequestToJSON(requestParameters['updateChunkContentRequest']),
318
+ }, initOverrides);
319
+
320
+ return new runtime.JSONApiResponse(response, (jsonValue) => ChunkResponseFromJSON(jsonValue));
321
+ }
322
+
323
+ /**
324
+ * Update chunk content by creating a new content row. The old content row is preserved (not deleted). If the new content matches an existing content hash, it will be deduplicated.
325
+ * Update Chunk Content Handler
326
+ */
327
+ async updateChunkContent(requestParameters: UpdateChunkContentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse> {
328
+ const response = await this.updateChunkContentRaw(requestParameters, initOverrides);
329
+ return await response.value();
330
+ }
331
+
332
+ /**
333
+ * Update chunk metadata by merging with existing metadata. The provided metadata is shallow-merged into the existing chunk_metadata.
334
+ * Update Chunk Metadata Handler
335
+ */
336
+ async updateChunkMetadataRaw(requestParameters: UpdateChunkMetadataOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkResponse>> {
337
+ if (requestParameters['chunkId'] == null) {
338
+ throw new runtime.RequiredError(
339
+ 'chunkId',
340
+ 'Required parameter "chunkId" was null or undefined when calling updateChunkMetadata().'
341
+ );
342
+ }
343
+
344
+ if (requestParameters['updateChunkMetadataRequest'] == null) {
345
+ throw new runtime.RequiredError(
346
+ 'updateChunkMetadataRequest',
347
+ 'Required parameter "updateChunkMetadataRequest" was null or undefined when calling updateChunkMetadata().'
348
+ );
349
+ }
350
+
351
+ const queryParameters: any = {};
352
+
353
+ const headerParameters: runtime.HTTPHeaders = {};
354
+
355
+ headerParameters['Content-Type'] = 'application/json';
356
+
357
+
358
+ let urlPath = `/v1/chunks/{chunk_id}/metadata`;
359
+ urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
360
+
361
+ const response = await this.request({
362
+ path: urlPath,
363
+ method: 'PATCH',
364
+ headers: headerParameters,
365
+ query: queryParameters,
366
+ body: UpdateChunkMetadataRequestToJSON(requestParameters['updateChunkMetadataRequest']),
367
+ }, initOverrides);
368
+
369
+ return new runtime.JSONApiResponse(response, (jsonValue) => ChunkResponseFromJSON(jsonValue));
370
+ }
371
+
372
+ /**
373
+ * Update chunk metadata by merging with existing metadata. The provided metadata is shallow-merged into the existing chunk_metadata.
374
+ * Update Chunk Metadata Handler
375
+ */
376
+ async updateChunkMetadata(requestParameters: UpdateChunkMetadataOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse> {
377
+ const response = await this.updateChunkMetadataRaw(requestParameters, initOverrides);
378
+ return await response.value();
379
+ }
380
+
381
+ }
package/src/apis/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export * from './AuthApi';
4
+ export * from './ChunksApi';
4
5
  export * from './DefaultApi';
5
6
  export * from './DocumentVersionsApi';
6
7
  export * from './DocumentsApi';
@@ -0,0 +1,90 @@
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 { PolygonReference } from './PolygonReference';
17
+ import {
18
+ PolygonReferenceFromJSON,
19
+ PolygonReferenceFromJSONTyped,
20
+ PolygonReferenceToJSON,
21
+ PolygonReferenceToJSONTyped,
22
+ } from './PolygonReference';
23
+
24
+ /**
25
+ * Metadata for a chunk including source document references.
26
+ * @export
27
+ * @interface ChunkMetadataInput
28
+ */
29
+ export interface ChunkMetadataInput {
30
+ /**
31
+ * List of bounding boxes in the source document for the chunk, potentially from multiple areas of multiple pages.
32
+ * @type {Array<PolygonReference>}
33
+ * @memberof ChunkMetadataInput
34
+ */
35
+ polygons?: Array<PolygonReference>;
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the ChunkMetadataInput interface.
40
+ */
41
+ export function instanceOfChunkMetadataInput(value: object): value is ChunkMetadataInput {
42
+ return true;
43
+ }
44
+
45
+ export function ChunkMetadataInputFromJSON(json: any): ChunkMetadataInput {
46
+ return ChunkMetadataInputFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function ChunkMetadataInputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkMetadataInput {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'polygons': json['polygons'] == null ? undefined : ((json['polygons'] as Array<any>).map(PolygonReferenceFromJSON)),
56
+ };
57
+ }
58
+
59
+ export function ChunkMetadataInputToJSON(json: any): ChunkMetadataInput {
60
+ return ChunkMetadataInputToJSONTyped(json, false);
61
+ }
62
+
63
+ export function ChunkMetadataInputToJSONTyped(value?: ChunkMetadataInput | null, ignoreDiscriminator: boolean = false): any {
64
+ if (value == null) {
65
+ return value;
66
+ }
67
+
68
+ return {
69
+
70
+ 'polygons': value['polygons'] == null ? undefined : ((value['polygons'] as Array<any>).map(PolygonReferenceToJSON)),
71
+ };
72
+ }
73
+
74
+ export const ChunkMetadataInputPropertyValidationAttributesMap: {
75
+ [property: string]: {
76
+ maxLength?: number,
77
+ minLength?: number,
78
+ pattern?: string,
79
+ maximum?: number,
80
+ exclusiveMaximum?: boolean,
81
+ minimum?: number,
82
+ exclusiveMinimum?: boolean,
83
+ multipleOf?: number,
84
+ maxItems?: number,
85
+ minItems?: number,
86
+ uniqueItems?: boolean
87
+ }
88
+ } = {
89
+ }
90
+
@@ -0,0 +1,90 @@
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 { PolygonReference } from './PolygonReference';
17
+ import {
18
+ PolygonReferenceFromJSON,
19
+ PolygonReferenceFromJSONTyped,
20
+ PolygonReferenceToJSON,
21
+ PolygonReferenceToJSONTyped,
22
+ } from './PolygonReference';
23
+
24
+ /**
25
+ * Metadata for a chunk including source document references.
26
+ * @export
27
+ * @interface ChunkMetadataOutput
28
+ */
29
+ export interface ChunkMetadataOutput {
30
+ /**
31
+ * List of bounding boxes in the source document for the chunk, potentially from multiple areas of multiple pages.
32
+ * @type {Array<PolygonReference>}
33
+ * @memberof ChunkMetadataOutput
34
+ */
35
+ polygons?: Array<PolygonReference>;
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the ChunkMetadataOutput interface.
40
+ */
41
+ export function instanceOfChunkMetadataOutput(value: object): value is ChunkMetadataOutput {
42
+ return true;
43
+ }
44
+
45
+ export function ChunkMetadataOutputFromJSON(json: any): ChunkMetadataOutput {
46
+ return ChunkMetadataOutputFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function ChunkMetadataOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkMetadataOutput {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'polygons': json['polygons'] == null ? undefined : ((json['polygons'] as Array<any>).map(PolygonReferenceFromJSON)),
56
+ };
57
+ }
58
+
59
+ export function ChunkMetadataOutputToJSON(json: any): ChunkMetadataOutput {
60
+ return ChunkMetadataOutputToJSONTyped(json, false);
61
+ }
62
+
63
+ export function ChunkMetadataOutputToJSONTyped(value?: ChunkMetadataOutput | null, ignoreDiscriminator: boolean = false): any {
64
+ if (value == null) {
65
+ return value;
66
+ }
67
+
68
+ return {
69
+
70
+ 'polygons': value['polygons'] == null ? undefined : ((value['polygons'] as Array<any>).map(PolygonReferenceToJSON)),
71
+ };
72
+ }
73
+
74
+ export const ChunkMetadataOutputPropertyValidationAttributesMap: {
75
+ [property: string]: {
76
+ maxLength?: number,
77
+ minLength?: number,
78
+ pattern?: string,
79
+ maximum?: number,
80
+ exclusiveMaximum?: boolean,
81
+ minimum?: number,
82
+ exclusiveMinimum?: boolean,
83
+ multipleOf?: number,
84
+ maxItems?: number,
85
+ minItems?: number,
86
+ uniqueItems?: boolean
87
+ }
88
+ } = {
89
+ }
90
+