mavenagi 0.0.0-alpha.2 → 0.0.0-alpha.3

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 (274) hide show
  1. package/Client.d.ts +6 -0
  2. package/Client.js +10 -0
  3. package/README.md +11 -11
  4. package/api/resources/action/client/Client.d.ts +78 -0
  5. package/api/resources/action/client/Client.js +304 -0
  6. package/api/resources/action/client/index.d.ts +1 -0
  7. package/api/resources/action/client/index.js +1 -0
  8. package/api/resources/action/index.d.ts +2 -0
  9. package/api/resources/action/index.js +2 -0
  10. package/api/resources/action/types/Action.d.ts +23 -0
  11. package/api/resources/action/types/ActionParameter.d.ts +8 -0
  12. package/api/resources/action/types/index.d.ts +2 -0
  13. package/api/resources/action/types/index.js +2 -0
  14. package/api/resources/actionSet/client/Client.d.ts +71 -0
  15. package/api/resources/actionSet/client/Client.js +297 -0
  16. package/api/resources/actionSet/client/index.d.ts +1 -0
  17. package/api/resources/actionSet/client/index.js +1 -0
  18. package/api/resources/actionSet/index.d.ts +2 -0
  19. package/api/resources/actionSet/index.js +2 -0
  20. package/api/resources/actionSet/types/ActionSetBase.d.ts +9 -0
  21. package/{dist/api/resources/knowledge/types/IdBody.d.ts → api/resources/actionSet/types/ActionSetBase.js} +1 -3
  22. package/api/resources/actionSet/types/ActionSetRequest.d.ts +6 -0
  23. package/api/resources/{knowledge/types/IdBody.d.ts → actionSet/types/ActionSetRequest.js} +1 -3
  24. package/api/resources/actionSet/types/ActionSetResponse.d.ts +8 -0
  25. package/api/resources/actionSet/types/ActionSetResponse.js +4 -0
  26. package/api/resources/actionSet/types/index.d.ts +3 -0
  27. package/api/resources/actionSet/types/index.js +3 -0
  28. package/api/resources/commons/errors/{AgentNotFoundError.d.ts → BadRequestError.d.ts} +1 -1
  29. package/api/resources/{conversation/errors/EmptyConversationError.js → commons/errors/BadRequestError.js} +3 -3
  30. package/{dist/api/resources/commons/errors/AgentNotFoundError.d.ts → api/resources/commons/errors/NotFoundError.d.ts} +1 -1
  31. package/{dist/api/resources/commons/errors/AgentNotFoundError.js → api/resources/commons/errors/NotFoundError.js} +3 -3
  32. package/{dist/api/resources/conversation/errors/EmptyConversationError.d.ts → api/resources/commons/errors/ServerError.d.ts} +1 -1
  33. package/api/resources/commons/errors/ServerError.js +14 -0
  34. package/api/resources/commons/errors/index.d.ts +3 -1
  35. package/api/resources/commons/errors/index.js +3 -1
  36. package/api/resources/commons/types/Feedback.d.ts +16 -0
  37. package/api/resources/commons/types/Feedback.js +4 -0
  38. package/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
  39. package/{dist/api/resources/conversation → api/resources/commons}/types/FeedbackType.js +2 -0
  40. package/api/resources/commons/types/User.d.ts +1 -0
  41. package/api/resources/commons/types/index.d.ts +2 -0
  42. package/api/resources/commons/types/index.js +2 -0
  43. package/api/resources/conversation/client/Client.d.ts +61 -29
  44. package/api/resources/conversation/client/Client.js +215 -109
  45. package/api/resources/conversation/index.d.ts +0 -1
  46. package/api/resources/conversation/index.js +0 -1
  47. package/api/resources/conversation/types/ActionExecutionRequest.d.ts +10 -0
  48. package/api/resources/conversation/types/ActionExecutionRequest.js +4 -0
  49. package/api/resources/conversation/types/ActionExecutionResponse.d.ts +7 -0
  50. package/api/resources/conversation/types/ActionExecutionResponse.js +4 -0
  51. package/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
  52. package/api/resources/conversation/types/FeedbackRequest.d.ts +1 -8
  53. package/api/resources/conversation/types/UserMessage.d.ts +1 -0
  54. package/api/resources/conversation/types/index.d.ts +2 -1
  55. package/api/resources/conversation/types/index.js +2 -1
  56. package/api/resources/index.d.ts +4 -2
  57. package/api/resources/index.js +4 -2
  58. package/api/resources/knowledge/client/Client.d.ts +30 -34
  59. package/api/resources/knowledge/client/Client.js +94 -121
  60. package/api/resources/knowledge/index.d.ts +0 -1
  61. package/api/resources/knowledge/index.js +0 -1
  62. package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +1 -1
  63. package/api/resources/knowledge/types/KnowledgeDocument.d.ts +1 -1
  64. package/api/resources/knowledge/types/index.d.ts +0 -1
  65. package/api/resources/knowledge/types/index.js +0 -1
  66. package/core/index.d.ts +1 -1
  67. package/core/index.js +1 -1
  68. package/dist/Client.d.ts +6 -0
  69. package/dist/Client.js +10 -0
  70. package/dist/api/resources/action/client/Client.d.ts +78 -0
  71. package/dist/api/resources/action/client/Client.js +304 -0
  72. package/dist/api/resources/action/client/index.d.ts +1 -0
  73. package/dist/api/resources/action/client/index.js +1 -0
  74. package/dist/api/resources/action/index.d.ts +2 -0
  75. package/dist/api/resources/action/index.js +2 -0
  76. package/dist/api/resources/action/types/Action.d.ts +23 -0
  77. package/dist/api/resources/action/types/Action.js +4 -0
  78. package/dist/api/resources/action/types/ActionParameter.d.ts +8 -0
  79. package/dist/api/resources/action/types/ActionParameter.js +4 -0
  80. package/dist/api/resources/action/types/index.d.ts +2 -0
  81. package/dist/api/resources/action/types/index.js +2 -0
  82. package/dist/api/resources/actionSet/client/Client.d.ts +71 -0
  83. package/dist/api/resources/actionSet/client/Client.js +297 -0
  84. package/dist/api/resources/actionSet/client/index.d.ts +1 -0
  85. package/dist/api/resources/actionSet/client/index.js +1 -0
  86. package/dist/api/resources/actionSet/index.d.ts +2 -0
  87. package/dist/api/resources/actionSet/index.js +2 -0
  88. package/dist/api/resources/actionSet/types/ActionSetBase.d.ts +9 -0
  89. package/dist/api/resources/actionSet/types/ActionSetBase.js +4 -0
  90. package/dist/api/resources/actionSet/types/ActionSetRequest.d.ts +6 -0
  91. package/dist/api/resources/actionSet/types/ActionSetRequest.js +4 -0
  92. package/dist/api/resources/actionSet/types/ActionSetResponse.d.ts +8 -0
  93. package/dist/api/resources/actionSet/types/ActionSetResponse.js +4 -0
  94. package/dist/api/resources/actionSet/types/index.d.ts +3 -0
  95. package/dist/api/resources/actionSet/types/index.js +3 -0
  96. package/{api/resources/conversation/errors/EmptyConversationError.d.ts → dist/api/resources/commons/errors/BadRequestError.d.ts} +1 -1
  97. package/dist/api/resources/{knowledge/errors/VersionInProgressError.js → commons/errors/BadRequestError.js} +3 -3
  98. package/dist/api/resources/commons/errors/NotFoundError.d.ts +8 -0
  99. package/{api/resources/commons/errors/AgentNotFoundError.js → dist/api/resources/commons/errors/NotFoundError.js} +3 -3
  100. package/dist/api/resources/commons/errors/ServerError.d.ts +8 -0
  101. package/dist/api/resources/commons/errors/ServerError.js +14 -0
  102. package/dist/api/resources/commons/errors/index.d.ts +3 -1
  103. package/dist/api/resources/commons/errors/index.js +3 -1
  104. package/dist/api/resources/commons/types/Feedback.d.ts +16 -0
  105. package/dist/api/resources/commons/types/Feedback.js +4 -0
  106. package/dist/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
  107. package/{api/resources/conversation → dist/api/resources/commons}/types/FeedbackType.js +2 -0
  108. package/dist/api/resources/commons/types/User.d.ts +1 -0
  109. package/dist/api/resources/commons/types/index.d.ts +2 -0
  110. package/dist/api/resources/commons/types/index.js +2 -0
  111. package/dist/api/resources/conversation/client/Client.d.ts +61 -29
  112. package/dist/api/resources/conversation/client/Client.js +215 -109
  113. package/dist/api/resources/conversation/index.d.ts +0 -1
  114. package/dist/api/resources/conversation/index.js +0 -1
  115. package/dist/api/resources/conversation/types/ActionExecutionRequest.d.ts +10 -0
  116. package/dist/api/resources/conversation/types/ActionExecutionRequest.js +4 -0
  117. package/dist/api/resources/conversation/types/ActionExecutionResponse.d.ts +7 -0
  118. package/dist/api/resources/conversation/types/ActionExecutionResponse.js +4 -0
  119. package/dist/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
  120. package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +1 -8
  121. package/dist/api/resources/conversation/types/UserMessage.d.ts +1 -0
  122. package/dist/api/resources/conversation/types/index.d.ts +2 -1
  123. package/dist/api/resources/conversation/types/index.js +2 -1
  124. package/dist/api/resources/index.d.ts +4 -2
  125. package/dist/api/resources/index.js +4 -2
  126. package/dist/api/resources/knowledge/client/Client.d.ts +30 -34
  127. package/dist/api/resources/knowledge/client/Client.js +94 -121
  128. package/dist/api/resources/knowledge/index.d.ts +0 -1
  129. package/dist/api/resources/knowledge/index.js +0 -1
  130. package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +1 -1
  131. package/dist/api/resources/knowledge/types/KnowledgeDocument.d.ts +1 -1
  132. package/dist/api/resources/knowledge/types/index.d.ts +0 -1
  133. package/dist/api/resources/knowledge/types/index.js +0 -1
  134. package/dist/core/index.d.ts +1 -1
  135. package/dist/core/index.js +1 -1
  136. package/dist/serialization/resources/action/index.d.ts +1 -0
  137. package/dist/serialization/resources/action/index.js +1 -0
  138. package/dist/serialization/resources/action/types/Action.d.ts +21 -0
  139. package/dist/serialization/resources/action/types/Action.js +16 -0
  140. package/dist/serialization/resources/action/types/ActionParameter.d.ts +14 -0
  141. package/dist/serialization/resources/action/types/ActionParameter.js +9 -0
  142. package/dist/serialization/resources/action/types/index.d.ts +2 -0
  143. package/dist/serialization/resources/action/types/index.js +2 -0
  144. package/dist/serialization/resources/actionSet/index.d.ts +1 -0
  145. package/dist/serialization/resources/actionSet/index.js +1 -0
  146. package/dist/serialization/resources/{knowledge/types/IdBody.d.ts → actionSet/types/ActionSetBase.d.ts} +4 -3
  147. package/dist/serialization/resources/actionSet/types/ActionSetBase.js +8 -0
  148. package/dist/serialization/resources/actionSet/types/ActionSetRequest.d.ts +12 -0
  149. package/dist/serialization/resources/actionSet/types/ActionSetRequest.js +6 -0
  150. package/dist/serialization/resources/actionSet/types/ActionSetResponse.d.ts +14 -0
  151. package/dist/serialization/resources/actionSet/types/ActionSetResponse.js +11 -0
  152. package/dist/serialization/resources/actionSet/types/index.d.ts +3 -0
  153. package/dist/serialization/resources/actionSet/types/index.js +3 -0
  154. package/dist/serialization/resources/commons/types/Feedback.d.ts +17 -0
  155. package/dist/serialization/resources/commons/types/Feedback.js +12 -0
  156. package/dist/serialization/resources/{conversation → commons}/types/FeedbackType.d.ts +1 -1
  157. package/dist/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
  158. package/dist/serialization/resources/commons/types/User.d.ts +1 -0
  159. package/dist/serialization/resources/commons/types/User.js +1 -0
  160. package/dist/serialization/resources/commons/types/index.d.ts +2 -0
  161. package/dist/serialization/resources/commons/types/index.js +2 -0
  162. package/dist/serialization/resources/conversation/types/ActionExecutionRequest.d.ts +15 -0
  163. package/dist/serialization/resources/conversation/types/ActionExecutionRequest.js +10 -0
  164. package/dist/serialization/resources/conversation/types/ActionExecutionResponse.d.ts +12 -0
  165. package/dist/serialization/resources/{knowledge/types/IdBody.js → conversation/types/ActionExecutionResponse.js} +2 -2
  166. package/dist/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
  167. package/dist/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
  168. package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +2 -6
  169. package/dist/serialization/resources/conversation/types/FeedbackRequest.js +2 -7
  170. package/dist/serialization/resources/conversation/types/index.d.ts +2 -1
  171. package/dist/serialization/resources/conversation/types/index.js +2 -1
  172. package/dist/serialization/resources/index.d.ts +4 -0
  173. package/dist/serialization/resources/index.js +4 -0
  174. package/dist/serialization/resources/knowledge/types/index.d.ts +0 -1
  175. package/dist/serialization/resources/knowledge/types/index.js +0 -1
  176. package/package.json +1 -1
  177. package/serialization/resources/action/index.d.ts +1 -0
  178. package/serialization/resources/action/index.js +1 -0
  179. package/serialization/resources/action/types/Action.d.ts +21 -0
  180. package/serialization/resources/action/types/Action.js +16 -0
  181. package/serialization/resources/action/types/ActionParameter.d.ts +14 -0
  182. package/serialization/resources/action/types/ActionParameter.js +9 -0
  183. package/serialization/resources/action/types/index.d.ts +2 -0
  184. package/serialization/resources/action/types/index.js +2 -0
  185. package/serialization/resources/actionSet/index.d.ts +1 -0
  186. package/serialization/resources/actionSet/index.js +1 -0
  187. package/serialization/resources/{knowledge/types/IdBody.d.ts → actionSet/types/ActionSetBase.d.ts} +4 -3
  188. package/serialization/resources/actionSet/types/ActionSetBase.js +8 -0
  189. package/serialization/resources/actionSet/types/ActionSetRequest.d.ts +12 -0
  190. package/serialization/resources/actionSet/types/ActionSetRequest.js +6 -0
  191. package/serialization/resources/actionSet/types/ActionSetResponse.d.ts +14 -0
  192. package/serialization/resources/actionSet/types/ActionSetResponse.js +11 -0
  193. package/serialization/resources/actionSet/types/index.d.ts +3 -0
  194. package/serialization/resources/actionSet/types/index.js +3 -0
  195. package/serialization/resources/commons/types/Feedback.d.ts +17 -0
  196. package/serialization/resources/commons/types/Feedback.js +12 -0
  197. package/serialization/resources/{conversation → commons}/types/FeedbackType.d.ts +1 -1
  198. package/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
  199. package/serialization/resources/commons/types/User.d.ts +1 -0
  200. package/serialization/resources/commons/types/User.js +1 -0
  201. package/serialization/resources/commons/types/index.d.ts +2 -0
  202. package/serialization/resources/commons/types/index.js +2 -0
  203. package/serialization/resources/conversation/types/ActionExecutionRequest.d.ts +15 -0
  204. package/serialization/resources/conversation/types/ActionExecutionRequest.js +10 -0
  205. package/serialization/resources/conversation/types/ActionExecutionResponse.d.ts +12 -0
  206. package/serialization/resources/{knowledge/types/IdBody.js → conversation/types/ActionExecutionResponse.js} +2 -2
  207. package/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
  208. package/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
  209. package/serialization/resources/conversation/types/FeedbackRequest.d.ts +2 -6
  210. package/serialization/resources/conversation/types/FeedbackRequest.js +2 -7
  211. package/serialization/resources/conversation/types/index.d.ts +2 -1
  212. package/serialization/resources/conversation/types/index.js +2 -1
  213. package/serialization/resources/index.d.ts +4 -0
  214. package/serialization/resources/index.js +4 -0
  215. package/serialization/resources/knowledge/types/index.d.ts +0 -1
  216. package/serialization/resources/knowledge/types/index.js +0 -1
  217. package/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
  218. package/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
  219. package/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
  220. package/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
  221. package/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
  222. package/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
  223. package/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
  224. package/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
  225. package/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
  226. package/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
  227. package/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
  228. package/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
  229. package/api/resources/conversation/errors/index.d.ts +0 -7
  230. package/api/resources/conversation/errors/index.js +0 -7
  231. package/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
  232. package/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
  233. package/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
  234. package/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
  235. package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
  236. package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
  237. package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
  238. package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
  239. package/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
  240. package/api/resources/knowledge/errors/VersionInProgressError.js +0 -14
  241. package/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
  242. package/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
  243. package/api/resources/knowledge/errors/index.d.ts +0 -6
  244. package/api/resources/knowledge/errors/index.js +0 -6
  245. package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
  246. package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
  247. package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
  248. package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
  249. package/dist/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
  250. package/dist/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
  251. package/dist/api/resources/conversation/errors/EmptyConversationError.js +0 -14
  252. package/dist/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
  253. package/dist/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
  254. package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
  255. package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
  256. package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
  257. package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
  258. package/dist/api/resources/conversation/errors/index.d.ts +0 -7
  259. package/dist/api/resources/conversation/errors/index.js +0 -7
  260. package/dist/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
  261. package/dist/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
  262. package/dist/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
  263. package/dist/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
  264. package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
  265. package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
  266. package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
  267. package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
  268. package/dist/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
  269. package/dist/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
  270. package/dist/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
  271. package/dist/api/resources/knowledge/errors/index.d.ts +0 -6
  272. package/dist/api/resources/knowledge/errors/index.js +0 -6
  273. /package/api/resources/{knowledge/types/IdBody.js → action/types/Action.js} +0 -0
  274. /package/{dist/api/resources/knowledge/types/IdBody.js → api/resources/action/types/ActionParameter.js} +0 -0
