mavenagi 0.0.0-alpha.2 → 0.0.0-alpha.21

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 (815) hide show
  1. package/Client.d.ts +21 -0
  2. package/Client.js +20 -0
  3. package/README.md +83 -16
  4. package/api/resources/actions/client/Client.d.ts +96 -0
  5. package/api/resources/actions/client/Client.js +319 -0
  6. package/api/resources/actions/client/index.d.ts +1 -0
  7. package/api/resources/actions/client/index.js +1 -0
  8. package/api/resources/actions/index.d.ts +2 -0
  9. package/api/resources/actions/index.js +2 -0
  10. package/api/resources/actions/types/ActionBase.d.ts +18 -0
  11. package/api/resources/actions/types/ActionParameter.d.ts +9 -0
  12. package/api/resources/actions/types/ActionRequest.d.ts +31 -0
  13. package/api/resources/actions/types/ActionResponse.d.ts +35 -0
  14. package/api/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +10 -0
  15. package/api/resources/actions/types/ConversationPrecondition.d.ts +16 -0
  16. package/api/resources/actions/types/MetadataPrecondition.d.ts +10 -0
  17. package/api/resources/actions/types/Precondition.d.ts +31 -0
  18. package/api/resources/actions/types/PreconditionBase.d.ts +8 -0
  19. package/api/resources/actions/types/PreconditionGroup.d.ts +8 -0
  20. package/api/resources/actions/types/PreconditionGroupOperator.d.ts +8 -0
  21. package/api/resources/actions/types/PreconditionGroupOperator.js +7 -0
  22. package/api/resources/actions/types/PreconditionOperator.d.ts +7 -0
  23. package/api/resources/{knowledge/types/IdBody.d.ts → actions/types/PreconditionOperator.js} +3 -3
  24. package/api/resources/actions/types/TagsPrecondition.d.ts +8 -0
  25. package/api/resources/actions/types/index.d.ts +13 -0
  26. package/api/resources/actions/types/index.js +13 -0
  27. package/api/resources/appSettings/client/Client.d.ts +47 -0
  28. package/api/resources/appSettings/client/Client.js +125 -0
  29. package/api/resources/appSettings/client/index.d.ts +1 -0
  30. package/api/resources/appSettings/client/index.js +1 -0
  31. package/api/resources/appSettings/index.d.ts +1 -0
  32. package/api/resources/appSettings/index.js +1 -0
  33. package/api/resources/commons/errors/{AgentNotFoundError.d.ts → BadRequestError.d.ts} +1 -1
  34. package/api/resources/{conversation/errors/EmptyConversationError.js → commons/errors/BadRequestError.js} +3 -3
  35. package/{dist/api/resources/commons/errors/AgentNotFoundError.d.ts → api/resources/commons/errors/NotFoundError.d.ts} +1 -1
  36. package/{dist/api/resources/commons/errors/AgentNotFoundError.js → api/resources/commons/errors/NotFoundError.js} +3 -3
  37. package/api/resources/{conversation/errors/EmptyConversationError.d.ts → commons/errors/ServerError.d.ts} +1 -1
  38. package/api/resources/commons/errors/ServerError.js +14 -0
  39. package/api/resources/commons/errors/index.d.ts +3 -1
  40. package/api/resources/commons/errors/index.js +3 -1
  41. package/api/resources/commons/types/AppUser.d.ts +9 -0
  42. package/api/resources/commons/types/AppUserIdentifier.d.ts +9 -0
  43. package/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
  44. package/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
  45. package/api/resources/commons/types/AppUserRequest.d.ts +26 -0
  46. package/api/resources/commons/types/AppUserResponse.d.ts +42 -0
  47. package/api/resources/commons/types/EntityId.d.ts +14 -0
  48. package/api/resources/commons/types/EntityIdBase.d.ts +10 -0
  49. package/api/resources/commons/types/EntityIdBase.js +4 -0
  50. package/api/resources/commons/types/EntityType.d.ts +16 -0
  51. package/api/resources/commons/types/EntityType.js +15 -0
  52. package/api/resources/commons/types/EventTriggerBase.d.ts +10 -0
  53. package/api/resources/commons/types/EventTriggerBase.js +4 -0
  54. package/api/resources/commons/types/EventTriggerResponse.d.ts +22 -0
  55. package/api/resources/commons/types/EventTriggerResponse.js +4 -0
  56. package/api/resources/commons/types/EventTriggerType.d.ts +8 -0
  57. package/api/resources/commons/types/EventTriggerType.js +7 -0
  58. package/api/resources/commons/types/Feedback.d.ts +12 -0
  59. package/api/resources/commons/types/Feedback.js +4 -0
  60. package/api/resources/commons/types/FeedbackBase.d.ts +10 -0
  61. package/api/resources/commons/types/FeedbackBase.js +4 -0
  62. package/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
  63. package/{dist/api/resources/conversation → api/resources/commons}/types/FeedbackType.js +2 -0
  64. package/api/resources/commons/types/UserData.d.ts +10 -0
  65. package/api/resources/commons/types/UserData.js +4 -0
  66. package/api/resources/commons/types/VisibilityType.d.ts +9 -0
  67. package/api/resources/commons/types/VisibilityType.js +8 -0
  68. package/api/resources/commons/types/index.d.ts +16 -1
  69. package/api/resources/commons/types/index.js +16 -1
  70. package/api/resources/conversation/client/Client.d.ts +149 -44
  71. package/api/resources/conversation/client/Client.js +474 -132
  72. package/api/resources/conversation/index.d.ts +0 -1
  73. package/api/resources/conversation/index.js +0 -1
  74. package/api/resources/conversation/types/ActionFormField.d.ts +1 -0
  75. package/api/resources/conversation/types/AskRequest.d.ts +15 -3
  76. package/api/resources/conversation/types/AskStreamActionEvent.d.ts +6 -0
  77. package/api/resources/conversation/types/AskStreamActionEvent.js +4 -0
  78. package/api/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
  79. package/api/resources/conversation/types/AskStreamTextEvent.d.ts +1 -0
  80. package/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
  81. package/api/resources/conversation/types/BotMessage.d.ts +2 -0
  82. package/api/resources/conversation/types/Capability.d.ts +18 -0
  83. package/api/resources/conversation/types/Capability.js +8 -0
  84. package/{dist/api/resources/knowledge/types/IdBody.d.ts → api/resources/conversation/types/CategorizationResponse.d.ts} +2 -2
  85. package/api/resources/conversation/types/CategorizationResponse.js +4 -0
  86. package/api/resources/conversation/types/ConversationAnalysis.d.ts +12 -0
  87. package/api/resources/conversation/types/ConversationAnalysis.js +4 -0
  88. package/api/resources/conversation/types/ConversationBase.d.ts +14 -4
  89. package/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -5
  90. package/api/resources/conversation/types/ConversationMessageRequest.d.ts +3 -1
  91. package/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
  92. package/api/resources/conversation/types/ConversationResponse.d.ts +4 -0
  93. package/api/resources/conversation/types/FeedbackRequest.d.ts +7 -7
  94. package/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
  95. package/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
  96. package/api/resources/conversation/types/ResponseConfig.js +4 -0
  97. package/api/resources/conversation/types/ResponseLength.d.ts +9 -0
  98. package/api/resources/conversation/types/ResponseLength.js +8 -0
  99. package/api/resources/conversation/types/Sentiment.d.ts +14 -0
  100. package/api/resources/conversation/types/Sentiment.js +10 -0
  101. package/api/resources/conversation/types/StreamResponse.d.ts +4 -1
  102. package/api/resources/conversation/types/SubmitActionFormRequest.d.ts +8 -0
  103. package/api/resources/conversation/types/SubmitActionFormRequest.js +4 -0
  104. package/api/resources/conversation/types/UserMessage.d.ts +3 -3
  105. package/api/resources/conversation/types/UserMessageBase.d.ts +11 -0
  106. package/api/resources/conversation/types/UserMessageBase.js +4 -0
  107. package/api/resources/conversation/types/index.d.ts +9 -3
  108. package/api/resources/conversation/types/index.js +9 -3
  109. package/api/resources/index.d.ts +6 -2
  110. package/api/resources/index.js +6 -2
  111. package/api/resources/knowledge/client/Client.d.ts +86 -74
  112. package/api/resources/knowledge/client/Client.js +240 -175
  113. package/api/resources/knowledge/index.d.ts +0 -1
  114. package/api/resources/knowledge/index.js +0 -1
  115. package/{dist/api/resources/knowledge/types/KnowledgeDocument.d.ts → api/resources/knowledge/types/BaseKnowledgeDocument.d.ts} +2 -5
  116. package/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
  117. package/api/resources/knowledge/types/{KnowledgeBase.d.ts → KnowledgeBaseProperties.d.ts} +3 -3
  118. package/api/resources/knowledge/types/KnowledgeBaseProperties.js +4 -0
  119. package/api/resources/knowledge/types/KnowledgeBaseRequest.d.ts +18 -0
  120. package/api/resources/knowledge/types/KnowledgeBaseRequest.js +4 -0
  121. package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +22 -0
  122. package/api/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
  123. package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
  124. package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +7 -3
  125. package/api/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +11 -0
  126. package/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
  127. package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +22 -0
  128. package/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
  129. package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +24 -0
  130. package/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
  131. package/api/resources/knowledge/types/index.d.ts +7 -5
  132. package/api/resources/knowledge/types/index.js +7 -5
  133. package/api/resources/triggers/client/Client.d.ts +83 -0
  134. package/api/resources/triggers/client/Client.js +306 -0
  135. package/api/resources/triggers/client/index.d.ts +1 -0
  136. package/api/resources/triggers/client/index.js +1 -0
  137. package/api/resources/triggers/index.d.ts +2 -0
  138. package/api/resources/triggers/index.js +2 -0
  139. package/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
  140. package/api/resources/triggers/types/EventTriggerRequest.js +4 -0
  141. package/api/resources/triggers/types/index.d.ts +1 -0
  142. package/api/resources/triggers/types/index.js +1 -0
  143. package/api/resources/users/client/Client.d.ts +77 -0
  144. package/api/resources/users/client/Client.js +230 -0
  145. package/api/resources/users/client/index.d.ts +1 -0
  146. package/api/resources/users/client/index.js +1 -0
  147. package/api/resources/users/index.d.ts +1 -0
  148. package/api/resources/users/index.js +1 -0
  149. package/core/fetcher/Fetcher.d.ts +4 -1
  150. package/core/fetcher/Fetcher.js +18 -159
  151. package/core/fetcher/createRequestUrl.d.ts +1 -0
  152. package/core/fetcher/createRequestUrl.js +6 -0
  153. package/core/fetcher/getFetchFn.d.ts +4 -0
  154. package/core/fetcher/getFetchFn.js +32 -0
  155. package/core/fetcher/getRequestBody.d.ts +7 -0
  156. package/core/fetcher/getRequestBody.js +19 -0
  157. package/core/fetcher/getResponseBody.d.ts +1 -0
  158. package/core/fetcher/getResponseBody.js +48 -0
  159. package/core/fetcher/makeRequest.d.ts +1 -0
  160. package/core/fetcher/makeRequest.js +38 -0
  161. package/core/fetcher/requestWithRetries.d.ts +1 -0
  162. package/core/fetcher/requestWithRetries.js +28 -0
  163. package/core/fetcher/signals.d.ts +12 -0
  164. package/core/fetcher/signals.js +32 -0
  165. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  166. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +243 -0
  167. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  168. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +120 -0
  169. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  170. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +225 -0
  171. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  172. package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
  173. package/core/index.d.ts +1 -1
  174. package/core/index.js +1 -1
  175. package/core/runtime/runtime.d.ts +1 -0
  176. package/core/runtime/runtime.js +1 -0
  177. package/core/schemas/Schema.d.ts +8 -4
  178. package/core/schemas/Schema.js +1 -0
  179. package/core/schemas/builders/bigint/bigint.d.ts +2 -0
  180. package/core/schemas/builders/bigint/bigint.js +46 -0
  181. package/core/schemas/builders/bigint/index.d.ts +1 -0
  182. package/core/schemas/builders/bigint/index.js +1 -0
  183. package/core/schemas/builders/index.d.ts +1 -0
  184. package/core/schemas/builders/index.js +1 -0
  185. package/core/schemas/builders/lazy/lazy.d.ts +2 -2
  186. package/core/schemas/builders/lazy/lazy.js +8 -19
  187. package/core/schemas/builders/lazy/lazyObject.js +1 -10
  188. package/core/schemas/builders/list/list.js +31 -44
  189. package/core/schemas/builders/object/object.js +90 -111
  190. package/core/schemas/builders/object/types.d.ts +2 -2
  191. package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  192. package/core/schemas/builders/record/record.js +49 -60
  193. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  194. package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  195. package/core/schemas/builders/set/set.js +6 -15
  196. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  197. package/core/schemas/builders/union/union.js +51 -62
  198. package/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
  199. package/core/schemas/utils/maybeSkipValidation.js +3 -12
  200. package/dist/Client.d.ts +21 -0
  201. package/dist/Client.js +20 -0
  202. package/dist/api/resources/actions/client/Client.d.ts +96 -0
  203. package/dist/api/resources/actions/client/Client.js +319 -0
  204. package/dist/api/resources/actions/client/index.d.ts +1 -0
  205. package/dist/api/resources/actions/client/index.js +1 -0
  206. package/dist/api/resources/actions/index.d.ts +2 -0
  207. package/dist/api/resources/actions/index.js +2 -0
  208. package/dist/api/resources/actions/types/ActionBase.d.ts +18 -0
  209. package/dist/api/resources/actions/types/ActionBase.js +4 -0
  210. package/dist/api/resources/actions/types/ActionParameter.d.ts +9 -0
  211. package/dist/api/resources/actions/types/ActionParameter.js +4 -0
  212. package/dist/api/resources/actions/types/ActionRequest.d.ts +31 -0
  213. package/dist/api/resources/actions/types/ActionRequest.js +4 -0
  214. package/dist/api/resources/actions/types/ActionResponse.d.ts +35 -0
  215. package/dist/api/resources/actions/types/ActionResponse.js +4 -0
  216. package/dist/api/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +10 -0
  217. package/dist/api/resources/actions/types/ConversationExecutedActionPrecondition.js +4 -0
  218. package/dist/api/resources/actions/types/ConversationPrecondition.d.ts +16 -0
  219. package/dist/api/resources/actions/types/ConversationPrecondition.js +4 -0
  220. package/dist/api/resources/actions/types/MetadataPrecondition.d.ts +10 -0
  221. package/dist/api/resources/actions/types/MetadataPrecondition.js +4 -0
  222. package/dist/api/resources/actions/types/Precondition.d.ts +31 -0
  223. package/dist/api/resources/actions/types/Precondition.js +4 -0
  224. package/dist/api/resources/actions/types/PreconditionBase.d.ts +8 -0
  225. package/dist/api/resources/actions/types/PreconditionBase.js +4 -0
  226. package/dist/api/resources/actions/types/PreconditionGroup.d.ts +8 -0
  227. package/dist/api/resources/actions/types/PreconditionGroup.js +4 -0
  228. package/dist/api/resources/actions/types/PreconditionGroupOperator.d.ts +8 -0
  229. package/dist/api/resources/actions/types/PreconditionGroupOperator.js +7 -0
  230. package/dist/api/resources/actions/types/PreconditionOperator.d.ts +7 -0
  231. package/dist/api/resources/actions/types/PreconditionOperator.js +6 -0
  232. package/dist/api/resources/actions/types/TagsPrecondition.d.ts +8 -0
  233. package/dist/api/resources/actions/types/TagsPrecondition.js +4 -0
  234. package/dist/api/resources/actions/types/index.d.ts +13 -0
  235. package/dist/api/resources/actions/types/index.js +13 -0
  236. package/dist/api/resources/appSettings/client/Client.d.ts +47 -0
  237. package/dist/api/resources/appSettings/client/Client.js +125 -0
  238. package/dist/api/resources/appSettings/client/index.d.ts +1 -0
  239. package/dist/api/resources/appSettings/client/index.js +1 -0
  240. package/dist/api/resources/appSettings/index.d.ts +1 -0
  241. package/dist/api/resources/appSettings/index.js +1 -0
  242. package/dist/api/resources/{conversation/errors/EmptyConversationError.d.ts → commons/errors/BadRequestError.d.ts} +1 -1
  243. package/dist/api/resources/{knowledge/errors/VersionInProgressError.js → commons/errors/BadRequestError.js} +3 -3
  244. package/dist/api/resources/commons/errors/NotFoundError.d.ts +8 -0
  245. package/{api/resources/commons/errors/AgentNotFoundError.js → dist/api/resources/commons/errors/NotFoundError.js} +3 -3
  246. package/dist/api/resources/commons/errors/ServerError.d.ts +8 -0
  247. package/dist/api/resources/commons/errors/ServerError.js +14 -0
  248. package/dist/api/resources/commons/errors/index.d.ts +3 -1
  249. package/dist/api/resources/commons/errors/index.js +3 -1
  250. package/dist/api/resources/commons/types/AppUser.d.ts +9 -0
  251. package/dist/api/resources/commons/types/AppUser.js +4 -0
  252. package/dist/api/resources/commons/types/AppUserIdentifier.d.ts +9 -0
  253. package/dist/api/resources/commons/types/AppUserIdentifier.js +4 -0
  254. package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
  255. package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
  256. package/dist/api/resources/commons/types/AppUserRequest.d.ts +26 -0
  257. package/dist/api/resources/commons/types/AppUserRequest.js +4 -0
  258. package/dist/api/resources/commons/types/AppUserResponse.d.ts +42 -0
  259. package/dist/api/resources/commons/types/AppUserResponse.js +4 -0
  260. package/dist/api/resources/commons/types/EntityId.d.ts +14 -0
  261. package/dist/api/resources/commons/types/EntityId.js +4 -0
  262. package/dist/api/resources/commons/types/EntityIdBase.d.ts +10 -0
  263. package/dist/api/resources/commons/types/EntityIdBase.js +4 -0
  264. package/dist/api/resources/commons/types/EntityType.d.ts +16 -0
  265. package/dist/api/resources/commons/types/EntityType.js +15 -0
  266. package/dist/api/resources/commons/types/EventTriggerBase.d.ts +10 -0
  267. package/dist/api/resources/commons/types/EventTriggerBase.js +4 -0
  268. package/dist/api/resources/commons/types/EventTriggerResponse.d.ts +22 -0
  269. package/dist/api/resources/commons/types/EventTriggerResponse.js +4 -0
  270. package/dist/api/resources/commons/types/EventTriggerType.d.ts +8 -0
  271. package/dist/api/resources/commons/types/EventTriggerType.js +7 -0
  272. package/dist/api/resources/commons/types/Feedback.d.ts +12 -0
  273. package/dist/api/resources/commons/types/Feedback.js +4 -0
  274. package/dist/api/resources/commons/types/FeedbackBase.d.ts +10 -0
  275. package/dist/api/resources/commons/types/FeedbackBase.js +4 -0
  276. package/dist/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
  277. package/{api/resources/conversation → dist/api/resources/commons}/types/FeedbackType.js +2 -0
  278. package/dist/api/resources/commons/types/UserData.d.ts +10 -0
  279. package/dist/api/resources/commons/types/UserData.js +4 -0
  280. package/dist/api/resources/commons/types/VisibilityType.d.ts +9 -0
  281. package/dist/api/resources/commons/types/VisibilityType.js +8 -0
  282. package/dist/api/resources/commons/types/index.d.ts +16 -1
  283. package/dist/api/resources/commons/types/index.js +16 -1
  284. package/dist/api/resources/conversation/client/Client.d.ts +149 -44
  285. package/dist/api/resources/conversation/client/Client.js +474 -132
  286. package/dist/api/resources/conversation/index.d.ts +0 -1
  287. package/dist/api/resources/conversation/index.js +0 -1
  288. package/dist/api/resources/conversation/types/ActionFormField.d.ts +1 -0
  289. package/dist/api/resources/conversation/types/AskRequest.d.ts +15 -3
  290. package/dist/api/resources/conversation/types/AskStreamActionEvent.d.ts +6 -0
  291. package/dist/api/resources/conversation/types/AskStreamActionEvent.js +4 -0
  292. package/dist/api/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
  293. package/dist/api/resources/conversation/types/AskStreamTextEvent.d.ts +1 -0
  294. package/dist/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
  295. package/dist/api/resources/conversation/types/BotMessage.d.ts +2 -0
  296. package/dist/api/resources/conversation/types/Capability.d.ts +18 -0
  297. package/dist/api/resources/conversation/types/Capability.js +8 -0
  298. package/dist/api/resources/conversation/types/CategorizationResponse.d.ts +6 -0
  299. package/dist/api/resources/conversation/types/CategorizationResponse.js +4 -0
  300. package/dist/api/resources/conversation/types/ConversationAnalysis.d.ts +12 -0
  301. package/dist/api/resources/conversation/types/ConversationAnalysis.js +4 -0
  302. package/dist/api/resources/conversation/types/ConversationBase.d.ts +14 -4
  303. package/dist/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -5
  304. package/dist/api/resources/conversation/types/ConversationMessageRequest.d.ts +3 -1
  305. package/dist/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
  306. package/dist/api/resources/conversation/types/ConversationResponse.d.ts +4 -0
  307. package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +7 -7
  308. package/dist/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
  309. package/dist/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
  310. package/dist/api/resources/conversation/types/ResponseConfig.js +4 -0
  311. package/dist/api/resources/conversation/types/ResponseLength.d.ts +9 -0
  312. package/dist/api/resources/conversation/types/ResponseLength.js +8 -0
  313. package/dist/api/resources/conversation/types/Sentiment.d.ts +14 -0
  314. package/dist/api/resources/conversation/types/Sentiment.js +10 -0
  315. package/dist/api/resources/conversation/types/StreamResponse.d.ts +4 -1
  316. package/dist/api/resources/conversation/types/SubmitActionFormRequest.d.ts +8 -0
  317. package/dist/api/resources/conversation/types/SubmitActionFormRequest.js +4 -0
  318. package/dist/api/resources/conversation/types/UserMessage.d.ts +3 -3
  319. package/dist/api/resources/conversation/types/UserMessageBase.d.ts +11 -0
  320. package/dist/api/resources/conversation/types/UserMessageBase.js +4 -0
  321. package/dist/api/resources/conversation/types/index.d.ts +9 -3
  322. package/dist/api/resources/conversation/types/index.js +9 -3
  323. package/dist/api/resources/index.d.ts +6 -2
  324. package/dist/api/resources/index.js +6 -2
  325. package/dist/api/resources/knowledge/client/Client.d.ts +86 -74
  326. package/dist/api/resources/knowledge/client/Client.js +240 -175
  327. package/dist/api/resources/knowledge/index.d.ts +0 -1
  328. package/dist/api/resources/knowledge/index.js +0 -1
  329. package/{api/resources/knowledge/types/KnowledgeDocument.d.ts → dist/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts} +2 -5
  330. package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
  331. package/dist/api/resources/knowledge/types/{KnowledgeBase.d.ts → KnowledgeBaseProperties.d.ts} +3 -3
  332. package/dist/api/resources/knowledge/types/KnowledgeBaseProperties.js +4 -0
  333. package/dist/api/resources/knowledge/types/KnowledgeBaseRequest.d.ts +18 -0
  334. package/dist/api/resources/knowledge/types/KnowledgeBaseRequest.js +4 -0
  335. package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +22 -0
  336. package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
  337. package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
  338. package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +7 -3
  339. package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +11 -0
  340. package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
  341. package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +22 -0
  342. package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
  343. package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +24 -0
  344. package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
  345. package/dist/api/resources/knowledge/types/index.d.ts +7 -5
  346. package/dist/api/resources/knowledge/types/index.js +7 -5
  347. package/dist/api/resources/triggers/client/Client.d.ts +83 -0
  348. package/dist/api/resources/triggers/client/Client.js +306 -0
  349. package/dist/api/resources/triggers/client/index.d.ts +1 -0
  350. package/dist/api/resources/triggers/client/index.js +1 -0
  351. package/dist/api/resources/triggers/index.d.ts +2 -0
  352. package/dist/api/resources/triggers/index.js +2 -0
  353. package/dist/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
  354. package/dist/api/resources/triggers/types/EventTriggerRequest.js +4 -0
  355. package/dist/api/resources/triggers/types/index.d.ts +1 -0
  356. package/dist/api/resources/triggers/types/index.js +1 -0
  357. package/dist/api/resources/users/client/Client.d.ts +77 -0
  358. package/dist/api/resources/users/client/Client.js +230 -0
  359. package/dist/api/resources/users/client/index.d.ts +1 -0
  360. package/dist/api/resources/users/client/index.js +1 -0
  361. package/dist/api/resources/users/index.d.ts +1 -0
  362. package/dist/api/resources/users/index.js +1 -0
  363. package/dist/core/fetcher/Fetcher.d.ts +4 -1
  364. package/dist/core/fetcher/Fetcher.js +18 -159
  365. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  366. package/dist/core/fetcher/createRequestUrl.js +6 -0
  367. package/dist/core/fetcher/getFetchFn.d.ts +4 -0
  368. package/dist/core/fetcher/getFetchFn.js +32 -0
  369. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  370. package/dist/core/fetcher/getRequestBody.js +19 -0
  371. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  372. package/dist/core/fetcher/getResponseBody.js +48 -0
  373. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  374. package/dist/core/fetcher/makeRequest.js +38 -0
  375. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  376. package/dist/core/fetcher/requestWithRetries.js +28 -0
  377. package/dist/core/fetcher/signals.d.ts +12 -0
  378. package/dist/core/fetcher/signals.js +32 -0
  379. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  380. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +243 -0
  381. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  382. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +120 -0
  383. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  384. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +225 -0
  385. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  386. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
  387. package/dist/core/index.d.ts +1 -1
  388. package/dist/core/index.js +1 -1
  389. package/dist/core/runtime/runtime.d.ts +1 -0
  390. package/dist/core/runtime/runtime.js +1 -0
  391. package/dist/core/schemas/Schema.d.ts +8 -4
  392. package/dist/core/schemas/Schema.js +1 -0
  393. package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
  394. package/dist/core/schemas/builders/bigint/bigint.js +46 -0
  395. package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
  396. package/dist/core/schemas/builders/bigint/index.js +1 -0
  397. package/dist/core/schemas/builders/index.d.ts +1 -0
  398. package/dist/core/schemas/builders/index.js +1 -0
  399. package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
  400. package/dist/core/schemas/builders/lazy/lazy.js +8 -19
  401. package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
  402. package/dist/core/schemas/builders/list/list.js +31 -44
  403. package/dist/core/schemas/builders/object/object.js +90 -111
  404. package/dist/core/schemas/builders/object/types.d.ts +2 -2
  405. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  406. package/dist/core/schemas/builders/record/record.js +49 -60
  407. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  408. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  409. package/dist/core/schemas/builders/set/set.js +6 -15
  410. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  411. package/dist/core/schemas/builders/union/union.js +51 -62
  412. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
  413. package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
  414. package/dist/serialization/resources/actions/index.d.ts +1 -0
  415. package/dist/serialization/resources/actions/index.js +1 -0
  416. package/dist/serialization/resources/actions/types/ActionBase.d.ts +18 -0
  417. package/dist/serialization/resources/actions/types/ActionBase.js +14 -0
  418. package/dist/serialization/resources/actions/types/ActionParameter.d.ts +15 -0
  419. package/dist/serialization/resources/actions/types/ActionParameter.js +10 -0
  420. package/dist/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
  421. package/dist/serialization/resources/actions/types/ActionRequest.js +11 -0
  422. package/dist/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
  423. package/dist/serialization/resources/actions/types/ActionResponse.js +11 -0
  424. package/dist/serialization/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +14 -0
  425. package/dist/serialization/resources/actions/types/ConversationExecutedActionPrecondition.js +11 -0
  426. package/dist/serialization/resources/actions/types/ConversationPrecondition.d.ts +22 -0
  427. package/dist/serialization/resources/actions/types/ConversationPrecondition.js +17 -0
  428. package/dist/serialization/resources/actions/types/MetadataPrecondition.d.ts +14 -0
  429. package/dist/serialization/resources/actions/types/MetadataPrecondition.js +11 -0
  430. package/dist/serialization/resources/actions/types/Precondition.d.ts +22 -0
  431. package/dist/serialization/resources/actions/types/Precondition.js +19 -0
  432. package/dist/serialization/resources/actions/types/PreconditionBase.d.ts +13 -0
  433. package/dist/serialization/resources/actions/types/PreconditionBase.js +8 -0
  434. package/dist/serialization/resources/actions/types/PreconditionGroup.d.ts +14 -0
  435. package/dist/serialization/resources/actions/types/PreconditionGroup.js +10 -0
  436. package/dist/serialization/resources/actions/types/PreconditionGroupOperator.d.ts +10 -0
  437. package/dist/serialization/resources/actions/types/PreconditionGroupOperator.js +5 -0
  438. package/dist/serialization/resources/actions/types/PreconditionOperator.d.ts +10 -0
  439. package/dist/serialization/resources/actions/types/PreconditionOperator.js +5 -0
  440. package/dist/serialization/resources/actions/types/TagsPrecondition.d.ts +13 -0
  441. package/dist/serialization/resources/actions/types/TagsPrecondition.js +10 -0
  442. package/dist/serialization/resources/actions/types/index.d.ts +13 -0
  443. package/dist/serialization/resources/actions/types/index.js +13 -0
  444. package/dist/serialization/resources/appSettings/client/get.d.ts +9 -0
  445. package/dist/serialization/resources/appSettings/client/get.js +5 -0
  446. package/dist/serialization/resources/appSettings/client/index.d.ts +1 -0
  447. package/dist/serialization/resources/appSettings/client/index.js +1 -0
  448. package/dist/serialization/resources/appSettings/index.d.ts +1 -0
  449. package/dist/serialization/resources/appSettings/index.js +1 -0
  450. package/dist/serialization/resources/commons/types/AppUser.d.ts +15 -0
  451. package/dist/serialization/resources/commons/types/AppUser.js +10 -0
  452. package/dist/serialization/resources/commons/types/AppUserIdentifier.d.ts +14 -0
  453. package/dist/serialization/resources/commons/types/AppUserIdentifier.js +9 -0
  454. package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
  455. package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
  456. package/dist/serialization/resources/commons/types/AppUserRequest.d.ts +14 -0
  457. package/dist/serialization/resources/commons/types/AppUserRequest.js +11 -0
  458. package/dist/serialization/resources/commons/types/AppUserResponse.d.ts +16 -0
  459. package/dist/serialization/resources/commons/types/AppUserResponse.js +13 -0
  460. package/dist/serialization/resources/commons/types/EntityId.d.ts +17 -0
  461. package/dist/serialization/resources/commons/types/EntityId.js +14 -0
  462. package/{serialization/resources/knowledge/types/IdBody.d.ts → dist/serialization/resources/commons/types/EntityIdBase.d.ts} +3 -3
  463. package/dist/serialization/resources/{knowledge/types/IdBody.js → commons/types/EntityIdBase.js} +2 -2
  464. package/dist/serialization/resources/commons/types/EntityType.d.ts +10 -0
  465. package/dist/serialization/resources/commons/types/EntityType.js +16 -0
  466. package/dist/serialization/resources/commons/types/EventTriggerBase.d.ts +14 -0
  467. package/dist/serialization/resources/commons/types/EventTriggerBase.js +9 -0
  468. package/dist/serialization/resources/commons/types/EventTriggerResponse.d.ts +14 -0
  469. package/dist/serialization/resources/commons/types/EventTriggerResponse.js +11 -0
  470. package/dist/serialization/resources/commons/types/EventTriggerType.d.ts +10 -0
  471. package/dist/serialization/resources/commons/types/EventTriggerType.js +5 -0
  472. package/dist/serialization/resources/commons/types/Feedback.d.ts +16 -0
  473. package/dist/serialization/resources/commons/types/Feedback.js +13 -0
  474. package/dist/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
  475. package/dist/serialization/resources/commons/types/FeedbackBase.js +9 -0
  476. package/{serialization/resources/conversation → dist/serialization/resources/commons}/types/FeedbackType.d.ts +1 -1
  477. package/dist/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
  478. package/dist/serialization/resources/commons/types/UserData.d.ts +14 -0
  479. package/dist/serialization/resources/commons/types/UserData.js +9 -0
  480. package/dist/serialization/resources/commons/types/VisibilityType.d.ts +10 -0
  481. package/dist/serialization/resources/commons/types/VisibilityType.js +5 -0
  482. package/dist/serialization/resources/commons/types/index.d.ts +16 -1
  483. package/dist/serialization/resources/commons/types/index.js +16 -1
  484. package/dist/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
  485. package/dist/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
  486. package/dist/serialization/resources/conversation/client/index.d.ts +1 -0
  487. package/dist/serialization/resources/conversation/client/index.js +1 -0
  488. package/dist/serialization/resources/conversation/types/ActionFormField.d.ts +1 -0
  489. package/dist/serialization/resources/conversation/types/ActionFormField.js +1 -0
  490. package/dist/serialization/resources/conversation/types/AskRequest.d.ts +3 -3
  491. package/dist/serialization/resources/conversation/types/AskRequest.js +3 -3
  492. package/dist/serialization/resources/conversation/types/AskStreamActionEvent.d.ts +12 -0
  493. package/dist/serialization/resources/conversation/types/AskStreamActionEvent.js +6 -0
  494. package/dist/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
  495. package/dist/serialization/resources/conversation/types/AskStreamStartEvent.js +2 -1
  496. package/dist/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
  497. package/dist/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
  498. package/dist/serialization/resources/conversation/types/BotMessage.d.ts +2 -0
  499. package/dist/serialization/resources/conversation/types/BotMessage.js +2 -0
  500. package/dist/serialization/resources/conversation/types/Capability.d.ts +10 -0
  501. package/dist/serialization/resources/conversation/types/Capability.js +5 -0
  502. package/dist/serialization/resources/{commons/types/User.d.ts → conversation/types/CategorizationResponse.d.ts} +3 -5
  503. package/dist/serialization/resources/conversation/types/CategorizationResponse.js +7 -0
  504. package/dist/serialization/resources/conversation/types/ConversationAnalysis.d.ts +15 -0
  505. package/dist/serialization/resources/conversation/types/ConversationAnalysis.js +10 -0
  506. package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +8 -3
  507. package/dist/serialization/resources/conversation/types/ConversationBase.js +8 -3
  508. package/dist/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -3
  509. package/dist/serialization/resources/conversation/types/ConversationMessageBase.js +2 -3
  510. package/dist/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +4 -2
  511. package/dist/serialization/resources/conversation/types/ConversationMessageRequest.js +7 -2
  512. package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
  513. package/dist/serialization/resources/conversation/types/ConversationRequest.js +2 -0
  514. package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +4 -0
  515. package/dist/serialization/resources/conversation/types/ConversationResponse.js +4 -0
  516. package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +6 -5
  517. package/dist/serialization/resources/conversation/types/FeedbackRequest.js +9 -6
  518. package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
  519. package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +2 -1
  520. package/dist/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
  521. package/dist/serialization/resources/conversation/types/ResponseConfig.js +11 -0
  522. package/dist/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
  523. package/dist/serialization/resources/conversation/types/ResponseLength.js +5 -0
  524. package/dist/serialization/resources/conversation/types/Sentiment.d.ts +10 -0
  525. package/dist/serialization/resources/conversation/types/Sentiment.js +5 -0
  526. package/dist/serialization/resources/conversation/types/StreamResponse.d.ts +5 -1
  527. package/dist/serialization/resources/conversation/types/StreamResponse.js +2 -0
  528. package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +13 -0
  529. package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.js +8 -0
  530. package/dist/serialization/resources/conversation/types/UserMessage.d.ts +4 -5
  531. package/dist/serialization/resources/conversation/types/UserMessage.js +4 -5
  532. package/dist/serialization/resources/conversation/types/UserMessageBase.d.ts +17 -0
  533. package/dist/serialization/resources/conversation/types/UserMessageBase.js +14 -0
  534. package/dist/serialization/resources/conversation/types/index.d.ts +9 -3
  535. package/dist/serialization/resources/conversation/types/index.js +9 -3
  536. package/dist/serialization/resources/index.d.ts +5 -0
  537. package/dist/serialization/resources/index.js +5 -0
  538. package/dist/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +3 -5
  539. package/{serialization/resources/knowledge/types/KnowledgeDocument.js → dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.js} +2 -6
  540. package/{serialization/resources/knowledge/types/KnowledgeBase.d.ts → dist/serialization/resources/knowledge/types/KnowledgeBaseProperties.d.ts} +4 -5
  541. package/dist/serialization/resources/knowledge/types/{KnowledgeBase.js → KnowledgeBaseProperties.js} +3 -6
  542. package/dist/serialization/resources/knowledge/types/KnowledgeBaseRequest.d.ts +14 -0
  543. package/dist/serialization/resources/knowledge/types/KnowledgeBaseRequest.js +11 -0
  544. package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +14 -0
  545. package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +11 -0
  546. package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +0 -1
  547. package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +0 -1
  548. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +10 -0
  549. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
  550. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +17 -0
  551. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +14 -0
  552. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +15 -0
  553. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +12 -0
  554. package/dist/serialization/resources/knowledge/types/index.d.ts +7 -5
  555. package/dist/serialization/resources/knowledge/types/index.js +7 -5
  556. package/dist/serialization/resources/triggers/index.d.ts +1 -0
  557. package/dist/serialization/resources/triggers/index.js +1 -0
  558. package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
  559. package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
  560. package/dist/serialization/resources/triggers/types/index.d.ts +1 -0
  561. package/dist/serialization/resources/triggers/types/index.js +1 -0
  562. package/dist/version.d.ts +1 -0
  563. package/dist/version.js +1 -0
  564. package/package.json +12 -2
  565. package/reference.md +1876 -0
  566. package/serialization/resources/actions/index.d.ts +1 -0
  567. package/serialization/resources/actions/index.js +1 -0
  568. package/serialization/resources/actions/types/ActionBase.d.ts +18 -0
  569. package/serialization/resources/actions/types/ActionBase.js +14 -0
  570. package/serialization/resources/actions/types/ActionParameter.d.ts +15 -0
  571. package/serialization/resources/actions/types/ActionParameter.js +10 -0
  572. package/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
  573. package/serialization/resources/actions/types/ActionRequest.js +11 -0
  574. package/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
  575. package/serialization/resources/actions/types/ActionResponse.js +11 -0
  576. package/serialization/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +14 -0
  577. package/serialization/resources/actions/types/ConversationExecutedActionPrecondition.js +11 -0
  578. package/serialization/resources/actions/types/ConversationPrecondition.d.ts +22 -0
  579. package/serialization/resources/actions/types/ConversationPrecondition.js +17 -0
  580. package/serialization/resources/actions/types/MetadataPrecondition.d.ts +14 -0
  581. package/serialization/resources/actions/types/MetadataPrecondition.js +11 -0
  582. package/serialization/resources/actions/types/Precondition.d.ts +22 -0
  583. package/serialization/resources/actions/types/Precondition.js +19 -0
  584. package/serialization/resources/actions/types/PreconditionBase.d.ts +13 -0
  585. package/serialization/resources/actions/types/PreconditionBase.js +8 -0
  586. package/serialization/resources/actions/types/PreconditionGroup.d.ts +14 -0
  587. package/serialization/resources/actions/types/PreconditionGroup.js +10 -0
  588. package/serialization/resources/actions/types/PreconditionGroupOperator.d.ts +10 -0
  589. package/serialization/resources/actions/types/PreconditionGroupOperator.js +5 -0
  590. package/serialization/resources/actions/types/PreconditionOperator.d.ts +10 -0
  591. package/serialization/resources/actions/types/PreconditionOperator.js +5 -0
  592. package/serialization/resources/actions/types/TagsPrecondition.d.ts +13 -0
  593. package/serialization/resources/actions/types/TagsPrecondition.js +10 -0
  594. package/serialization/resources/actions/types/index.d.ts +13 -0
  595. package/serialization/resources/actions/types/index.js +13 -0
  596. package/serialization/resources/appSettings/client/get.d.ts +9 -0
  597. package/serialization/resources/appSettings/client/get.js +5 -0
  598. package/serialization/resources/appSettings/client/index.d.ts +1 -0
  599. package/serialization/resources/appSettings/client/index.js +1 -0
  600. package/serialization/resources/appSettings/index.d.ts +1 -0
  601. package/serialization/resources/appSettings/index.js +1 -0
  602. package/serialization/resources/commons/types/AppUser.d.ts +15 -0
  603. package/serialization/resources/commons/types/AppUser.js +10 -0
  604. package/serialization/resources/commons/types/AppUserIdentifier.d.ts +14 -0
  605. package/serialization/resources/commons/types/AppUserIdentifier.js +9 -0
  606. package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
  607. package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
  608. package/serialization/resources/commons/types/AppUserRequest.d.ts +14 -0
  609. package/serialization/resources/commons/types/AppUserRequest.js +11 -0
  610. package/serialization/resources/commons/types/AppUserResponse.d.ts +16 -0
  611. package/serialization/resources/commons/types/AppUserResponse.js +13 -0
  612. package/serialization/resources/commons/types/EntityId.d.ts +17 -0
  613. package/serialization/resources/commons/types/EntityId.js +14 -0
  614. package/{dist/serialization/resources/knowledge/types/IdBody.d.ts → serialization/resources/commons/types/EntityIdBase.d.ts} +3 -3
  615. package/serialization/resources/{knowledge/types/IdBody.js → commons/types/EntityIdBase.js} +2 -2
  616. package/serialization/resources/commons/types/EntityType.d.ts +10 -0
  617. package/serialization/resources/commons/types/EntityType.js +16 -0
  618. package/serialization/resources/commons/types/EventTriggerBase.d.ts +14 -0
  619. package/serialization/resources/commons/types/EventTriggerBase.js +9 -0
  620. package/serialization/resources/commons/types/EventTriggerResponse.d.ts +14 -0
  621. package/serialization/resources/commons/types/EventTriggerResponse.js +11 -0
  622. package/serialization/resources/commons/types/EventTriggerType.d.ts +10 -0
  623. package/serialization/resources/commons/types/EventTriggerType.js +5 -0
  624. package/serialization/resources/commons/types/Feedback.d.ts +16 -0
  625. package/serialization/resources/commons/types/Feedback.js +13 -0
  626. package/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
  627. package/serialization/resources/commons/types/FeedbackBase.js +9 -0
  628. package/{dist/serialization/resources/conversation → serialization/resources/commons}/types/FeedbackType.d.ts +1 -1
  629. package/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
  630. package/serialization/resources/commons/types/UserData.d.ts +14 -0
  631. package/serialization/resources/commons/types/UserData.js +9 -0
  632. package/serialization/resources/commons/types/VisibilityType.d.ts +10 -0
  633. package/serialization/resources/commons/types/VisibilityType.js +5 -0
  634. package/serialization/resources/commons/types/index.d.ts +16 -1
  635. package/serialization/resources/commons/types/index.js +16 -1
  636. package/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
  637. package/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
  638. package/serialization/resources/conversation/client/index.d.ts +1 -0
  639. package/serialization/resources/conversation/client/index.js +1 -0
  640. package/serialization/resources/conversation/types/ActionFormField.d.ts +1 -0
  641. package/serialization/resources/conversation/types/ActionFormField.js +1 -0
  642. package/serialization/resources/conversation/types/AskRequest.d.ts +3 -3
  643. package/serialization/resources/conversation/types/AskRequest.js +3 -3
  644. package/serialization/resources/conversation/types/AskStreamActionEvent.d.ts +12 -0
  645. package/serialization/resources/conversation/types/AskStreamActionEvent.js +6 -0
  646. package/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
  647. package/serialization/resources/conversation/types/AskStreamStartEvent.js +2 -1
  648. package/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
  649. package/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
  650. package/serialization/resources/conversation/types/BotMessage.d.ts +2 -0
  651. package/serialization/resources/conversation/types/BotMessage.js +2 -0
  652. package/serialization/resources/conversation/types/Capability.d.ts +10 -0
  653. package/serialization/resources/conversation/types/Capability.js +5 -0
  654. package/serialization/resources/{commons/types/User.d.ts → conversation/types/CategorizationResponse.d.ts} +3 -5
  655. package/serialization/resources/conversation/types/CategorizationResponse.js +7 -0
  656. package/serialization/resources/conversation/types/ConversationAnalysis.d.ts +15 -0
  657. package/serialization/resources/conversation/types/ConversationAnalysis.js +10 -0
  658. package/serialization/resources/conversation/types/ConversationBase.d.ts +8 -3
  659. package/serialization/resources/conversation/types/ConversationBase.js +8 -3
  660. package/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -3
  661. package/serialization/resources/conversation/types/ConversationMessageBase.js +2 -3
  662. package/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +4 -2
  663. package/serialization/resources/conversation/types/ConversationMessageRequest.js +7 -2
  664. package/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
  665. package/serialization/resources/conversation/types/ConversationRequest.js +2 -0
  666. package/serialization/resources/conversation/types/ConversationResponse.d.ts +4 -0
  667. package/serialization/resources/conversation/types/ConversationResponse.js +4 -0
  668. package/serialization/resources/conversation/types/FeedbackRequest.d.ts +6 -5
  669. package/serialization/resources/conversation/types/FeedbackRequest.js +9 -6
  670. package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
  671. package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +2 -1
  672. package/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
  673. package/serialization/resources/conversation/types/ResponseConfig.js +11 -0
  674. package/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
  675. package/serialization/resources/conversation/types/ResponseLength.js +5 -0
  676. package/serialization/resources/conversation/types/Sentiment.d.ts +10 -0
  677. package/serialization/resources/conversation/types/Sentiment.js +5 -0
  678. package/serialization/resources/conversation/types/StreamResponse.d.ts +5 -1
  679. package/serialization/resources/conversation/types/StreamResponse.js +2 -0
  680. package/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +13 -0
  681. package/serialization/resources/conversation/types/SubmitActionFormRequest.js +8 -0
  682. package/serialization/resources/conversation/types/UserMessage.d.ts +4 -5
  683. package/serialization/resources/conversation/types/UserMessage.js +4 -5
  684. package/serialization/resources/conversation/types/UserMessageBase.d.ts +17 -0
  685. package/serialization/resources/conversation/types/UserMessageBase.js +14 -0
  686. package/serialization/resources/conversation/types/index.d.ts +9 -3
  687. package/serialization/resources/conversation/types/index.js +9 -3
  688. package/serialization/resources/index.d.ts +5 -0
  689. package/serialization/resources/index.js +5 -0
  690. package/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +3 -5
  691. package/{dist/serialization/resources/knowledge/types/KnowledgeDocument.js → serialization/resources/knowledge/types/BaseKnowledgeDocument.js} +2 -6
  692. package/{dist/serialization/resources/knowledge/types/KnowledgeBase.d.ts → serialization/resources/knowledge/types/KnowledgeBaseProperties.d.ts} +4 -5
  693. package/serialization/resources/knowledge/types/{KnowledgeBase.js → KnowledgeBaseProperties.js} +3 -6
  694. package/serialization/resources/knowledge/types/KnowledgeBaseRequest.d.ts +14 -0
  695. package/serialization/resources/knowledge/types/KnowledgeBaseRequest.js +11 -0
  696. package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +14 -0
  697. package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +11 -0
  698. package/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +0 -1
  699. package/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +0 -1
  700. package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +10 -0
  701. package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
  702. package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +17 -0
  703. package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +14 -0
  704. package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +15 -0
  705. package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +12 -0
  706. package/serialization/resources/knowledge/types/index.d.ts +7 -5
  707. package/serialization/resources/knowledge/types/index.js +7 -5
  708. package/serialization/resources/triggers/index.d.ts +1 -0
  709. package/serialization/resources/triggers/index.js +1 -0
  710. package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
  711. package/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
  712. package/serialization/resources/triggers/types/index.d.ts +1 -0
  713. package/serialization/resources/triggers/types/index.js +1 -0
  714. package/version.d.ts +1 -0
  715. package/version.js +1 -0
  716. package/api/resources/commons/types/User.d.ts +0 -9
  717. package/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
  718. package/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
  719. package/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
  720. package/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
  721. package/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
  722. package/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
  723. package/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
  724. package/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
  725. package/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
  726. package/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
  727. package/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
  728. package/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
  729. package/api/resources/conversation/errors/index.d.ts +0 -7
  730. package/api/resources/conversation/errors/index.js +0 -7
  731. package/api/resources/conversation/types/ConversationContext.d.ts +0 -20
  732. package/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
  733. package/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
  734. package/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
  735. package/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
  736. package/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
  737. package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
  738. package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
  739. package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
  740. package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
  741. package/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
  742. package/api/resources/knowledge/errors/VersionInProgressError.js +0 -14
  743. package/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
  744. package/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
  745. package/api/resources/knowledge/errors/index.d.ts +0 -6
  746. package/api/resources/knowledge/errors/index.js +0 -6
  747. package/api/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -7
  748. package/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -9
  749. package/dist/api/resources/commons/types/User.d.ts +0 -9
  750. package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
  751. package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
  752. package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
  753. package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
  754. package/dist/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
  755. package/dist/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
  756. package/dist/api/resources/conversation/errors/EmptyConversationError.js +0 -14
  757. package/dist/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
  758. package/dist/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
  759. package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
  760. package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
  761. package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
  762. package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
  763. package/dist/api/resources/conversation/errors/index.d.ts +0 -7
  764. package/dist/api/resources/conversation/errors/index.js +0 -7
  765. package/dist/api/resources/conversation/types/ConversationContext.d.ts +0 -20
  766. package/dist/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
  767. package/dist/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
  768. package/dist/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
  769. package/dist/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
  770. package/dist/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
  771. package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
  772. package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
  773. package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
  774. package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
  775. package/dist/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
  776. package/dist/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
  777. package/dist/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
  778. package/dist/api/resources/knowledge/errors/index.d.ts +0 -6
  779. package/dist/api/resources/knowledge/errors/index.js +0 -6
  780. package/dist/api/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -7
  781. package/dist/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -9
  782. package/dist/serialization/resources/commons/types/User.js +0 -9
  783. package/dist/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
  784. package/dist/serialization/resources/conversation/types/ConversationContext.js +0 -15
  785. package/dist/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
  786. package/dist/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
  787. package/dist/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -12
  788. package/dist/serialization/resources/knowledge/types/KnowledgeBaseId.js +0 -7
  789. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -13
  790. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.js +0 -8
  791. package/serialization/resources/commons/types/User.js +0 -9
  792. package/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
  793. package/serialization/resources/conversation/types/ConversationContext.js +0 -15
  794. package/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
  795. package/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
  796. package/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts +0 -12
  797. package/serialization/resources/knowledge/types/KnowledgeBaseId.js +0 -7
  798. package/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +0 -13
  799. package/serialization/resources/knowledge/types/KnowledgeDocumentId.js +0 -8
  800. /package/api/resources/{commons/types/User.js → actions/types/ActionBase.js} +0 -0
  801. /package/api/resources/{conversation/types/ConversationContext.js → actions/types/ActionParameter.js} +0 -0
  802. /package/api/resources/{conversation/types/ConversationMessageContext.js → actions/types/ActionRequest.js} +0 -0
  803. /package/api/resources/{knowledge/types/IdBody.js → actions/types/ActionResponse.js} +0 -0
  804. /package/api/resources/{knowledge/types/KnowledgeBase.js → actions/types/ConversationExecutedActionPrecondition.js} +0 -0
  805. /package/api/resources/{knowledge/types/KnowledgeBaseId.js → actions/types/ConversationPrecondition.js} +0 -0
  806. /package/api/resources/{knowledge/types/KnowledgeDocument.js → actions/types/MetadataPrecondition.js} +0 -0
  807. /package/api/resources/{knowledge/types/KnowledgeDocumentId.js → actions/types/Precondition.js} +0 -0
  808. /package/{dist/api/resources/commons/types/User.js → api/resources/actions/types/PreconditionBase.js} +0 -0
  809. /package/{dist/api/resources/conversation/types/ConversationContext.js → api/resources/actions/types/PreconditionGroup.js} +0 -0
  810. /package/{dist/api/resources/conversation/types/ConversationMessageContext.js → api/resources/actions/types/TagsPrecondition.js} +0 -0
  811. /package/{dist/api/resources/knowledge/types/IdBody.js → api/resources/commons/types/AppUser.js} +0 -0
  812. /package/{dist/api/resources/knowledge/types/KnowledgeBase.js → api/resources/commons/types/AppUserIdentifier.js} +0 -0
  813. /package/{dist/api/resources/knowledge/types/KnowledgeBaseId.js → api/resources/commons/types/AppUserRequest.js} +0 -0
  814. /package/{dist/api/resources/knowledge/types/KnowledgeDocument.js → api/resources/commons/types/AppUserResponse.js} +0 -0
  815. /package/{dist/api/resources/knowledge/types/KnowledgeDocumentId.js → api/resources/commons/types/EntityId.js} +0 -0
