@usecortex_ai/node 0.1.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 (305) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +71 -0
  3. package/dist/Client.d.ts +64 -0
  4. package/dist/Client.js +137 -0
  5. package/dist/api/errors/BadRequestError.d.ts +9 -0
  6. package/dist/api/errors/BadRequestError.js +42 -0
  7. package/dist/api/errors/ForbiddenError.d.ts +9 -0
  8. package/dist/api/errors/ForbiddenError.js +42 -0
  9. package/dist/api/errors/InternalServerError.d.ts +9 -0
  10. package/dist/api/errors/InternalServerError.js +42 -0
  11. package/dist/api/errors/NotFoundError.d.ts +9 -0
  12. package/dist/api/errors/NotFoundError.js +42 -0
  13. package/dist/api/errors/ServiceUnavailableError.d.ts +9 -0
  14. package/dist/api/errors/ServiceUnavailableError.js +42 -0
  15. package/dist/api/errors/UnauthorizedError.d.ts +9 -0
  16. package/dist/api/errors/UnauthorizedError.js +42 -0
  17. package/dist/api/errors/UnprocessableEntityError.d.ts +8 -0
  18. package/dist/api/errors/UnprocessableEntityError.js +42 -0
  19. package/dist/api/errors/index.d.ts +7 -0
  20. package/dist/api/errors/index.js +23 -0
  21. package/dist/api/index.d.ts +3 -0
  22. package/dist/api/index.js +19 -0
  23. package/dist/api/resources/embeddings/client/Client.d.ts +157 -0
  24. package/dist/api/resources/embeddings/client/Client.js +410 -0
  25. package/dist/api/resources/embeddings/client/index.d.ts +2 -0
  26. package/dist/api/resources/embeddings/client/index.js +17 -0
  27. package/dist/api/resources/embeddings/client/requests/EmbeddingsCreateCollectionRequest.d.ts +12 -0
  28. package/dist/api/resources/embeddings/client/requests/EmbeddingsCreateCollectionRequest.js +5 -0
  29. package/dist/api/resources/embeddings/client/requests/EmbeddingsDeleteRequest.d.ts +15 -0
  30. package/dist/api/resources/embeddings/client/requests/EmbeddingsDeleteRequest.js +5 -0
  31. package/dist/api/resources/embeddings/client/requests/EmbeddingsSearchRequest.d.ts +17 -0
  32. package/dist/api/resources/embeddings/client/requests/EmbeddingsSearchRequest.js +5 -0
  33. package/dist/api/resources/embeddings/client/requests/GetEmbeddingsBasedOnChunkIdsRequest.d.ts +15 -0
  34. package/dist/api/resources/embeddings/client/requests/GetEmbeddingsBasedOnChunkIdsRequest.js +5 -0
  35. package/dist/api/resources/embeddings/client/requests/index.d.ts +4 -0
  36. package/dist/api/resources/embeddings/client/requests/index.js +2 -0
  37. package/dist/api/resources/embeddings/index.d.ts +1 -0
  38. package/dist/api/resources/embeddings/index.js +17 -0
  39. package/dist/api/resources/fetch/client/Client.d.ts +54 -0
  40. package/dist/api/resources/fetch/client/Client.js +127 -0
  41. package/dist/api/resources/fetch/client/index.d.ts +2 -0
  42. package/dist/api/resources/fetch/client/index.js +17 -0
  43. package/dist/api/resources/fetch/client/requests/FetchContentRequest.d.ts +18 -0
  44. package/dist/api/resources/fetch/client/requests/FetchContentRequest.js +5 -0
  45. package/dist/api/resources/fetch/client/requests/index.d.ts +1 -0
  46. package/dist/api/resources/fetch/client/requests/index.js +2 -0
  47. package/dist/api/resources/fetch/index.d.ts +1 -0
  48. package/dist/api/resources/fetch/index.js +17 -0
  49. package/dist/api/resources/index.d.ts +16 -0
  50. package/dist/api/resources/index.js +45 -0
  51. package/dist/api/resources/search/client/Client.d.ts +133 -0
  52. package/dist/api/resources/search/client/Client.js +324 -0
  53. package/dist/api/resources/search/client/index.d.ts +2 -0
  54. package/dist/api/resources/search/client/index.js +17 -0
  55. package/dist/api/resources/search/client/requests/FullTextSearchRequest.d.ts +18 -0
  56. package/dist/api/resources/search/client/requests/FullTextSearchRequest.js +5 -0
  57. package/dist/api/resources/search/client/requests/QnARequest.d.ts +30 -0
  58. package/dist/api/resources/search/client/requests/QnARequest.js +5 -0
  59. package/dist/api/resources/search/client/requests/SearchRequest.d.ts +22 -0
  60. package/dist/api/resources/search/client/requests/SearchRequest.js +5 -0
  61. package/dist/api/resources/search/client/requests/index.d.ts +3 -0
  62. package/dist/api/resources/search/client/requests/index.js +2 -0
  63. package/dist/api/resources/search/index.d.ts +1 -0
  64. package/dist/api/resources/search/index.js +17 -0
  65. package/dist/api/resources/sources/client/Client.d.ts +72 -0
  66. package/dist/api/resources/sources/client/Client.js +207 -0
  67. package/dist/api/resources/sources/client/index.d.ts +2 -0
  68. package/dist/api/resources/sources/client/index.js +17 -0
  69. package/dist/api/resources/sources/client/requests/SourceBodyParams.d.ts +14 -0
  70. package/dist/api/resources/sources/client/requests/SourceBodyParams.js +5 -0
  71. package/dist/api/resources/sources/client/requests/SourcesGetAllRequest.d.ts +13 -0
  72. package/dist/api/resources/sources/client/requests/SourcesGetAllRequest.js +5 -0
  73. package/dist/api/resources/sources/client/requests/index.d.ts +2 -0
  74. package/dist/api/resources/sources/client/requests/index.js +2 -0
  75. package/dist/api/resources/sources/index.d.ts +1 -0
  76. package/dist/api/resources/sources/index.js +17 -0
  77. package/dist/api/resources/tenant/client/Client.d.ts +56 -0
  78. package/dist/api/resources/tenant/client/Client.js +132 -0
  79. package/dist/api/resources/tenant/client/index.d.ts +2 -0
  80. package/dist/api/resources/tenant/client/index.js +17 -0
  81. package/dist/api/resources/tenant/client/requests/TenantStatsRequest.d.ts +13 -0
  82. package/dist/api/resources/tenant/client/requests/TenantStatsRequest.js +5 -0
  83. package/dist/api/resources/tenant/client/requests/index.d.ts +1 -0
  84. package/dist/api/resources/tenant/client/requests/index.js +2 -0
  85. package/dist/api/resources/tenant/index.d.ts +1 -0
  86. package/dist/api/resources/tenant/index.js +17 -0
  87. package/dist/api/resources/upload/client/Client.d.ts +369 -0
  88. package/dist/api/resources/upload/client/Client.js +1439 -0
  89. package/dist/api/resources/upload/client/index.d.ts +2 -0
  90. package/dist/api/resources/upload/client/index.js +17 -0
  91. package/dist/api/resources/upload/client/requests/BodyBatchUpdateUploadBatchUpdatePatch.d.ts +19 -0
  92. package/dist/api/resources/upload/client/requests/BodyBatchUpdateUploadBatchUpdatePatch.js +5 -0
  93. package/dist/api/resources/upload/client/requests/BodyBatchUploadUploadBatchUploadPost.d.ts +18 -0
  94. package/dist/api/resources/upload/client/requests/BodyBatchUploadUploadBatchUploadPost.js +5 -0
  95. package/dist/api/resources/upload/client/requests/BodyUpdateFileUploadUpdateDocumentPatch.d.ts +20 -0
  96. package/dist/api/resources/upload/client/requests/BodyUpdateFileUploadUpdateDocumentPatch.js +5 -0
  97. package/dist/api/resources/upload/client/requests/BodyUploadFilesUploadUploadDocumentPost.d.ts +18 -0
  98. package/dist/api/resources/upload/client/requests/BodyUploadFilesUploadUploadDocumentPost.js +5 -0
  99. package/dist/api/resources/upload/client/requests/EmbeddingsUpdateRequest.d.ts +18 -0
  100. package/dist/api/resources/upload/client/requests/EmbeddingsUpdateRequest.js +5 -0
  101. package/dist/api/resources/upload/client/requests/EmbeddingsUploadRequest.d.ts +16 -0
  102. package/dist/api/resources/upload/client/requests/EmbeddingsUploadRequest.js +5 -0
  103. package/dist/api/resources/upload/client/requests/UploadScrapeWebpageRequest.d.ts +16 -0
  104. package/dist/api/resources/upload/client/requests/UploadScrapeWebpageRequest.js +5 -0
  105. package/dist/api/resources/upload/client/requests/UploadUpdateMarkdownRequest.d.ts +20 -0
  106. package/dist/api/resources/upload/client/requests/UploadUpdateMarkdownRequest.js +5 -0
  107. package/dist/api/resources/upload/client/requests/UploadUpdateTextRequest.d.ts +20 -0
  108. package/dist/api/resources/upload/client/requests/UploadUpdateTextRequest.js +5 -0
  109. package/dist/api/resources/upload/client/requests/UploadUpdateWebpageRequest.d.ts +17 -0
  110. package/dist/api/resources/upload/client/requests/UploadUpdateWebpageRequest.js +5 -0
  111. package/dist/api/resources/upload/client/requests/UploadUploadAppSourcesRequest.d.ts +16 -0
  112. package/dist/api/resources/upload/client/requests/UploadUploadAppSourcesRequest.js +5 -0
  113. package/dist/api/resources/upload/client/requests/UploadUploadMarkdownRequest.d.ts +18 -0
  114. package/dist/api/resources/upload/client/requests/UploadUploadMarkdownRequest.js +5 -0
  115. package/dist/api/resources/upload/client/requests/UploadUploadTextRequest.d.ts +18 -0
  116. package/dist/api/resources/upload/client/requests/UploadUploadTextRequest.js +5 -0
  117. package/dist/api/resources/upload/client/requests/UploadVerifyProcessingRequest.d.ts +13 -0
  118. package/dist/api/resources/upload/client/requests/UploadVerifyProcessingRequest.js +5 -0
  119. package/dist/api/resources/upload/client/requests/index.d.ts +14 -0
  120. package/dist/api/resources/upload/client/requests/index.js +2 -0
  121. package/dist/api/resources/upload/index.d.ts +1 -0
  122. package/dist/api/resources/upload/index.js +17 -0
  123. package/dist/api/resources/user/client/Client.d.ts +55 -0
  124. package/dist/api/resources/user/client/Client.js +144 -0
  125. package/dist/api/resources/user/client/index.d.ts +2 -0
  126. package/dist/api/resources/user/client/index.js +17 -0
  127. package/dist/api/resources/user/client/requests/BodyCreateTenantUserCreateTenantPost.d.ts +11 -0
  128. package/dist/api/resources/user/client/requests/BodyCreateTenantUserCreateTenantPost.js +5 -0
  129. package/dist/api/resources/user/client/requests/index.d.ts +1 -0
  130. package/dist/api/resources/user/client/requests/index.js +2 -0
  131. package/dist/api/resources/user/index.d.ts +1 -0
  132. package/dist/api/resources/user/index.js +17 -0
  133. package/dist/api/resources/userMemory/client/Client.d.ts +108 -0
  134. package/dist/api/resources/userMemory/client/Client.js +370 -0
  135. package/dist/api/resources/userMemory/client/index.d.ts +2 -0
  136. package/dist/api/resources/userMemory/client/index.js +17 -0
  137. package/dist/api/resources/userMemory/client/requests/UserMemoryAddUserMemoryRequest.d.ts +16 -0
  138. package/dist/api/resources/userMemory/client/requests/UserMemoryAddUserMemoryRequest.js +5 -0
  139. package/dist/api/resources/userMemory/client/requests/UserMemoryDeleteUserMemoryRequest.d.ts +16 -0
  140. package/dist/api/resources/userMemory/client/requests/UserMemoryDeleteUserMemoryRequest.js +5 -0
  141. package/dist/api/resources/userMemory/client/requests/UserMemoryGenerateUserMemoryRequest.d.ts +18 -0
  142. package/dist/api/resources/userMemory/client/requests/UserMemoryGenerateUserMemoryRequest.js +5 -0
  143. package/dist/api/resources/userMemory/client/requests/UserMemoryListUserMemoriesRequest.d.ts +14 -0
  144. package/dist/api/resources/userMemory/client/requests/UserMemoryListUserMemoriesRequest.js +5 -0
  145. package/dist/api/resources/userMemory/client/requests/UserMemoryRetrieveUserMemoryRequest.d.ts +17 -0
  146. package/dist/api/resources/userMemory/client/requests/UserMemoryRetrieveUserMemoryRequest.js +5 -0
  147. package/dist/api/resources/userMemory/client/requests/index.d.ts +5 -0
  148. package/dist/api/resources/userMemory/client/requests/index.js +2 -0
  149. package/dist/api/resources/userMemory/index.d.ts +1 -0
  150. package/dist/api/resources/userMemory/index.js +17 -0
  151. package/dist/api/types/ActualErrorResponse.d.ts +7 -0
  152. package/dist/api/types/ActualErrorResponse.js +5 -0
  153. package/dist/api/types/AppSourcesUploadData.d.ts +9 -0
  154. package/dist/api/types/AppSourcesUploadData.js +5 -0
  155. package/dist/api/types/AttachmentModel.d.ts +13 -0
  156. package/dist/api/types/AttachmentModel.js +5 -0
  157. package/dist/api/types/BatchUploadData.d.ts +9 -0
  158. package/dist/api/types/BatchUploadData.js +5 -0
  159. package/dist/api/types/Bm25OperatorType.d.ts +8 -0
  160. package/dist/api/types/Bm25OperatorType.js +10 -0
  161. package/dist/api/types/ContentModel.d.ts +11 -0
  162. package/dist/api/types/ContentModel.js +5 -0
  163. package/dist/api/types/DeleteMemoryRequest.d.ts +8 -0
  164. package/dist/api/types/DeleteMemoryRequest.js +5 -0
  165. package/dist/api/types/EmbeddingsCreateCollectionData.d.ts +9 -0
  166. package/dist/api/types/EmbeddingsCreateCollectionData.js +5 -0
  167. package/dist/api/types/EmbeddingsDeleteData.d.ts +9 -0
  168. package/dist/api/types/EmbeddingsDeleteData.js +5 -0
  169. package/dist/api/types/EmbeddingsGetData.d.ts +9 -0
  170. package/dist/api/types/EmbeddingsGetData.js +5 -0
  171. package/dist/api/types/EmbeddingsSearchData.d.ts +9 -0
  172. package/dist/api/types/EmbeddingsSearchData.js +5 -0
  173. package/dist/api/types/ErrorResponse.d.ts +9 -0
  174. package/dist/api/types/ErrorResponse.js +5 -0
  175. package/dist/api/types/ExtendedContext.d.ts +7 -0
  176. package/dist/api/types/ExtendedContext.js +5 -0
  177. package/dist/api/types/FetchContentData.d.ts +10 -0
  178. package/dist/api/types/FetchContentData.js +5 -0
  179. package/dist/api/types/FileUploadResult.d.ts +7 -0
  180. package/dist/api/types/FileUploadResult.js +5 -0
  181. package/dist/api/types/FullTextSearchData.d.ts +9 -0
  182. package/dist/api/types/FullTextSearchData.js +5 -0
  183. package/dist/api/types/HttpValidationError.d.ts +7 -0
  184. package/dist/api/types/HttpValidationError.js +5 -0
  185. package/dist/api/types/ListSourcesResponse.d.ts +9 -0
  186. package/dist/api/types/ListSourcesResponse.js +5 -0
  187. package/dist/api/types/MarkdownUploadRequest.d.ts +8 -0
  188. package/dist/api/types/MarkdownUploadRequest.js +5 -0
  189. package/dist/api/types/ProcessingStatus.d.ts +9 -0
  190. package/dist/api/types/ProcessingStatus.js +5 -0
  191. package/dist/api/types/RelatedChunk.d.ts +9 -0
  192. package/dist/api/types/RelatedChunk.js +5 -0
  193. package/dist/api/types/SearchChunk.d.ts +21 -0
  194. package/dist/api/types/SearchChunk.js +5 -0
  195. package/dist/api/types/SearchData.d.ts +9 -0
  196. package/dist/api/types/SearchData.js +5 -0
  197. package/dist/api/types/SingleUploadData.d.ts +8 -0
  198. package/dist/api/types/SingleUploadData.js +5 -0
  199. package/dist/api/types/Source.d.ts +19 -0
  200. package/dist/api/types/Source.js +5 -0
  201. package/dist/api/types/SourceContent.d.ts +11 -0
  202. package/dist/api/types/SourceContent.js +5 -0
  203. package/dist/api/types/SourceModel.d.ts +18 -0
  204. package/dist/api/types/SourceModel.js +5 -0
  205. package/dist/api/types/TenantCreateData.d.ts +9 -0
  206. package/dist/api/types/TenantCreateData.js +5 -0
  207. package/dist/api/types/TenantStats.d.ts +10 -0
  208. package/dist/api/types/TenantStats.js +5 -0
  209. package/dist/api/types/ValidationError.d.ts +14 -0
  210. package/dist/api/types/ValidationError.js +5 -0
  211. package/dist/api/types/index.d.ts +30 -0
  212. package/dist/api/types/index.js +46 -0
  213. package/dist/core/auth/AuthProvider.d.ts +4 -0
  214. package/dist/core/auth/AuthProvider.js +2 -0
  215. package/dist/core/auth/AuthRequest.d.ts +9 -0
  216. package/dist/core/auth/AuthRequest.js +2 -0
  217. package/dist/core/auth/BasicAuth.d.ts +8 -0
  218. package/dist/core/auth/BasicAuth.js +26 -0
  219. package/dist/core/auth/BearerToken.d.ts +5 -0
  220. package/dist/core/auth/BearerToken.js +15 -0
  221. package/dist/core/auth/index.d.ts +4 -0
  222. package/dist/core/auth/index.js +7 -0
  223. package/dist/core/base64.d.ts +2 -0
  224. package/dist/core/base64.js +27 -0
  225. package/dist/core/exports.d.ts +1 -0
  226. package/dist/core/exports.js +17 -0
  227. package/dist/core/fetcher/APIResponse.d.ts +20 -0
  228. package/dist/core/fetcher/APIResponse.js +2 -0
  229. package/dist/core/fetcher/BinaryResponse.d.ts +20 -0
  230. package/dist/core/fetcher/BinaryResponse.js +18 -0
  231. package/dist/core/fetcher/Fetcher.d.ts +40 -0
  232. package/dist/core/fetcher/Fetcher.js +105 -0
  233. package/dist/core/fetcher/Headers.d.ts +3 -0
  234. package/dist/core/fetcher/Headers.js +92 -0
  235. package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
  236. package/dist/core/fetcher/HttpResponsePromise.js +92 -0
  237. package/dist/core/fetcher/RawResponse.d.ts +29 -0
  238. package/dist/core/fetcher/RawResponse.js +44 -0
  239. package/dist/core/fetcher/ResponseWithBody.d.ts +4 -0
  240. package/dist/core/fetcher/ResponseWithBody.js +7 -0
  241. package/dist/core/fetcher/Supplier.d.ts +4 -0
  242. package/dist/core/fetcher/Supplier.js +13 -0
  243. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  244. package/dist/core/fetcher/createRequestUrl.js +9 -0
  245. package/dist/core/fetcher/getErrorResponseBody.d.ts +1 -0
  246. package/dist/core/fetcher/getErrorResponseBody.js +34 -0
  247. package/dist/core/fetcher/getFetchFn.d.ts +1 -0
  248. package/dist/core/fetcher/getFetchFn.js +7 -0
  249. package/dist/core/fetcher/getHeader.d.ts +1 -0
  250. package/dist/core/fetcher/getHeader.js +12 -0
  251. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  252. package/dist/core/fetcher/getRequestBody.js +13 -0
  253. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  254. package/dist/core/fetcher/getResponseBody.js +45 -0
  255. package/dist/core/fetcher/index.d.ts +9 -0
  256. package/dist/core/fetcher/index.js +15 -0
  257. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  258. package/dist/core/fetcher/makeRequest.js +33 -0
  259. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  260. package/dist/core/fetcher/requestWithRetries.js +30 -0
  261. package/dist/core/fetcher/signals.d.ts +12 -0
  262. package/dist/core/fetcher/signals.js +37 -0
  263. package/dist/core/file/exports.d.ts +1 -0
  264. package/dist/core/file/exports.js +2 -0
  265. package/dist/core/file/file.d.ts +5 -0
  266. package/dist/core/file/file.js +177 -0
  267. package/dist/core/file/index.d.ts +2 -0
  268. package/dist/core/file/index.js +18 -0
  269. package/dist/core/file/types.d.ts +70 -0
  270. package/dist/core/file/types.js +2 -0
  271. package/dist/core/form-data-utils/FormDataWrapper.d.ts +16 -0
  272. package/dist/core/form-data-utils/FormDataWrapper.js +178 -0
  273. package/dist/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
  274. package/dist/core/form-data-utils/encodeAsFormParameter.js +13 -0
  275. package/dist/core/form-data-utils/index.d.ts +2 -0
  276. package/dist/core/form-data-utils/index.js +20 -0
  277. package/dist/core/headers.d.ts +3 -0
  278. package/dist/core/headers.js +30 -0
  279. package/dist/core/index.d.ts +7 -0
  280. package/dist/core/index.js +36 -0
  281. package/dist/core/json.d.ts +15 -0
  282. package/dist/core/json.js +24 -0
  283. package/dist/core/runtime/index.d.ts +1 -0
  284. package/dist/core/runtime/index.js +5 -0
  285. package/dist/core/runtime/runtime.d.ts +9 -0
  286. package/dist/core/runtime/runtime.js +102 -0
  287. package/dist/core/url/index.d.ts +2 -0
  288. package/dist/core/url/index.js +7 -0
  289. package/dist/core/url/join.d.ts +1 -0
  290. package/dist/core/url/join.js +70 -0
  291. package/dist/core/url/qs.d.ts +6 -0
  292. package/dist/core/url/qs.js +65 -0
  293. package/dist/environments.d.ts +7 -0
  294. package/dist/environments.js +9 -0
  295. package/dist/errors/CortexAIError.d.ts +15 -0
  296. package/dist/errors/CortexAIError.js +30 -0
  297. package/dist/errors/CortexAITimeoutError.d.ts +6 -0
  298. package/dist/errors/CortexAITimeoutError.js +13 -0
  299. package/dist/errors/index.d.ts +2 -0
  300. package/dist/errors/index.js +7 -0
  301. package/dist/exports.d.ts +1 -0
  302. package/dist/exports.js +17 -0
  303. package/dist/index.d.ts +5 -0
  304. package/dist/index.js +38 -0
  305. package/package.json +30 -0
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface BodyCreateTenantUserCreateTenantPost {
9
+ tenant_id?: string;
10
+ tenant_metadata_schema?: Record<string, unknown>[];
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export { type BodyCreateTenantUserCreateTenantPost } from "./BodyCreateTenantUserCreateTenantPost.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
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
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,108 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments.js";
5
+ import * as core from "../../../../core/index.js";
6
+ import * as CortexAI from "../../../index.js";
7
+ export declare namespace UserMemory {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.CortexAIEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ token?: core.Supplier<core.BearerToken | undefined>;
13
+ /** Additional headers to include in requests. */
14
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
15
+ }
16
+ interface RequestOptions {
17
+ /** The maximum time to wait for a response in seconds. */
18
+ timeoutInSeconds?: number;
19
+ /** The number of times to retry the request. Defaults to 2. */
20
+ maxRetries?: number;
21
+ /** A hook to abort the request. */
22
+ abortSignal?: AbortSignal;
23
+ /** Additional query string parameters to include in the request. */
24
+ queryParams?: Record<string, unknown>;
25
+ /** Additional headers to include in the request. */
26
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
27
+ }
28
+ }
29
+ export declare class UserMemory {
30
+ protected readonly _options: UserMemory.Options;
31
+ constructor(_options?: UserMemory.Options);
32
+ /**
33
+ * @param {CortexAI.UserMemoryListUserMemoriesRequest} request
34
+ * @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
35
+ *
36
+ * @throws {@link CortexAI.UnprocessableEntityError}
37
+ *
38
+ * @example
39
+ * await client.userMemory.listUserMemories({
40
+ * tenant_id: "tenant_id",
41
+ * sub_tenant_id: "sub_tenant_id"
42
+ * })
43
+ */
44
+ listUserMemories(request: CortexAI.UserMemoryListUserMemoriesRequest, requestOptions?: UserMemory.RequestOptions): core.HttpResponsePromise<unknown>;
45
+ private __listUserMemories;
46
+ /**
47
+ * @param {CortexAI.UserMemoryDeleteUserMemoryRequest} request
48
+ * @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
49
+ *
50
+ * @throws {@link CortexAI.UnprocessableEntityError}
51
+ *
52
+ * @example
53
+ * await client.userMemory.deleteUserMemory({
54
+ * tenant_id: "tenant_id",
55
+ * memory_id: "memory_id",
56
+ * sub_tenant_id: "sub_tenant_id"
57
+ * })
58
+ */
59
+ deleteUserMemory(request: CortexAI.UserMemoryDeleteUserMemoryRequest, requestOptions?: UserMemory.RequestOptions): core.HttpResponsePromise<unknown>;
60
+ private __deleteUserMemory;
61
+ /**
62
+ * @param {CortexAI.UserMemoryRetrieveUserMemoryRequest} request
63
+ * @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
64
+ *
65
+ * @throws {@link CortexAI.UnprocessableEntityError}
66
+ *
67
+ * @example
68
+ * await client.userMemory.retrieveUserMemory({
69
+ * tenant_id: "tenant_id",
70
+ * query: "query",
71
+ * sub_tenant_id: "sub_tenant_id"
72
+ * })
73
+ */
74
+ retrieveUserMemory(request: CortexAI.UserMemoryRetrieveUserMemoryRequest, requestOptions?: UserMemory.RequestOptions): core.HttpResponsePromise<unknown>;
75
+ private __retrieveUserMemory;
76
+ /**
77
+ * @param {CortexAI.UserMemoryGenerateUserMemoryRequest} request
78
+ * @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
79
+ *
80
+ * @throws {@link CortexAI.UnprocessableEntityError}
81
+ *
82
+ * @example
83
+ * await client.userMemory.generateUserMemory({
84
+ * tenant_id: "tenant_id",
85
+ * user_query: "user_query",
86
+ * user_name: "user_name",
87
+ * sub_tenant_id: "sub_tenant_id"
88
+ * })
89
+ */
90
+ generateUserMemory(request: CortexAI.UserMemoryGenerateUserMemoryRequest, requestOptions?: UserMemory.RequestOptions): core.HttpResponsePromise<unknown>;
91
+ private __generateUserMemory;
92
+ /**
93
+ * @param {CortexAI.UserMemoryAddUserMemoryRequest} request
94
+ * @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
95
+ *
96
+ * @throws {@link CortexAI.UnprocessableEntityError}
97
+ *
98
+ * @example
99
+ * await client.userMemory.addUserMemory({
100
+ * tenant_id: "tenant_id",
101
+ * user_memory: "user_memory",
102
+ * sub_tenant_id: "sub_tenant_id"
103
+ * })
104
+ */
105
+ addUserMemory(request: CortexAI.UserMemoryAddUserMemoryRequest, requestOptions?: UserMemory.RequestOptions): core.HttpResponsePromise<unknown>;
106
+ private __addUserMemory;
107
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
108
+ }
@@ -0,0 +1,370 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.UserMemory = void 0;
30
+ const environments = __importStar(require("../../../../environments.js"));
31
+ const core = __importStar(require("../../../../core/index.js"));
32
+ const CortexAI = __importStar(require("../../../index.js"));
33
+ const headers_js_1 = require("../../../../core/headers.js");
34
+ const errors = __importStar(require("../../../../errors/index.js"));
35
+ class UserMemory {
36
+ constructor(_options = {}) {
37
+ this._options = _options;
38
+ }
39
+ /**
40
+ * @param {CortexAI.UserMemoryListUserMemoriesRequest} request
41
+ * @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
42
+ *
43
+ * @throws {@link CortexAI.UnprocessableEntityError}
44
+ *
45
+ * @example
46
+ * await client.userMemory.listUserMemories({
47
+ * tenant_id: "tenant_id",
48
+ * sub_tenant_id: "sub_tenant_id"
49
+ * })
50
+ */
51
+ listUserMemories(request, requestOptions) {
52
+ return core.HttpResponsePromise.fromPromise(this.__listUserMemories(request, requestOptions));
53
+ }
54
+ async __listUserMemories(request, requestOptions) {
55
+ var _a, _b, _c;
56
+ const { tenant_id: tenantId, sub_tenant_id: subTenantId } = request;
57
+ const _queryParams = {};
58
+ _queryParams["tenant_id"] = tenantId;
59
+ _queryParams["sub_tenant_id"] = subTenantId;
60
+ 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);
61
+ const _response = await core.fetcher({
62
+ 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, "user_memory/list_user_memories"),
63
+ method: "GET",
64
+ headers: _headers,
65
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
66
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
67
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
68
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
69
+ });
70
+ if (_response.ok) {
71
+ return { data: _response.body, rawResponse: _response.rawResponse };
72
+ }
73
+ if (_response.error.reason === "status-code") {
74
+ switch (_response.error.statusCode) {
75
+ case 422:
76
+ throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
77
+ default:
78
+ throw new errors.CortexAIError({
79
+ statusCode: _response.error.statusCode,
80
+ body: _response.error.body,
81
+ rawResponse: _response.rawResponse,
82
+ });
83
+ }
84
+ }
85
+ switch (_response.error.reason) {
86
+ case "non-json":
87
+ throw new errors.CortexAIError({
88
+ statusCode: _response.error.statusCode,
89
+ body: _response.error.rawBody,
90
+ rawResponse: _response.rawResponse,
91
+ });
92
+ case "timeout":
93
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /user_memory/list_user_memories.");
94
+ case "unknown":
95
+ throw new errors.CortexAIError({
96
+ message: _response.error.errorMessage,
97
+ rawResponse: _response.rawResponse,
98
+ });
99
+ }
100
+ }
101
+ /**
102
+ * @param {CortexAI.UserMemoryDeleteUserMemoryRequest} request
103
+ * @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
104
+ *
105
+ * @throws {@link CortexAI.UnprocessableEntityError}
106
+ *
107
+ * @example
108
+ * await client.userMemory.deleteUserMemory({
109
+ * tenant_id: "tenant_id",
110
+ * memory_id: "memory_id",
111
+ * sub_tenant_id: "sub_tenant_id"
112
+ * })
113
+ */
114
+ deleteUserMemory(request, requestOptions) {
115
+ return core.HttpResponsePromise.fromPromise(this.__deleteUserMemory(request, requestOptions));
116
+ }
117
+ async __deleteUserMemory(request, requestOptions) {
118
+ var _a, _b, _c;
119
+ const { tenant_id: tenantId, memory_id: memoryId, sub_tenant_id: subTenantId } = request;
120
+ const _queryParams = {};
121
+ _queryParams["tenant_id"] = tenantId;
122
+ _queryParams["memory_id"] = memoryId;
123
+ _queryParams["sub_tenant_id"] = subTenantId;
124
+ 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);
125
+ const _response = await core.fetcher({
126
+ 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, "user_memory/delete_user_memory"),
127
+ method: "DELETE",
128
+ headers: _headers,
129
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
130
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
131
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
132
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
133
+ });
134
+ if (_response.ok) {
135
+ return { data: _response.body, rawResponse: _response.rawResponse };
136
+ }
137
+ if (_response.error.reason === "status-code") {
138
+ switch (_response.error.statusCode) {
139
+ case 422:
140
+ throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
141
+ default:
142
+ throw new errors.CortexAIError({
143
+ statusCode: _response.error.statusCode,
144
+ body: _response.error.body,
145
+ rawResponse: _response.rawResponse,
146
+ });
147
+ }
148
+ }
149
+ switch (_response.error.reason) {
150
+ case "non-json":
151
+ throw new errors.CortexAIError({
152
+ statusCode: _response.error.statusCode,
153
+ body: _response.error.rawBody,
154
+ rawResponse: _response.rawResponse,
155
+ });
156
+ case "timeout":
157
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling DELETE /user_memory/delete_user_memory.");
158
+ case "unknown":
159
+ throw new errors.CortexAIError({
160
+ message: _response.error.errorMessage,
161
+ rawResponse: _response.rawResponse,
162
+ });
163
+ }
164
+ }
165
+ /**
166
+ * @param {CortexAI.UserMemoryRetrieveUserMemoryRequest} request
167
+ * @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
168
+ *
169
+ * @throws {@link CortexAI.UnprocessableEntityError}
170
+ *
171
+ * @example
172
+ * await client.userMemory.retrieveUserMemory({
173
+ * tenant_id: "tenant_id",
174
+ * query: "query",
175
+ * sub_tenant_id: "sub_tenant_id"
176
+ * })
177
+ */
178
+ retrieveUserMemory(request, requestOptions) {
179
+ return core.HttpResponsePromise.fromPromise(this.__retrieveUserMemory(request, requestOptions));
180
+ }
181
+ async __retrieveUserMemory(request, requestOptions) {
182
+ var _a, _b, _c;
183
+ const { tenant_id: tenantId, query, sub_tenant_id: subTenantId, max_count: maxCount } = request;
184
+ const _queryParams = {};
185
+ _queryParams["tenant_id"] = tenantId;
186
+ _queryParams["query"] = query;
187
+ _queryParams["sub_tenant_id"] = subTenantId;
188
+ if (maxCount != null) {
189
+ _queryParams["max_count"] = maxCount.toString();
190
+ }
191
+ 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);
192
+ const _response = await core.fetcher({
193
+ 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, "user_memory/retrieve_user_memory"),
194
+ method: "GET",
195
+ headers: _headers,
196
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
197
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
198
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
199
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
200
+ });
201
+ if (_response.ok) {
202
+ return { data: _response.body, rawResponse: _response.rawResponse };
203
+ }
204
+ if (_response.error.reason === "status-code") {
205
+ switch (_response.error.statusCode) {
206
+ case 422:
207
+ throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
208
+ default:
209
+ throw new errors.CortexAIError({
210
+ statusCode: _response.error.statusCode,
211
+ body: _response.error.body,
212
+ rawResponse: _response.rawResponse,
213
+ });
214
+ }
215
+ }
216
+ switch (_response.error.reason) {
217
+ case "non-json":
218
+ throw new errors.CortexAIError({
219
+ statusCode: _response.error.statusCode,
220
+ body: _response.error.rawBody,
221
+ rawResponse: _response.rawResponse,
222
+ });
223
+ case "timeout":
224
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling GET /user_memory/retrieve_user_memory.");
225
+ case "unknown":
226
+ throw new errors.CortexAIError({
227
+ message: _response.error.errorMessage,
228
+ rawResponse: _response.rawResponse,
229
+ });
230
+ }
231
+ }
232
+ /**
233
+ * @param {CortexAI.UserMemoryGenerateUserMemoryRequest} request
234
+ * @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
235
+ *
236
+ * @throws {@link CortexAI.UnprocessableEntityError}
237
+ *
238
+ * @example
239
+ * await client.userMemory.generateUserMemory({
240
+ * tenant_id: "tenant_id",
241
+ * user_query: "user_query",
242
+ * user_name: "user_name",
243
+ * sub_tenant_id: "sub_tenant_id"
244
+ * })
245
+ */
246
+ generateUserMemory(request, requestOptions) {
247
+ return core.HttpResponsePromise.fromPromise(this.__generateUserMemory(request, requestOptions));
248
+ }
249
+ async __generateUserMemory(request, requestOptions) {
250
+ var _a, _b, _c;
251
+ const { tenant_id: tenantId, user_query: userQuery, user_name: userName, sub_tenant_id: subTenantId } = request;
252
+ const _queryParams = {};
253
+ _queryParams["tenant_id"] = tenantId;
254
+ _queryParams["user_query"] = userQuery;
255
+ _queryParams["user_name"] = userName;
256
+ _queryParams["sub_tenant_id"] = subTenantId;
257
+ 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);
258
+ const _response = await core.fetcher({
259
+ 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, "user_memory/generate_user_memory"),
260
+ method: "POST",
261
+ headers: _headers,
262
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
263
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
264
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
265
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
266
+ });
267
+ if (_response.ok) {
268
+ return { data: _response.body, rawResponse: _response.rawResponse };
269
+ }
270
+ if (_response.error.reason === "status-code") {
271
+ switch (_response.error.statusCode) {
272
+ case 422:
273
+ throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
274
+ default:
275
+ throw new errors.CortexAIError({
276
+ statusCode: _response.error.statusCode,
277
+ body: _response.error.body,
278
+ rawResponse: _response.rawResponse,
279
+ });
280
+ }
281
+ }
282
+ switch (_response.error.reason) {
283
+ case "non-json":
284
+ throw new errors.CortexAIError({
285
+ statusCode: _response.error.statusCode,
286
+ body: _response.error.rawBody,
287
+ rawResponse: _response.rawResponse,
288
+ });
289
+ case "timeout":
290
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /user_memory/generate_user_memory.");
291
+ case "unknown":
292
+ throw new errors.CortexAIError({
293
+ message: _response.error.errorMessage,
294
+ rawResponse: _response.rawResponse,
295
+ });
296
+ }
297
+ }
298
+ /**
299
+ * @param {CortexAI.UserMemoryAddUserMemoryRequest} request
300
+ * @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
301
+ *
302
+ * @throws {@link CortexAI.UnprocessableEntityError}
303
+ *
304
+ * @example
305
+ * await client.userMemory.addUserMemory({
306
+ * tenant_id: "tenant_id",
307
+ * user_memory: "user_memory",
308
+ * sub_tenant_id: "sub_tenant_id"
309
+ * })
310
+ */
311
+ addUserMemory(request, requestOptions) {
312
+ return core.HttpResponsePromise.fromPromise(this.__addUserMemory(request, requestOptions));
313
+ }
314
+ async __addUserMemory(request, requestOptions) {
315
+ var _a, _b, _c;
316
+ const { tenant_id: tenantId, user_memory: userMemory, sub_tenant_id: subTenantId } = request;
317
+ const _queryParams = {};
318
+ _queryParams["tenant_id"] = tenantId;
319
+ _queryParams["user_memory"] = userMemory;
320
+ _queryParams["sub_tenant_id"] = subTenantId;
321
+ 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);
322
+ const _response = await core.fetcher({
323
+ 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, "user_memory/add_user_memory"),
324
+ method: "POST",
325
+ headers: _headers,
326
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
327
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
328
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
329
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
330
+ });
331
+ if (_response.ok) {
332
+ return { data: _response.body, rawResponse: _response.rawResponse };
333
+ }
334
+ if (_response.error.reason === "status-code") {
335
+ switch (_response.error.statusCode) {
336
+ case 422:
337
+ throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
338
+ default:
339
+ throw new errors.CortexAIError({
340
+ statusCode: _response.error.statusCode,
341
+ body: _response.error.body,
342
+ rawResponse: _response.rawResponse,
343
+ });
344
+ }
345
+ }
346
+ switch (_response.error.reason) {
347
+ case "non-json":
348
+ throw new errors.CortexAIError({
349
+ statusCode: _response.error.statusCode,
350
+ body: _response.error.rawBody,
351
+ rawResponse: _response.rawResponse,
352
+ });
353
+ case "timeout":
354
+ throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /user_memory/add_user_memory.");
355
+ case "unknown":
356
+ throw new errors.CortexAIError({
357
+ message: _response.error.errorMessage,
358
+ rawResponse: _response.rawResponse,
359
+ });
360
+ }
361
+ }
362
+ async _getAuthorizationHeader() {
363
+ const bearer = await core.Supplier.get(this._options.token);
364
+ if (bearer != null) {
365
+ return `Bearer ${bearer}`;
366
+ }
367
+ return undefined;
368
+ }
369
+ }
370
+ exports.UserMemory = UserMemory;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
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
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * tenant_id: "tenant_id",
8
+ * user_memory: "user_memory",
9
+ * sub_tenant_id: "sub_tenant_id"
10
+ * }
11
+ */
12
+ export interface UserMemoryAddUserMemoryRequest {
13
+ tenant_id: string;
14
+ user_memory: string;
15
+ sub_tenant_id: string;
16
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * tenant_id: "tenant_id",
8
+ * memory_id: "memory_id",
9
+ * sub_tenant_id: "sub_tenant_id"
10
+ * }
11
+ */
12
+ export interface UserMemoryDeleteUserMemoryRequest {
13
+ tenant_id: string;
14
+ memory_id: string;
15
+ sub_tenant_id: string;
16
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * tenant_id: "tenant_id",
8
+ * user_query: "user_query",
9
+ * user_name: "user_name",
10
+ * sub_tenant_id: "sub_tenant_id"
11
+ * }
12
+ */
13
+ export interface UserMemoryGenerateUserMemoryRequest {
14
+ tenant_id: string;
15
+ user_query: string;
16
+ user_name: string;
17
+ sub_tenant_id: string;
18
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
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
+ * }
10
+ */
11
+ export interface UserMemoryListUserMemoriesRequest {
12
+ tenant_id: string;
13
+ sub_tenant_id: string;
14
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
+ * query: "query",
9
+ * sub_tenant_id: "sub_tenant_id"
10
+ * }
11
+ */
12
+ export interface UserMemoryRetrieveUserMemoryRequest {
13
+ tenant_id: string;
14
+ query: string;
15
+ sub_tenant_id: string;
16
+ max_count?: number;
17
+ }