@usecortex_ai/node 0.3.5 → 0.4.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 (249) hide show
  1. package/dist/Client.d.ts +20 -24
  2. package/dist/Client.js +26 -34
  3. package/dist/api/errors/BadRequestError.d.ts +1 -2
  4. package/dist/api/errors/ForbiddenError.d.ts +1 -2
  5. package/dist/api/errors/InternalServerError.d.ts +1 -2
  6. package/dist/api/errors/NotFoundError.d.ts +1 -2
  7. package/dist/api/errors/ServiceUnavailableError.d.ts +1 -2
  8. package/dist/api/errors/TooManyRequestsError.d.ts +9 -0
  9. package/dist/api/errors/TooManyRequestsError.js +42 -0
  10. package/dist/api/errors/UnauthorizedError.d.ts +1 -2
  11. package/dist/api/errors/index.d.ts +1 -0
  12. package/dist/api/errors/index.js +1 -0
  13. package/dist/api/resources/dashboard/client/Client.d.ts +136 -0
  14. package/dist/api/resources/{userMemory → dashboard}/client/Client.js +191 -138
  15. package/dist/api/resources/dashboard/client/requests/CreateUserDashboardUserCreateUserPostRequest.d.ts +12 -0
  16. package/dist/api/resources/dashboard/client/requests/ListSourcesDashboardSourcesGetRequest.d.ts +16 -0
  17. package/dist/api/resources/dashboard/client/requests/index.d.ts +2 -0
  18. package/dist/api/resources/embeddings/client/Client.d.ts +40 -27
  19. package/dist/api/resources/embeddings/client/Client.js +68 -44
  20. package/dist/api/resources/embeddings/client/requests/BodyFilterRawEmbeddingsEndpointEmbeddingsFilterRawEmbeddingsPost.d.ts +24 -0
  21. package/dist/api/resources/embeddings/client/requests/BodyInsertRawEmbeddingsEndpointEmbeddingsInsertRawEmbeddingsPost.d.ts +27 -0
  22. package/dist/api/resources/embeddings/client/requests/BodySearchRawEmbeddingsEndpointEmbeddingsSearchRawEmbeddingsPost.d.ts +25 -0
  23. package/dist/api/resources/embeddings/client/requests/EmbeddingsDeleteRequest.d.ts +6 -5
  24. package/dist/api/resources/embeddings/client/requests/index.d.ts +3 -3
  25. package/dist/api/resources/fetch/client/Client.d.ts +96 -7
  26. package/dist/api/resources/fetch/client/Client.js +288 -10
  27. package/dist/api/resources/{sources/client/requests/SourcesGetGraphRelationsByIdRequest.d.ts → fetch/client/requests/FetchGraphRelationsBySourceIdRequest.d.ts} +2 -3
  28. package/dist/api/resources/{sources/client/requests/SourcesGetAllRequest.d.ts → fetch/client/requests/FetchSourcesRequest.d.ts} +2 -3
  29. package/dist/api/resources/fetch/client/requests/ListSourcesByIdRequest.d.ts +18 -0
  30. package/dist/api/resources/{upload/client/requests/UploadUpdateTextRequest.d.ts → fetch/client/requests/SourceFetchRequest.d.ts} +9 -10
  31. package/dist/api/resources/fetch/client/requests/index.d.ts +4 -1
  32. package/dist/api/resources/index.d.ts +10 -13
  33. package/dist/api/resources/index.js +11 -14
  34. package/dist/api/resources/search/client/Client.d.ts +50 -26
  35. package/dist/api/resources/search/client/Client.js +65 -35
  36. package/dist/api/resources/search/client/requests/FullTextSearchRequest.d.ts +6 -4
  37. package/dist/api/resources/search/client/requests/{SearchRequest.d.ts → HybridSearchRequest.d.ts} +13 -9
  38. package/dist/api/resources/search/client/requests/QnASearchRequest.d.ts +39 -0
  39. package/dist/api/resources/search/client/requests/index.d.ts +2 -2
  40. package/dist/api/resources/sources/client/Client.d.ts +11 -61
  41. package/dist/api/resources/sources/client/Client.js +14 -191
  42. package/dist/api/resources/sources/client/requests/SourceDeleteRequest.d.ts +17 -0
  43. package/dist/api/resources/sources/client/requests/index.d.ts +1 -3
  44. package/dist/api/resources/tenant/client/Client.d.ts +54 -38
  45. package/dist/api/resources/tenant/client/Client.js +67 -114
  46. package/dist/api/resources/tenant/client/requests/TenantCreateRequest.d.ts +20 -0
  47. package/dist/api/resources/tenant/client/requests/TenantStatsRequest.d.ts +1 -4
  48. package/dist/api/resources/tenant/client/requests/index.d.ts +1 -2
  49. package/dist/api/resources/upload/client/Client.d.ts +54 -428
  50. package/dist/api/resources/upload/client/Client.js +97 -1417
  51. package/dist/api/resources/upload/client/requests/{UploadUploadMarkdownRequest.d.ts → BodyAddMemoryMemoriesAddMemoryPost.d.ts} +7 -7
  52. package/dist/api/resources/upload/client/requests/BodyUploadAppIngestionUploadAppPost.d.ts +31 -0
  53. package/dist/api/resources/upload/client/requests/BodyUploadDocumentIngestionUploadDocumentPost.d.ts +22 -0
  54. package/dist/api/resources/upload/client/requests/UploadDeleteMemoryRequest.d.ts +18 -0
  55. package/dist/api/resources/upload/client/requests/UploadVerifyProcessingRequest.d.ts +1 -2
  56. package/dist/api/resources/upload/client/requests/index.d.ts +4 -16
  57. package/dist/api/types/AddMemoryResponse.d.ts +17 -0
  58. package/dist/api/types/ApiKeyInfo.d.ts +17 -0
  59. package/dist/api/types/AppSourcesUploadData.d.ts +10 -4
  60. package/dist/api/types/CollectionStats.d.ts +9 -0
  61. package/dist/api/types/CustomPropertyDefinition.d.ts +38 -0
  62. package/dist/api/types/DashboardApisResponse.d.ts +12 -0
  63. package/dist/api/types/DashboardSourcesResponse.d.ts +12 -0
  64. package/dist/api/types/DashboardTenantsResponse.d.ts +12 -0
  65. package/dist/api/types/DeleteResult.d.ts +14 -0
  66. package/dist/api/types/DeleteUserMemoryResponse.d.ts +1 -1
  67. package/dist/api/types/Entity.d.ts +2 -2
  68. package/dist/api/types/FetchMode.d.ts +12 -0
  69. package/dist/api/types/FetchMode.js +11 -0
  70. package/dist/api/types/GraphContext.d.ts +12 -0
  71. package/dist/api/types/Infra.d.ts +8 -0
  72. package/dist/api/types/InsertResult.d.ts +16 -0
  73. package/dist/api/types/MemoryItem.d.ts +41 -0
  74. package/dist/api/types/MemoryResultItem.d.ts +19 -0
  75. package/dist/api/types/MilvusDataType.d.ts +21 -0
  76. package/dist/api/types/MilvusDataType.js +20 -0
  77. package/dist/api/types/PathTriplet.d.ts +9 -0
  78. package/dist/api/types/ProcessingStatus.d.ts +16 -2
  79. package/dist/api/types/ProcessingStatus.js +12 -0
  80. package/dist/api/types/QnASearchResponse.d.ts +20 -0
  81. package/dist/api/types/RawEmbeddingDocument.d.ts +15 -0
  82. package/dist/api/types/RawEmbeddingSearchResult.d.ts +19 -0
  83. package/dist/api/types/RawEmbeddingVector.d.ts +12 -0
  84. package/dist/api/types/RelationEvidence.d.ts +8 -0
  85. package/dist/api/types/RetrievalResult.d.ts +11 -0
  86. package/dist/api/types/ScoredPathResponse.d.ts +11 -0
  87. package/dist/api/types/SearchMode.d.ts +11 -0
  88. package/dist/api/types/SearchMode.js +10 -0
  89. package/dist/api/types/SourceDeleteResponse.d.ts +14 -0
  90. package/dist/api/types/SourceDeleteResultItem.d.ts +14 -0
  91. package/dist/api/types/SourceFetchResponse.d.ts +26 -0
  92. package/dist/api/types/{GraphRelationsResponse.d.ts → SourceGraphRelationsResponse.d.ts} +2 -2
  93. package/dist/api/types/SourceListResponse.d.ts +11 -0
  94. package/dist/api/types/SourceModel.d.ts +5 -1
  95. package/dist/api/types/SourceStatus.d.ts +10 -0
  96. package/dist/api/types/SourceStatus.js +12 -0
  97. package/dist/api/types/SourceUploadResponse.d.ts +14 -0
  98. package/dist/api/types/SourceUploadResultItem.d.ts +14 -0
  99. package/dist/api/types/SupportedLlmProviders.d.ts +11 -0
  100. package/dist/api/types/SupportedLlmProviders.js +13 -0
  101. package/dist/api/types/TenantCreateResponse.d.ts +14 -0
  102. package/dist/api/types/TenantInfo.d.ts +11 -0
  103. package/dist/api/types/TenantMetadataSchemaInfo.d.ts +14 -0
  104. package/dist/api/types/TenantStatsResponse.d.ts +14 -0
  105. package/dist/api/types/{TripleWithEvidence.d.ts → TripletWithEvidence.d.ts} +1 -1
  106. package/dist/api/types/UserAssistantPair.d.ts +3 -0
  107. package/dist/api/types/{SearchChunk.d.ts → VectorStoreChunk.d.ts} +3 -6
  108. package/dist/api/types/index.d.ts +38 -31
  109. package/dist/api/types/index.js +38 -31
  110. package/package.json +30 -33
  111. package/dist/api/resources/document/client/Client.d.ts +0 -59
  112. package/dist/api/resources/document/client/Client.js +0 -132
  113. package/dist/api/resources/document/client/index.d.ts +0 -1
  114. package/dist/api/resources/embeddings/client/requests/EmbeddingsCreateCollectionRequest.d.ts +0 -13
  115. package/dist/api/resources/embeddings/client/requests/EmbeddingsSearchRequest.d.ts +0 -18
  116. package/dist/api/resources/embeddings/client/requests/GetEmbeddingsBasedOnChunkIdsRequest.d.ts +0 -18
  117. package/dist/api/resources/fetch/client/requests/FetchContentRequest.d.ts +0 -18
  118. package/dist/api/resources/search/client/requests/QnARequest.d.ts +0 -47
  119. package/dist/api/resources/sources/client/requests/SourceBodyParams.d.ts +0 -18
  120. package/dist/api/resources/tenant/client/requests/TenantDeleteSubTenantRequest.d.ts +0 -14
  121. package/dist/api/resources/tenant/client/requests/TenantGetSubTenantIdsRequest.d.ts +0 -12
  122. package/dist/api/resources/upload/client/requests/BodyBatchUpdateUploadBatchUpdatePatch.d.ts +0 -37
  123. package/dist/api/resources/upload/client/requests/BodyBatchUploadUploadBatchUploadPost.d.ts +0 -37
  124. package/dist/api/resources/upload/client/requests/BodyUpdateFileUploadUpdateDocumentPatch.d.ts +0 -38
  125. package/dist/api/resources/upload/client/requests/BodyUploadFilesUploadUploadDocumentPost.d.ts +0 -37
  126. package/dist/api/resources/upload/client/requests/EmbeddingsUpdateRequest.d.ts +0 -18
  127. package/dist/api/resources/upload/client/requests/EmbeddingsUploadRequest.d.ts +0 -21
  128. package/dist/api/resources/upload/client/requests/UploadBatchScrapeWebpageRequest.d.ts +0 -22
  129. package/dist/api/resources/upload/client/requests/UploadBatchUploadMarkdownRequest.d.ts +0 -22
  130. package/dist/api/resources/upload/client/requests/UploadBatchUploadTextRequest.d.ts +0 -22
  131. package/dist/api/resources/upload/client/requests/UploadScrapeWebpageRequest.d.ts +0 -25
  132. package/dist/api/resources/upload/client/requests/UploadUpdateMarkdownRequest.d.ts +0 -24
  133. package/dist/api/resources/upload/client/requests/UploadUpdateWebpageRequest.d.ts +0 -25
  134. package/dist/api/resources/upload/client/requests/UploadUploadAppSourcesRequest.d.ts +0 -20
  135. package/dist/api/resources/upload/client/requests/UploadUploadTextRequest.d.ts +0 -21
  136. package/dist/api/resources/user/client/Client.d.ts +0 -60
  137. package/dist/api/resources/user/client/Client.js +0 -152
  138. package/dist/api/resources/user/client/requests/BodyCreateTenantUserCreateTenantPost.d.ts +0 -15
  139. package/dist/api/resources/user/client/requests/index.d.ts +0 -1
  140. package/dist/api/resources/user/client/requests/index.js +0 -2
  141. package/dist/api/resources/user/index.d.ts +0 -1
  142. package/dist/api/resources/user/index.js +0 -17
  143. package/dist/api/resources/userMemory/client/Client.d.ts +0 -150
  144. package/dist/api/resources/userMemory/client/index.d.ts +0 -2
  145. package/dist/api/resources/userMemory/client/index.js +0 -17
  146. package/dist/api/resources/userMemory/client/requests/AddUserMemoryRequest.d.ts +0 -27
  147. package/dist/api/resources/userMemory/client/requests/RetrieveUserMemoryRequest.d.ts +0 -24
  148. package/dist/api/resources/userMemory/client/requests/UserMemoryDeleteUserMemoryRequest.d.ts +0 -19
  149. package/dist/api/resources/userMemory/client/requests/UserMemoryListUserMemoriesRequest.d.ts +0 -16
  150. package/dist/api/resources/userMemory/client/requests/index.d.ts +0 -4
  151. package/dist/api/resources/userMemory/client/requests/index.js +0 -2
  152. package/dist/api/resources/userMemory/index.d.ts +0 -1
  153. package/dist/api/resources/userMemory/index.js +0 -17
  154. package/dist/api/types/AddUserMemoryResponse.d.ts +0 -16
  155. package/dist/api/types/BatchUploadData.d.ts +0 -11
  156. package/dist/api/types/BodyScrapeWebpageUploadScrapeWebpagePost.d.ts +0 -5
  157. package/dist/api/types/BodyUpdateScrapeJobUploadUpdateWebpagePatch.d.ts +0 -5
  158. package/dist/api/types/DeleteMemoryRequest.d.ts +0 -11
  159. package/dist/api/types/DeleteSources.d.ts +0 -7
  160. package/dist/api/types/DeleteSubTenantData.d.ts +0 -15
  161. package/dist/api/types/EmbeddingsCreateCollectionData.d.ts +0 -13
  162. package/dist/api/types/EmbeddingsDeleteData.d.ts +0 -13
  163. package/dist/api/types/EmbeddingsGetData.d.ts +0 -13
  164. package/dist/api/types/EmbeddingsSearchData.d.ts +0 -13
  165. package/dist/api/types/ExtendedContext.d.ts +0 -8
  166. package/dist/api/types/FetchContentData.d.ts +0 -13
  167. package/dist/api/types/FileUploadResult.d.ts +0 -9
  168. package/dist/api/types/ListSourcesResponse.d.ts +0 -12
  169. package/dist/api/types/ListUserMemoriesResponse.d.ts +0 -13
  170. package/dist/api/types/MarkdownUploadRequest.d.ts +0 -22
  171. package/dist/api/types/RelatedChunk.d.ts +0 -9
  172. package/dist/api/types/RelatedChunk.js +0 -5
  173. package/dist/api/types/Relations.d.ts +0 -9
  174. package/dist/api/types/Relations.js +0 -5
  175. package/dist/api/types/RetrieveResponse.d.ts +0 -12
  176. package/dist/api/types/RetrieveResponse.js +0 -5
  177. package/dist/api/types/RetrieveUserMemoryResponse.d.ts +0 -15
  178. package/dist/api/types/RetrieveUserMemoryResponse.js +0 -5
  179. package/dist/api/types/SearchChunk.js +0 -5
  180. package/dist/api/types/SingleUploadData.d.ts +0 -10
  181. package/dist/api/types/SingleUploadData.js +0 -5
  182. package/dist/api/types/Source.d.ts +0 -19
  183. package/dist/api/types/Source.js +0 -5
  184. package/dist/api/types/SubTenantIdsData.d.ts +0 -17
  185. package/dist/api/types/SubTenantIdsData.js +0 -5
  186. package/dist/api/types/TenantCreateData.d.ts +0 -13
  187. package/dist/api/types/TenantCreateData.js +0 -5
  188. package/dist/api/types/TenantStats.d.ts +0 -15
  189. package/dist/api/types/TenantStats.js +0 -5
  190. package/dist/api/types/TripleWithEvidence.js +0 -5
  191. package/dist/api/types/UserMemory.d.ts +0 -12
  192. package/dist/api/types/UserMemory.js +0 -5
  193. package/dist/api/types/WebpageScrapeRequest.d.ts +0 -9
  194. package/dist/api/types/WebpageScrapeRequest.js +0 -5
  195. /package/dist/api/resources/{user → dashboard}/client/index.d.ts +0 -0
  196. /package/dist/api/resources/{user → dashboard}/client/index.js +0 -0
  197. /package/dist/api/resources/{embeddings/client/requests/EmbeddingsCreateCollectionRequest.js → dashboard/client/requests/CreateUserDashboardUserCreateUserPostRequest.js} +0 -0
  198. /package/dist/api/resources/{embeddings/client/requests/EmbeddingsSearchRequest.js → dashboard/client/requests/ListSourcesDashboardSourcesGetRequest.js} +0 -0
  199. /package/dist/api/resources/{document/client → dashboard/client/requests}/index.js +0 -0
  200. /package/dist/api/resources/{document → dashboard}/index.d.ts +0 -0
  201. /package/dist/api/resources/{document → dashboard}/index.js +0 -0
  202. /package/dist/api/resources/embeddings/client/requests/{GetEmbeddingsBasedOnChunkIdsRequest.js → BodyFilterRawEmbeddingsEndpointEmbeddingsFilterRawEmbeddingsPost.js} +0 -0
  203. /package/dist/api/resources/{fetch/client/requests/FetchContentRequest.js → embeddings/client/requests/BodyInsertRawEmbeddingsEndpointEmbeddingsInsertRawEmbeddingsPost.js} +0 -0
  204. /package/dist/api/resources/{search/client/requests/QnARequest.js → embeddings/client/requests/BodySearchRawEmbeddingsEndpointEmbeddingsSearchRawEmbeddingsPost.js} +0 -0
  205. /package/dist/api/resources/{search/client/requests/SearchRequest.js → fetch/client/requests/FetchGraphRelationsBySourceIdRequest.js} +0 -0
  206. /package/dist/api/resources/{sources/client/requests/SourceBodyParams.js → fetch/client/requests/FetchSourcesRequest.js} +0 -0
  207. /package/dist/api/resources/{sources/client/requests/SourcesGetAllRequest.js → fetch/client/requests/ListSourcesByIdRequest.js} +0 -0
  208. /package/dist/api/resources/{sources/client/requests/SourcesGetGraphRelationsByIdRequest.js → fetch/client/requests/SourceFetchRequest.js} +0 -0
  209. /package/dist/api/resources/{tenant/client/requests/TenantDeleteSubTenantRequest.js → search/client/requests/HybridSearchRequest.js} +0 -0
  210. /package/dist/api/resources/{tenant/client/requests/TenantGetSubTenantIdsRequest.js → search/client/requests/QnASearchRequest.js} +0 -0
  211. /package/dist/api/resources/{upload/client/requests/BodyBatchUpdateUploadBatchUpdatePatch.js → sources/client/requests/SourceDeleteRequest.js} +0 -0
  212. /package/dist/api/resources/{upload/client/requests/BodyBatchUploadUploadBatchUploadPost.js → tenant/client/requests/TenantCreateRequest.js} +0 -0
  213. /package/dist/api/resources/upload/client/requests/{BodyUpdateFileUploadUpdateDocumentPatch.js → BodyAddMemoryMemoriesAddMemoryPost.js} +0 -0
  214. /package/dist/api/resources/upload/client/requests/{BodyUploadFilesUploadUploadDocumentPost.js → BodyUploadAppIngestionUploadAppPost.js} +0 -0
  215. /package/dist/api/resources/upload/client/requests/{EmbeddingsUpdateRequest.js → BodyUploadDocumentIngestionUploadDocumentPost.js} +0 -0
  216. /package/dist/api/resources/upload/client/requests/{EmbeddingsUploadRequest.js → UploadDeleteMemoryRequest.js} +0 -0
  217. /package/dist/api/{resources/upload/client/requests/UploadBatchScrapeWebpageRequest.js → types/AddMemoryResponse.js} +0 -0
  218. /package/dist/api/{resources/upload/client/requests/UploadBatchUploadMarkdownRequest.js → types/ApiKeyInfo.js} +0 -0
  219. /package/dist/api/{resources/upload/client/requests/UploadBatchUploadTextRequest.js → types/CollectionStats.js} +0 -0
  220. /package/dist/api/{resources/upload/client/requests/UploadScrapeWebpageRequest.js → types/CustomPropertyDefinition.js} +0 -0
  221. /package/dist/api/{resources/upload/client/requests/UploadUpdateMarkdownRequest.js → types/DashboardApisResponse.js} +0 -0
  222. /package/dist/api/{resources/upload/client/requests/UploadUpdateTextRequest.js → types/DashboardSourcesResponse.js} +0 -0
  223. /package/dist/api/{resources/upload/client/requests/UploadUpdateWebpageRequest.js → types/DashboardTenantsResponse.js} +0 -0
  224. /package/dist/api/{resources/upload/client/requests/UploadUploadAppSourcesRequest.js → types/DeleteResult.js} +0 -0
  225. /package/dist/api/{resources/upload/client/requests/UploadUploadMarkdownRequest.js → types/GraphContext.js} +0 -0
  226. /package/dist/api/{resources/upload/client/requests/UploadUploadTextRequest.js → types/Infra.js} +0 -0
  227. /package/dist/api/{resources/user/client/requests/BodyCreateTenantUserCreateTenantPost.js → types/InsertResult.js} +0 -0
  228. /package/dist/api/{resources/userMemory/client/requests/AddUserMemoryRequest.js → types/MemoryItem.js} +0 -0
  229. /package/dist/api/{resources/userMemory/client/requests/RetrieveUserMemoryRequest.js → types/MemoryResultItem.js} +0 -0
  230. /package/dist/api/{resources/userMemory/client/requests/UserMemoryDeleteUserMemoryRequest.js → types/PathTriplet.js} +0 -0
  231. /package/dist/api/{resources/userMemory/client/requests/UserMemoryListUserMemoriesRequest.js → types/QnASearchResponse.js} +0 -0
  232. /package/dist/api/types/{AddUserMemoryResponse.js → RawEmbeddingDocument.js} +0 -0
  233. /package/dist/api/types/{BatchUploadData.js → RawEmbeddingSearchResult.js} +0 -0
  234. /package/dist/api/types/{BodyScrapeWebpageUploadScrapeWebpagePost.js → RawEmbeddingVector.js} +0 -0
  235. /package/dist/api/types/{BodyUpdateScrapeJobUploadUpdateWebpagePatch.js → RetrievalResult.js} +0 -0
  236. /package/dist/api/types/{DeleteMemoryRequest.js → ScoredPathResponse.js} +0 -0
  237. /package/dist/api/types/{DeleteSources.js → SourceDeleteResponse.js} +0 -0
  238. /package/dist/api/types/{DeleteSubTenantData.js → SourceDeleteResultItem.js} +0 -0
  239. /package/dist/api/types/{EmbeddingsCreateCollectionData.js → SourceFetchResponse.js} +0 -0
  240. /package/dist/api/types/{EmbeddingsDeleteData.js → SourceGraphRelationsResponse.js} +0 -0
  241. /package/dist/api/types/{EmbeddingsGetData.js → SourceListResponse.js} +0 -0
  242. /package/dist/api/types/{EmbeddingsSearchData.js → SourceUploadResponse.js} +0 -0
  243. /package/dist/api/types/{ExtendedContext.js → SourceUploadResultItem.js} +0 -0
  244. /package/dist/api/types/{FetchContentData.js → TenantCreateResponse.js} +0 -0
  245. /package/dist/api/types/{FileUploadResult.js → TenantInfo.js} +0 -0
  246. /package/dist/api/types/{GraphRelationsResponse.js → TenantMetadataSchemaInfo.js} +0 -0
  247. /package/dist/api/types/{ListSourcesResponse.js → TenantStatsResponse.js} +0 -0
  248. /package/dist/api/types/{ListUserMemoriesResponse.js → TripletWithEvidence.js} +0 -0
  249. /package/dist/api/types/{MarkdownUploadRequest.js → VectorStoreChunk.js} +0 -0