@@ -21,45 +21,50 @@ export class Knowledge {
21
21
  this._options = _options;
22
22
  }
23
23
  /**
24
- * Create knowledge base
24
+ * Update a knowledge base or create it if it doesn't exist.
25
25
  *
26
- * @param {MavenAGI.KnowledgeBase} request
26
+ * @param {MavenAGI.KnowledgeBaseRequest} request
27
27
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
28
28
  *
29
- * @throws {@link MavenAGI.AgentNotFoundError}
29
+ * @throws {@link MavenAGI.NotFoundError}
30
+ * @throws {@link MavenAGI.BadRequestError}
31
+ * @throws {@link MavenAGI.ServerError}
30
32
  *
31
33
  * @example
32
- * await mavenAgi.knowledge.createKnowledgeBase({
33
- * displayName: "string",
34
- * type: MavenAGI.KnowledgeBaseType.Api,
35
- * url: "string",
36
- * knowledgeBaseId: "string"
34
+ * await client.knowledge.createOrUpdateKnowledgeBase({
35
+ * knowledgeBaseId: {
36
+ * referenceId: "help-center"
37
+ * },
38
+ * name: "Help center",
39
+ * type: "API"
37
40
  * })
38
41
  */
39
- createKnowledgeBase(request, requestOptions) {
40
- var _a, _b, _c;
42
+ createOrUpdateKnowledgeBase(request, requestOptions) {
43
+ var _a, _b;
41
44
  return __awaiter(this, void 0, void 0, function* () {
42
45
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
43
46
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge"),
44
- method: "POST",
47
+ method: "PUT",
45
48
  headers: {
46
49
  Authorization: yield this._getAuthorizationHeader(),
47
50
  "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
48
51
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
49
52
  "X-Fern-Language": "JavaScript",
50
53
  "X-Fern-SDK-Name": "mavenagi",
51
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
54
+ "X-Fern-SDK-Version": "0.0.0-alpha.21",
55
+ "User-Agent": "mavenagi/0.0.0-alpha.21",
52
56
  "X-Fern-Runtime": core.RUNTIME.type,
53
57
  "X-Fern-Runtime-Version": core.RUNTIME.version,
54
58
  },
55
59
  contentType: "application/json",
56
- body: yield serializers.KnowledgeBase.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
60
+ requestType: "json",
61
+ body: serializers.KnowledgeBaseRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
57
62
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
58
63
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
59
64
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
60
65
  });
61
66
  if (_response.ok) {
62
- return yield serializers.KnowledgeBase.parseOrThrow(_response.body, {
67
+ return serializers.KnowledgeBaseResponse.parseOrThrow(_response.body, {
63
68
  unrecognizedObjectKeys: "passthrough",
64
69
  allowUnrecognizedUnionMembers: true,
65
70
  allowUnrecognizedEnumValues: true,
@@ -67,9 +72,23 @@ export class Knowledge {
67
72
  });
68
73
  }
69
74
  if (_response.error.reason === "status-code") {
70
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
71
- case "AgentNotFoundError":
72
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
75
+ switch (_response.error.statusCode) {
76
+ case 404:
77
+ throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
78
+ unrecognizedObjectKeys: "passthrough",
79
+ allowUnrecognizedUnionMembers: true,
80
+ allowUnrecognizedEnumValues: true,
81
+ breadcrumbsPrefix: ["response"],
82
+ }));
83
+ case 400:
84
+ throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
85
+ unrecognizedObjectKeys: "passthrough",
86
+ allowUnrecognizedUnionMembers: true,
87
+ allowUnrecognizedEnumValues: true,
88
+ breadcrumbsPrefix: ["response"],
89
+ }));
90
+ case 500:
91
+ throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
73
92
  unrecognizedObjectKeys: "passthrough",
74
93
  allowUnrecognizedUnionMembers: true,
75
94
  allowUnrecognizedEnumValues: true,
@@ -98,46 +117,43 @@ export class Knowledge {
98
117
  });
