@usecortex_ai/node 0.1.2 → 0.2.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 (110) hide show
  1. package/dist/Client.d.ts +5 -11
  2. package/dist/Client.js +12 -63
  3. package/dist/api/resources/document/client/Client.d.ts +59 -0
  4. package/dist/api/resources/document/client/Client.js +128 -0
  5. package/dist/api/resources/document/client/index.d.ts +1 -0
  6. package/dist/api/resources/document/client/index.js +2 -0
  7. package/dist/api/resources/document/index.d.ts +1 -0
  8. package/dist/api/resources/document/index.js +17 -0
  9. package/dist/api/resources/embeddings/client/Client.d.ts +13 -38
  10. package/dist/api/resources/embeddings/client/Client.js +12 -41
  11. package/dist/api/resources/embeddings/client/requests/EmbeddingsCreateCollectionRequest.d.ts +1 -0
  12. package/dist/api/resources/embeddings/client/requests/EmbeddingsDeleteRequest.d.ts +3 -0
  13. package/dist/api/resources/embeddings/client/requests/EmbeddingsSearchRequest.d.ts +3 -0
  14. package/dist/api/resources/embeddings/client/requests/GetEmbeddingsBasedOnChunkIdsRequest.d.ts +3 -0
  15. package/dist/api/resources/fetch/client/Client.d.ts +3 -3
  16. package/dist/api/resources/fetch/client/Client.js +2 -6
  17. package/dist/api/resources/fetch/client/requests/FetchContentRequest.d.ts +5 -0
  18. package/dist/api/resources/index.d.ts +1 -0
  19. package/dist/api/resources/index.js +2 -1
  20. package/dist/api/resources/search/client/Client.d.ts +11 -38
  21. package/dist/api/resources/search/client/Client.js +10 -41
  22. package/dist/api/resources/search/client/requests/FullTextSearchRequest.d.ts +5 -0
  23. package/dist/api/resources/search/client/requests/QnARequest.d.ts +17 -0
  24. package/dist/api/resources/search/client/requests/SearchRequest.d.ts +9 -1
  25. package/dist/api/resources/sources/client/Client.d.ts +15 -35
  26. package/dist/api/resources/sources/client/Client.js +14 -97
  27. package/dist/api/resources/sources/client/requests/SourcesGetAllRequest.d.ts +2 -0
  28. package/dist/api/resources/sources/client/requests/index.d.ts +0 -1
  29. package/dist/api/resources/tenant/client/Client.d.ts +55 -5
  30. package/dist/api/resources/tenant/client/Client.js +173 -8
  31. package/dist/api/resources/tenant/client/requests/TenantDeleteSubTenantRequest.d.ts +14 -0
  32. package/dist/api/resources/tenant/client/requests/TenantDeleteSubTenantRequest.js +5 -0
  33. package/dist/api/resources/tenant/client/requests/TenantGetSubTenantIdsRequest.d.ts +12 -0
  34. package/dist/api/resources/tenant/client/requests/TenantGetSubTenantIdsRequest.js +5 -0
  35. package/dist/api/resources/tenant/client/requests/TenantStatsRequest.d.ts +2 -0
  36. package/dist/api/resources/tenant/client/requests/index.d.ts +2 -0
  37. package/dist/api/resources/upload/client/Client.d.ts +95 -10
  38. package/dist/api/resources/upload/client/Client.js +94 -25
  39. package/dist/api/resources/upload/client/requests/BodyBatchUpdateUploadBatchUpdatePatch.d.ts +17 -1
  40. package/dist/api/resources/upload/client/requests/BodyBatchUploadUploadBatchUploadPost.d.ts +16 -1
  41. package/dist/api/resources/upload/client/requests/BodyUpdateFileUploadUpdateDocumentPatch.d.ts +17 -1
  42. package/dist/api/resources/upload/client/requests/BodyUploadFilesUploadUploadDocumentPost.d.ts +16 -1
  43. package/dist/api/resources/upload/client/requests/EmbeddingsUpdateRequest.d.ts +3 -0
  44. package/dist/api/resources/upload/client/requests/EmbeddingsUploadRequest.d.ts +4 -0
  45. package/dist/api/resources/upload/client/requests/UploadScrapeWebpageRequest.d.ts +4 -0
  46. package/dist/api/resources/upload/client/requests/UploadUpdateMarkdownRequest.d.ts +3 -0
  47. package/dist/api/resources/upload/client/requests/UploadUpdateTextRequest.d.ts +3 -0
  48. package/dist/api/resources/upload/client/requests/UploadUpdateWebpageRequest.d.ts +4 -0
  49. package/dist/api/resources/upload/client/requests/UploadUploadAppSourcesRequest.d.ts +3 -0
  50. package/dist/api/resources/upload/client/requests/UploadUploadMarkdownRequest.d.ts +2 -0
  51. package/dist/api/resources/upload/client/requests/UploadUploadTextRequest.d.ts +2 -0
  52. package/dist/api/resources/upload/client/requests/UploadVerifyProcessingRequest.d.ts +2 -0
  53. package/dist/api/resources/user/client/Client.d.ts +9 -6
  54. package/dist/api/resources/user/client/Client.js +8 -9
  55. package/dist/api/resources/user/client/requests/BodyCreateTenantUserCreateTenantPost.d.ts +1 -0
  56. package/dist/api/resources/userMemory/client/Client.d.ts +89 -21
  57. package/dist/api/resources/userMemory/client/Client.js +183 -33
  58. package/dist/api/resources/userMemory/client/requests/AddUserMemoryRequest.d.ts +18 -0
  59. package/dist/api/resources/userMemory/client/requests/AddUserMemoryRequest.js +5 -0
  60. package/dist/api/resources/userMemory/client/requests/GenerateUserMemoryRequest.d.ts +21 -0
  61. package/dist/api/resources/userMemory/client/requests/GenerateUserMemoryRequest.js +5 -0
  62. package/dist/api/resources/userMemory/client/requests/RetrieveUserMemoryRequest.d.ts +20 -0
  63. package/dist/api/resources/userMemory/client/requests/RetrieveUserMemoryRequest.js +5 -0
  64. package/dist/api/resources/userMemory/client/requests/UserMemoryDeleteUserMemoryRequest.d.ts +5 -3
  65. package/dist/api/resources/userMemory/client/requests/UserMemoryListUserMemoriesRequest.d.ts +4 -3
  66. package/dist/api/resources/userMemory/client/requests/index.d.ts +3 -3
  67. package/dist/api/types/AddUserMemoryResponse.d.ts +14 -0
  68. package/dist/api/types/AddUserMemoryResponse.js +5 -0
  69. package/dist/api/types/AppSourcesUploadData.d.ts +3 -1
  70. package/dist/api/types/AttachmentModel.d.ts +7 -0
  71. package/dist/api/types/BatchUploadData.d.ts +3 -1
  72. package/dist/api/types/BodyScrapeWebpageUploadScrapeWebpagePost.d.ts +0 -1
  73. package/dist/api/types/BodyUpdateScrapeJobUploadUpdateWebpagePatch.d.ts +0 -1
  74. package/dist/api/types/ContentModel.d.ts +6 -0
  75. package/dist/api/types/DeleteMemoryRequest.d.ts +3 -0
  76. package/dist/api/types/DeleteSources.d.ts +7 -0
  77. package/dist/api/types/DeleteSources.js +5 -0
  78. package/dist/api/types/DeleteSubTenantData.d.ts +15 -0
  79. package/dist/api/types/DeleteSubTenantData.js +5 -0
  80. package/dist/api/types/DeleteUserMemoryResponse.d.ts +12 -0
  81. package/dist/api/types/DeleteUserMemoryResponse.js +5 -0
  82. package/dist/api/types/EmbeddingsCreateCollectionData.d.ts +4 -0
  83. package/dist/api/types/EmbeddingsDeleteData.d.ts +4 -0
  84. package/dist/api/types/EmbeddingsGetData.d.ts +4 -0
  85. package/dist/api/types/EmbeddingsSearchData.d.ts +4 -0
  86. package/dist/api/types/ErrorResponse.d.ts +0 -1
  87. package/dist/api/types/FetchContentData.d.ts +4 -1
  88. package/dist/api/types/FileUploadResult.d.ts +2 -0
  89. package/dist/api/types/GenerateUserMemoryResponse.d.ts +13 -0
  90. package/dist/api/types/GenerateUserMemoryResponse.js +5 -0
  91. package/dist/api/types/ListSourcesResponse.d.ts +3 -0
  92. package/dist/api/types/ListUserMemoriesResponse.d.ts +13 -0
  93. package/dist/api/types/ListUserMemoriesResponse.js +5 -0
  94. package/dist/api/types/MarkdownUploadRequest.d.ts +12 -2
  95. package/dist/api/types/ProcessingStatus.d.ts +3 -0
  96. package/dist/api/types/Relations.d.ts +2 -0
  97. package/dist/api/types/RetrieveUserMemoryResponse.d.ts +13 -0
  98. package/dist/api/types/RetrieveUserMemoryResponse.js +5 -0
  99. package/dist/api/types/SearchChunk.d.ts +11 -6
  100. package/dist/api/types/SingleUploadData.d.ts +3 -1
  101. package/dist/api/types/Source.d.ts +7 -8
  102. package/dist/api/types/SourceModel.d.ts +21 -2
  103. package/dist/api/types/SubTenantIdsData.d.ts +6 -1
  104. package/dist/api/types/TenantCreateData.d.ts +4 -0
  105. package/dist/api/types/TenantStats.d.ts +5 -0
  106. package/dist/api/types/UserMemory.d.ts +12 -0
  107. package/dist/api/types/UserMemory.js +5 -0
  108. package/dist/api/types/index.d.ts +8 -1
  109. package/dist/api/types/index.js +8 -1
  110. package/package.json +1 -1
