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,304 @@
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 Action {
20
+ constructor(_options) {
21
+ this._options = _options;
22
+ }
23
+ /**
24
+ * Get an action by its supplied ID
25
+ *
26
+ * @param {string} actionId - The ID of the action to get
27
+ * @param {Action.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.action.get("string")
35
+ */
36
+ get(actionId, 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/actions/${encodeURIComponent(actionId)}`),
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.Action.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
+ * Update an action or create it if it doesn't exist
112
+ *
113
+ * @param {MavenAGI.Action} request
114
+ * @param {Action.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.action.register({
122
+ * id: "string",
123
+ * actionSetId: "string",
124
+ * appId: "string",
125
+ * name: "string",
126
+ * description: "string",
127
+ * userInteractionRequired: true,
128
+ * buttonName: "string",
129
+ * requiredUserContextFieldNames: new Set(["string"]),
130
+ * userFormParameters: [{}]
131
+ * })
132
+ */
133
+ register(request, requestOptions) {
134
+ var _a, _b;
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
137
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/actions"),
138
+ method: "PUT",
139
+ headers: {
140
+ Authorization: yield this._getAuthorizationHeader(),
141
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
142
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
143
+ "X-Fern-Language": "JavaScript",
144
+ "X-Fern-SDK-Name": "mavenagi",
145
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
146
+ "X-Fern-Runtime": core.RUNTIME.type,
147
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
148
+ },
149
+ contentType: "application/json",
150
+ body: yield serializers.Action.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
151
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
152
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
153
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
154
+ });
155
+ if (_response.ok) {
156
+ return yield serializers.Action.parseOrThrow(_response.body, {
157
+ unrecognizedObjectKeys: "passthrough",
158
+ allowUnrecognizedUnionMembers: true,
159
+ allowUnrecognizedEnumValues: true,
160
+ breadcrumbsPrefix: ["response"],
161
+ });
162
+ }
163
+ if (_response.error.reason === "status-code") {
164
+ switch (_response.error.statusCode) {
165
+ case 404:
166
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
167
+ unrecognizedObjectKeys: "passthrough",
168
+ allowUnrecognizedUnionMembers: true,
169
+ allowUnrecognizedEnumValues: true,
170
+ breadcrumbsPrefix: ["response"],
171
+ }));
172
+ case 400:
173
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
174
+ unrecognizedObjectKeys: "passthrough",
175
+ allowUnrecognizedUnionMembers: true,
176
+ allowUnrecognizedEnumValues: true,
177
+ breadcrumbsPrefix: ["response"],
178
+ }));
179
+ case 500:
180
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
181
+ unrecognizedObjectKeys: "passthrough",
182
+ allowUnrecognizedUnionMembers: true,
183
+ allowUnrecognizedEnumValues: true,
184
+ breadcrumbsPrefix: ["response"],
185
+ }));
186
+ default:
187
+ throw new errors.MavenAGIError({
188
+ statusCode: _response.error.statusCode,
189
+ body: _response.error.body,
190
+ });
191
+ }
192
+ }
193
+ switch (_response.error.reason) {
194
+ case "non-json":
195
+ throw new errors.MavenAGIError({
196
+ statusCode: _response.error.statusCode,
197
+ body: _response.error.rawBody,
198
+ });
199
+ case "timeout":
200
+ throw new errors.MavenAGITimeoutError();
201
+ case "unknown":
202
+ throw new errors.MavenAGIError({
203
+ message: _response.error.errorMessage,
204
+ });
205
+ }
206
+ });
207
+ }
208
+ /**
209
+ * Delete an action
210
+ *
211
+ * @param {string} actionId - The ID of the action to delete
212
+ * @param {Action.RequestOptions} requestOptions - Request-specific configuration.
213
+ *
214
+ * @throws {@link MavenAGI.NotFoundError}
215
+ * @throws {@link MavenAGI.BadRequestError}
216
+ * @throws {@link MavenAGI.ServerError}
217
+ *
218
+ * @example
219
+ * await client.action.delete("string")
220
+ */
221
+ delete(actionId, requestOptions) {
222
+ var _a, _b;
223
+ return __awaiter(this, void 0, void 0, function* () {
224
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
225
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/${encodeURIComponent(actionId)}`),
226
+ method: "DELETE",
227
+ headers: {
228
+ Authorization: yield this._getAuthorizationHeader(),
229
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
230
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
231
+ "X-Fern-Language": "JavaScript",
232
+ "X-Fern-SDK-Name": "mavenagi",
233
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
234
+ "X-Fern-Runtime": core.RUNTIME.type,
235
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
236
+ },
237
+ contentType: "application/json",
238
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
239
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
240
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
241
+ });
242
+ if (_response.ok) {
243
+ return;
244
+ }
245
+ if (_response.error.reason === "status-code") {
246
+ switch (_response.error.statusCode) {
247
+ case 404:
248
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
249
+ unrecognizedObjectKeys: "passthrough",
250
+ allowUnrecognizedUnionMembers: true,
251
+ allowUnrecognizedEnumValues: true,
252
+ breadcrumbsPrefix: ["response"],
253
+ }));
254
+ case 400:
255
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
256
+ unrecognizedObjectKeys: "passthrough",
257
+ allowUnrecognizedUnionMembers: true,
258
+ allowUnrecognizedEnumValues: true,
259
+ breadcrumbsPrefix: ["response"],
260
+ }));
261
+ case 500:
262
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
263
+ unrecognizedObjectKeys: "passthrough",
264
+ allowUnrecognizedUnionMembers: true,
265
+ allowUnrecognizedEnumValues: true,
266
+ breadcrumbsPrefix: ["response"],
267
+ }));
268
+ default:
269
+ throw new errors.MavenAGIError({
270
+ statusCode: _response.error.statusCode,
271
+ body: _response.error.body,
272
+ });
273
+ }
274
+ }
275
+ switch (_response.error.reason) {
276
+ case "non-json":
277
+ throw new errors.MavenAGIError({
278
+ statusCode: _response.error.statusCode,
279
+ body: _response.error.rawBody,
280
+ });
281
+ case "timeout":
282
+ throw new errors.MavenAGITimeoutError();
283
+ case "unknown":
284
+ throw new errors.MavenAGIError({
285
+ message: _response.error.errorMessage,
286
+ });
287
+ }
288
+ });
289
+ }
290
+ _getAuthorizationHeader() {
291
+ var _a, _b;
292
+ return __awaiter(this, void 0, void 0, function* () {
293
+ 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"];
294
+ 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"];
295
+ if (appId != null && appSecret != null) {
296
+ return core.BasicAuth.toAuthorizationHeader({
297
+ username: appId,
298
+ password: appSecret,
299
+ });
300
+ }
301
+ return undefined;
302
+ });
303
+ }
304
+ }
@@ -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,23 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as MavenAGI from "../../../index";
5
+ export interface Action {
6
+ /** Externally supplied ID to uniquely identify this action */
7
+ id: string;
8
+ /** The ID of the action set this action belongs to. Must be an existing action set ID. */
9
+ actionSetId: string;
10
+ /** The maven app id of the app that runs this action */
11
+ appId: string;
12
+ /** The name of the action */
13
+ name: string;
14
+ /** The description of the action. This helps Maven decide when to trigger the action and is not displayed directly to the user. */
15
+ description: string;
16
+ /** Whether the action requires user interaction to execute */
17
+ userInteractionRequired: boolean;
18
+ /** The name of the button that submits the action */
19
+ buttonName?: string;
20
+ /** The names of the user context fields required by the action */
21
+ requiredUserContextFieldNames: Set<string>;
22
+ userFormParameters: MavenAGI.ActionParameter[];
23
+ }
@@ -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
+ export interface ActionParameter {
5
+ id: string;
6
+ description: string;
7
+ required: boolean;
8
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./Action";
2
+ export * from "./ActionParameter";
@@ -0,0 +1,2 @@
1
+ export * from "./Action";
2
+ export * from "./ActionParameter";
@@ -0,0 +1,71 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments";
5
+ import * as core from "../../../../core";
6
+ import * as MavenAGI from "../../../index";
7
+ export declare namespace ActionSet {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
10
+ appId?: core.Supplier<string | undefined>;
11
+ appSecret?: core.Supplier<string | undefined>;
12
+ organizationId: core.Supplier<string>;
13
+ agentId: core.Supplier<string>;
14
+ fetcher?: core.FetchFunction;
15
+ }
16
+ interface RequestOptions {
17
+ timeoutInSeconds?: number;
18
+ maxRetries?: number;
19
+ abortSignal?: AbortSignal;
20
+ }
21
+ }
22
+ export declare class ActionSet {
23
+ protected readonly _options: ActionSet.Options;
24
+ constructor(_options: ActionSet.Options);
25
+ /**
26
+ * Get an action set by its supplied ID
27
+ *
28
+ * @param {string} actionSetId - The ID of the action set to get
29
+ * @param {ActionSet.RequestOptions} requestOptions - Request-specific configuration.
30
+ *
31
+ * @throws {@link MavenAGI.NotFoundError}
32
+ * @throws {@link MavenAGI.BadRequestError}
33
+ * @throws {@link MavenAGI.ServerError}
34
+ *
35
+ * @example
36
+ * await client.actionSet.get("string")
37
+ */
38
+ get(actionSetId: string, requestOptions?: ActionSet.RequestOptions): Promise<MavenAGI.ActionSetResponse>;
39
+ /**
40
+ * Create an action set
41
+ *
42
+ * @param {MavenAGI.ActionSetRequest} request
43
+ * @param {ActionSet.RequestOptions} requestOptions - Request-specific configuration.
44
+ *
45
+ * @throws {@link MavenAGI.NotFoundError}
46
+ * @throws {@link MavenAGI.BadRequestError}
47
+ * @throws {@link MavenAGI.ServerError}
48
+ *
49
+ * @example
50
+ * await client.actionSet.create({
51
+ * id: "string",
52
+ * name: "string"
53
+ * })
54
+ */
55
+ create(request: MavenAGI.ActionSetRequest, requestOptions?: ActionSet.RequestOptions): Promise<MavenAGI.ActionSetResponse>;
56
+ /**
57
+ * Delete an action set
58
+ *
59
+ * @param {string} actionSetId - The ID of the action set to delete
60
+ * @param {ActionSet.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @throws {@link MavenAGI.NotFoundError}
63
+ * @throws {@link MavenAGI.BadRequestError}
64
+ * @throws {@link MavenAGI.ServerError}
65
+ *
66
+ * @example
67
+ * await client.actionSet.delete("string")
68
+ */
69
+ delete(actionSetId: string, requestOptions?: ActionSet.RequestOptions): Promise<void>;
70
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
71
+ }