99
118
  }
100
119
  /**
101
- * Create a new knowledge base version. Only supported on API knowledge bases.
120
+ * Get an existing knowledge base by its supplied ID
102
121
  *
103
- * @param {MavenAGI.KnowledgeBaseVersion} request
122
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to get. All other entity ID fields are inferred from the request.
104
123
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
105
124
  *
106
- * @throws {@link MavenAGI.VersionInProgressError}
107
- * @throws {@link MavenAGI.IneligibleKnowledgeBaseError}
108
- * @throws {@link MavenAGI.KnowledgeBaseNotFoundError}
109
- * @throws {@link MavenAGI.AgentNotFoundError}
125
+ * @throws {@link MavenAGI.NotFoundError}
126
+ * @throws {@link MavenAGI.BadRequestError}
127
+ * @throws {@link MavenAGI.ServerError}
110
128
  *
111
129
  * @example
112
- * await mavenAgi.knowledge.createKnowledgeBaseVersion({
113
- * knowledgeBaseId: "string",
114
- * type: MavenAGI.KnowledgeBaseVersionType.Full
115
- * })
130
+ * await client.knowledge.getKnowledgeBase("help-center")
116
131
  */
117
- createKnowledgeBaseVersion(request, requestOptions) {
118
- var _a, _b, _c;
132
+ getKnowledgeBase(knowledgeBaseReferenceId, requestOptions) {
133
+ var _a, _b;
119
134
  return __awaiter(this, void 0, void 0, function* () {
120
135
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
121
- url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/version"),
122
- method: "POST",
136
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}`),
137
+ method: "GET",
123
138
  headers: {
124
139
  Authorization: yield this._getAuthorizationHeader(),
125
140
  "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
126
141
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
127
142
  "X-Fern-Language": "JavaScript",
128
143
  "X-Fern-SDK-Name": "mavenagi",
129
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
144
+ "X-Fern-SDK-Version": "0.0.0-alpha.21",
145
+ "User-Agent": "mavenagi/0.0.0-alpha.21",
130
146
  "X-Fern-Runtime": core.RUNTIME.type,
131
147
  "X-Fern-Runtime-Version": core.RUNTIME.version,
132
148
  },
133
149
  contentType: "application/json",
134
- body: yield serializers.KnowledgeBaseVersion.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
150
+ requestType: "json",
135
151
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
136
152
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
137
153
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
138
154
  });
139
155
  if (_response.ok) {
140
- return yield serializers.KnowledgeBaseVersion.parseOrThrow(_response.body, {
156
+ return serializers.KnowledgeBaseResponse.parseOrThrow(_response.body, {
141
157
  unrecognizedObjectKeys: "passthrough",
142
158
  allowUnrecognizedUnionMembers: true,
143
159
  allowUnrecognizedEnumValues: true,
@@ -145,30 +161,23 @@ export class Knowledge {
145
161
  });
146
162
  }
147
163
  if (_response.error.reason === "status-code") {
148
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
149
- case "VersionInProgressError":
150
- throw new MavenAGI.VersionInProgressError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
151
- unrecognizedObjectKeys: "passthrough",
152
- allowUnrecognizedUnionMembers: true,
153
- allowUnrecognizedEnumValues: true,
154
- breadcrumbsPrefix: ["response"],
155
- }));
156
- case "IneligibleKnowledgeBaseError":
157
- throw new MavenAGI.IneligibleKnowledgeBaseError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
164
+ switch (_response.error.statusCode) {
165
+ case 404:
166
+ throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
158
167
  unrecognizedObjectKeys: "passthrough",
159
168
  allowUnrecognizedUnionMembers: true,
160
169
  allowUnrecognizedEnumValues: true,
161
170
  breadcrumbsPrefix: ["response"],
162
171
  }));
163
- case "KnowledgeBaseNotFoundError":
164
- throw new MavenAGI.KnowledgeBaseNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
172
+ case 400:
173
+ throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
165
174
  unrecognizedObjectKeys: "passthrough",
166
175
  allowUnrecognizedUnionMembers: true,
167
176
  allowUnrecognizedEnumValues: true,
168
177
  breadcrumbsPrefix: ["response"],
169
178
  }));
170
- case "AgentNotFoundError":
171
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
179
+ case 500:
180
+ throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
172
181
  unrecognizedObjectKeys: "passthrough",
173
182
  allowUnrecognizedUnionMembers: true,
174
183
  allowUnrecognizedEnumValues: true,
@@ -197,26 +206,26 @@ export class Knowledge {
197
206
  });
198
207
  }
199
208
  /**
200
- * Finalize a knowledge base version. Required to indicate a version is complete.
209
+ * Create a new knowledge base version. Only supported on API knowledge bases. Will throw an exception if there is an existing version in progress.
201
210
  *
202
- * @param {MavenAGI.KnowledgeBaseId} request
211
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to create a version for. All other entity ID fields are inferred from the request.
212
+ * @param {MavenAGI.KnowledgeBaseVersion} request
203
213
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
204
214
  *
205
- * @throws {@link MavenAGI.VersionNotInProgressError}
206
- * @throws {@link MavenAGI.IneligibleKnowledgeBaseError}
207
- * @throws {@link MavenAGI.KnowledgeBaseNotFoundError}
208
- * @throws {@link MavenAGI.AgentNotFoundError}
215
+ * @throws {@link MavenAGI.NotFoundError}
216
+ * @throws {@link MavenAGI.BadRequestError}
217
+ * @throws {@link MavenAGI.ServerError}
209
218
  *
210
219
  * @example
211
- * await mavenAgi.knowledge.finalizeKnowledgeBaseVersion({
212
- * knowledgeBaseId: "string"
220
+ * await client.knowledge.createKnowledgeBaseVersion("help-center", {
221
+ * type: "FULL"
213
222
  * })
214
223
  */
215
- finalizeKnowledgeBaseVersion(request, requestOptions) {
216
- var _a, _b, _c;
224
+ createKnowledgeBaseVersion(knowledgeBaseReferenceId, request, requestOptions) {
225
+ var _a, _b;
217
226
  return __awaiter(this, void 0, void 0, function* () {
218
227
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
219
- url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/version/finalize"),
228
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/version`),
220
229
  method: "POST",
221
230
  headers: {
222
231
  Authorization: yield this._getAuthorizationHeader(),
@@ -224,44 +233,128 @@ export class Knowledge {
224
233
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
225
234
  "X-Fern-Language": "JavaScript",
226
235
  "X-Fern-SDK-Name": "mavenagi",
227
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
236
+ "X-Fern-SDK-Version": "0.0.0-alpha.21",
237
+ "User-Agent": "mavenagi/0.0.0-alpha.21",
228
238
  "X-Fern-Runtime": core.RUNTIME.type,
229
239
  "X-Fern-Runtime-Version": core.RUNTIME.version,
230
240
  },
231
241
  contentType: "application/json",
232
- body: yield serializers.KnowledgeBaseId.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
242
+ requestType: "json",
243
+ body: serializers.KnowledgeBaseVersion.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
233
244
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
234
245
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
235
246
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
236
247
  });
237
248
  if (_response.ok) {
238
- return;
249
+ return serializers.KnowledgeBaseVersion.parseOrThrow(_response.body, {
250
+ unrecognizedObjectKeys: "passthrough",
251
+ allowUnrecognizedUnionMembers: true,
252
+ allowUnrecognizedEnumValues: true,
253
+ breadcrumbsPrefix: ["response"],
254
+ });
239
255
  }
240
256
  if (_response.error.reason === "status-code") {
241
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
242
- case "VersionNotInProgressError":
243
- throw new MavenAGI.VersionNotInProgressError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
257
+ switch (_response.error.statusCode) {
258
+ case 404:
259
+ throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
260
+ unrecognizedObjectKeys: "passthrough",
261
+ allowUnrecognizedUnionMembers: true,
262
+ allowUnrecognizedEnumValues: true,
263
+ breadcrumbsPrefix: ["response"],
264
+ }));
265
+ case 400:
266
+ throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
244
267
  unrecognizedObjectKeys: "passthrough",