@@ -44,10 +44,16 @@ const CortexAI = __importStar(require("../../../index.js"));
44
44
  const headers_js_1 = require("../../../../core/headers.js");
45
45
  const errors = __importStar(require("../../../../errors/index.js"));
46
46
  class Upload {
47
- constructor(_options = {}) {
47
+ constructor(_options) {
48
48
  this._options = _options;
49
49
  }
50
50
  /**
51
+ * Upload multiple documents simultaneously for efficient bulk processing.
52
+ *
53
+ * This endpoint allows you to upload several files at once, which is ideal for large document collections or periodic data imports. Each file gets processed asynchronously, and you can track the progress of individual files using their returned file IDs.
54
+ *
55
+ * The system automatically handles file parsing, content extraction, and indexing across all uploaded documents. You'll receive confirmation once all files are queued for processing.
56
+ *
51
57
  * @param {CortexAI.BodyBatchUploadUploadBatchUploadPost} request
52
58
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
53
59
  *
@@ -86,9 +92,6 @@ class Upload {
86
92
  if (request.document_metadata != null) {
87
93
  _request.append("document_metadata", request.document_metadata);
88
94
  }
89
- if (request.relations != null) {
90
- _request.append("relations", request.relations);
91
- }
92
95
  const _maybeEncodedRequest = await _request.getRequest();
93
96
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: await this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
94
97
  const _response = await core.fetcher({
@@ -147,6 +150,12 @@ class Upload {
147
150
  }
148
151
  }
149
152
  /**
153
+ * Update multiple existing documents with new content and metadata.
154
+ *
155
+ * Use this endpoint when you need to replace or modify several documents that are already in your knowledge base. Each file must correspond to an existing source ID, ensuring that updates are applied to the correct documents.
156
+ *
157
+ * The system processes updates asynchronously, allowing you to continue working while your documents are re-indexed. Track the progress using the returned file IDs to know when updates are complete.
158
+ *
150
159
  * @param {CortexAI.BodyBatchUpdateUploadBatchUpdatePatch} request
151
160
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
152
161
  *
@@ -190,9 +199,6 @@ class Upload {
190
199
  if (request.document_metadata != null) {
191
200
  _request.append("document_metadata", request.document_metadata);
192
201
  }
193
- if (request.relations != null) {
194
- _request.append("relations", request.relations);
195
- }
196
202
  const _maybeEncodedRequest = await _request.getRequest();
197
203
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: await this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
198
204
  const _response = await core.fetcher({
@@ -251,6 +257,12 @@ class Upload {
251
257
  }
252
258
  }
253
259
  /**
260
+ * Upload a single document for processing and indexing into your knowledge base.
261
+ *
262
+ * This endpoint accepts documents in various formats and processes them for search and retrieval. You can include custom metadata to help organize and categorize your content.
263
+ *
264
+ * The system extracts text content, processes it asynchronously, and makes it available for search queries. You can track the processing status using the returned file ID.
265
+ *
254
266
  * @param {CortexAI.BodyUploadFilesUploadUploadDocumentPost} request
255
267
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
256
268
  *
@@ -287,9 +299,6 @@ class Upload {
287
299
  if (request.document_metadata != null) {
288
300
  _request.append("document_metadata", request.document_metadata);
289
301
  }
290
- if (request.relations != null) {
291
- _request.append("relations", request.relations);
292
- }
293
302
  const _maybeEncodedRequest = await _request.getRequest();
294
303
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: await this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
295
304
  const _response = await core.fetcher({
@@ -348,6 +357,12 @@ class Upload {
348
357
  }
349
358
  }
350
359
  /**
360
+ * Replace an existing document with updated content.
361
+ *
362
+ * This endpoint allows you to update a specific document that's already in your knowledge base. Provide the source ID of the document you want to modify, along with the new file content.
363
+ *
364
+ * The system will process your update asynchronously and re-index the document with the new content. You can monitor the progress using the returned file ID.
365
+ *
351
366
  * @param {CortexAI.BodyUpdateFileUploadUpdateDocumentPatch} request
352
367
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
353
368
  *
@@ -386,9 +401,6 @@ class Upload {
386
401
  if (request.document_metadata != null) {
387
402
  _request.append("document_metadata", request.document_metadata);
388
403
  }
389
- if (request.relations != null) {
390
- _request.append("relations", request.relations);
391
- }
392
404
  const _maybeEncodedRequest = await _request.getRequest();
393
405
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: await this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
394
406
  const _response = await core.fetcher({
@@ -447,6 +459,12 @@ class Upload {
447
459
  }
448
460
  }
449
461
  /**
462
+ * Upload structured data from applications or APIs for indexing.
463
+ *
464
+ * This endpoint is designed for importing data from applications. If you are specifically using Cortex to provide search to an application, you should prefer this endpoint. It accepts structured source objects and allows you to clearly define contents of attachments
465
+ *
466
+ * The system processes each source asynchronously and makes the content available for search and retrieval. Use this when you need to integrate search and indexing from data in your applications into your knowledge base.
467
+ *
450
468
  * @param {CortexAI.UploadUploadAppSourcesRequest} request
451
469
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
452
470
  *
@@ -532,8 +550,11 @@ class Upload {
532
550
  }
533
551
  }
534
552
  /**
535
- * Upload markdown content. If request.document_metadata contains a 'file_id' key (non-empty), it will be used as the file ID;
536
- * otherwise, a new file_id will be generated for that file. This allows file-specific IDs to be set directly in the metadata.
553
+ * Upload text or markdown content directly for processing.
554
+ *
555
+ * This endpoint accepts plain text or markdown-formatted content that you want to add to your knowledge base. It's perfect for notes, documentation, articles, or any text-based content you want to make searchable.
556
+ *
557
+ * You can include custom metadata to help organize and categorize your content. You can track the processing status using the returned file ID.
537
558
  *
538
559
  * @param {CortexAI.UploadUploadMarkdownRequest} request
539
560
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
@@ -622,8 +643,11 @@ class Upload {
622
643
  }
623
644
  }
624
645
  /**
625
- * Upload markdown content. If request.document_metadata contains a 'file_id' key (non-empty), it will be used as the file ID;
626
- * otherwise, a new file_id will be generated for that file. This allows file-specific IDs to be set directly in the metadata.
646
+ * Upload text or markdown content directly for processing.
647
+ *
648
+ * This endpoint accepts plain text or markdown-formatted content that you want to add to your knowledge base. It's perfect for notes, documentation, articles, or any text-based content you want to make searchable.
649
+ *
650
+ * You can include custom metadata to help organize and categorize your content. You can track the processing status using the returned file ID.
627
651
  *
628
652
  * @param {CortexAI.UploadUploadTextRequest} request
629
653
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
@@ -712,6 +736,12 @@ class Upload {
712
736
  }
713
737
  }
714
738
  /**
739
+ * Update existing text or markdown content with new information.
740
+ *
741
+ * This endpoint allows you to modify text or markdown content that's already in your knowledge base. Provide the source ID of the content you want to update, along with the new text.
742
+ *
743
+ * The system will reprocess and re-index the updated content asynchronously. Use this when you need to correct information, add details, or refresh existing documentation.
744
+ *
715
745
  * @param {CortexAI.UploadUpdateMarkdownRequest} request
716
746
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
717
747
  *
@@ -801,6 +831,12 @@ class Upload {
801
831
  }
802
832
  }
803
833
  /**
834
+ * Update existing text or markdown content with new information.
835
+ *
836
+ * This endpoint allows you to modify text or markdown content that's already in your knowledge base. Provide the source ID of the content you want to update, along with the new text.
837
+ *
838
+ * The system will reprocess and re-index the updated content asynchronously. Use this when you need to correct information, add details, or refresh existing documentation.
839
+ *
804
840
  * @param {CortexAI.UploadUpdateTextRequest} request
805
841
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
806
842
  *
@@ -890,6 +926,12 @@ class Upload {
890
926
  }
891
927
  }
892
928
  /**
929
+ * Upload pre-computed embeddings for advanced similarity search.
930
+ *
931
+ * This endpoint accepts vector embeddings that you've generated externally, allowing you to integrate with custom embedding models or existing vector databases. The embeddings represent chunks of your content as numerical vectors.
932
+ *
933
+ * The system stores these embeddings and makes them available for semantic search and similarity matching. Use this when you want to leverage specialized embedding models or have existing vector representations.
934
+ *
893
935
  * @param {CortexAI.EmbeddingsUploadRequest} request
894
936
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
895
937
  *
@@ -975,6 +1017,12 @@ class Upload {
975
1017
  }
976
1018
  }
977
1019
  /**
1020
+ * Update existing embeddings with new vector representations.
1021
+ *
1022
+ * This endpoint allows you to modify embeddings that are already stored in your knowledge base. Provide updated vector representations for specific chunks of content, identified by their chunk IDs.
1023
+ *
1024
+ * The system will replace the existing embeddings with your new ones, ensuring that similarity searches reflect the most current vector representations. Use this when you need to update embeddings due to model improvements or content changes.
1025
+ *
978
1026
  * @param {CortexAI.EmbeddingsUpdateRequest} request
979
1027
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
980
1028
  *
@@ -1059,6 +1107,12 @@ class Upload {
1059
1107
  }
1060
1108
  }
1061
1109
  /**
1110
+ * Extract and index content from web pages automatically.
1111
+ *
1112
+ * This endpoint initiates web scraping for the specified URL, extracting the main content, text, and structure from the webpage. It's perfect for capturing articles, documentation, or any web content you want to include in your knowledge base.
1113
+ *
1114
+ * The system processes the webpage content asynchronously, cleaning and structuring the information for optimal search and retrieval. Use this when you need to add web content without manual copying and pasting.
1115
+ *
1062
1116
  * @param {CortexAI.UploadScrapeWebpageRequest} request
1063
1117
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
1064
1118
  *
@@ -1149,6 +1203,12 @@ class Upload {
1149
1203
  }
1150
1204
  }
1151
1205
  /**
1206
+ * Update web scraping content with fresh data from the source URL.
1207
+ *
1208
+ * This endpoint refreshes the content for an existing web scraping job. Provide the source ID of the webpage content you want to update, and the system will re-scrape the URL to capture any changes.
1209
+ *
1210
+ * The updated content gets processed asynchronously and re-indexed in your knowledge base. Use this to keep web content current when the source pages are frequently updated.
1211
+ *
1152
1212
  * @param {CortexAI.UploadUpdateWebpageRequest} request
1153
1213
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
1154
1214
  *
@@ -1238,6 +1298,12 @@ class Upload {
1238
1298
  }
1239
1299
  }
1240
1300
  /**
1301
+ * Remove documents and content from your knowledge base.
1302
+ *
1303
+ * This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
1304
+ *
1305
+ * Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
1306
+ *
1241
1307
  * @param {CortexAI.DeleteMemoryRequest} request
1242
1308
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
1243
1309
  *
@@ -1299,6 +1365,12 @@ class Upload {
1299
1365
  }
1300
1366
  }
1301
1367
  /**
1368
+ * Remove documents and content from your knowledge base.
1369
+ *
1370
+ * This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
1371
+ *
1372
+ * Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
1373
+ *
1302
1374
  * @param {CortexAI.DeleteMemoryRequest} request
1303
1375
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
1304
1376
  *
@@ -1360,10 +1432,11 @@ class Upload {
1360
1432
  }
1361
1433
  }
1362
1434
  /**
1363
- * Verify the processing status of an uploaded file.
1435
+ * Check the current processing status of your uploaded content.
1436
+ *
1437
+ * This endpoint allows you to monitor the progress of documents, text, or other content you've uploaded. Simply provide the file ID to see whether processing is complete, still in progress, or if any errors occurred.
1364
1438
  *
1365
- * Returns:
1366
- * ProcessingStatusResponse: Processing status information
1439
+ * Use this to determine when your content is ready for search and retrieval, or to troubleshoot any processing issues.
1367
1440
  *
1368
1441
  * @param {CortexAI.UploadVerifyProcessingRequest} request
1369
1442
  * @param {Upload.RequestOptions} requestOptions - Request-specific configuration.
@@ -1446,11 +1519,7 @@ class Upload {
1446
1519
  }
1447
1520
  }
1448
1521
  async _getAuthorizationHeader() {
1449
- const bearer = await core.Supplier.get(this._options.token);
1450
- if (bearer != null) {
1451
- return `Bearer ${bearer}`;
1452
- }
1453
- return undefined;
1522
+ return `Bearer ${await core.Supplier.get(this._options.token)}`;
1454
1523
  }
1455
1524
  }
1456
1525
  exports.Upload = Upload;
@@ -10,11 +10,27 @@ import * as core from "../../../../../core/index.js";
10
10
  * }
11
11
  */
12
12
  export interface BodyBatchUpdateUploadBatchUpdatePatch {
13
+ /** Unique identifier for the tenant/organization */
13
14
  tenant_id: string;
15
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
14
16
  sub_tenant_id?: string;
17
+ /** The document file to upload (e.g., PDF, DOCX, TXT) */
15
18
  files: core.file.Uploadable.FileLike[];
19
+ /** List of source IDs corresponding to the files being updated */
16
20
  source_ids?: string[];
21
+ /**
22
+ * JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
23
+ *
24
+ * Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
25
+ *
26
+ */
17
27
  tenant_metadata?: string;
28
+ /**
29
+ * JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
30
+ *
31
+ * Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
32
+ *
33
+ *
34
+ */
18
35
  document_metadata?: string;
19
- relations?: string;
20
36
  }
@@ -10,10 +10,25 @@ import * as core from "../../../../../core/index.js";
10
10
  * }
11
11
  */
12
12
  export interface BodyBatchUploadUploadBatchUploadPost {
13
+ /** Unique identifier for the tenant/organization */
13
14
  tenant_id: string;
15
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
14
16
  sub_tenant_id?: string;
17
+ /** The document file to upload (e.g., PDF, DOCX, TXT) */
15
18
  files: core.file.Uploadable.FileLike[];
19
+ /**
20
+ * JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
21
+ *
22
+ * Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
23
+ *
24
+ */
16
25
  tenant_metadata?: string;
26
+ /**
27
+ * JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
28
+ *
29
+ * Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
30
+ *
31
+ *
32
+ */
17
33
  document_metadata?: string;
18
- relations?: string;
19
34
  }
@@ -11,11 +11,27 @@ import * as core from "../../../../../core/index.js";
11
11
  * }