@@ -37,13 +37,14 @@ class Sources {
37
37
  this._options = _options;
38
38
  }
39
39
  /**
40
- * Retrieve all sources for a specific tenant.
40
+ * Remove documents and content from your knowledge base.
41
41
  *
42
- * Use this endpoint to fetch a complete list of all sources associated with your tenant. This includes documents, files, and other content you've uploaded for processing.
42
+ * This endpoint permanently deletes the specified sources from your knowledge base.
43
+ * Once deleted, the content will no longer be available for search or retrieval.
43
44
  *
44
- * You can optionally specify a sub-tenant to narrow down the results to sources within that specific sub-tenant scope.
45
+ * Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
45
46
  *
46
- * @param {CortexAI.SourcesGetAllRequest} request
47
+ * @param {CortexAI.SourceDeleteRequest} request
47
48
  * @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
48
49
  *
49
50
  * @throws {@link CortexAI.BadRequestError}
@@ -55,107 +56,20 @@ class Sources {
55
56
  * @throws {@link CortexAI.ServiceUnavailableError}
56
57
  *
57
58
  * @example
58
- * await client.sources.getAll({
59
- * tenant_id: "tenant_1234",
60
- * sub_tenant_id: "sub_tenant_4567"
59
+ * await client.sources.delete({
60
+ * tenant_id: "tenant_id",
61
+ * sub_tenant_id: "sub_tenant_id",
62
+ * source_ids: ["source_ids"]
61
63
  * })
62
64
  */
