@athenaintel/sdk 4.3.308 → 4.3.310

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 (432) hide show
  1. package/README.md +117 -9
  2. package/dist/cjs/BaseClient.d.ts +14 -1
  3. package/dist/cjs/BaseClient.js +59 -0
  4. package/dist/cjs/Client.d.ts +24 -23
  5. package/dist/cjs/Client.js +10 -51
  6. package/dist/cjs/api/errors/BadRequestError.d.ts +1 -1
  7. package/dist/cjs/api/errors/ContentTooLargeError.d.ts +2 -2
  8. package/dist/cjs/api/errors/ForbiddenError.d.ts +1 -1
  9. package/dist/cjs/api/errors/InternalServerError.d.ts +1 -1
  10. package/dist/cjs/api/errors/NotFoundError.d.ts +1 -1
  11. package/dist/cjs/api/errors/NotImplementedError.d.ts +1 -1
  12. package/dist/cjs/api/errors/ServiceUnavailableError.d.ts +1 -1
  13. package/dist/cjs/api/errors/UnauthorizedError.d.ts +1 -1
  14. package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +1 -1
  15. package/dist/cjs/api/errors/UnsupportedMediaTypeError.d.ts +2 -2
  16. package/dist/cjs/api/errors/index.d.ts +5 -5
  17. package/dist/cjs/api/errors/index.js +5 -5
  18. package/dist/cjs/api/index.d.ts +1 -1
  19. package/dist/cjs/api/index.js +1 -1
  20. package/dist/cjs/api/resources/agents/client/Client.d.ts +20 -20
  21. package/dist/cjs/api/resources/agents/client/Client.js +29 -26
  22. package/dist/cjs/api/resources/agents/client/index.d.ts +0 -1
  23. package/dist/cjs/api/resources/agents/client/requests/index.d.ts +1 -1
  24. package/dist/cjs/api/resources/agents/resources/drive/client/Client.d.ts +7 -7
  25. package/dist/cjs/api/resources/agents/resources/drive/client/Client.js +20 -17
  26. package/dist/cjs/api/resources/agents/resources/drive/client/index.d.ts +0 -1
  27. package/dist/cjs/api/resources/agents/resources/drive/client/requests/index.d.ts +1 -1
  28. package/dist/cjs/api/resources/agents/resources/general/client/Client.d.ts +11 -11
  29. package/dist/cjs/api/resources/agents/resources/general/client/Client.js +42 -23
  30. package/dist/cjs/api/resources/agents/resources/index.d.ts +3 -3
  31. package/dist/cjs/api/resources/agents/resources/index.js +6 -6
  32. package/dist/cjs/api/resources/agents/resources/research/client/Client.d.ts +7 -7
  33. package/dist/cjs/api/resources/agents/resources/research/client/Client.js +20 -17
  34. package/dist/cjs/api/resources/agents/resources/research/client/index.d.ts +0 -1
  35. package/dist/cjs/api/resources/agents/resources/research/client/requests/index.d.ts +1 -1
  36. package/dist/cjs/api/resources/agents/resources/sql/client/Client.d.ts +7 -7
  37. package/dist/cjs/api/resources/agents/resources/sql/client/Client.js +20 -17
  38. package/dist/cjs/api/resources/agents/resources/sql/client/index.d.ts +0 -1
  39. package/dist/cjs/api/resources/agents/resources/sql/client/requests/index.d.ts +1 -1
  40. package/dist/cjs/api/resources/aop/client/Client.d.ts +9 -9
  41. package/dist/cjs/api/resources/aop/client/Client.js +31 -20
  42. package/dist/cjs/api/resources/assets/client/Client.d.ts +14 -14
  43. package/dist/cjs/api/resources/assets/client/Client.js +62 -35
  44. package/dist/cjs/api/resources/assets/client/index.d.ts +0 -1
  45. package/dist/cjs/api/resources/assets/client/requests/CreateAssetRequestIn.d.ts +1 -1
  46. package/dist/cjs/api/resources/assets/client/requests/index.d.ts +3 -3
  47. package/dist/cjs/api/resources/databases/client/Client.d.ts +36 -32
  48. package/dist/cjs/api/resources/databases/client/Client.js +149 -81
  49. package/dist/cjs/api/resources/databases/client/index.d.ts +0 -1
  50. package/dist/cjs/api/resources/databases/client/requests/DatabasesDeleteRequest.d.ts +15 -0
  51. package/dist/cjs/api/resources/databases/client/requests/DatabasesDeleteRequest.js +3 -0
  52. package/dist/cjs/api/resources/databases/client/requests/UpdateDataRequest.d.ts +3 -0
  53. package/dist/cjs/api/resources/databases/client/requests/index.d.ts +4 -3
  54. package/dist/cjs/api/resources/index.d.ts +8 -8
  55. package/dist/cjs/api/resources/index.js +12 -12
  56. package/dist/cjs/api/resources/query/client/Client.d.ts +9 -9
  57. package/dist/cjs/api/resources/query/client/Client.js +34 -23
  58. package/dist/cjs/api/resources/query/client/index.d.ts +0 -1
  59. package/dist/cjs/api/resources/query/client/requests/QueryExecuteRequest.d.ts +1 -1
  60. package/dist/cjs/api/resources/query/client/requests/index.d.ts +2 -2
  61. package/dist/cjs/api/resources/query/index.d.ts +1 -1
  62. package/dist/cjs/api/resources/query/index.js +1 -1
  63. package/dist/cjs/api/resources/threads/client/Client.d.ts +8 -8
  64. package/dist/cjs/api/resources/threads/client/Client.js +25 -22
  65. package/dist/cjs/api/resources/tools/client/Client.d.ts +33 -33
  66. package/dist/cjs/api/resources/tools/client/Client.js +106 -55
  67. package/dist/cjs/api/resources/tools/client/index.d.ts +0 -1
  68. package/dist/cjs/api/resources/tools/client/requests/BodySaveAssetApiV0ToolsFileSavePost.d.ts +2 -2
  69. package/dist/cjs/api/resources/tools/client/requests/ToolsDataFrameRequest.d.ts +1 -1
  70. package/dist/cjs/api/resources/tools/client/requests/index.d.ts +7 -7
  71. package/dist/cjs/api/resources/tools/index.d.ts +1 -1
  72. package/dist/cjs/api/resources/tools/index.js +1 -1
  73. package/dist/cjs/api/resources/tools/resources/calendar/client/Client.d.ts +9 -9
  74. package/dist/cjs/api/resources/tools/resources/calendar/client/Client.js +30 -19
  75. package/dist/cjs/api/resources/tools/resources/email/client/Client.d.ts +11 -11
  76. package/dist/cjs/api/resources/tools/resources/email/client/Client.js +41 -22
  77. package/dist/cjs/api/resources/tools/resources/index.d.ts +3 -3
  78. package/dist/cjs/api/resources/tools/resources/index.js +3 -3
  79. package/dist/cjs/api/resources/tools/resources/sheets/client/Client.d.ts +39 -39
  80. package/dist/cjs/api/resources/tools/resources/sheets/client/Client.js +196 -65
  81. package/dist/cjs/api/resources/tools/resources/sheets/client/index.d.ts +0 -1
  82. package/dist/cjs/api/resources/tools/resources/sheets/client/requests/CreateNewSheetTabRequest.d.ts +1 -1
  83. package/dist/cjs/api/resources/tools/resources/sheets/client/requests/FormatSheetRangeRequest.d.ts +1 -1
  84. package/dist/cjs/api/resources/tools/resources/sheets/client/requests/InsertTableRowRequest.d.ts +1 -1
  85. package/dist/cjs/api/resources/tools/resources/sheets/client/requests/UpdateSheetRangeRequest.d.ts +1 -1
  86. package/dist/cjs/api/resources/tools/resources/sheets/client/requests/index.d.ts +17 -17
  87. package/dist/cjs/api/resources/tools/resources/structuredDataExtractor/client/Client.d.ts +7 -7
  88. package/dist/cjs/api/resources/tools/resources/structuredDataExtractor/client/Client.js +20 -17
  89. package/dist/cjs/api/resources/tools/resources/structuredDataExtractor/client/index.d.ts +0 -1
  90. package/dist/cjs/api/resources/tools/resources/structuredDataExtractor/client/requests/StructuredDataExtractorRequest.d.ts +1 -1
  91. package/dist/cjs/api/resources/tools/resources/structuredDataExtractor/client/requests/index.d.ts +1 -1
  92. package/dist/cjs/api/resources/tools/resources/tasks/client/Client.d.ts +7 -7
  93. package/dist/cjs/api/resources/tools/resources/tasks/client/Client.js +20 -17
  94. package/dist/cjs/api/resources/tools/resources/tasks/client/index.d.ts +0 -1
  95. package/dist/cjs/api/resources/tools/resources/tasks/client/requests/index.d.ts +1 -1
  96. package/dist/cjs/api/types/AopExecuteResponseOut.d.ts +1 -1
  97. package/dist/cjs/api/types/AssetNode.d.ts +1 -1
  98. package/dist/cjs/api/types/BorderModel.d.ts +1 -1
  99. package/dist/cjs/api/types/BordersModel.d.ts +1 -1
  100. package/dist/cjs/api/types/CellFormat.d.ts +1 -1
  101. package/dist/cjs/api/types/Chunk.d.ts +1 -1
  102. package/dist/cjs/api/types/ChunkContentItem.d.ts +1 -1
  103. package/dist/cjs/api/types/ConversationAssetInfo.d.ts +1 -1
  104. package/dist/cjs/api/types/ConversationMessage.d.ts +1 -1
  105. package/dist/cjs/api/types/ConversationResult.d.ts +1 -1
  106. package/dist/cjs/api/types/DatabaseTableSchemaResponse.d.ts +1 -1
  107. package/dist/cjs/api/types/DatabaseTablesResponse.d.ts +1 -1
  108. package/dist/cjs/api/types/FolderResponse.d.ts +1 -1
  109. package/dist/cjs/api/types/GeneralAgentRequest.d.ts +1 -1
  110. package/dist/cjs/api/types/GeneralAgentResponse.d.ts +1 -1
  111. package/dist/cjs/api/types/GeneralAgentResponseMessage.d.ts +1 -1
  112. package/dist/cjs/api/types/GeneralAgentResponseMessageKwargs.d.ts +1 -1
  113. package/dist/cjs/api/types/InputMessage.d.ts +1 -1
  114. package/dist/cjs/api/types/InputMessageContentItem.d.ts +1 -1
  115. package/dist/cjs/api/types/NumberFormatModel.d.ts +1 -1
  116. package/dist/cjs/api/types/PaginatedAssetsOut.d.ts +1 -1
  117. package/dist/cjs/api/types/Sheet.d.ts +1 -1
  118. package/dist/cjs/api/types/StructuredDataExtractorResponse.d.ts +1 -1
  119. package/dist/cjs/api/types/TextFormatModel.d.ts +1 -1
  120. package/dist/cjs/api/types/ThreadStatusResponseOut.d.ts +1 -1
  121. package/dist/cjs/api/types/index.d.ts +5 -5
  122. package/dist/cjs/api/types/index.js +5 -5
  123. package/dist/cjs/auth/HeaderAuthProvider.d.ts +14 -0
  124. package/dist/cjs/auth/HeaderAuthProvider.js +71 -0
  125. package/dist/cjs/auth/index.d.ts +1 -0
  126. package/dist/cjs/auth/index.js +5 -0
  127. package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
  128. package/dist/cjs/core/auth/AuthProvider.js +2 -0
  129. package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
  130. package/dist/cjs/core/auth/AuthRequest.js +2 -0
  131. package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
  132. package/dist/cjs/core/auth/BasicAuth.js +27 -0
  133. package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
  134. package/dist/cjs/core/auth/BearerToken.js +16 -0
  135. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
  136. package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
  137. package/dist/cjs/core/auth/index.d.ts +5 -0
  138. package/dist/cjs/core/auth/index.js +9 -0
  139. package/dist/cjs/core/base64.d.ts +2 -0
  140. package/dist/cjs/core/base64.js +26 -0
  141. package/dist/cjs/core/exports.d.ts +1 -0
  142. package/dist/cjs/core/exports.js +1 -0
  143. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
  144. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +1 -1
  145. package/dist/cjs/core/fetcher/Fetcher.d.ts +9 -2
  146. package/dist/cjs/core/fetcher/Fetcher.js +204 -9
  147. package/dist/cjs/core/fetcher/getErrorResponseBody.js +2 -1
  148. package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
  149. package/dist/cjs/core/fetcher/getRequestBody.js +4 -0
  150. package/dist/cjs/core/fetcher/getResponseBody.js +21 -7
  151. package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
  152. package/dist/cjs/core/fetcher/makeRequest.js +2 -4
  153. package/dist/cjs/core/fetcher/requestWithRetries.js +3 -12
  154. package/dist/cjs/core/fetcher/signals.d.ts +1 -7
  155. package/dist/cjs/core/fetcher/signals.js +0 -12
  156. package/dist/cjs/core/file/file.d.ts +5 -0
  157. package/dist/cjs/core/file/file.js +25 -7
  158. package/dist/cjs/core/form-data-utils/FormDataWrapper.d.ts +2 -3
  159. package/dist/cjs/core/form-data-utils/FormDataWrapper.js +62 -85
  160. package/dist/cjs/core/headers.js +6 -4
  161. package/dist/cjs/core/index.d.ts +5 -2
  162. package/dist/cjs/core/index.js +6 -3
  163. package/dist/cjs/core/logging/exports.d.ts +18 -0
  164. package/dist/cjs/core/logging/exports.js +45 -0
  165. package/dist/cjs/core/logging/index.d.ts +1 -0
  166. package/dist/cjs/core/logging/index.js +17 -0
  167. package/dist/cjs/core/logging/logger.d.ts +126 -0
  168. package/dist/cjs/core/logging/logger.js +144 -0
  169. package/dist/cjs/core/runtime/runtime.js +11 -10
  170. package/dist/cjs/core/url/encodePathParam.d.ts +1 -0
  171. package/dist/cjs/core/url/encodePathParam.js +21 -0
  172. package/dist/cjs/core/url/index.d.ts +1 -0
  173. package/dist/cjs/core/url/index.js +3 -1
  174. package/dist/cjs/core/url/join.js +3 -4
  175. package/dist/cjs/errors/AthenaIntelligenceError.d.ts +1 -1
  176. package/dist/cjs/errors/AthenaIntelligenceError.js +1 -1
  177. package/dist/cjs/index.d.ts +2 -2
  178. package/dist/cjs/index.js +4 -4
  179. package/dist/cjs/version.d.ts +1 -1
  180. package/dist/cjs/version.js +1 -1
  181. package/dist/esm/BaseClient.d.mts +14 -1
  182. package/dist/esm/BaseClient.mjs +23 -1
  183. package/dist/esm/Client.d.mts +24 -23
  184. package/dist/esm/Client.mjs +17 -26
  185. package/dist/esm/api/errors/BadRequestError.d.mts +1 -1
  186. package/dist/esm/api/errors/BadRequestError.mjs +0 -1
  187. package/dist/esm/api/errors/ContentTooLargeError.d.mts +2 -2
  188. package/dist/esm/api/errors/ContentTooLargeError.mjs +0 -2
  189. package/dist/esm/api/errors/ForbiddenError.d.mts +1 -1
  190. package/dist/esm/api/errors/ForbiddenError.mjs +0 -1
  191. package/dist/esm/api/errors/InternalServerError.d.mts +1 -1
  192. package/dist/esm/api/errors/InternalServerError.mjs +0 -1
  193. package/dist/esm/api/errors/NotFoundError.d.mts +1 -1
  194. package/dist/esm/api/errors/NotFoundError.mjs +0 -1
  195. package/dist/esm/api/errors/NotImplementedError.d.mts +1 -1
  196. package/dist/esm/api/errors/NotImplementedError.mjs +0 -1
  197. package/dist/esm/api/errors/ServiceUnavailableError.d.mts +1 -1
  198. package/dist/esm/api/errors/ServiceUnavailableError.mjs +0 -1
  199. package/dist/esm/api/errors/UnauthorizedError.d.mts +1 -1
  200. package/dist/esm/api/errors/UnauthorizedError.mjs +0 -1
  201. package/dist/esm/api/errors/UnprocessableEntityError.d.mts +1 -1
  202. package/dist/esm/api/errors/UnprocessableEntityError.mjs +0 -1
  203. package/dist/esm/api/errors/UnsupportedMediaTypeError.d.mts +2 -2
  204. package/dist/esm/api/errors/UnsupportedMediaTypeError.mjs +0 -2
  205. package/dist/esm/api/errors/index.d.mts +5 -5
  206. package/dist/esm/api/errors/index.mjs +5 -5
  207. package/dist/esm/api/index.d.mts +1 -1
  208. package/dist/esm/api/index.mjs +1 -1
  209. package/dist/esm/api/resources/agents/client/Client.d.mts +20 -20
  210. package/dist/esm/api/resources/agents/client/Client.mjs +31 -28
  211. package/dist/esm/api/resources/agents/client/index.d.mts +0 -1
  212. package/dist/esm/api/resources/agents/client/index.mjs +0 -1
  213. package/dist/esm/api/resources/agents/client/requests/index.d.mts +1 -1
  214. package/dist/esm/api/resources/agents/client/requests/index.mjs +1 -1
  215. package/dist/esm/api/resources/agents/resources/drive/client/Client.d.mts +7 -7
  216. package/dist/esm/api/resources/agents/resources/drive/client/Client.mjs +18 -15
  217. package/dist/esm/api/resources/agents/resources/drive/client/index.d.mts +0 -1
  218. package/dist/esm/api/resources/agents/resources/drive/client/index.mjs +0 -1
  219. package/dist/esm/api/resources/agents/resources/drive/client/requests/index.d.mts +1 -1
  220. package/dist/esm/api/resources/agents/resources/drive/client/requests/index.mjs +1 -1
  221. package/dist/esm/api/resources/agents/resources/general/client/Client.d.mts +11 -11
  222. package/dist/esm/api/resources/agents/resources/general/client/Client.mjs +40 -21
  223. package/dist/esm/api/resources/agents/resources/index.d.mts +3 -3
  224. package/dist/esm/api/resources/agents/resources/index.mjs +3 -3
  225. package/dist/esm/api/resources/agents/resources/research/client/Client.d.mts +7 -7
  226. package/dist/esm/api/resources/agents/resources/research/client/Client.mjs +18 -15
  227. package/dist/esm/api/resources/agents/resources/research/client/index.d.mts +0 -1
  228. package/dist/esm/api/resources/agents/resources/research/client/index.mjs +0 -1
  229. package/dist/esm/api/resources/agents/resources/research/client/requests/index.d.mts +1 -1
  230. package/dist/esm/api/resources/agents/resources/research/client/requests/index.mjs +1 -1
  231. package/dist/esm/api/resources/agents/resources/sql/client/Client.d.mts +7 -7
  232. package/dist/esm/api/resources/agents/resources/sql/client/Client.mjs +18 -15
  233. package/dist/esm/api/resources/agents/resources/sql/client/index.d.mts +0 -1
  234. package/dist/esm/api/resources/agents/resources/sql/client/index.mjs +0 -1
  235. package/dist/esm/api/resources/agents/resources/sql/client/requests/index.d.mts +1 -1
  236. package/dist/esm/api/resources/agents/resources/sql/client/requests/index.mjs +1 -1
  237. package/dist/esm/api/resources/aop/client/Client.d.mts +9 -9
  238. package/dist/esm/api/resources/aop/client/Client.mjs +29 -18
  239. package/dist/esm/api/resources/assets/client/Client.d.mts +14 -14
  240. package/dist/esm/api/resources/assets/client/Client.mjs +60 -33
  241. package/dist/esm/api/resources/assets/client/index.d.mts +0 -1
  242. package/dist/esm/api/resources/assets/client/index.mjs +0 -1
  243. package/dist/esm/api/resources/assets/client/requests/CreateAssetRequestIn.d.mts +1 -1
  244. package/dist/esm/api/resources/assets/client/requests/CreateAssetRequestIn.mjs +1 -1
  245. package/dist/esm/api/resources/assets/client/requests/index.d.mts +3 -3
  246. package/dist/esm/api/resources/assets/client/requests/index.mjs +1 -3
  247. package/dist/esm/api/resources/databases/client/Client.d.mts +36 -32
  248. package/dist/esm/api/resources/databases/client/Client.mjs +147 -79
  249. package/dist/esm/api/resources/databases/client/index.d.mts +0 -1
  250. package/dist/esm/api/resources/databases/client/index.mjs +0 -1
  251. package/dist/esm/api/resources/databases/client/requests/DatabasesDeleteRequest.d.mts +15 -0
  252. package/dist/esm/api/resources/databases/client/requests/DatabasesDeleteRequest.mjs +2 -0
  253. package/dist/esm/api/resources/databases/client/requests/UpdateDataRequest.d.mts +3 -0
  254. package/dist/esm/api/resources/databases/client/requests/index.d.mts +4 -3
  255. package/dist/esm/api/resources/databases/client/requests/index.mjs +1 -3
  256. package/dist/esm/api/resources/index.d.mts +8 -8
  257. package/dist/esm/api/resources/index.mjs +8 -8
  258. package/dist/esm/api/resources/query/client/Client.d.mts +9 -9
  259. package/dist/esm/api/resources/query/client/Client.mjs +32 -21
  260. package/dist/esm/api/resources/query/client/index.d.mts +0 -1
  261. package/dist/esm/api/resources/query/client/index.mjs +0 -1
  262. package/dist/esm/api/resources/query/client/requests/QueryExecuteRequest.d.mts +1 -1
  263. package/dist/esm/api/resources/query/client/requests/QueryExecuteRequest.mjs +1 -1
  264. package/dist/esm/api/resources/query/client/requests/index.d.mts +2 -2
  265. package/dist/esm/api/resources/query/client/requests/index.mjs +1 -2
  266. package/dist/esm/api/resources/query/index.d.mts +1 -1
  267. package/dist/esm/api/resources/query/index.mjs +1 -1
  268. package/dist/esm/api/resources/threads/client/Client.d.mts +8 -8
  269. package/dist/esm/api/resources/threads/client/Client.mjs +23 -20
  270. package/dist/esm/api/resources/tools/client/Client.d.mts +33 -33
  271. package/dist/esm/api/resources/tools/client/Client.mjs +109 -59
  272. package/dist/esm/api/resources/tools/client/index.d.mts +0 -1
  273. package/dist/esm/api/resources/tools/client/index.mjs +0 -1
  274. package/dist/esm/api/resources/tools/client/requests/BodySaveAssetApiV0ToolsFileSavePost.d.mts +2 -2
  275. package/dist/esm/api/resources/tools/client/requests/BodySaveAssetApiV0ToolsFileSavePost.mjs +1 -2
  276. package/dist/esm/api/resources/tools/client/requests/ToolsDataFrameRequest.d.mts +1 -1
  277. package/dist/esm/api/resources/tools/client/requests/ToolsDataFrameRequest.mjs +1 -1
  278. package/dist/esm/api/resources/tools/client/requests/index.d.mts +7 -7
  279. package/dist/esm/api/resources/tools/client/requests/index.mjs +1 -7
  280. package/dist/esm/api/resources/tools/index.d.mts +1 -1
  281. package/dist/esm/api/resources/tools/index.mjs +1 -1
  282. package/dist/esm/api/resources/tools/resources/calendar/client/Client.d.mts +9 -9
  283. package/dist/esm/api/resources/tools/resources/calendar/client/Client.mjs +28 -17
  284. package/dist/esm/api/resources/tools/resources/email/client/Client.d.mts +11 -11
  285. package/dist/esm/api/resources/tools/resources/email/client/Client.mjs +39 -20
  286. package/dist/esm/api/resources/tools/resources/index.d.mts +3 -3
  287. package/dist/esm/api/resources/tools/resources/index.mjs +3 -3
  288. package/dist/esm/api/resources/tools/resources/sheets/client/Client.d.mts +39 -39
  289. package/dist/esm/api/resources/tools/resources/sheets/client/Client.mjs +194 -63
  290. package/dist/esm/api/resources/tools/resources/sheets/client/index.d.mts +0 -1
  291. package/dist/esm/api/resources/tools/resources/sheets/client/index.mjs +0 -1
  292. package/dist/esm/api/resources/tools/resources/sheets/client/requests/CreateNewSheetTabRequest.d.mts +1 -1
  293. package/dist/esm/api/resources/tools/resources/sheets/client/requests/CreateNewSheetTabRequest.mjs +1 -1
  294. package/dist/esm/api/resources/tools/resources/sheets/client/requests/FormatSheetRangeRequest.d.mts +1 -1
  295. package/dist/esm/api/resources/tools/resources/sheets/client/requests/FormatSheetRangeRequest.mjs +1 -1
  296. package/dist/esm/api/resources/tools/resources/sheets/client/requests/InsertTableRowRequest.d.mts +1 -1
  297. package/dist/esm/api/resources/tools/resources/sheets/client/requests/InsertTableRowRequest.mjs +1 -1
  298. package/dist/esm/api/resources/tools/resources/sheets/client/requests/UpdateSheetRangeRequest.d.mts +1 -1
  299. package/dist/esm/api/resources/tools/resources/sheets/client/requests/UpdateSheetRangeRequest.mjs +1 -1
  300. package/dist/esm/api/resources/tools/resources/sheets/client/requests/index.d.mts +17 -17
  301. package/dist/esm/api/resources/tools/resources/sheets/client/requests/index.mjs +1 -17
  302. package/dist/esm/api/resources/tools/resources/structuredDataExtractor/client/Client.d.mts +7 -7
  303. package/dist/esm/api/resources/tools/resources/structuredDataExtractor/client/Client.mjs +18 -15
  304. package/dist/esm/api/resources/tools/resources/structuredDataExtractor/client/index.d.mts +0 -1
  305. package/dist/esm/api/resources/tools/resources/structuredDataExtractor/client/index.mjs +0 -1
  306. package/dist/esm/api/resources/tools/resources/structuredDataExtractor/client/requests/StructuredDataExtractorRequest.d.mts +1 -1
  307. package/dist/esm/api/resources/tools/resources/structuredDataExtractor/client/requests/StructuredDataExtractorRequest.mjs +1 -1
  308. package/dist/esm/api/resources/tools/resources/structuredDataExtractor/client/requests/index.d.mts +1 -1
  309. package/dist/esm/api/resources/tools/resources/structuredDataExtractor/client/requests/index.mjs +1 -1
  310. package/dist/esm/api/resources/tools/resources/tasks/client/Client.d.mts +7 -7
  311. package/dist/esm/api/resources/tools/resources/tasks/client/Client.mjs +18 -15
  312. package/dist/esm/api/resources/tools/resources/tasks/client/index.d.mts +0 -1
  313. package/dist/esm/api/resources/tools/resources/tasks/client/index.mjs +0 -1
  314. package/dist/esm/api/resources/tools/resources/tasks/client/requests/index.d.mts +1 -1
  315. package/dist/esm/api/resources/tools/resources/tasks/client/requests/index.mjs +1 -1
  316. package/dist/esm/api/types/AopExecuteResponseOut.d.mts +1 -1
  317. package/dist/esm/api/types/AopExecuteResponseOut.mjs +1 -1
  318. package/dist/esm/api/types/AssetNode.d.mts +1 -1
  319. package/dist/esm/api/types/AssetNode.mjs +1 -1
  320. package/dist/esm/api/types/BorderModel.d.mts +1 -1
  321. package/dist/esm/api/types/BorderModel.mjs +1 -1
  322. package/dist/esm/api/types/BordersModel.d.mts +1 -1
  323. package/dist/esm/api/types/BordersModel.mjs +1 -1
  324. package/dist/esm/api/types/CellFormat.d.mts +1 -1
  325. package/dist/esm/api/types/CellFormat.mjs +0 -1
  326. package/dist/esm/api/types/Chunk.d.mts +1 -1
  327. package/dist/esm/api/types/Chunk.mjs +1 -1
  328. package/dist/esm/api/types/ChunkContentItem.d.mts +1 -1
  329. package/dist/esm/api/types/ChunkContentItem.mjs +1 -1
  330. package/dist/esm/api/types/ConversationAssetInfo.d.mts +1 -1
  331. package/dist/esm/api/types/ConversationAssetInfo.mjs +1 -1
  332. package/dist/esm/api/types/ConversationMessage.d.mts +1 -1
  333. package/dist/esm/api/types/ConversationMessage.mjs +1 -1
  334. package/dist/esm/api/types/ConversationResult.d.mts +1 -1
  335. package/dist/esm/api/types/ConversationResult.mjs +1 -1
  336. package/dist/esm/api/types/DatabaseTableSchemaResponse.d.mts +1 -1
  337. package/dist/esm/api/types/DatabaseTableSchemaResponse.mjs +1 -1
  338. package/dist/esm/api/types/DatabaseTablesResponse.d.mts +1 -1
  339. package/dist/esm/api/types/DatabaseTablesResponse.mjs +1 -1
  340. package/dist/esm/api/types/FolderResponse.d.mts +1 -1
  341. package/dist/esm/api/types/FolderResponse.mjs +1 -1
  342. package/dist/esm/api/types/GeneralAgentRequest.d.mts +1 -1
  343. package/dist/esm/api/types/GeneralAgentRequest.mjs +1 -1
  344. package/dist/esm/api/types/GeneralAgentResponse.d.mts +1 -1
  345. package/dist/esm/api/types/GeneralAgentResponse.mjs +1 -1
  346. package/dist/esm/api/types/GeneralAgentResponseMessage.d.mts +1 -1
  347. package/dist/esm/api/types/GeneralAgentResponseMessage.mjs +1 -1
  348. package/dist/esm/api/types/GeneralAgentResponseMessageKwargs.d.mts +1 -1
  349. package/dist/esm/api/types/GeneralAgentResponseMessageKwargs.mjs +1 -1
  350. package/dist/esm/api/types/InputMessage.d.mts +1 -1
  351. package/dist/esm/api/types/InputMessage.mjs +1 -1
  352. package/dist/esm/api/types/InputMessageContentItem.d.mts +1 -1
  353. package/dist/esm/api/types/InputMessageContentItem.mjs +1 -1
  354. package/dist/esm/api/types/NumberFormatModel.d.mts +1 -1
  355. package/dist/esm/api/types/NumberFormatModel.mjs +1 -1
  356. package/dist/esm/api/types/PaginatedAssetsOut.d.mts +1 -1
  357. package/dist/esm/api/types/PaginatedAssetsOut.mjs +1 -1
  358. package/dist/esm/api/types/Sheet.d.mts +1 -1
  359. package/dist/esm/api/types/Sheet.mjs +1 -1
  360. package/dist/esm/api/types/StructuredDataExtractorResponse.d.mts +1 -1
  361. package/dist/esm/api/types/StructuredDataExtractorResponse.mjs +1 -1
  362. package/dist/esm/api/types/TextFormatModel.d.mts +1 -1
  363. package/dist/esm/api/types/TextFormatModel.mjs +1 -1
  364. package/dist/esm/api/types/ThreadStatusResponseOut.d.mts +1 -1
  365. package/dist/esm/api/types/ThreadStatusResponseOut.mjs +1 -1
  366. package/dist/esm/api/types/index.d.mts +5 -5
  367. package/dist/esm/api/types/index.mjs +5 -5
  368. package/dist/esm/auth/HeaderAuthProvider.d.mts +14 -0
  369. package/dist/esm/auth/HeaderAuthProvider.mjs +34 -0
  370. package/dist/esm/auth/index.d.mts +1 -0
  371. package/dist/esm/auth/index.mjs +1 -0
  372. package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
  373. package/dist/esm/core/auth/AuthProvider.mjs +1 -0
  374. package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
  375. package/dist/esm/core/auth/AuthRequest.mjs +1 -0
  376. package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
  377. package/dist/esm/core/auth/BasicAuth.mjs +24 -0
  378. package/dist/esm/core/auth/BearerToken.d.mts +7 -0
  379. package/dist/esm/core/auth/BearerToken.mjs +13 -0
  380. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
  381. package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
  382. package/dist/esm/core/auth/index.d.mts +5 -0
  383. package/dist/esm/core/auth/index.mjs +3 -0
  384. package/dist/esm/core/base64.d.mts +2 -0
  385. package/dist/esm/core/base64.mjs +22 -0
  386. package/dist/esm/core/exports.d.mts +1 -0
  387. package/dist/esm/core/exports.mjs +1 -0
  388. package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
  389. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +1 -1
  390. package/dist/esm/core/fetcher/EndpointSupplier.mjs +0 -1
  391. package/dist/esm/core/fetcher/Fetcher.d.mts +9 -2
  392. package/dist/esm/core/fetcher/Fetcher.mjs +204 -9
  393. package/dist/esm/core/fetcher/getErrorResponseBody.mjs +2 -1
  394. package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
  395. package/dist/esm/core/fetcher/getRequestBody.mjs +4 -0
  396. package/dist/esm/core/fetcher/getResponseBody.mjs +21 -7
  397. package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
  398. package/dist/esm/core/fetcher/makeRequest.mjs +2 -4
  399. package/dist/esm/core/fetcher/requestWithRetries.mjs +3 -12
  400. package/dist/esm/core/fetcher/signals.d.mts +1 -7
  401. package/dist/esm/core/fetcher/signals.mjs +0 -12
  402. package/dist/esm/core/file/file.d.mts +5 -0
  403. package/dist/esm/core/file/file.mjs +24 -7
  404. package/dist/esm/core/form-data-utils/FormDataWrapper.d.mts +2 -3
  405. package/dist/esm/core/form-data-utils/FormDataWrapper.mjs +59 -82
  406. package/dist/esm/core/headers.mjs +6 -4
  407. package/dist/esm/core/index.d.mts +5 -2
  408. package/dist/esm/core/index.mjs +5 -2
  409. package/dist/esm/core/logging/exports.d.mts +18 -0
  410. package/dist/esm/core/logging/exports.mjs +9 -0
  411. package/dist/esm/core/logging/index.d.mts +1 -0
  412. package/dist/esm/core/logging/index.mjs +1 -0
  413. package/dist/esm/core/logging/logger.d.mts +126 -0
  414. package/dist/esm/core/logging/logger.mjs +138 -0
  415. package/dist/esm/core/runtime/runtime.mjs +11 -10
  416. package/dist/esm/core/url/encodePathParam.d.mts +1 -0
  417. package/dist/esm/core/url/encodePathParam.mjs +18 -0
  418. package/dist/esm/core/url/index.d.mts +1 -0
  419. package/dist/esm/core/url/index.mjs +1 -0
  420. package/dist/esm/core/url/join.mjs +3 -4
  421. package/dist/esm/errors/AthenaIntelligenceError.d.mts +1 -1
  422. package/dist/esm/errors/AthenaIntelligenceError.mjs +1 -2
  423. package/dist/esm/index.d.mts +2 -2
  424. package/dist/esm/index.mjs +1 -2
  425. package/dist/esm/version.d.mts +1 -1
  426. package/dist/esm/version.mjs +1 -1
  427. package/package.json +11 -5
  428. package/reference.md +455 -491
  429. package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
  430. package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
  431. package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
  432. package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