12
12
  */
13
13
  export interface BodyUpdateFileUploadUpdateDocumentPatch {
14
+ /** The source ID of the document to update */
14
15
  source_id: string;
16
+ /** Unique identifier for the tenant/organization */
15
17
  tenant_id: string;
18
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
16
19
  sub_tenant_id?: string;
20
+ /** The document file to upload (e.g., PDF, DOCX, TXT) */
17
21
  file: core.file.Uploadable.FileLike;
22
+ /**
23
+ * JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
24
+ *
25
+ * Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
26
+ *
27
+ */
18
28
  tenant_metadata?: string;
29
+ /**
30
+ * JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
31
+ *
32
+ * Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
33
+ *
34
+ *
35
+ */
19
36
  document_metadata?: string;
20
- relations?: string;
21
37
  }
@@ -10,10 +10,25 @@ import * as core from "../../../../../core/index.js";
10
10
  * }
11
11
  */
12
12
  export interface BodyUploadFilesUploadUploadDocumentPost {
13
+ /** Unique identifier for the tenant/organization */
13
14
  tenant_id: string;
15
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
14
16
  sub_tenant_id?: string;
17
+ /** The document file to upload (e.g., PDF, DOCX, TXT) */
15
18
  file: core.file.Uploadable.FileLike;
19
+ /**
20
+ * JSON string containing tenant-level document metadata (e.g., department, compliance_tag)
21
+ *
22
+ * Example: > "{"department":"Finance","compliance_tag":"GDPR"}"
23
+ *
24
+ */
16
25
  tenant_metadata?: string;
26
+ /**
27
+ * JSON string containing document-specific metadata (e.g., title, author, file_id). If file_id is not provided, the system will generate an ID automatically.
28
+ *
29
+ * Example: > "{"title":"Q1 Report.pdf","author":"Alice Smith","file_id":"custom_file_123"}"
30
+ *
31
+ *
32
+ */
17
33
  document_metadata?: string;
18
- relations?: string;
19
34
  }
