tuix-rag-service-client 0.1.2

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 (50) hide show
  1. package/.openapi-generator/FILES +20 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +48 -0
  5. package/apis/ClientApi.js +365 -0
  6. package/apis/ClientApi.js.map +1 -0
  7. package/apis/ClientApi.ts +501 -0
  8. package/apis/index.js +20 -0
  9. package/apis/index.js.map +1 -0
  10. package/apis/index.ts +3 -0
  11. package/docs/ClientApi.md +614 -0
  12. package/docs/CreateResourceResponseDTO.md +34 -0
  13. package/docs/ErrorDTO.md +34 -0
  14. package/docs/PaginatedResourcesDTO.md +42 -0
  15. package/docs/QueryResponseDTO.md +38 -0
  16. package/docs/ResourceDTO.md +44 -0
  17. package/docs/SearchRequestDTO.md +38 -0
  18. package/docs/SearchResultDTO.md +42 -0
  19. package/index.js +22 -0
  20. package/index.js.map +1 -0
  21. package/index.ts +5 -0
  22. package/models/CreateResourceResponseDTO.js +49 -0
  23. package/models/CreateResourceResponseDTO.js.map +1 -0
  24. package/models/CreateResourceResponseDTO.ts +65 -0
  25. package/models/ErrorDTO.js +49 -0
  26. package/models/ErrorDTO.js.map +1 -0
  27. package/models/ErrorDTO.ts +65 -0
  28. package/models/PaginatedResourcesDTO.js +68 -0
  29. package/models/PaginatedResourcesDTO.js.map +1 -0
  30. package/models/PaginatedResourcesDTO.ts +110 -0
  31. package/models/QueryResponseDTO.js +54 -0
  32. package/models/QueryResponseDTO.js.map +1 -0
  33. package/models/QueryResponseDTO.ts +89 -0
  34. package/models/ResourceDTO.js +59 -0
  35. package/models/ResourceDTO.js.map +1 -0
  36. package/models/ResourceDTO.ts +105 -0
  37. package/models/SearchRequestDTO.js +55 -0
  38. package/models/SearchRequestDTO.js.map +1 -0
  39. package/models/SearchRequestDTO.ts +82 -0
  40. package/models/SearchResultDTO.js +57 -0
  41. package/models/SearchResultDTO.js.map +1 -0
  42. package/models/SearchResultDTO.ts +97 -0
  43. package/models/index.js +26 -0
  44. package/models/index.js.map +1 -0
  45. package/models/index.ts +9 -0
  46. package/package.json +17 -0
  47. package/runtime.js +330 -0
  48. package/runtime.js.map +1 -0
  49. package/runtime.ts +432 -0
  50. package/tsconfig.build.tsbuildinfo +1 -0