@@ -0,0 +1,297 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import * as environments from "../../../../environments";
14
+ import * as core from "../../../../core";
15
+ import * as MavenAGI from "../../../index";
16
+ import urlJoin from "url-join";
17
+ import * as serializers from "../../../../serialization/index";
18
+ import * as errors from "../../../../errors/index";
19
+ export class ActionSet {
20
+ constructor(_options) {
21
+ this._options = _options;
22
+ }
23
+ /**
24
+ * Get an action set by its supplied ID
25
+ *
26
+ * @param {string} actionSetId - The ID of the action set to get
27
+ * @param {ActionSet.RequestOptions} requestOptions - Request-specific configuration.
28
+ *
29
+ * @throws {@link MavenAGI.NotFoundError}
30
+ * @throws {@link MavenAGI.BadRequestError}
31
+ * @throws {@link MavenAGI.ServerError}
32
+ *
33
+ * @example
34
+ * await client.actionSet.get("string")
35
+ */
36
+ get(actionSetId, requestOptions) {
37
+ var _a, _b;
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
40
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/action-sets/${encodeURIComponent(actionSetId)}`),
41
+ method: "GET",
42
+ headers: {
43
+ Authorization: yield this._getAuthorizationHeader(),
44
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
45
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
46
+ "X-Fern-Language": "JavaScript",
47
+ "X-Fern-SDK-Name": "mavenagi",
48
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
49
+ "X-Fern-Runtime": core.RUNTIME.type,
50
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
51
+ },
52
+ contentType: "application/json",
53
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
54
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
55
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
56
+ });
57
+ if (_response.ok) {
58
+ return yield serializers.ActionSetResponse.parseOrThrow(_response.body, {
59
+ unrecognizedObjectKeys: "passthrough",
60
+ allowUnrecognizedUnionMembers: true,
61
+ allowUnrecognizedEnumValues: true,
62
+ breadcrumbsPrefix: ["response"],
63
+ });
64
+ }
65
+ if (_response.error.reason === "status-code") {
66
+ switch (_response.error.statusCode) {
67
+ case 404:
68
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
69
+ unrecognizedObjectKeys: "passthrough",
70
+ allowUnrecognizedUnionMembers: true,
71
+ allowUnrecognizedEnumValues: true,
72
+ breadcrumbsPrefix: ["response"],
73
+ }));
74
+ case 400:
75
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
76
+ unrecognizedObjectKeys: "passthrough",
77
+ allowUnrecognizedUnionMembers: true,
78
+ allowUnrecognizedEnumValues: true,
79
+ breadcrumbsPrefix: ["response"],
80
+ }));
81
+ case 500:
82
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
83
+ unrecognizedObjectKeys: "passthrough",
84
+ allowUnrecognizedUnionMembers: true,
85
+ allowUnrecognizedEnumValues: true,
86
+ breadcrumbsPrefix: ["response"],
87
+ }));
88
+ default:
89
+ throw new errors.MavenAGIError({
90
+ statusCode: _response.error.statusCode,
91
+ body: _response.error.body,
92
+ });
93
+ }
94
+ }
95
+ switch (_response.error.reason) {
96
+ case "non-json":
97
+ throw new errors.MavenAGIError({
98
+ statusCode: _response.error.statusCode,
99
+ body: _response.error.rawBody,
100
+ });
101
+ case "timeout":
102
+ throw new errors.MavenAGITimeoutError();
103
+ case "unknown":
104
+ throw new errors.MavenAGIError({
105
+ message: _response.error.errorMessage,
106
+ });
107
+ }
108
+ });
109
+ }
110
+ /**
111
+ * Create an action set
112
+ *
113
+ * @param {MavenAGI.ActionSetRequest} request
114
+ * @param {ActionSet.RequestOptions} requestOptions - Request-specific configuration.
115
+ *
116
+ * @throws {@link MavenAGI.NotFoundError}
117
+ * @throws {@link MavenAGI.BadRequestError}
118
+ * @throws {@link MavenAGI.ServerError}
119
+ *
120
+ * @example
121
+ * await client.actionSet.create({
122
+ * id: "string",
123
+ * name: "string"
124
+ * })
125
+ */
126
+ create(request, requestOptions) {
127
+ var _a, _b;
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
130
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/action-sets"),
131
+ method: "POST",
132
+ headers: {
133
+ Authorization: yield this._getAuthorizationHeader(),
134
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
135
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
136
+ "X-Fern-Language": "JavaScript",
137
+ "X-Fern-SDK-Name": "mavenagi",
138
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
139
+ "X-Fern-Runtime": core.RUNTIME.type,
140
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
141
+ },
142
+ contentType: "application/json",
143
+ body: yield serializers.ActionSetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
144
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
145
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
146
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
147
+ });
148
+ if (_response.ok) {
149
+ return yield serializers.ActionSetResponse.parseOrThrow(_response.body, {
150
+ unrecognizedObjectKeys: "passthrough",
151
+ allowUnrecognizedUnionMembers: true,
152
+ allowUnrecognizedEnumValues: true,
153
+ breadcrumbsPrefix: ["response"],
154
+ });
155
+ }
156
+ if (_response.error.reason === "status-code") {
157
+ switch (_response.error.statusCode) {
158
+ case 404:
159
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
160
+ unrecognizedObjectKeys: "passthrough",
161
+ allowUnrecognizedUnionMembers: true,
162
+ allowUnrecognizedEnumValues: true,
163
+ breadcrumbsPrefix: ["response"],
164
+ }));
165
+ case 400:
166
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
167
+ unrecognizedObjectKeys: "passthrough",
168
+ allowUnrecognizedUnionMembers: true,
169
+ allowUnrecognizedEnumValues: true,
170
+ breadcrumbsPrefix: ["response"],
171
+ }));
172
+ case 500:
173
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
174
+ unrecognizedObjectKeys: "passthrough",
175
+ allowUnrecognizedUnionMembers: true,
176
+ allowUnrecognizedEnumValues: true,
177
+ breadcrumbsPrefix: ["response"],
178
+ }));
179
+ default:
180
+ throw new errors.MavenAGIError({
181
+ statusCode: _response.error.statusCode,
182
+ body: _response.error.body,
183
+ });
184
+ }
185
+ }
186
+ switch (_response.error.reason) {
187
+ case "non-json":
188
+ throw new errors.MavenAGIError({
189
+ statusCode: _response.error.statusCode,
190
+ body: _response.error.rawBody,
191
+ });
192
+ case "timeout":
193
+ throw new errors.MavenAGITimeoutError();
194
+ case "unknown":
195
+ throw new errors.MavenAGIError({
196
+ message: _response.error.errorMessage,
197
+ });
198
+ }
199
+ });
200
+ }
201
+ /**
202
+ * Delete an action set
203
+ *
204
+ * @param {string} actionSetId - The ID of the action set to delete
205
+ * @param {ActionSet.RequestOptions} requestOptions - Request-specific configuration.
206
+ *
207
+ * @throws {@link MavenAGI.NotFoundError}
208
+ * @throws {@link MavenAGI.BadRequestError}
209
+ * @throws {@link MavenAGI.ServerError}
210
+ *
211
+ * @example
212
+ * await client.actionSet.delete("string")
213
+ */
214
+ delete(actionSetId, requestOptions) {
215
+ var _a, _b;
216
+ return __awaiter(this, void 0, void 0, function* () {
217
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
218
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/action-sets/${encodeURIComponent(actionSetId)}`),
219
+ method: "DELETE",
220
+ headers: {
221
+ Authorization: yield this._getAuthorizationHeader(),
222
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
223
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
224
+ "X-Fern-Language": "JavaScript",
225
+ "X-Fern-SDK-Name": "mavenagi",
226
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
227
+ "X-Fern-Runtime": core.RUNTIME.type,
228
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
229
+ },
230
+ contentType: "application/json",
231
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
232
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
233
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
234
+ });
235
+ if (_response.ok) {
236
+ return;
237
+ }
238
+ if (_response.error.reason === "status-code") {
239
+ switch (_response.error.statusCode) {
240
+ case 404:
241
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
242
+ unrecognizedObjectKeys: "passthrough",
243
+ allowUnrecognizedUnionMembers: true,
244
+ allowUnrecognizedEnumValues: true,
245
+ breadcrumbsPrefix: ["response"],
246
+ }));
247
+ case 400:
248
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
249
+ unrecognizedObjectKeys: "passthrough",
250
+ allowUnrecognizedUnionMembers: true,
251
+ allowUnrecognizedEnumValues: true,
252
+ breadcrumbsPrefix: ["response"],
253
+ }));
254
+ case 500:
255
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
256
+ unrecognizedObjectKeys: "passthrough",
257
+ allowUnrecognizedUnionMembers: true,
258
+ allowUnrecognizedEnumValues: true,
259
+ breadcrumbsPrefix: ["response"],
260
+ }));
261
+ default:
262
+ throw new errors.MavenAGIError({
263
+ statusCode: _response.error.statusCode,
264
+ body: _response.error.body,
265
+ });
266
+ }
267
+ }
268
+ switch (_response.error.reason) {
269
+ case "non-json":
270
+ throw new errors.MavenAGIError({
271
+ statusCode: _response.error.statusCode,
272
+ body: _response.error.rawBody,
273
+ });
274
+ case "timeout":
275
+ throw new errors.MavenAGITimeoutError();
276
+ case "unknown":
277
+ throw new errors.MavenAGIError({
278
+ message: _response.error.errorMessage,
279
+ });
280
+ }
281
+ });
282
+ }
283
+ _getAuthorizationHeader() {
284
+ var _a, _b;
285
+ return __awaiter(this, void 0, void 0, function* () {
286
+ const appId = (_a = (yield core.Supplier.get(this._options.appId))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["MAVENAGI_APP_ID"];
287
+ const appSecret = (_b = (yield core.Supplier.get(this._options.appSecret))) !== null && _b !== void 0 ? _b : process === null || process === void 0 ? void 0 : process.env["MAVENAGI_APP_SECRET"];
288
+ if (appId != null && appSecret != null) {
289
+ return core.BasicAuth.toAuthorizationHeader({
290
+ username: appId,
291
+ password: appSecret,
292
+ });
293
+ }
294
+ return undefined;
295
+ });
296
+ }
297
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./types";
2
+ export * from "./client";
@@ -0,0 +1,2 @@
1
+ export * from "./types";
2
+ export * from "./client";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface ActionSetBase {
5
+ /** Externally supplied ID to uniquely identify this action set */
6
+ id: string;
7
+ /** The name of the action set */
8
+ name: string;
9
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as MavenAGI from "../../../index";
5
+ export interface ActionSetRequest extends MavenAGI.ActionSetBase {
6
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as MavenAGI from "../../../index";
5
+ export interface ActionSetResponse extends MavenAGI.ActionSetBase {
6
+ /** The actions in this action set */
7
+ actions: MavenAGI.Action[];
8
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from "./ActionSetBase";
2
+ export * from "./ActionSetRequest";
3
+ export * from "./ActionSetResponse";
@@ -0,0 +1,3 @@
1
+ export * from "./ActionSetBase";
2
+ export * from "./ActionSetRequest";
3
+ export * from "./ActionSetResponse";
@@ -3,6 +3,6 @@
3
3
  */
4
4
  import * as errors from "../../../../errors/index";
5
5
  import * as MavenAGI from "../../../index";
6
- export declare class EmptyConversationError extends errors.MavenAGIError {
6
+ export declare class BadRequestError extends errors.MavenAGIError {
7
7
  constructor(body: MavenAGI.ErrorMessage);
8
8
  }
@@ -2,13 +2,13 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../../../errors/index";
5
- export class VersionInProgressError extends errors.MavenAGIError {
5
+ export class BadRequestError extends errors.MavenAGIError {
6
6
  constructor(body) {
7
7
  super({
8
- message: "VersionInProgressError",
8
+ message: "BadRequestError",
9
9
  statusCode: 400,
10
10
  body: body,
11
11
  });
12
- Object.setPrototypeOf(this, VersionInProgressError.prototype);
12
+ Object.setPrototypeOf(this, BadRequestError.prototype);
13
13
  }
14
14
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as errors from "../../../../errors/index";
5
+ import * as MavenAGI from "../../../index";
6
+ export declare class NotFoundError extends errors.MavenAGIError {
7
+ constructor(body: MavenAGI.ErrorMessage);
8
+ }
@@ -2,13 +2,13 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../../../errors/index";
5
- export class AgentNotFoundError extends errors.MavenAGIError {
5
+ export class NotFoundError extends errors.MavenAGIError {
6
6
  constructor(body) {
7
7
  super({
8
- message: "AgentNotFoundError",
8
+ message: "NotFoundError",
9
9
  statusCode: 404,
10
10
  body: body,
11
11
  });
12
- Object.setPrototypeOf(this, AgentNotFoundError.prototype);
12
+ Object.setPrototypeOf(this, NotFoundError.prototype);
13
13
  }
14
14
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as errors from "../../../../errors/index";
5
+ import * as MavenAGI from "../../../index";
6
+ export declare class ServerError extends errors.MavenAGIError {
7
+ constructor(body: MavenAGI.ErrorMessage);
8
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as errors from "../../../../errors/index";
5
+ export class ServerError extends errors.MavenAGIError {
6
+ constructor(body) {
7
+ super({
8
+ message: "ServerError",
9
+ statusCode: 500,
10
+ body: body,
11
+ });
12
+ Object.setPrototypeOf(this, ServerError.prototype);
13
+ }
14
+ }
@@ -1 +1,3 @@
1
- export * from "./AgentNotFoundError";
1
+ export * from "./NotFoundError";
2
+ export * from "./BadRequestError";
3
+ export * from "./ServerError";
@@ -1 +1,3 @@
1
- export * from "./AgentNotFoundError";
1
+ export * from "./NotFoundError";
2
+ export * from "./BadRequestError";
3
+ export * from "./ServerError";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as MavenAGI from "../../../index";
5
+ export interface Feedback {
6
+ /** The ID of the piece of feedback */
7
+ id: string;
8
+ /** The ID of the conversation the feedback is about */
9
+ conversationId: string;
10
+ /** The ID of the conversation message the feedback is about */
11
+ conversationMessageId: string;
12
+ /** The type of feedback */
13
+ type: MavenAGI.FeedbackType;
14
+ /** The feedback text */
15
+ text: string;
16
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -4,8 +4,10 @@
4
4
  /**
5
5
  * The type of feedback
6
6
  */
7
- export declare type FeedbackType = "THUMBS_UP" | "THUMBS_DOWN";
7
+ export declare type FeedbackType = "THUMBS_UP" | "THUMBS_DOWN" | "INSERT" | "HANDOFF";
8
8
  export declare const FeedbackType: {
9
9
  readonly ThumbsUp: "THUMBS_UP";
10
10
  readonly ThumbsDown: "THUMBS_DOWN";
11
+ readonly Insert: "INSERT";
12
+ readonly Handoff: "HANDOFF";
11
13
  };
@@ -4,4 +4,6 @@
4
4
  export const FeedbackType = {
5
5
  ThumbsUp: "THUMBS_UP",
6
6
  ThumbsDown: "THUMBS_DOWN",
7
+ Insert: "INSERT",
8
+ Handoff: "HANDOFF",
7
9
  };
@@ -6,4 +6,5 @@ export interface User {
6
6
  /** The unique ID of the user */
7
7
  id?: Record<string, string>;
8
8
  email?: string;
9
+ context?: Record<string, string>;
9
10
  }
@@ -1,2 +1,4 @@
1
1
  export * from "./ErrorMessage";
2
2
  export * from "./User";
3
+ export * from "./FeedbackType";
4
+ export * from "./Feedback";
@@ -1,2 +1,4 @@
1
1
  export * from "./ErrorMessage";
2
2
  export * from "./User";
3
+ export * from "./FeedbackType";
4
+ export * from "./Feedback";