@@ -8,7 +8,10 @@
8
8
  * }
9
9
  */
10
10
  export interface EmbeddingsUpdateRequest {
11
+ /** Unique identifier for the tenant/organization */
11
12
  tenant_id: string;
13
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
12
14
  sub_tenant_id?: string;
15
+ /** The embeddings of source you want to index */
13
16
  embeddings?: Record<string, number[]>;
14
17
  }
@@ -9,8 +9,12 @@
9
9
  * }
10
10
  */
11
11
  export interface EmbeddingsUploadRequest {
12
+ /** Unique identifier for the tenant/organization */
12
13
  tenant_id: string;
14
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
13
15
  sub_tenant_id?: string;
16
+ /** The embeddings of source you want to index */
14
17
  embeddings: number[][];
18
+ /** The Source ID of the target source you want to index */
15
19
  file_id?: string;
16
20
  }
@@ -11,9 +11,13 @@ import * as CortexAI from "../../../../index.js";
11
11
  * }
12
12
  */
13
13
  export interface UploadScrapeWebpageRequest {
14
+ /** The URL of the webpage to scrape and index */
14
15
  web_url: string;
16
+ /** Unique identifier for the tenant/organization */
15
17
  tenant_id: string;
18
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
16
19
  sub_tenant_id?: string;
20
+ /** Optional custom file ID for the scraped content. If not provided, a unique ID will be generated */
17
21
  file_id?: string;
18
22
  body: CortexAI.BodyScrapeWebpageUploadScrapeWebpagePost;
19
23
  }