@@ -0,0 +1,501 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Tuix RAG Service
5
+ * RAG (Retrieval-Augmented Generation) service for vector search and embeddings
6
+ *
7
+ * The version of the OpenAPI document: 0.0.1
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
+ CreateResourceResponseDTO,
19
+ ErrorDTO,
20
+ PaginatedResourcesDTO,
21
+ QueryResponseDTO,
22
+ ResourceDTO,
23
+ SearchRequestDTO,
24
+ } from '../models/index';
25
+ import {
26
+ CreateResourceResponseDTOFromJSON,
27
+ CreateResourceResponseDTOToJSON,
28
+ ErrorDTOFromJSON,
29
+ ErrorDTOToJSON,
30
+ PaginatedResourcesDTOFromJSON,
31
+ PaginatedResourcesDTOToJSON,
32
+ QueryResponseDTOFromJSON,
33
+ QueryResponseDTOToJSON,
34
+ ResourceDTOFromJSON,
35
+ ResourceDTOToJSON,
36
+ SearchRequestDTOFromJSON,
37
+ SearchRequestDTOToJSON,
38
+ } from '../models/index';
39
+
40
+ export interface ApiSearchPostRequest {
41
+ searchRequestDTO: SearchRequestDTO;
42
+ }
43
+
44
+ export interface ResourcesGetRequest {
45
+ page?: number;
46
+ pageSize?: number;
47
+ }
48
+
49
+ export interface ResourcesIdDeleteRequest {
50
+ id: string;
51
+ }
52
+
53
+ export interface ResourcesIdGetRequest {
54
+ id: string;
55
+ }
56
+
57
+ export interface ResourcesIdPatchRequest {
58
+ id: string;
59
+ file: Blob;
60
+ name: string;
61
+ chunkSize?: number;
62
+ role?: string;
63
+ }
64
+
65
+ export interface ResourcesPostRequest {
66
+ file: Blob;
67
+ name: string;
68
+ chunkSize?: number;
69
+ role?: string;
70
+ }
71
+
72
+ export interface SearchPostRequest {
73
+ searchRequestDTO: SearchRequestDTO;
74
+ }
75
+
76
+ /**
77
+ *
78
+ */
79
+ export class ClientApi extends runtime.BaseAPI {
80
+
81
+ /**
82
+ * Search for content chunks similar to the provided query using vector similarity search, optionally filtered by role.
83
+ * Search for similar content using POST method
84
+ */
85
+ async apiSearchPostRaw(requestParameters: ApiSearchPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<QueryResponseDTO>> {
86
+ if (requestParameters['searchRequestDTO'] == null) {
87
+ throw new runtime.RequiredError(
88
+ 'searchRequestDTO',
89
+ 'Required parameter "searchRequestDTO" was null or undefined when calling apiSearchPost().'
90
+ );
91
+ }
92
+
93
+ const queryParameters: any = {};
94
+
95
+ const headerParameters: runtime.HTTPHeaders = {};
96
+
97
+ headerParameters['Content-Type'] = 'application/json';
98
+
99
+
100
+ let urlPath = `/api/search`;
101
+
102
+ const response = await this.request({
103
+ path: urlPath,
104
+ method: 'POST',
105
+ headers: headerParameters,
106
+ query: queryParameters,
107
+ body: SearchRequestDTOToJSON(requestParameters['searchRequestDTO']),
108
+ }, initOverrides);
109
+
110
+ return new runtime.JSONApiResponse(response, (jsonValue) => QueryResponseDTOFromJSON(jsonValue));
111
+ }
112
+
113
+ /**
114
+ * Search for content chunks similar to the provided query using vector similarity search, optionally filtered by role.
115
+ * Search for similar content using POST method
116
+ */
117
+ async apiSearchPost(requestParameters: ApiSearchPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<QueryResponseDTO> {
118
+ const response = await this.apiSearchPostRaw(requestParameters, initOverrides);
119
+ return await response.value();
120
+ }
121
+
122
+ /**
123
+ * Delete all resources and their associated chunks
124
+ * Delete all resources and chunks
125
+ */
126
+ async resourcesDeleteRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
127
+ const queryParameters: any = {};
128
+
129
+ const headerParameters: runtime.HTTPHeaders = {};
130
+
131
+ if (this.configuration && this.configuration.apiKey) {
132
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth0JWT authentication
133
+ }
134
+
135
+
136
+ let urlPath = `/resources`;
137
+
138
+ const response = await this.request({
139
+ path: urlPath,
140
+ method: 'DELETE',
141
+ headers: headerParameters,
142
+ query: queryParameters,
143
+ }, initOverrides);
144
+
145
+ return new runtime.VoidApiResponse(response);
146
+ }
147
+
148
+ /**
149
+ * Delete all resources and their associated chunks
150
+ * Delete all resources and chunks
151
+ */
152
+ async resourcesDelete(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
153
+ await this.resourcesDeleteRaw(initOverrides);
154
+ }
155
+
156
+ /**
157
+ * Get a paginated list of all resources including their chunks
158
+ * Get paginated list of resources with chunks
159
+ */
160
+ async resourcesGetRaw(requestParameters: ResourcesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResourcesDTO>> {
161
+ const queryParameters: any = {};
162
+
163
+ if (requestParameters['page'] != null) {
164
+ queryParameters['page'] = requestParameters['page'];
165
+ }
166
+
167
+ if (requestParameters['pageSize'] != null) {
168
+ queryParameters['pageSize'] = requestParameters['pageSize'];
169
+ }
170
+
171
+ const headerParameters: runtime.HTTPHeaders = {};
172
+
173
+ if (this.configuration && this.configuration.apiKey) {
174
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth0JWT authentication
175
+ }
176
+
177
+
178
+ let urlPath = `/resources`;
179
+
180
+ const response = await this.request({
181
+ path: urlPath,
182
+ method: 'GET',
183
+ headers: headerParameters,
184
+ query: queryParameters,
185
+ }, initOverrides);
186
+
187
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResourcesDTOFromJSON(jsonValue));
188
+ }
189
+
190
+ /**
191
+ * Get a paginated list of all resources including their chunks
192
+ * Get paginated list of resources with chunks
193
+ */
194
+ async resourcesGet(requestParameters: ResourcesGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResourcesDTO> {
195
+ const response = await this.resourcesGetRaw(requestParameters, initOverrides);
196
+ return await response.value();
197
+ }
198
+
199
+ /**
200
+ * Delete a specific resource and all its associated chunks
201
+ * Delete a resource and its chunks
202
+ */
203
+ async resourcesIdDeleteRaw(requestParameters: ResourcesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
204
+ if (requestParameters['id'] == null) {
205
+ throw new runtime.RequiredError(
206
+ 'id',
207
+ 'Required parameter "id" was null or undefined when calling resourcesIdDelete().'
208
+ );
209
+ }
210
+
211
+ const queryParameters: any = {};
212
+
213
+ const headerParameters: runtime.HTTPHeaders = {};
214
+
215
+ if (this.configuration && this.configuration.apiKey) {
216
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth0JWT authentication
217
+ }
218
+
219
+
220
+ let urlPath = `/resources/{id}`;
221
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
222
+
223
+ const response = await this.request({
224
+ path: urlPath,
225
+ method: 'DELETE',
226
+ headers: headerParameters,
227
+ query: queryParameters,
228
+ }, initOverrides);
229
+
230
+ return new runtime.VoidApiResponse(response);
231
+ }
232
+
233
+ /**
234
+ * Delete a specific resource and all its associated chunks
235
+ * Delete a resource and its chunks
236
+ */
237
+ async resourcesIdDelete(requestParameters: ResourcesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
238
+ await this.resourcesIdDeleteRaw(requestParameters, initOverrides);
239
+ }
240
+
241
+ /**
242
+ * Get a specific resource including all its chunks
243
+ * Get a resource by ID with chunks
244
+ */
245
+ async resourcesIdGetRaw(requestParameters: ResourcesIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResourceDTO>> {
246
+ if (requestParameters['id'] == null) {
247
+ throw new runtime.RequiredError(
248
+ 'id',
249
+ 'Required parameter "id" was null or undefined when calling resourcesIdGet().'
250
+ );
251
+ }
252
+
253
+ const queryParameters: any = {};
254
+
255
+ const headerParameters: runtime.HTTPHeaders = {};
256
+
257
+ if (this.configuration && this.configuration.apiKey) {
258
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth0JWT authentication
259
+ }
260
+
261
+
262
+ let urlPath = `/resources/{id}`;
263
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
264
+
265
+ const response = await this.request({
266
+ path: urlPath,
267
+ method: 'GET',
268
+ headers: headerParameters,
269
+ query: queryParameters,
270
+ }, initOverrides);
271
+
272
+ return new runtime.JSONApiResponse(response, (jsonValue) => ResourceDTOFromJSON(jsonValue));
273
+ }
274
+
275
+ /**
276
+ * Get a specific resource including all its chunks
277
+ * Get a resource by ID with chunks
278
+ */
279
+ async resourcesIdGet(requestParameters: ResourcesIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResourceDTO> {
280
+ const response = await this.resourcesIdGetRaw(requestParameters, initOverrides);
281
+ return await response.value();
282
+ }
283
+
284
+ /**
285
+ * Update resource metadata and replace all chunks with new ones
286
+ * Update a resource and replace its chunks
287
+ */
288
+ async resourcesIdPatchRaw(requestParameters: ResourcesIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResourceDTO>> {
289
+ if (requestParameters['id'] == null) {
290
+ throw new runtime.RequiredError(
291
+ 'id',
292
+ 'Required parameter "id" was null or undefined when calling resourcesIdPatch().'
293
+ );
294
+ }
295
+
296
+ if (requestParameters['file'] == null) {
297
+ throw new runtime.RequiredError(
298
+ 'file',
299
+ 'Required parameter "file" was null or undefined when calling resourcesIdPatch().'
300
+ );
301
+ }
302
+
303
+ if (requestParameters['name'] == null) {
304
+ throw new runtime.RequiredError(
305
+ 'name',
306
+ 'Required parameter "name" was null or undefined when calling resourcesIdPatch().'
307
+ );
308
+ }
309
+
310
+ const queryParameters: any = {};
311
+
312
+ const headerParameters: runtime.HTTPHeaders = {};
313
+
314
+ if (this.configuration && this.configuration.apiKey) {
315
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth0JWT authentication
316
+ }
317
+
318
+ const consumes: runtime.Consume[] = [
319
+ { contentType: 'multipart/form-data' },
320
+ ];
321
+ // @ts-ignore: canConsumeForm may be unused
322
+ const canConsumeForm = runtime.canConsumeForm(consumes);
323
+
324
+ let formParams: { append(param: string, value: any): any };
325
+ let useForm = false;
326
+ // use FormData to transmit files using content-type "multipart/form-data"
327
+ useForm = canConsumeForm;
328
+ if (useForm) {
329
+ formParams = new FormData();
330
+ } else {
331
+ formParams = new URLSearchParams();
332
+ }
333
+
334
+ if (requestParameters['chunkSize'] != null) {
335
+ formParams.append('chunkSize', requestParameters['chunkSize'] as any);
336
+ }
337
+
338
+ if (requestParameters['file'] != null) {
339
+ formParams.append('file', requestParameters['file'] as any);
340
+ }
341
+
342
+ if (requestParameters['name'] != null) {
343
+ formParams.append('name', requestParameters['name'] as any);
344
+ }
345
+
346
+ if (requestParameters['role'] != null) {
347
+ formParams.append('role', requestParameters['role'] as any);
348
+ }
349
+
350
+
351
+ let urlPath = `/resources/{id}`;
352
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
353
+
354
+ const response = await this.request({
355
+ path: urlPath,
356
+ method: 'PATCH',
357
+ headers: headerParameters,
358
+ query: queryParameters,
359
+ body: formParams,
360
+ }, initOverrides);
361
+
362
+ return new runtime.JSONApiResponse(response, (jsonValue) => ResourceDTOFromJSON(jsonValue));
363
+ }
364
+
365
+ /**
366
+ * Update resource metadata and replace all chunks with new ones
367
+ * Update a resource and replace its chunks
368
+ */
369
+ async resourcesIdPatch(requestParameters: ResourcesIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResourceDTO> {
370
+ const response = await this.resourcesIdPatchRaw(requestParameters, initOverrides);
371
+ return await response.value();
372
+ }
373
+
374
+ /**
375
+ * Create a new resource and embed its chunks
376
+ * Create a new resource with chunks
377
+ */
378
+ async resourcesPostRaw(requestParameters: ResourcesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateResourceResponseDTO>> {
379
+ if (requestParameters['file'] == null) {
380
+ throw new runtime.RequiredError(
381
+ 'file',
382
+ 'Required parameter "file" was null or undefined when calling resourcesPost().'
383
+ );
384
+ }
385
+
386
+ if (requestParameters['name'] == null) {
387
+ throw new runtime.RequiredError(
388
+ 'name',
389
+ 'Required parameter "name" was null or undefined when calling resourcesPost().'
390
+ );
391
+ }
392
+
393
+ const queryParameters: any = {};
394
+
395
+ const headerParameters: runtime.HTTPHeaders = {};
396
+
397
+ if (this.configuration && this.configuration.apiKey) {
398
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth0JWT authentication
399
+ }
400
+
401
+ const consumes: runtime.Consume[] = [
402
+ { contentType: 'multipart/form-data' },
403
+ ];
404
+ // @ts-ignore: canConsumeForm may be unused
405
+ const canConsumeForm = runtime.canConsumeForm(consumes);
406
+
407
+ let formParams: { append(param: string, value: any): any };
408
+ let useForm = false;
409
+ // use FormData to transmit files using content-type "multipart/form-data"
410
+ useForm = canConsumeForm;
411
+ if (useForm) {
412
+ formParams = new FormData();
413
+ } else {
414
+ formParams = new URLSearchParams();
415
+ }
416
+
417
+ if (requestParameters['chunkSize'] != null) {
418
+ formParams.append('chunkSize', requestParameters['chunkSize'] as any);
419
+ }
420
+
421
+ if (requestParameters['file'] != null) {
422
+ formParams.append('file', requestParameters['file'] as any);
423
+ }
424
+
425
+ if (requestParameters['name'] != null) {
426
+ formParams.append('name', requestParameters['name'] as any);
427
+ }
428
+
429
+ if (requestParameters['role'] != null) {
430
+ formParams.append('role', requestParameters['role'] as any);
431
+ }
432
+
433
+
434
+ let urlPath = `/resources`;
435
+
436
+ const response = await this.request({
437
+ path: urlPath,
438
+ method: 'POST',
439
+ headers: headerParameters,
440
+ query: queryParameters,
441
+ body: formParams,
442
+ }, initOverrides);
443
+
444
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateResourceResponseDTOFromJSON(jsonValue));
445
+ }
446
+
447
+ /**
448
+ * Create a new resource and embed its chunks
449
+ * Create a new resource with chunks
450
+ */
451
+ async resourcesPost(requestParameters: ResourcesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateResourceResponseDTO> {
452
+ const response = await this.resourcesPostRaw(requestParameters, initOverrides);
453
+ return await response.value();
454
+ }
455
+
456
+ /**
457
+ * Search for content chunks similar to the provided query using vector similarity search, optionally filtered by role.
458
+ * Search for similar content using POST method
459
+ */
460
+ async searchPostRaw(requestParameters: SearchPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<QueryResponseDTO>> {
461
+ if (requestParameters['searchRequestDTO'] == null) {
462
+ throw new runtime.RequiredError(
463
+ 'searchRequestDTO',
464
+ 'Required parameter "searchRequestDTO" was null or undefined when calling searchPost().'
465
+ );
466
+ }
467
+
468
+ const queryParameters: any = {};
469
+
470
+ const headerParameters: runtime.HTTPHeaders = {};
471
+
472
+ headerParameters['Content-Type'] = 'application/json';
473
+
474
+ if (this.configuration && this.configuration.apiKey) {
475
+ headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth0JWT authentication
476
+ }
477
+
478
+
479
+ let urlPath = `/search`;
480
+
481
+ const response = await this.request({
482
+ path: urlPath,
483
+ method: 'POST',
484
+ headers: headerParameters,
485
+ query: queryParameters,
486
+ body: SearchRequestDTOToJSON(requestParameters['searchRequestDTO']),
487
+ }, initOverrides);
488
+
489
+ return new runtime.JSONApiResponse(response, (jsonValue) => QueryResponseDTOFromJSON(jsonValue));
490
+ }
491
+
492
+ /**
493
+ * Search for content chunks similar to the provided query using vector similarity search, optionally filtered by role.
494
+ * Search for similar content using POST method
495
+ */
496
+ async searchPost(requestParameters: SearchPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<QueryResponseDTO> {
497
+ const response = await this.searchPostRaw(requestParameters, initOverrides);
498
+ return await response.value();
499
+ }
500
+
501
+ }
package/apis/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /* tslint:disable */
18
+ /* eslint-disable */
19
+ __exportStar(require("./ClientApi"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oBAAoB;AACpB,oBAAoB;AACpB,8CAA4B"}
package/apis/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export * from './ClientApi';