245
268
  allowUnrecognizedUnionMembers: true,
246
269
  allowUnrecognizedEnumValues: true,
247
270
  breadcrumbsPrefix: ["response"],
248
271
  }));
249
- case "IneligibleKnowledgeBaseError":
250
- throw new MavenAGI.IneligibleKnowledgeBaseError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
272
+ case 500:
273
+ throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
274
+ unrecognizedObjectKeys: "passthrough",
275
+ allowUnrecognizedUnionMembers: true,
276
+ allowUnrecognizedEnumValues: true,
277
+ breadcrumbsPrefix: ["response"],
278
+ }));
279
+ default:
280
+ throw new errors.MavenAGIError({
281
+ statusCode: _response.error.statusCode,
282
+ body: _response.error.body,
283
+ });
284
+ }
285
+ }
286
+ switch (_response.error.reason) {
287
+ case "non-json":
288
+ throw new errors.MavenAGIError({
289
+ statusCode: _response.error.statusCode,
290
+ body: _response.error.rawBody,
291
+ });
292
+ case "timeout":
293
+ throw new errors.MavenAGITimeoutError();
294
+ case "unknown":
295
+ throw new errors.MavenAGIError({
296
+ message: _response.error.errorMessage,
297
+ });
298
+ }
299
+ });
300
+ }
301
+ /**
302
+ * Finalize the latest knowledge base version. Required to indicate the version is complete. Will throw an exception if the latest version is not in progress.
303
+ *
304
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to finalize a version for. All other entity ID fields are inferred from the request.
305
+ * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
306
+ *
307
+ * @throws {@link MavenAGI.NotFoundError}
308
+ * @throws {@link MavenAGI.BadRequestError}
309
+ * @throws {@link MavenAGI.ServerError}
310
+ *
311
+ * @example
312
+ * await client.knowledge.finalizeKnowledgeBaseVersion("help-center")
313
+ */
314
+ finalizeKnowledgeBaseVersion(knowledgeBaseReferenceId, requestOptions) {
315
+ var _a, _b;
316
+ return __awaiter(this, void 0, void 0, function* () {
317
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
318
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/version/finalize`),
319
+ method: "POST",
320
+ headers: {
321
+ Authorization: yield this._getAuthorizationHeader(),
322
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
323
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
324
+ "X-Fern-Language": "JavaScript",
325
+ "X-Fern-SDK-Name": "mavenagi",
326
+ "X-Fern-SDK-Version": "0.0.0-alpha.21",
327
+ "User-Agent": "mavenagi/0.0.0-alpha.21",
328
+ "X-Fern-Runtime": core.RUNTIME.type,
329
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
330
+ },
331
+ contentType: "application/json",
332
+ requestType: "json",
333
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
334
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
335
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
336
+ });
337
+ if (_response.ok) {
338
+ return;
339
+ }
340
+ if (_response.error.reason === "status-code") {
341
+ switch (_response.error.statusCode) {
342
+ case 404:
343
+ throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
251
344
  unrecognizedObjectKeys: "passthrough",
252
345
  allowUnrecognizedUnionMembers: true,
253
346
  allowUnrecognizedEnumValues: true,
254
347
  breadcrumbsPrefix: ["response"],
255
348
  }));
256
- case "KnowledgeBaseNotFoundError":
257
- throw new MavenAGI.KnowledgeBaseNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
349
+ case 400:
350
+ throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
258
351
  unrecognizedObjectKeys: "passthrough",
259
352
  allowUnrecognizedUnionMembers: true,
260
353
  allowUnrecognizedEnumValues: true,
261
354
  breadcrumbsPrefix: ["response"],
262
355
  }));
263
- case "AgentNotFoundError":
264
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
356
+ case 500:
357
+ throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
265
358
  unrecognizedObjectKeys: "passthrough",
266
359
  allowUnrecognizedUnionMembers: true,
267
360
  allowUnrecognizedEnumValues: true,
@@ -290,35 +383,31 @@ export class Knowledge {
290
383
  });
291
384
  }
292
385
  /**
293
- * Create knowledge document
386
+ * Create knowledge document. Requires an existing knowledge base with an in progress version. Will throw an exception if the latest version is not in progress.
294
387
  *
295
- * @param {MavenAGI.KnowledgeDocument} request
388
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to create a document for. All other entity ID fields are inferred from the request.
389
+ * @param {MavenAGI.KnowledgeDocumentRequest} request
296
390
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
297
391
  *
298
- * @throws {@link MavenAGI.VersionNotInProgressError}
299
- * @throws {@link MavenAGI.IneligibleKnowledgeBaseError}
300
- * @throws {@link MavenAGI.KnowledgeBaseNotFoundError}
301
- * @throws {@link MavenAGI.DocumentCreationError}
302
- * @throws {@link MavenAGI.AgentNotFoundError}
392
+ * @throws {@link MavenAGI.NotFoundError}
393
+ * @throws {@link MavenAGI.BadRequestError}
394
+ * @throws {@link MavenAGI.ServerError}
303
395
  *
304
396
  * @example
305
- * await mavenAgi.knowledge.createKnowledgeDocument({
306
- * title: "string",
307
- * content: "string",
308
- * url: "string",
309
- * language: "string",
310
- * createdAt: new Date("2024-01-15T09:30:00.000Z"),
311
- * updatedAt: new Date("2024-01-15T09:30:00.000Z"),
312
- * author: "string",
313
- * knowledgeBaseId: "string",
314
- * documentId: "string"
397
+ * await client.knowledge.createKnowledgeDocument("help-center", {
398
+ * knowledgeDocumentId: {
399
+ * referenceId: "getting-started"
400
+ * },
401
+ * contentType: "MARKDOWN",
402
+ * content: "## Getting started\\nThis is a getting started guide for the help center.",
403
+ * title: "Getting started"
315
404
  * })
316
405
  */
317
- createKnowledgeDocument(request, requestOptions) {
318
- var _a, _b, _c;
406
+ createKnowledgeDocument(knowledgeBaseReferenceId, request, requestOptions) {
407
+ var _a, _b;
319
408
  return __awaiter(this, void 0, void 0, function* () {
320
409
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
321
- url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/document"),
410
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/document`),
322
411
  method: "POST",
323
412
  headers: {
324
413
  Authorization: yield this._getAuthorizationHeader(),
@@ -326,18 +415,20 @@ export class Knowledge {
326
415
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
327
416
  "X-Fern-Language": "JavaScript",
328
417
  "X-Fern-SDK-Name": "mavenagi",
329
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
418
+ "X-Fern-SDK-Version": "0.0.0-alpha.21",
419
+ "User-Agent": "mavenagi/0.0.0-alpha.21",
330
420
  "X-Fern-Runtime": core.RUNTIME.type,
331
421
  "X-Fern-Runtime-Version": core.RUNTIME.version,
332
422
  },
333
423
  contentType: "application/json",
334
- body: yield serializers.KnowledgeDocument.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
424
+ requestType: "json",
425
+ body: serializers.KnowledgeDocumentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
335
426
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
336
427
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
337
428
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
338
429
  });
339
430
  if (_response.ok) {
340
- return yield serializers.KnowledgeDocument.parseOrThrow(_response.body, {
431
+ return serializers.KnowledgeDocumentResponse.parseOrThrow(_response.body, {
341
432
  unrecognizedObjectKeys: "passthrough",
342
433
  allowUnrecognizedUnionMembers: true,
343
434
  allowUnrecognizedEnumValues: true,
@@ -345,32 +436,23 @@ export class Knowledge {
345
436
  });
346
437
  }
347
438
  if (_response.error.reason === "status-code") {
348
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
349
- case "VersionNotInProgressError":
350
- throw new MavenAGI.VersionNotInProgressError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
351
- unrecognizedObjectKeys: "passthrough",
352
- allowUnrecognizedUnionMembers: true,
353
- allowUnrecognizedEnumValues: true,
354
- breadcrumbsPrefix: ["response"],
355
- }));
356
- case "IneligibleKnowledgeBaseError":
357
- throw new MavenAGI.IneligibleKnowledgeBaseError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
439
+ switch (_response.error.statusCode) {
440
+ case 404:
441
+ throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
358
442
  unrecognizedObjectKeys: "passthrough",
359
443
  allowUnrecognizedUnionMembers: true,
360
444
  allowUnrecognizedEnumValues: true,
361
445
  breadcrumbsPrefix: ["response"],
362
446
  }));