@@ -13,8 +13,11 @@ import * as CortexAI from "../../../../index.js";
13
13
  * }
14
14
  */
15
15
  export interface UploadUpdateMarkdownRequest {
16
+ /** The source ID of the document to update */
16
17
  source_id: string;
18
+ /** Unique identifier for the tenant/organization */
17
19
  tenant_id: string;
20
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
18
21
  sub_tenant_id?: string;
19
22
  body: CortexAI.MarkdownUploadRequest;
20
23
  }
@@ -13,8 +13,11 @@ import * as CortexAI from "../../../../index.js";
13
13
  * }
14
14
  */
15
15
  export interface UploadUpdateTextRequest {
16
+ /** The source ID of the document to update */
16
17
  source_id: string;
18
+ /** Unique identifier for the tenant/organization */
17
19
  tenant_id: string;
20
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
18
21
  sub_tenant_id?: string;
19
22
  body: CortexAI.MarkdownUploadRequest;
20
23
  }
@@ -12,9 +12,13 @@ import * as CortexAI from "../../../../index.js";
12
12
  * }
13
13
  */
14
14
  export interface UploadUpdateWebpageRequest {
15
+ /** The URL of the webpage to re-scrape */
15
16
  web_url: string;
17
+ /** The file ID of the existing web scraping job to update */
16
18
  source_id: string;
19
+ /** Unique identifier for the tenant/organization */
17
20
  tenant_id: string;
21
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
18
22
  sub_tenant_id?: string;
19
23
  body: CortexAI.BodyUpdateScrapeJobUploadUpdateWebpagePatch;
20
24
  }