63
- getAll(request, requestOptions) {
64
- return core.HttpResponsePromise.fromPromise(this.__getAll(request, requestOptions));
65
+ delete(request, requestOptions) {
66
+ return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
65
67
  }
66
- async __getAll(request, requestOptions) {
67
- var _a, _b, _c;
68
- const { tenant_id: tenantId, sub_tenant_id: subTenantId } = request;
69
- const _queryParams = {};
70
- _queryParams["tenant_id"] = tenantId;
71
- if (subTenantId != null) {
72
- _queryParams["sub_tenant_id"] = subTenantId;
73
- }
74
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
75
- const _response = await core.fetcher({
76
- url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "list/sources"),
77
- method: "GET",
78
- headers: _headers,
79
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
80
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
81
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
82
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
83
- });
84
- if (_response.ok) {
85
- return { data: _response.body, rawResponse: _response.rawResponse };
86
- }
87
- if (_response.error.reason === "status-code") {
88
- switch (_response.error.statusCode) {
89
- case 400:
90
- throw new CortexAI.BadRequestError(_response.error.body, _response.rawResponse);
91
- case 401:
92
- throw new CortexAI.UnauthorizedError(_response.error.body, _response.rawResponse);
93
- case 403:
94
- throw new CortexAI.ForbiddenError(_response.error.body, _response.rawResponse);
95
- case 404:
96
- throw new CortexAI.NotFoundError(_response.error.body, _response.rawResponse);
97
- case 422:
98
- throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
99
- case 500:
100
- throw new CortexAI.InternalServerError(_response.error.body, _response.rawResponse);
101
- case 503:
102
- throw new CortexAI.ServiceUnavailableError(_response.error.body, _response.rawResponse);
103
- default:
104
- throw new errors.CortexAIError({
105
- statusCode: _response.error.statusCode,
106
- body: _response.error.body,
107
- rawResponse: _response.rawResponse,
108
- });
109
- }
110
- }
111
- switch (_response.error.reason) {
112
- case "non-json":
113
- throw new errors.CortexAIError({
114
- statusCode: _response.error.statusCode,
115
- body: _response.error.rawBody,
116
- rawResponse: _response.rawResponse,
117
- });
118
- case "timeout":
119
- throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /list/sources.");
120
- case "unknown":
121
- throw new errors.CortexAIError({
122
- message: _response.error.errorMessage,
123
- rawResponse: _response.rawResponse,
124
- });
125
- }
126
- }
127
- /**
128
- * Retrieve specific sources by their IDs.
129
- *
130
- * Use this endpoint to fetch one or more sources by providing their unique identifiers. This is useful when you need detailed information about specific documents or content you've previously uploaded.
131
- *
132
- * Provide the source IDs in the request body along with your tenant information to get the exact sources you need.
133
- *
134
- * @param {CortexAI.SourceBodyParams} request
135
- * @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
136
- *
137
- * @throws {@link CortexAI.BadRequestError}
138
- * @throws {@link CortexAI.UnauthorizedError}
139
- * @throws {@link CortexAI.ForbiddenError}
140
- * @throws {@link CortexAI.NotFoundError}
141
- * @throws {@link CortexAI.UnprocessableEntityError}
142
- * @throws {@link CortexAI.InternalServerError}
143
- * @throws {@link CortexAI.ServiceUnavailableError}
144
- *
145
- * @example
146
- * await client.sources.getByIds({
147
- * tenant_id: "tenant_1234",
148
- * source_ids: ["CortexDoc1234", "CortexDoc4567"]
149
- * })
150
- */
151
- getByIds(request, requestOptions) {
152
- return core.HttpResponsePromise.fromPromise(this.__getByIds(request, requestOptions));
153
- }
154
- async __getByIds(request, requestOptions) {
68
+ async __delete(request, requestOptions) {
155
69
  var _a, _b, _c;
156
70
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
157
71
  const _response = await core.fetcher({
158
- url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "list/sources_by_id"),
72
+ url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "delete/delete-sources"),
159
73
  method: "POST",
160
74
  headers: _headers,
161
75
  contentType: "application/json",
@@ -201,98 +115,7 @@ class Sources {
201
115
  rawResponse: _response.rawResponse,
202
116
  });
203
117
  case "timeout":
204
- throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /list/sources_by_id.");
205
- case "unknown":
206
- throw new errors.CortexAIError({
207
- message: _response.error.errorMessage,
208
- rawResponse: _response.rawResponse,
209
- });
210
- }
211
- }
212
- /**
213
- * Retrieve relations for a specific source.
214
- *
215
- * Use this endpoint to fetch all relations associated with a specific source. This is useful when you need to understand the relationships between entities within a source.
216
- *
217
- * Provide the source ID in the request body along with your tenant information to get the relations for that source.
218
- *
219
- * @param {CortexAI.SourcesGetGraphRelationsByIdRequest} request
220
- * @param {Sources.RequestOptions} requestOptions - Request-specific configuration.
221
- *
222
- * @throws {@link CortexAI.BadRequestError}
223
- * @throws {@link CortexAI.UnauthorizedError}
224
- * @throws {@link CortexAI.ForbiddenError}
225
- * @throws {@link CortexAI.NotFoundError}
226
- * @throws {@link CortexAI.UnprocessableEntityError}
227
- * @throws {@link CortexAI.InternalServerError}
228
- * @throws {@link CortexAI.ServiceUnavailableError}
229
- *
230
- * @example
231
- * await client.sources.getGraphRelationsById({
232
- * source_id: "CortexDoc1234",
233
- * tenant_id: "tenant_1234"
234
- * })
235
- */
236
- getGraphRelationsById(request, requestOptions) {
237
- return core.HttpResponsePromise.fromPromise(this.__getGraphRelationsById(request, requestOptions));
238
- }
239
- async __getGraphRelationsById(request, requestOptions) {
240
- var _a, _b, _c;
241
- const { source_id: sourceId, tenant_id: tenantId, sub_tenant_id: subTenantId } = request;
242
- const _queryParams = {};
243
- _queryParams["source_id"] = sourceId;
244
- if (tenantId != null) {
245
- _queryParams["tenant_id"] = tenantId;
246
- }
247
- if (subTenantId != null) {
248
- _queryParams["sub_tenant_id"] = subTenantId;
249
- }
250
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
251
- const _response = await core.fetcher({
252
- url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "list/graph_relations_by_id"),
253
- method: "GET",
254
- headers: _headers,
255
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
256
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
257
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
258
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
259
- });
260
- if (_response.ok) {
261
- return { data: _response.body, rawResponse: _response.rawResponse };
262
- }
263
- if (_response.error.reason === "status-code") {
264
- switch (_response.error.statusCode) {
265
- case 400:
266
- throw new CortexAI.BadRequestError(_response.error.body, _response.rawResponse);
267
- case 401:
268
- throw new CortexAI.UnauthorizedError(_response.error.body, _response.rawResponse);
269
- case 403:
270
- throw new CortexAI.ForbiddenError(_response.error.body, _response.rawResponse);
271
- case 404:
272
- throw new CortexAI.NotFoundError(_response.error.body, _response.rawResponse);
273
- case 422:
274
- throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
275
- case 500:
276
- throw new CortexAI.InternalServerError(_response.error.body, _response.rawResponse);
277
- case 503:
278
- throw new CortexAI.ServiceUnavailableError(_response.error.body, _response.rawResponse);
279
- default:
280
- throw new errors.CortexAIError({
281
- statusCode: _response.error.statusCode,
282
- body: _response.error.body,
283
- rawResponse: _response.rawResponse,
284
- });
285
- }
286
- }
287
- switch (_response.error.reason) {
288
- case "non-json":
289
- throw new errors.CortexAIError({
290
- statusCode: _response.error.statusCode,
291
- body: _response.error.rawBody,
292
- rawResponse: _response.rawResponse,
293
- });
294
- case "timeout":
295
- throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /list/graph_relations_by_id.");
118
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /delete/delete-sources.");
296
119
  case "unknown":
297
120
  throw new errors.CortexAIError({
298
121
  message: _response.error.errorMessage,
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * tenant_id: "tenant_id",
8
+ * sub_tenant_id: "sub_tenant_id",
9
+ * source_ids: ["source_ids"]
10
+ * }
11
+ */
12
+ export interface SourceDeleteRequest {
13
+ tenant_id: string;
14
+ sub_tenant_id: string;
15
+ /** List of source IDs to delete. */
16
+ source_ids: string[];
17
+ }
@@ -1,3 +1 @@
1
- export { type SourcesGetAllRequest } from "./SourcesGetAllRequest.js";
2
- export { type SourceBodyParams } from "./SourceBodyParams.js";
3
- export { type SourcesGetGraphRelationsByIdRequest } from "./SourcesGetGraphRelationsByIdRequest.js";
1
+ export { type SourceDeleteRequest } from "./SourceDeleteRequest.js";
@@ -30,37 +30,48 @@ export declare class Tenant {
30
30
  protected readonly _options: Tenant.Options;
31
31
  constructor(_options?: Tenant.Options);
32
32
  /**
33
- * Retrieve usage stats for your tenant.
33
+ * Create a tenant for your account.
34
34
  *
35
- * Use this endpoint to check whether a tenant exists and view core metrics like total indexed objects and vector dimension. This helps you validate setup and monitor ingestion.
35
+ * Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search.
36
36
  *
37
- * Expected outcome
38
- * - You receive the current object count and vector dimension for the tenant.
39
- * - If the tenant does not exist, you get a not-found error.
37
+ * **Tenant Metadata Schema**
40
38
  *
41
- * @param {CortexAI.TenantStatsRequest} request
42
- * @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
39
+ * You can optionally provide a `tenant_metadata_schema` to define custom fields that will be
40
+ * indexed in the vector store. Each field can be configured with:
43
41
  *
44
- * @throws {@link CortexAI.BadRequestError}
45
- * @throws {@link CortexAI.UnauthorizedError}
46
- * @throws {@link CortexAI.ForbiddenError}
47
- * @throws {@link CortexAI.NotFoundError}
48
- * @throws {@link CortexAI.UnprocessableEntityError}
49
- * @throws {@link CortexAI.InternalServerError}
50
- * @throws {@link CortexAI.ServiceUnavailableError}
42
+ * - `enable_match`: Enable text filtering on this field
43
+ * - `enable_dense_embedding`: Create dense embeddings for semantic similarity search
44
+ * - `enable_sparse_embedding`: Create sparse embeddings (BM25) for keyword search
51
45
  *
52
- * @example
53
- * await client.tenant.stats({
54
- * tenant_id: "tenant_1234",
55
- * sub_tenant_id: "sub_tenant_4567"
56
- * })
57
- */
58
- stats(request: CortexAI.TenantStatsRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.TenantStats>;
59
- private __stats;
60
- /**
61
- * Retrieve all sub-tenant IDs contained within a specific tenant. Fetches the sub-tenant IDs directly from the underlying data store.
46
+ * **Example Request:**
47
+ * ```json
48
+ * {
49
+ * "tenant_id": "my-tenant",
50
+ * "tenant_metadata_schema": [
51
+ * {
52
+ * "name": "category",
53
+ * "data_type": "VARCHAR",
54
+ * "max_length": 256,
55
+ * "enable_match": true
56
+ * },
57
+ * {
58
+ * "name": "product_description",
59
+ * "data_type": "VARCHAR",
60
+ * "max_length": 4096,
61
+ * "enable_dense_embedding": true,
62
+ * "enable_sparse_embedding": true
63
+ * }
64
+ * ]
65
+ * }
66
+ * ```
67
+ *
68
+ * Expected outcome:
69
+ * - A tenant is created and returned with its identifier.
70
+ * - If tenant_metadata_schema is provided, the vector store collection will include
71
+ * the specified custom fields with their configured search capabilities.
72
+ * - If the tenant already exists, you receive a success message with the existing identifier.
62
73
  *
63
- * @param {CortexAI.TenantGetSubTenantIdsRequest} request
74
+ * @param {CortexAI.TenantCreateRequest} request
64
75
  * @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
65
76
  *
66
77
  * @throws {@link CortexAI.BadRequestError}
@@ -72,19 +83,25 @@ export declare class Tenant {
72
83
  * @throws {@link CortexAI.ServiceUnavailableError}
73
84
  *
74
85
  * @example
75
- * await client.tenant.getSubTenantIds({
76
- * tenant_id: "tenant_1234"
86
+ * await client.tenant.createTenant({
87
+ * tenant_id: "tenant_id"
77
88
  * })
78
89
  */
79
- getSubTenantIds(request: CortexAI.TenantGetSubTenantIdsRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.SubTenantIdsData>;
80
- private __getSubTenantIds;
90
+ createTenant(request: CortexAI.TenantCreateRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.TenantCreateResponse>;
91
+ private __createTenant;
81
92
  /**
82
- * Delete a sub-tenant from a given tenant.
93
+ * Retrieve usage stats for your tenant.
83
94
  *
84
- * This endpoint deletes a specific sub-tenant from the specified tenant.
85
- * It validates that the sub-tenant is not the primary/default sub-tenant before deletion.
95
+ * Use this endpoint to check whether a tenant exists and view core metrics like total
96
+ * indexed objects and vector dimension. This helps you validate
97
+ * setup and monitor ingestion.
86
98
  *
87
- * @param {CortexAI.TenantDeleteSubTenantRequest} request
99
+ * Expected outcome
100
+ *
101
+ * You receive the current object count and vector dimension for the tenant.
102
+ * If the tenant does not exist, you get a not-found error.
103
+ *
104
+ * @param {CortexAI.TenantStatsRequest} request
88
105
  * @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
89
106
  *
90
107
  * @throws {@link CortexAI.BadRequestError}
@@ -96,12 +113,11 @@ export declare class Tenant {
96
113
  * @throws {@link CortexAI.ServiceUnavailableError}
97
114
  *
98
115
  * @example
99
- * await client.tenant.deleteSubTenant({
100
- * tenant_id: "tenant_1234",
101
- * sub_tenant_id: "sub_tenant_4567"
116
+ * await client.tenant.stats({
117
+ * tenant_id: "tenant_id"
102
118
  * })
103
119
  */
104
- deleteSubTenant(request: CortexAI.TenantDeleteSubTenantRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.DeleteSubTenantData>;
105
- private __deleteSubTenant;
120
+ stats(request: CortexAI.TenantStatsRequest, requestOptions?: Tenant.RequestOptions): core.HttpResponsePromise<CortexAI.TenantStatsResponse>;
121
+ private __stats;
106
122
  protected _getAuthorizationHeader(): Promise<string | undefined>;
107
123
  }
@@ -37,99 +37,48 @@ class Tenant {
37
37
  this._options = _options;
38
38
  }
39
39
  /**
40
- * Retrieve usage stats for your tenant.
40
+ * Create a tenant for your account.
41
41
  *
42
- * Use this endpoint to check whether a tenant exists and view core metrics like total indexed objects and vector dimension. This helps you validate setup and monitor ingestion.
42
+ * Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search.
43
43
  *
44
- * Expected outcome
45
- * - You receive the current object count and vector dimension for the tenant.
46
- * - If the tenant does not exist, you get a not-found error.
44
+ * **Tenant Metadata Schema**
47
45
  *
48
- * @param {CortexAI.TenantStatsRequest} request
49
- * @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
46
+ * You can optionally provide a `tenant_metadata_schema` to define custom fields that will be
47
+ * indexed in the vector store. Each field can be configured with:
50
48
  *
51
- * @throws {@link CortexAI.BadRequestError}
52
- * @throws {@link CortexAI.UnauthorizedError}
53
- * @throws {@link CortexAI.ForbiddenError}
54
- * @throws {@link CortexAI.NotFoundError}
55
- * @throws {@link CortexAI.UnprocessableEntityError}
56
- * @throws {@link CortexAI.InternalServerError}
57
- * @throws {@link CortexAI.ServiceUnavailableError}
49
+ * - `enable_match`: Enable text filtering on this field
50
+ * - `enable_dense_embedding`: Create dense embeddings for semantic similarity search
51
+ * - `enable_sparse_embedding`: Create sparse embeddings (BM25) for keyword search
58
52
  *
59
- * @example
60
- * await client.tenant.stats({
61
- * tenant_id: "tenant_1234",
62
- * sub_tenant_id: "sub_tenant_4567"
63
- * })
64
- */
65
- stats(request, requestOptions) {
66
- return core.HttpResponsePromise.fromPromise(this.__stats(request, requestOptions));
67
- }
68
- async __stats(request, requestOptions) {
69
- var _a, _b, _c;
70
- const { tenant_id: tenantId, sub_tenant_id: subTenantId } = request;
71
- const _queryParams = {};
72
- _queryParams["tenant_id"] = tenantId;
73
- if (subTenantId != null) {
74
- _queryParams["sub_tenant_id"] = subTenantId;
75
- }
76
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
77
- const _response = await core.fetcher({
78
- url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "tenant/stats"),
79
- method: "GET",
80
- headers: _headers,
81
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
82
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
83
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
84
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
85
- });
86
- if (_response.ok) {
87
- return { data: _response.body, rawResponse: _response.rawResponse };
88
- }
89
- if (_response.error.reason === "status-code") {
90
- switch (_response.error.statusCode) {
91
- case 400:
92
- throw new CortexAI.BadRequestError(_response.error.body, _response.rawResponse);
93
- case 401:
94
- throw new CortexAI.UnauthorizedError(_response.error.body, _response.rawResponse);
95
- case 403:
96
- throw new CortexAI.ForbiddenError(_response.error.body, _response.rawResponse);
97
- case 404:
98
- throw new CortexAI.NotFoundError(_response.error.body, _response.rawResponse);
99
- case 422:
100
- throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
101
- case 500:
102
- throw new CortexAI.InternalServerError(_response.error.body, _response.rawResponse);
103
- case 503:
104
- throw new CortexAI.ServiceUnavailableError(_response.error.body, _response.rawResponse);
105
- default:
106
- throw new errors.CortexAIError({
107
- statusCode: _response.error.statusCode,
108
- body: _response.error.body,
109
- rawResponse: _response.rawResponse,
110
- });
111
- }
112
- }
113
- switch (_response.error.reason) {
114
- case "non-json":
115
- throw new errors.CortexAIError({
116
- statusCode: _response.error.statusCode,
117
- body: _response.error.rawBody,
118
- rawResponse: _response.rawResponse,
119
- });
120
- case "timeout":
121
- throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /tenant/stats.");
122
- case "unknown":
123
- throw new errors.CortexAIError({
124
- message: _response.error.errorMessage,
125
- rawResponse: _response.rawResponse,
126
- });
127
- }
128
- }
129
- /**
130
- * Retrieve all sub-tenant IDs contained within a specific tenant. Fetches the sub-tenant IDs directly from the underlying data store.
53
+ * **Example Request:**
54
+ * ```json
55
+ * {
56
+ * "tenant_id": "my-tenant",
57
+ * "tenant_metadata_schema": [
58
+ * {
59
+ * "name": "category",
60
+ * "data_type": "VARCHAR",
61
+ * "max_length": 256,
62
+ * "enable_match": true
63
+ * },
64
+ * {
65
+ * "name": "product_description",
66
+ * "data_type": "VARCHAR",
67
+ * "max_length": 4096,
68
+ * "enable_dense_embedding": true,
69
+ * "enable_sparse_embedding": true
70
+ * }
71
+ * ]
72
+ * }
73
+ * ```
131
74
  *
132
- * @param {CortexAI.TenantGetSubTenantIdsRequest} request
75
+ * Expected outcome:
76
+ * - A tenant is created and returned with its identifier.
77
+ * - If tenant_metadata_schema is provided, the vector store collection will include
78
+ * the specified custom fields with their configured search capabilities.
79
+ * - If the tenant already exists, you receive a success message with the existing identifier.
80
+ *
81
+ * @param {CortexAI.TenantCreateRequest} request
133
82
  * @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
134
83
  *
135
84
  * @throws {@link CortexAI.BadRequestError}
@@ -141,24 +90,24 @@ class Tenant {
141
90
  * @throws {@link CortexAI.ServiceUnavailableError}
142
91
  *
143
92
  * @example
144
- * await client.tenant.getSubTenantIds({
145
- * tenant_id: "tenant_1234"
93
+ * await client.tenant.createTenant({
94
+ * tenant_id: "tenant_id"
146
95
  * })
147
96
  */
148
- getSubTenantIds(request, requestOptions) {
149
- return core.HttpResponsePromise.fromPromise(this.__getSubTenantIds(request, requestOptions));
97
+ createTenant(request, requestOptions) {
98
+ return core.HttpResponsePromise.fromPromise(this.__createTenant(request, requestOptions));
150
99
  }
151
- async __getSubTenantIds(request, requestOptions) {
100
+ async __createTenant(request, requestOptions) {
152
101
  var _a, _b, _c;
153
- const { tenant_id: tenantId } = request;
154
- const _queryParams = {};
155
- _queryParams["tenant_id"] = tenantId;
156
102
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
157
103
  const _response = await core.fetcher({
158
- url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "tenant/sub_tenant_ids"),
159
- method: "GET",
104
+ url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "tenants/create"),
105
+ method: "POST",
160
106
  headers: _headers,
161
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
107
+ contentType: "application/json",
108
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
109
+ requestType: "json",
110
+ body: request,
162
111
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
163
112
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
164
113
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -198,7 +147,7 @@ class Tenant {
198
147
  rawResponse: _response.rawResponse,
199
148
  });
200
149
  case "timeout":
201
- throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /tenant/sub_tenant_ids.");
150
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /tenants/create.");
202
151
  case "unknown":
203
152
  throw new errors.CortexAIError({
204
153
  message: _response.error.errorMessage,
@@ -207,12 +156,18 @@ class Tenant {
207
156
  }
208
157
  }
209
158
  /**
210
- * Delete a sub-tenant from a given tenant.
159
+ * Retrieve usage stats for your tenant.
160
+ *
161
+ * Use this endpoint to check whether a tenant exists and view core metrics like total
162
+ * indexed objects and vector dimension. This helps you validate
163
+ * setup and monitor ingestion.
164
+ *
165
+ * Expected outcome
211
166
  *
212
- * This endpoint deletes a specific sub-tenant from the specified tenant.
213
- * It validates that the sub-tenant is not the primary/default sub-tenant before deletion.
167
+ * You receive the current object count and vector dimension for the tenant.
168
+ * If the tenant does not exist, you get a not-found error.
214
169
  *
215
- * @param {CortexAI.TenantDeleteSubTenantRequest} request
170
+ * @param {CortexAI.TenantStatsRequest} request
216
171
  * @param {Tenant.RequestOptions} requestOptions - Request-specific configuration.
217
172
  *
218
173
  * @throws {@link CortexAI.BadRequestError}
@@ -224,24 +179,22 @@ class Tenant {
224
179
  * @throws {@link CortexAI.ServiceUnavailableError}
225
180
  *
226
181
  * @example
227
- * await client.tenant.deleteSubTenant({
228
- * tenant_id: "tenant_1234",
229
- * sub_tenant_id: "sub_tenant_4567"
182
+ * await client.tenant.stats({
183
+ * tenant_id: "tenant_id"
230
184
  * })
231
185
  */
232
- deleteSubTenant(request, requestOptions) {
233
- return core.HttpResponsePromise.fromPromise(this.__deleteSubTenant(request, requestOptions));
186
+ stats(request, requestOptions) {
187
+ return core.HttpResponsePromise.fromPromise(this.__stats(request, requestOptions));
234
188
  }
235
- async __deleteSubTenant(request, requestOptions) {
189
+ async __stats(request, requestOptions) {
236
190
  var _a, _b, _c;
237
- const { tenant_id: tenantId, sub_tenant_id: subTenantId } = request;
191
+ const { tenant_id: tenantId } = request;
238
192
  const _queryParams = {};
239
193
  _queryParams["tenant_id"] = tenantId;
240
- _queryParams["sub_tenant_id"] = subTenantId;
241
194
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
242
195
  const _response = await core.fetcher({
243
- url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "tenant/delete_sub_tenant"),
244
- method: "DELETE",
196
+ url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "tenants/stats"),
197
+ method: "GET",
245
198
  headers: _headers,
246
199
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
247
200
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -283,7 +236,7 @@ class Tenant {
283
236
  rawResponse: _response.rawResponse,
284
237
  });
285
238
  case "timeout":
286
- throw new errors.CortexAITimeoutError("Timeout exceeded when calling DELETE /tenant/delete_sub_tenant.");
239
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /tenants/stats.");
287
240
  case "unknown":
288
241
  throw new errors.CortexAIError({
289
242
  message: _response.error.errorMessage,