363
- case "KnowledgeBaseNotFoundError":
364
- throw new MavenAGI.KnowledgeBaseNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
447
+ case 400:
448
+ throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
365
449
  unrecognizedObjectKeys: "passthrough",
366
450
  allowUnrecognizedUnionMembers: true,
367
451
  allowUnrecognizedEnumValues: true,
368
452
  breadcrumbsPrefix: ["response"],
369
453
  }));
370
- case "DocumentCreationError":
371
- throw new MavenAGI.DocumentCreationError();
372
- case "AgentNotFoundError":
373
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
454
+ case 500:
455
+ throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
374
456
  unrecognizedObjectKeys: "passthrough",
375
457
  allowUnrecognizedUnionMembers: true,
376
458
  allowUnrecognizedEnumValues: true,
@@ -399,34 +481,31 @@ export class Knowledge {
399
481
  });
400
482
  }
401
483
  /**
402
- * Update knowledge document
484
+ * Not yet implemented. Update knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
403
485
  *
404
- * @param {MavenAGI.KnowledgeDocument} request
486
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base that contains the document to update. All other entity ID fields are inferred from the request.
487
+ * @param {MavenAGI.KnowledgeDocumentRequest} request
405
488
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
406
489
  *
407
- * @throws {@link MavenAGI.VersionNotInProgressError}
408
- * @throws {@link MavenAGI.KnowledgeBaseNotFoundError}
409
- * @throws {@link MavenAGI.DocumentNotFoundError}
410
- * @throws {@link MavenAGI.AgentNotFoundError}
490
+ * @throws {@link MavenAGI.NotFoundError}
491
+ * @throws {@link MavenAGI.BadRequestError}
492
+ * @throws {@link MavenAGI.ServerError}
411
493
  *
412
494
  * @example
413
- * await mavenAgi.knowledge.updateKnowledgeDocument({
414
- * title: "string",
415
- * content: "string",
416
- * url: "string",
417
- * language: "string",
418
- * createdAt: new Date("2024-01-15T09:30:00.000Z"),
419
- * updatedAt: new Date("2024-01-15T09:30:00.000Z"),
420
- * author: "string",
421
- * knowledgeBaseId: "string",
422
- * documentId: "string"
495
+ * await client.knowledge.updateKnowledgeDocument("help-center", {
496
+ * knowledgeDocumentId: {
497
+ * referenceId: "getting-started"
498
+ * },
499
+ * contentType: "MARKDOWN",
500
+ * content: "## Getting started\\nThis is a getting started guide for the help center.",
501
+ * title: "Getting started"
423
502
  * })
424
503
  */