@@ -10,7 +10,10 @@ import * as CortexAI from "../../../../index.js";
10
10
  * }
11
11
  */
12
12
  export interface UploadUploadAppSourcesRequest {
13
+ /** Unique identifier for the tenant/organization */
13
14
  tenant_id: string;
15
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
14
16
  sub_tenant_id?: string;
17
+ /** List of structured source objects containing app-generated data to be indexed */
15
18
  body: CortexAI.SourceModel[];
16
19
  }
@@ -12,7 +12,9 @@ import * as CortexAI from "../../../../index.js";
12
12
  * }
13
13
  */
14
14
  export interface UploadUploadMarkdownRequest {
15
+ /** Unique identifier for the tenant/organization */
15
16
  tenant_id: string;
17
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
16
18
  sub_tenant_id?: string;
17
19
  body: CortexAI.MarkdownUploadRequest;
18
20
  }
@@ -12,7 +12,9 @@ import * as CortexAI from "../../../../index.js";
12
12
  * }
13
13
  */
14
14
  export interface UploadUploadTextRequest {
15
+ /** Unique identifier for the tenant/organization */
15
16
  tenant_id: string;
17
+ /** Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id */
16
18
  sub_tenant_id?: string;
17
19
  body: CortexAI.MarkdownUploadRequest;
18
20
  }