@@ -43,35 +43,36 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.Agents = void 0;
47
- const environments = __importStar(require("../../../../environments.js"));
48
- const core = __importStar(require("../../../../core/index.js"));
49
- const AthenaIntelligence = __importStar(require("../../../index.js"));
46
+ exports.AgentsClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
50
48
  const headers_js_1 = require("../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../environments.js"));
51
51
  const errors = __importStar(require("../../../../errors/index.js"));
52
+ const AthenaIntelligence = __importStar(require("../../../index.js"));
52
53
  const Client_js_1 = require("../resources/drive/client/Client.js");
53
54
  const Client_js_2 = require("../resources/general/client/Client.js");
54
55
  const Client_js_3 = require("../resources/research/client/Client.js");
55
56
  const Client_js_4 = require("../resources/sql/client/Client.js");
56
- class Agents {
57
- constructor(_options) {
58
- this._options = _options;
57
+ class AgentsClient {
58
+ constructor(options) {
59
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
59
60
  }
60
61
  get drive() {
61
62
  var _a;
62
- return ((_a = this._drive) !== null && _a !== void 0 ? _a : (this._drive = new Client_js_1.Drive(this._options)));
63
+ return ((_a = this._drive) !== null && _a !== void 0 ? _a : (this._drive = new Client_js_1.DriveClient(this._options)));
63
64
  }
64
65
  get general() {
65
66
  var _a;
66
- return ((_a = this._general) !== null && _a !== void 0 ? _a : (this._general = new Client_js_2.General(this._options)));
67
+ return ((_a = this._general) !== null && _a !== void 0 ? _a : (this._general = new Client_js_2.GeneralClient(this._options)));
67
68
  }
68
69
  get research() {
69
70
  var _a;
70
- return ((_a = this._research) !== null && _a !== void 0 ? _a : (this._research = new Client_js_3.Research(this._options)));
71
+ return ((_a = this._research) !== null && _a !== void 0 ? _a : (this._research = new Client_js_3.ResearchClient(this._options)));
71
72
  }
72
73
  get sql() {
73
74
  var _a;
74
- return ((_a = this._sql) !== null && _a !== void 0 ? _a : (this._sql = new Client_js_4.Sql(this._options)));
75
+ return ((_a = this._sql) !== null && _a !== void 0 ? _a : (this._sql = new Client_js_4.SqlClient(this._options)));
75
76
  }
76
77
  /**
77
78
  * Coming soon!
@@ -82,9 +83,9 @@ class Agents {
82
83
  * Refer to the specific agent's documentation for details on configuration options
83
84
  * and expected responses.
84
85
  *
85
- * @param {string} agentId - The ID of the custom agent to invoke. Create custom agents in [spaces](https://resources.athenaintel.com/docs/agents/create-your-agent).
86
+ * @param {string} agent_id - The ID of the custom agent to invoke. Create custom agents in [spaces](https://resources.athenaintel.com/docs/agents/create-your-agent).
86
87
  * @param {AthenaIntelligence.CustomAgentRequest} request
87
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
88
+ * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
88
89
  *
89
90
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
90
91
  *
@@ -98,15 +99,16 @@ class Agents {
98
99
  * }]
99
100
  * })
100
101
  */
101
- invokeById(agentId, request, requestOptions) {
102
- return core.HttpResponsePromise.fromPromise(this.__invokeById(agentId, request, requestOptions));
102
+ invokeById(agent_id, request, requestOptions) {
103
+ return core.HttpResponsePromise.fromPromise(this.__invokeById(agent_id, request, requestOptions));
103
104
  }
104
- __invokeById(agentId, request, requestOptions) {
105
+ __invokeById(agent_id, request, requestOptions) {
105
106
  return __awaiter(this, void 0, void 0, function* () {
106
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
107
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
107
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
108
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
109
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
108
110
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
109
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/agents/${encodeURIComponent(agentId)}/invoke`),
111
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/agents/${core.url.encodePathParam(agent_id)}/invoke`),
110
112
  method: "POST",
111
113
  headers: _headers,
112
114
  contentType: "application/json",
@@ -116,6 +118,8 @@ class Agents {
116
118
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
117
119
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
118
120
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
121
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
122
+ logging: this._options.logging,
119
123
  });
120
124
  if (_response.ok) {
121
125
  return {
@@ -142,6 +146,11 @@ class Agents {
142
146
  body: _response.error.rawBody,
143
147
  rawResponse: _response.rawResponse,
144
148
  });
149
+ case "body-is-null":
150
+ throw new errors.AthenaIntelligenceError({
151
+ statusCode: _response.error.statusCode,
152
+ rawResponse: _response.rawResponse,
153
+ });
145
154
  case "timeout":
146
155
  throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/agents/{agent_id}/invoke.");
147
156
  case "unknown":
@@ -152,11 +161,5 @@ class Agents {
152
161
  }
153
162
  });
154
163
  }
155
- _getCustomAuthorizationHeaders() {
156
- return __awaiter(this, void 0, void 0, function* () {
157
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
158
- return { "X-API-KEY": apiKeyValue };
159
- });
160
- }
161
164
  }
162
- exports.Agents = Agents;
165
+ exports.AgentsClient = AgentsClient;
@@ -1,2 +1 @@
1
- export {};
2
1
  export * from "./requests/index.js";
@@ -1 +1 @@
1
- export { type CustomAgentRequest } from "./CustomAgentRequest.js";
1
+ export type { CustomAgentRequest } from "./CustomAgentRequest.js";
@@ -1,20 +1,21 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
2
3
  import * as core from "../../../../../../core/index.js";
3
4
  import * as AthenaIntelligence from "../../../../../index.js";
4
- export declare namespace Drive {
5
+ export declare namespace DriveClient {
5
6
  interface Options extends BaseClientOptions {
6
7
  }
7
8
  interface RequestOptions extends BaseRequestOptions {
8
9
  }
9
10
  }
10
- export declare class Drive {
11
- protected readonly _options: Drive.Options;
12
- constructor(_options: Drive.Options);
11
+ export declare class DriveClient {
12
+ protected readonly _options: NormalizedClientOptionsWithAuth<DriveClient.Options>;
13
+ constructor(options: DriveClient.Options);
13
14
  /**
14
15
  * Coming soon! Manage folders and search for files in the internal drive.
15
16
  *
16
17
  * @param {AthenaIntelligence.agents.DriveAgentRequest} request
17
- * @param {Drive.RequestOptions} requestOptions - Request-specific configuration.
18
+ * @param {DriveClient.RequestOptions} requestOptions - Request-specific configuration.
18
19
  *
19
20
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
20
21
  *
@@ -28,7 +29,6 @@ export declare class Drive {
28
29
  * }]
29
30
  * })
30
31
  */
31
- invoke(request: AthenaIntelligence.agents.DriveAgentRequest, requestOptions?: Drive.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DriveAgentResponse>;
32
+ invoke(request: AthenaIntelligence.agents.DriveAgentRequest, requestOptions?: DriveClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.DriveAgentResponse>;
32
33
  private __invoke;
33
- protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
34
34
  }
@@ -43,21 +43,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.Drive = void 0;
47
- const environments = __importStar(require("../../../../../../environments.js"));
48
- const core = __importStar(require("../../../../../../core/index.js"));
49
- const AthenaIntelligence = __importStar(require("../../../../../index.js"));
46
+ exports.DriveClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../../../BaseClient.js");
50
48
  const headers_js_1 = require("../../../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../../../environments.js"));
51
51
  const errors = __importStar(require("../../../../../../errors/index.js"));
52
- class Drive {
53
- constructor(_options) {
54
- this._options = _options;
52
+ const AthenaIntelligence = __importStar(require("../../../../../index.js"));
53
+ class DriveClient {
54
+ constructor(options) {
55
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
55
56
  }
56
57
  /**
57
58
  * Coming soon! Manage folders and search for files in the internal drive.
58
59
  *
59
60
  * @param {AthenaIntelligence.agents.DriveAgentRequest} request
60
- * @param {Drive.RequestOptions} requestOptions - Request-specific configuration.
61
+ * @param {DriveClient.RequestOptions} requestOptions - Request-specific configuration.
61
62
  *
62
63
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
63
64
  *
@@ -76,8 +77,9 @@ class Drive {
76
77
  }
77
78
  __invoke(request, requestOptions) {
78
79
  return __awaiter(this, void 0, void 0, function* () {
79
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
80
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
80
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
81
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
82
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
81
83
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
82
84
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, "api/v0/agents/drive/invoke"),
83
85
  method: "POST",
@@ -89,6 +91,8 @@ class Drive {
89
91
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
90
92
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
91
93
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
94
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
95
+ logging: this._options.logging,
92
96
  });
93
97
  if (_response.ok) {
94
98
  return {
@@ -115,6 +119,11 @@ class Drive {
115
119
  body: _response.error.rawBody,
116
120
  rawResponse: _response.rawResponse,
117
121
  });
122
+ case "body-is-null":
123
+ throw new errors.AthenaIntelligenceError({
124
+ statusCode: _response.error.statusCode,
125
+ rawResponse: _response.rawResponse,
126
+ });
118
127
  case "timeout":
119
128
  throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/agents/drive/invoke.");
120
129
  case "unknown":
@@ -125,11 +134,5 @@ class Drive {
125
134
  }
126
135
  });
127
136
  }
128
- _getCustomAuthorizationHeaders() {
129
- return __awaiter(this, void 0, void 0, function* () {
130
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
131
- return { "X-API-KEY": apiKeyValue };
132
- });
133
- }
134
137
  }
135
- exports.Drive = Drive;
138
+ exports.DriveClient = DriveClient;
@@ -1,2 +1 @@
1
- export {};
2
1
  export * from "./requests/index.js";
@@ -1 +1 @@
1
- export { type DriveAgentRequest } from "./DriveAgentRequest.js";
1
+ export type { DriveAgentRequest } from "./DriveAgentRequest.js";
@@ -1,20 +1,21 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
2
3
  import * as core from "../../../../../../core/index.js";
3
4
  import * as AthenaIntelligence from "../../../../../index.js";
4
- export declare namespace General {
5
+ export declare namespace GeneralClient {
5
6
  interface Options extends BaseClientOptions {
6
7
  }
7
8
  interface RequestOptions extends BaseRequestOptions {
8
9
  }
9
10
  }
10
- export declare class General {
11
- protected readonly _options: General.Options;
12
- constructor(_options: General.Options);
11
+ export declare class GeneralClient {
12
+ protected readonly _options: NormalizedClientOptionsWithAuth<GeneralClient.Options>;
13
+ constructor(options: GeneralClient.Options);
13
14
  /**
14
15
  * Coming soon! Call the general agent with batched requests and return the results.
15
16
  *
16
17
  * @param {AthenaIntelligence.GeneralAgentRequest[]} request
17
- * @param {General.RequestOptions} requestOptions - Request-specific configuration.
18
+ * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
18
19
  *
19
20
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
20
21
  *
@@ -29,7 +30,7 @@ export declare class General {
29
30
  * }]
30
31
  * }])
31
32
  */
32
- batch(request: AthenaIntelligence.GeneralAgentRequest[], requestOptions?: General.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentResponse[]>;
33
+ batch(request: AthenaIntelligence.GeneralAgentRequest[], requestOptions?: GeneralClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentResponse[]>;
33
34
  private __batch;
34
35
  /**
35
36
  * Call the general Athena agent synchronously.
@@ -38,7 +39,7 @@ export declare class General {
38
39
  * and return the result.
39
40
  *
40
41
  * @param {AthenaIntelligence.GeneralAgentRequest} request
41
- * @param {General.RequestOptions} requestOptions - Request-specific configuration.
42
+ * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
42
43
  *
43
44
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
44
45
  *
@@ -53,13 +54,13 @@ export declare class General {
53
54
  * }]
54
55
  * })
55
56
  */
56
- invoke(request: AthenaIntelligence.GeneralAgentRequest, requestOptions?: General.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentResponse>;
57
+ invoke(request: AthenaIntelligence.GeneralAgentRequest, requestOptions?: GeneralClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentResponse>;
57
58
  private __invoke;
58
59
  /**
59
60
  * Coming soon! Call the general agent and stream events for real-time chat applications.
60
61
  *
61
62
  * @param {AthenaIntelligence.GeneralAgentRequest} request
62
- * @param {General.RequestOptions} requestOptions - Request-specific configuration.
63
+ * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
63
64
  *
64
65
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
65
66
  *
@@ -74,7 +75,6 @@ export declare class General {
74
75
  * }]
75
76
  * })
76
77
  */
77
- streamEvents(request: AthenaIntelligence.GeneralAgentRequest, requestOptions?: General.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentResponse>;
78
+ streamEvents(request: AthenaIntelligence.GeneralAgentRequest, requestOptions?: GeneralClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentResponse>;
78
79
  private __streamEvents;
79
- protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
80
80
  }
@@ -43,21 +43,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.General = void 0;
47
- const environments = __importStar(require("../../../../../../environments.js"));
48
- const core = __importStar(require("../../../../../../core/index.js"));
49
- const AthenaIntelligence = __importStar(require("../../../../../index.js"));
46
+ exports.GeneralClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../../../BaseClient.js");
50
48
  const headers_js_1 = require("../../../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../../../environments.js"));
51
51
  const errors = __importStar(require("../../../../../../errors/index.js"));
52
- class General {
53
- constructor(_options) {
54
- this._options = _options;
52
+ const AthenaIntelligence = __importStar(require("../../../../../index.js"));
53
+ class GeneralClient {
54
+ constructor(options) {
55
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
55
56
  }
56
57
  /**
57
58
  * Coming soon! Call the general agent with batched requests and return the results.
58
59
  *
59
60
  * @param {AthenaIntelligence.GeneralAgentRequest[]} request
60
- * @param {General.RequestOptions} requestOptions - Request-specific configuration.
61
+ * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
61
62
  *
62
63
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
63
64
  *
@@ -77,8 +78,9 @@ class General {
77
78
  }
78
79
  __batch(request, requestOptions) {
79
80
  return __awaiter(this, void 0, void 0, function* () {
80
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
81
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
81
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
82
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
83
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
82
84
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
83
85
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, "api/v0/agents/general/batch"),
84
86
  method: "POST",
@@ -90,6 +92,8 @@ class General {
90
92
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
91
93
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
92
94
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
95
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
96
+ logging: this._options.logging,
93
97
  });
94
98
  if (_response.ok) {
95
99
  return {
@@ -116,6 +120,11 @@ class General {
116
120
  body: _response.error.rawBody,
117
121
  rawResponse: _response.rawResponse,
118
122
  });
123
+ case "body-is-null":
124
+ throw new errors.AthenaIntelligenceError({
125
+ statusCode: _response.error.statusCode,
126
+ rawResponse: _response.rawResponse,
127
+ });
119
128
  case "timeout":
120
129
  throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/agents/general/batch.");
121
130
  case "unknown":
@@ -133,7 +142,7 @@ class General {
133
142
  * and return the result.
134
143
  *
135
144
  * @param {AthenaIntelligence.GeneralAgentRequest} request
136
- * @param {General.RequestOptions} requestOptions - Request-specific configuration.
145
+ * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
137
146
  *
138
147
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
139
148
  *
@@ -153,8 +162,9 @@ class General {
153
162
  }
154
163
  __invoke(request, requestOptions) {
155
164
  return __awaiter(this, void 0, void 0, function* () {
156
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
157
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
165
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
166
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
167
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
158
168
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
159
169
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, "api/v0/agents/general/invoke"),
160
170
  method: "POST",
@@ -166,6 +176,8 @@ class General {
166
176
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
167
177
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
168
178
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
179
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
180
+ logging: this._options.logging,
169
181
  });
170
182
  if (_response.ok) {
171
183
  return {
@@ -192,6 +204,11 @@ class General {
192
204
  body: _response.error.rawBody,
193
205
  rawResponse: _response.rawResponse,
194
206
  });
207
+ case "body-is-null":
208
+ throw new errors.AthenaIntelligenceError({
209
+ statusCode: _response.error.statusCode,
210
+ rawResponse: _response.rawResponse,
211
+ });
195
212
  case "timeout":
196
213
  throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/agents/general/invoke.");
197
214
  case "unknown":
@@ -206,7 +223,7 @@ class General {
206
223
  * Coming soon! Call the general agent and stream events for real-time chat applications.
207
224
  *
208
225
  * @param {AthenaIntelligence.GeneralAgentRequest} request
209
- * @param {General.RequestOptions} requestOptions - Request-specific configuration.
226
+ * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
210
227
  *
211
228
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
212
229
  *
@@ -226,8 +243,9 @@ class General {
226
243
  }
227
244
  __streamEvents(request, requestOptions) {
228
245
  return __awaiter(this, void 0, void 0, function* () {
229
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
230
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
246
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
247
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
248
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
231
249
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
232
250
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, "api/v0/agents/general/stream_events"),
233
251
  method: "POST",
@@ -239,6 +257,8 @@ class General {
239
257
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
240
258
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
241
259
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
260
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
261
+ logging: this._options.logging,
242
262
  });
243
263
  if (_response.ok) {
244
264
  return {
@@ -265,6 +285,11 @@ class General {
265
285
  body: _response.error.rawBody,
266
286
  rawResponse: _response.rawResponse,
267
287
  });
288
+ case "body-is-null":
289
+ throw new errors.AthenaIntelligenceError({
290
+ statusCode: _response.error.statusCode,
291
+ rawResponse: _response.rawResponse,
292
+ });
268
293
  case "timeout":
269
294
  throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/agents/general/stream_events.");
270
295
  case "unknown":
@@ -275,11 +300,5 @@ class General {
275
300
  }
276
301
  });
277
302
  }
278
- _getCustomAuthorizationHeaders() {
279
- return __awaiter(this, void 0, void 0, function* () {
280
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
281
- return { "X-API-KEY": apiKeyValue };
282
- });
283
- }
284
303
  }
285
- exports.General = General;
304
+ exports.GeneralClient = GeneralClient;
@@ -1,7 +1,7 @@
1
+ export * from "./drive/client/requests/index.js";
1
2
  export * as drive from "./drive/index.js";
2
3
  export * as general from "./general/index.js";
3
- export * as research from "./research/index.js";
4
- export * as sql from "./sql/index.js";
5
- export * from "./drive/client/requests/index.js";
6
4
  export * from "./research/client/requests/index.js";
5
+ export * as research from "./research/index.js";
7
6
  export * from "./sql/client/requests/index.js";
7
+ export * as sql from "./sql/index.js";
@@ -15,6 +15,9 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
18
21
  var __importStar = (this && this.__importStar) || (function () {
19
22
  var ownKeys = function(o) {
20
23
  ownKeys = Object.getOwnPropertyNames || function (o) {
@@ -32,15 +35,12 @@ var __importStar = (this && this.__importStar) || (function () {
32
35
  return result;
33
36
  };
34
37
  })();
35
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
- };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.sql = exports.research = exports.general = exports.drive = void 0;
40
+ __exportStar(require("./drive/client/requests/index.js"), exports);
40
41
  exports.drive = __importStar(require("./drive/index.js"));
41
42
  exports.general = __importStar(require("./general/index.js"));
42
- exports.research = __importStar(require("./research/index.js"));
43
- exports.sql = __importStar(require("./sql/index.js"));
44
- __exportStar(require("./drive/client/requests/index.js"), exports);
45
43
  __exportStar(require("./research/client/requests/index.js"), exports);
44
+ exports.research = __importStar(require("./research/index.js"));
46
45
  __exportStar(require("./sql/client/requests/index.js"), exports);
46
+ exports.sql = __importStar(require("./sql/index.js"));
@@ -1,20 +1,21 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
2
3
  import * as core from "../../../../../../core/index.js";
3
4
  import * as AthenaIntelligence from "../../../../../index.js";
4
- export declare namespace Research {
5
+ export declare namespace ResearchClient {
5
6
  interface Options extends BaseClientOptions {
6
7
  }
7
8
  interface RequestOptions extends BaseRequestOptions {
8
9
  }
9
10
  }
10
- export declare class Research {
11
- protected readonly _options: Research.Options;
12
- constructor(_options: Research.Options);
11
+ export declare class ResearchClient {
12
+ protected readonly _options: NormalizedClientOptionsWithAuth<ResearchClient.Options>;
13
+ constructor(options: ResearchClient.Options);
13
14
  /**
14
15
  * Coming soon! Conduct research using web and other sources.
15
16
  *
16
17
  * @param {AthenaIntelligence.agents.ResearchAgentRequest} request
17
- * @param {Research.RequestOptions} requestOptions - Request-specific configuration.
18
+ * @param {ResearchClient.RequestOptions} requestOptions - Request-specific configuration.
18
19
  *
19
20
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
20
21
  *
@@ -28,7 +29,6 @@ export declare class Research {
28
29
  * }]
29
30
  * })
30
31
  */
31
- invoke(request: AthenaIntelligence.agents.ResearchAgentRequest, requestOptions?: Research.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ResearchAgentResponse>;
32
+ invoke(request: AthenaIntelligence.agents.ResearchAgentRequest, requestOptions?: ResearchClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ResearchAgentResponse>;
32
33
  private __invoke;
33
- protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
34
34
  }
@@ -43,21 +43,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.Research = void 0;
47
- const environments = __importStar(require("../../../../../../environments.js"));
48
- const core = __importStar(require("../../../../../../core/index.js"));
49
- const AthenaIntelligence = __importStar(require("../../../../../index.js"));
46
+ exports.ResearchClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../../../BaseClient.js");
50
48
  const headers_js_1 = require("../../../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../../../environments.js"));
51
51
  const errors = __importStar(require("../../../../../../errors/index.js"));
52
- class Research {
53
- constructor(_options) {
54
- this._options = _options;
52
+ const AthenaIntelligence = __importStar(require("../../../../../index.js"));
53
+ class ResearchClient {
54
+ constructor(options) {
55
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
55
56
  }
56
57
  /**
57
58
  * Coming soon! Conduct research using web and other sources.
58
59
  *
59
60
  * @param {AthenaIntelligence.agents.ResearchAgentRequest} request
60
- * @param {Research.RequestOptions} requestOptions - Request-specific configuration.
61
+ * @param {ResearchClient.RequestOptions} requestOptions - Request-specific configuration.
61
62
  *
62
63
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
63
64
  *
@@ -76,8 +77,9 @@ class Research {
76
77
  }
77
78
  __invoke(request, requestOptions) {
78
79
  return __awaiter(this, void 0, void 0, function* () {
79
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
80
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
80
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
81
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
82
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
81
83
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
82
84
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, "api/v0/agents/research/invoke"),
83
85
  method: "POST",
@@ -89,6 +91,8 @@ class Research {
89
91
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
90
92
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
91
93
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
94
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
95
+ logging: this._options.logging,
92
96
  });
93
97
  if (_response.ok) {
94
98
  return {
@@ -115,6 +119,11 @@ class Research {
115
119
  body: _response.error.rawBody,
116
120
  rawResponse: _response.rawResponse,
117
121
  });
122
+ case "body-is-null":
123
+ throw new errors.AthenaIntelligenceError({
124
+ statusCode: _response.error.statusCode,
125
+ rawResponse: _response.rawResponse,
126
+ });
118
127
  case "timeout":
119
128
  throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/agents/research/invoke.");
120
129
  case "unknown":
@@ -125,11 +134,5 @@ class Research {
125
134
  }
126
135
  });
127
136
  }
128
- _getCustomAuthorizationHeaders() {
129
- return __awaiter(this, void 0, void 0, function* () {
130
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
131
- return { "X-API-KEY": apiKeyValue };
132
- });
133
- }
134
137
  }
135
- exports.Research = Research;
138
+ exports.ResearchClient = ResearchClient;