425
- updateKnowledgeDocument(request, requestOptions) {
426
- var _a, _b, _c;
504
+ updateKnowledgeDocument(knowledgeBaseReferenceId, request, requestOptions) {
505
+ var _a, _b;
427
506
  return __awaiter(this, void 0, void 0, function* () {
428
507
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
429
- url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/document"),
508
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/document`),
430
509
  method: "PUT",
431
510
  headers: {
432
511
  Authorization: yield this._getAuthorizationHeader(),
@@ -434,18 +513,20 @@ export class Knowledge {
434
513
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
435
514
  "X-Fern-Language": "JavaScript",
436
515
  "X-Fern-SDK-Name": "mavenagi",
437
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
516
+ "X-Fern-SDK-Version": "0.0.0-alpha.21",
517
+ "User-Agent": "mavenagi/0.0.0-alpha.21",
438
518
  "X-Fern-Runtime": core.RUNTIME.type,
439
519
  "X-Fern-Runtime-Version": core.RUNTIME.version,
440
520
  },
441
521
  contentType: "application/json",
442
- body: yield serializers.KnowledgeDocument.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
522
+ requestType: "json",
523
+ body: serializers.KnowledgeDocumentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
443
524
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
444
525
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
445
526
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
446
527
  });
447
528
  if (_response.ok) {
448
- return yield serializers.KnowledgeDocument.parseOrThrow(_response.body, {
529
+ return serializers.KnowledgeDocumentResponse.parseOrThrow(_response.body, {
449
530
  unrecognizedObjectKeys: "passthrough",
450
531
  allowUnrecognizedUnionMembers: true,
451
532
  allowUnrecognizedEnumValues: true,
@@ -453,30 +534,23 @@ export class Knowledge {
453
534
  });
454
535
  }
455
536
  if (_response.error.reason === "status-code") {
456
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
457
- case "VersionNotInProgressError":
458
- throw new MavenAGI.VersionNotInProgressError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
537
+ switch (_response.error.statusCode) {
538
+ case 404:
539
+ throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
459
540
  unrecognizedObjectKeys: "passthrough",
460
541
  allowUnrecognizedUnionMembers: true,
461
542
  allowUnrecognizedEnumValues: true,
462
543
  breadcrumbsPrefix: ["response"],
463
544
  }));
464
- case "KnowledgeBaseNotFoundError":
465
- throw new MavenAGI.KnowledgeBaseNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
545
+ case 400:
546
+ throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
466
547
  unrecognizedObjectKeys: "passthrough",
467
548
  allowUnrecognizedUnionMembers: true,
468
549
  allowUnrecognizedEnumValues: true,
469
550
  breadcrumbsPrefix: ["response"],
470
551
  }));
471
- case "DocumentNotFoundError":
472
- throw new MavenAGI.DocumentNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
473
- unrecognizedObjectKeys: "passthrough",
474
- allowUnrecognizedUnionMembers: true,
475
- allowUnrecognizedEnumValues: true,
476
- breadcrumbsPrefix: ["response"],
477
- }));
478
- case "AgentNotFoundError":
479
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
552
+ case 500:
553
+ throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
480
554
  unrecognizedObjectKeys: "passthrough",
481
555
  allowUnrecognizedUnionMembers: true,
482
556
  allowUnrecognizedEnumValues: true,
@@ -505,27 +579,24 @@ export class Knowledge {
505
579
  });
506
580
  }
507
581
  /**
508
- * Delete knowledge document
582
+ * Not yet implemented. Delete knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
509
583
  *
510
- * @param {MavenAGI.KnowledgeDocumentId} request
584
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base that contains the document to delete. All other entity ID fields are inferred from the request
585
+ * @param {string} knowledgeDocumentReferenceId - The reference ID of the knowledge document to delete. All other entity ID fields are inferred from the request.
511
586
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
512
587
  *
513
- * @throws {@link MavenAGI.VersionNotInProgressError}
514
- * @throws {@link MavenAGI.KnowledgeBaseNotFoundError}
515
- * @throws {@link MavenAGI.DocumentNotFoundError}
516
- * @throws {@link MavenAGI.AgentNotFoundError}
588
+ * @throws {@link MavenAGI.NotFoundError}
589
+ * @throws {@link MavenAGI.BadRequestError}
590
+ * @throws {@link MavenAGI.ServerError}
517
591
  *
518
592
  * @example
519
- * await mavenAgi.knowledge.deleteKnowledgeDocument({
520
- * knowledgeBaseId: "string",
521
- * documentId: "string"
522
- * })
593
+ * await client.knowledge.deleteKnowledgeDocument("help-center", "getting-started")
523
594
  */
524
- deleteKnowledgeDocument(request, requestOptions) {
525
- var _a, _b, _c;
595
+ deleteKnowledgeDocument(knowledgeBaseReferenceId, knowledgeDocumentReferenceId, requestOptions) {
596
+ var _a, _b;
526
597
  return __awaiter(this, void 0, void 0, function* () {
527
598
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
528
- url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/document"),
599
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/${encodeURIComponent(knowledgeDocumentReferenceId)}/document`),
529
600
  method: "DELETE",
530
601
  headers: {
531
602
  Authorization: yield this._getAuthorizationHeader(),
@@ -533,12 +604,13 @@ export class Knowledge {
533
604
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
534
605
  "X-Fern-Language": "JavaScript",
535
606
  "X-Fern-SDK-Name": "mavenagi",
536
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
607
+ "X-Fern-SDK-Version": "0.0.0-alpha.21",
608
+ "User-Agent": "mavenagi/0.0.0-alpha.21",
537
609
  "X-Fern-Runtime": core.RUNTIME.type,
538
610
  "X-Fern-Runtime-Version": core.RUNTIME.version,
539
611
  },
540
612
  contentType: "application/json",
541
- body: yield serializers.KnowledgeDocumentId.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
613
+ requestType: "json",
542
614
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
543
615
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
544
616
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -547,30 +619,23 @@ export class Knowledge {
547
619
  return;
548
620
  }
549
621
  if (_response.error.reason === "status-code") {
550
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
551
- case "VersionNotInProgressError":
552
- throw new MavenAGI.VersionNotInProgressError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
553
- unrecognizedObjectKeys: "passthrough",
554
- allowUnrecognizedUnionMembers: true,
555
- allowUnrecognizedEnumValues: true,
556
- breadcrumbsPrefix: ["response"],
557
- }));
558
- case "KnowledgeBaseNotFoundError":
559
- throw new MavenAGI.KnowledgeBaseNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
622
+ switch (_response.error.statusCode) {
623
+ case 404:
624
+ throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
560
625
  unrecognizedObjectKeys: "passthrough",
561
626
  allowUnrecognizedUnionMembers: true,
562
627
  allowUnrecognizedEnumValues: true,
563
628
  breadcrumbsPrefix: ["response"],
564
629
  }));
565
- case "DocumentNotFoundError":
566
- throw new MavenAGI.DocumentNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
630
+ case 400:
631
+ throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
567
632
  unrecognizedObjectKeys: "passthrough",
568
633
  allowUnrecognizedUnionMembers: true,
569
634
  allowUnrecognizedEnumValues: true,
570
635
  breadcrumbsPrefix: ["response"],
571
636
  }));
572
- case "AgentNotFoundError":
573
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
637
+ case 500:
638
+ throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
574
639
  unrecognizedObjectKeys: "passthrough",
575
640
  allowUnrecognizedUnionMembers: true,
576
641
  allowUnrecognizedEnumValues: true,