@@ -8,6 +8,8 @@
8
8
  * }
9
9
  */
10
10
  export interface UploadVerifyProcessingRequest {
11
+ /** The file ID to check processing status for */
11
12
  file_id: string;
13
+ /** Unique identifier for the tenant/organization */
12
14
  tenant_id?: string;
13
15
  }
@@ -9,7 +9,7 @@ export declare namespace User {
9
9
  environment?: core.Supplier<environments.CortexAIEnvironment | string>;
10
10
  /** Specify a custom URL to connect the client to. */
11
11
  baseUrl?: core.Supplier<string>;
12
- token?: core.Supplier<core.BearerToken | undefined>;
12
+ token: core.Supplier<core.BearerToken>;
13
13
  /** Additional headers to include in requests. */
14
14
  headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
15
15
  }
@@ -28,12 +28,15 @@ export declare namespace User {
28
28
  }
29
29
  export declare class User {
30
30
  protected readonly _options: User.Options;
31
- constructor(_options?: User.Options);
31
+ constructor(_options: User.Options);
32
32
  /**
33
- * Create a new tenant for the authenticated user.
33
+ * Create a tenant for your account.
34
34
  *
35
- * Returns:
36
- * TenantCreateResponse: Success response with tenant creation details
35
+ * Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search. Optionally include a metadata schema to enforce consistent attributes across documents.
36
+ *
37
+ * Expected outcome
38
+ * - A tenant is created and returned with its identifier.
39
+ * - If the tenant already exists, you receive a success message with the existing identifier.
37
40
  *
38
41
  * @param {CortexAI.BodyCreateTenantUserCreateTenantPost} request
39
42
  * @param {User.RequestOptions} requestOptions - Request-specific configuration.
@@ -51,5 +54,5 @@ export declare class User {
51
54
  */
52
55
  createTenant(request?: CortexAI.BodyCreateTenantUserCreateTenantPost, requestOptions?: User.RequestOptions): core.HttpResponsePromise<CortexAI.TenantCreateData>;
53
56
  private __createTenant;
54
- protected _getAuthorizationHeader(): Promise<string | undefined>;
57
+ protected _getAuthorizationHeader(): Promise<string>;
55
58
  }
@@ -44,14 +44,17 @@ const CortexAI = __importStar(require("../../../index.js"));
44
44
  const headers_js_1 = require("../../../../core/headers.js");
45
45
  const errors = __importStar(require("../../../../errors/index.js"));
46
46
  class User {
47
- constructor(_options = {}) {
47
+ constructor(_options) {
48
48
  this._options = _options;
49
49
  }
50
50
  /**
51
- * Create a new tenant for the authenticated user.
51
+ * Create a tenant for your account.
52
52
  *
53
- * Returns:
54
- * TenantCreateResponse: Success response with tenant creation details
53
+ * Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search. Optionally include a metadata schema to enforce consistent attributes across documents.
54
+ *
55
+ * Expected outcome
56
+ * - A tenant is created and returned with its identifier.
57
+ * - If the tenant already exists, you receive a success message with the existing identifier.
55
58
  *
56
59
  * @param {CortexAI.BodyCreateTenantUserCreateTenantPost} request
57
60
  * @param {User.RequestOptions} requestOptions - Request-specific configuration.
@@ -134,11 +137,7 @@ class User {
134
137
  }
135
138
  }
136
139
  async _getAuthorizationHeader() {
137
- const bearer = await core.Supplier.get(this._options.token);
138
- if (bearer != null) {
139
- return `Bearer ${bearer}`;
140
- }
141
- return undefined;
140
+ return `Bearer ${await core.Supplier.get(this._options.token)}`;
142
141
  }
143
142
  }
144
143
  exports.User = User;
@@ -6,6 +6,7 @@
6
6
  * {}
7
7
  */
8
8
  export interface BodyCreateTenantUserCreateTenantPost {
9
+ /** Unique identifier for the tenant/organization */
9
10
  tenant_id?: string;
10
11
  tenant_metadata_schema?: Record<string, unknown>[];
11
12
  }