mavenagi 0.0.0-alpha.3 → 0.0.0-alpha.4

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 (282) hide show
  1. package/Client.d.ts +9 -6
  2. package/Client.js +13 -8
  3. package/README.md +57 -33
  4. package/api/resources/actions/client/Client.d.ts +123 -0
  5. package/api/resources/actions/client/Client.js +564 -0
  6. package/api/resources/{action → actions}/types/Action.d.ts +2 -2
  7. package/{dist/api/resources/actionSet → api/resources/actions}/types/ActionSetResponse.d.ts +0 -2
  8. package/api/resources/{actionSet → actions}/types/index.d.ts +2 -0
  9. package/{dist/serialization/resources/actionSet → api/resources/actions}/types/index.js +2 -0
  10. package/api/resources/commons/types/AppUser.d.ts +10 -0
  11. package/api/resources/commons/types/AppUserIdentification.d.ts +8 -0
  12. package/api/resources/commons/types/AppUserIdentifyingProperty.d.ts +9 -0
  13. package/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
  14. package/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
  15. package/api/resources/commons/types/Feedback.d.ts +1 -1
  16. package/api/resources/commons/types/index.d.ts +4 -0
  17. package/api/resources/commons/types/index.js +4 -0
  18. package/api/resources/conversation/client/Client.d.ts +8 -2
  19. package/api/resources/conversation/client/Client.js +16 -10
  20. package/api/resources/conversation/types/AskRequest.d.ts +2 -0
  21. package/api/resources/conversation/types/Capability.d.ts +8 -0
  22. package/api/resources/conversation/types/Capability.js +7 -0
  23. package/api/resources/conversation/types/ConversationBase.d.ts +2 -0
  24. package/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
  25. package/api/resources/conversation/types/ResponseLength.d.ts +9 -0
  26. package/api/resources/conversation/types/ResponseLength.js +8 -0
  27. package/api/resources/conversation/types/index.d.ts +3 -0
  28. package/api/resources/conversation/types/index.js +3 -0
  29. package/api/resources/index.d.ts +5 -4
  30. package/api/resources/index.js +5 -4
  31. package/api/resources/knowledge/client/Client.d.ts +22 -6
  32. package/api/resources/knowledge/client/Client.js +103 -14
  33. package/api/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +1 -3
  34. package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
  35. package/api/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +11 -0
  36. package/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
  37. package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +9 -0
  38. package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +8 -0
  39. package/api/resources/knowledge/types/index.d.ts +4 -1
  40. package/api/resources/knowledge/types/index.js +4 -1
  41. package/api/resources/{action → triggers}/client/Client.d.ts +23 -29
  42. package/api/resources/{actionSet → triggers}/client/Client.js +32 -31
  43. package/api/resources/triggers/types/EventTrigger.d.ts +12 -0
  44. package/api/resources/triggers/types/EventTrigger.js +4 -0
  45. package/api/resources/triggers/types/EventTriggerType.d.ts +8 -0
  46. package/api/resources/triggers/types/EventTriggerType.js +7 -0
  47. package/api/resources/triggers/types/index.d.ts +2 -0
  48. package/api/resources/triggers/types/index.js +2 -0
  49. package/api/resources/user/client/Client.d.ts +62 -0
  50. package/api/resources/{action → user}/client/Client.js +29 -113
  51. package/api/resources/user/index.d.ts +1 -0
  52. package/api/resources/user/index.js +1 -0
  53. package/dist/Client.d.ts +9 -6
  54. package/dist/Client.js +13 -8
  55. package/dist/api/resources/actions/client/Client.d.ts +123 -0
  56. package/dist/api/resources/actions/client/Client.js +564 -0
  57. package/dist/api/resources/{action → actions}/types/Action.d.ts +2 -2
  58. package/dist/api/resources/actions/types/Action.js +4 -0
  59. package/dist/api/resources/actions/types/ActionParameter.js +4 -0
  60. package/dist/api/resources/actions/types/ActionSetBase.js +4 -0
  61. package/dist/api/resources/actions/types/ActionSetRequest.js +4 -0
  62. package/{api/resources/actionSet → dist/api/resources/actions}/types/ActionSetResponse.d.ts +0 -2
  63. package/dist/api/resources/actions/types/ActionSetResponse.js +4 -0
  64. package/dist/{serialization/resources/actionSet → api/resources/actions}/types/index.d.ts +2 -0
  65. package/{api/resources/actionSet → dist/api/resources/actions}/types/index.js +2 -0
  66. package/dist/api/resources/commons/types/AppUser.d.ts +10 -0
  67. package/dist/api/resources/commons/types/AppUser.js +4 -0
  68. package/dist/api/resources/commons/types/AppUserIdentification.d.ts +8 -0
  69. package/dist/api/resources/commons/types/AppUserIdentification.js +4 -0
  70. package/dist/api/resources/commons/types/AppUserIdentifyingProperty.d.ts +9 -0
  71. package/dist/api/resources/commons/types/AppUserIdentifyingProperty.js +4 -0
  72. package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
  73. package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
  74. package/dist/api/resources/commons/types/Feedback.d.ts +1 -1
  75. package/dist/api/resources/commons/types/index.d.ts +4 -0
  76. package/dist/api/resources/commons/types/index.js +4 -0
  77. package/dist/api/resources/conversation/client/Client.d.ts +8 -2
  78. package/dist/api/resources/conversation/client/Client.js +16 -10
  79. package/dist/api/resources/conversation/types/AskRequest.d.ts +2 -0
  80. package/dist/api/resources/conversation/types/Capability.d.ts +8 -0
  81. package/dist/api/resources/conversation/types/Capability.js +7 -0
  82. package/dist/api/resources/conversation/types/ConversationBase.d.ts +2 -0
  83. package/dist/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
  84. package/dist/api/resources/conversation/types/ResponseConfig.js +4 -0
  85. package/dist/api/resources/conversation/types/ResponseLength.d.ts +9 -0
  86. package/dist/api/resources/conversation/types/ResponseLength.js +8 -0
  87. package/dist/api/resources/conversation/types/index.d.ts +3 -0
  88. package/dist/api/resources/conversation/types/index.js +3 -0
  89. package/dist/api/resources/index.d.ts +5 -4
  90. package/dist/api/resources/index.js +5 -4
  91. package/dist/api/resources/knowledge/client/Client.d.ts +22 -6
  92. package/dist/api/resources/knowledge/client/Client.js +103 -14
  93. package/dist/api/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +1 -3
  94. package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
  95. package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
  96. package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +11 -0
  97. package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
  98. package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +9 -0
  99. package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
  100. package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +8 -0
  101. package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
  102. package/dist/api/resources/knowledge/types/index.d.ts +4 -1
  103. package/dist/api/resources/knowledge/types/index.js +4 -1
  104. package/dist/api/resources/{action → triggers}/client/Client.d.ts +23 -29
  105. package/dist/api/resources/{actionSet → triggers}/client/Client.js +32 -31
  106. package/dist/api/resources/triggers/client/index.d.ts +1 -0
  107. package/dist/api/resources/triggers/client/index.js +1 -0
  108. package/dist/api/resources/triggers/types/EventTrigger.d.ts +12 -0
  109. package/dist/api/resources/triggers/types/EventTrigger.js +4 -0
  110. package/dist/api/resources/triggers/types/EventTriggerType.d.ts +8 -0
  111. package/dist/api/resources/triggers/types/EventTriggerType.js +7 -0
  112. package/dist/api/resources/triggers/types/index.d.ts +2 -0
  113. package/dist/api/resources/triggers/types/index.js +2 -0
  114. package/dist/api/resources/user/client/Client.d.ts +62 -0
  115. package/dist/api/resources/{action → user}/client/Client.js +29 -113
  116. package/dist/api/resources/user/client/index.d.ts +1 -0
  117. package/dist/api/resources/user/client/index.js +1 -0
  118. package/dist/api/resources/user/index.d.ts +1 -0
  119. package/dist/api/resources/user/index.js +1 -0
  120. package/dist/serialization/resources/{actionSet → actions}/types/ActionSetResponse.d.ts +0 -2
  121. package/dist/serialization/resources/actions/types/ActionSetResponse.js +6 -0
  122. package/dist/{api/resources/actionSet → serialization/resources/actions}/types/index.d.ts +2 -0
  123. package/{serialization/resources/actionSet → dist/serialization/resources/actions}/types/index.js +2 -0
  124. package/dist/serialization/resources/commons/types/AppUser.d.ts +15 -0
  125. package/dist/serialization/resources/commons/types/AppUser.js +10 -0
  126. package/dist/serialization/resources/commons/types/AppUserIdentification.d.ts +13 -0
  127. package/dist/serialization/resources/commons/types/AppUserIdentification.js +8 -0
  128. package/dist/serialization/resources/commons/types/AppUserIdentifyingProperty.d.ts +14 -0
  129. package/dist/serialization/resources/commons/types/AppUserIdentifyingProperty.js +9 -0
  130. package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
  131. package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
  132. package/dist/serialization/resources/commons/types/Feedback.d.ts +1 -1
  133. package/dist/serialization/resources/commons/types/Feedback.js +1 -1
  134. package/dist/serialization/resources/commons/types/index.d.ts +4 -0
  135. package/dist/serialization/resources/commons/types/index.js +4 -0
  136. package/dist/serialization/resources/conversation/types/AskRequest.d.ts +2 -0
  137. package/dist/serialization/resources/conversation/types/AskRequest.js +2 -0
  138. package/dist/serialization/resources/conversation/types/Capability.d.ts +10 -0
  139. package/dist/serialization/resources/conversation/types/Capability.js +5 -0
  140. package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +2 -0
  141. package/dist/serialization/resources/conversation/types/ConversationBase.js +2 -0
  142. package/dist/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
  143. package/dist/serialization/resources/conversation/types/ResponseConfig.js +11 -0
  144. package/dist/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
  145. package/dist/serialization/resources/conversation/types/ResponseLength.js +5 -0
  146. package/dist/serialization/resources/conversation/types/index.d.ts +3 -0
  147. package/dist/serialization/resources/conversation/types/index.js +3 -0
  148. package/dist/serialization/resources/index.d.ts +4 -4
  149. package/dist/serialization/resources/index.js +4 -4
  150. package/dist/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +4 -5
  151. package/dist/serialization/resources/knowledge/types/{KnowledgeDocument.js → BaseKnowledgeDocument.js} +3 -4
  152. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +10 -0
  153. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
  154. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +15 -0
  155. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +12 -0
  156. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +13 -0
  157. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +10 -0
  158. package/dist/serialization/resources/knowledge/types/index.d.ts +4 -1
  159. package/dist/serialization/resources/knowledge/types/index.js +4 -1
  160. package/dist/serialization/resources/triggers/types/EventTrigger.d.ts +15 -0
  161. package/dist/serialization/resources/triggers/types/EventTrigger.js +10 -0
  162. package/dist/serialization/resources/triggers/types/EventTriggerType.d.ts +10 -0
  163. package/dist/serialization/resources/triggers/types/EventTriggerType.js +5 -0
  164. package/dist/serialization/resources/triggers/types/index.d.ts +2 -0
  165. package/dist/serialization/resources/triggers/types/index.js +2 -0
  166. package/package.json +1 -1
  167. package/serialization/resources/{actionSet → actions}/types/ActionSetResponse.d.ts +0 -2
  168. package/serialization/resources/actions/types/ActionSetResponse.js +6 -0
  169. package/serialization/resources/{actionSet → actions}/types/index.d.ts +2 -0
  170. package/{dist/api/resources/actionSet → serialization/resources/actions}/types/index.js +2 -0
  171. package/serialization/resources/commons/types/AppUser.d.ts +15 -0
  172. package/serialization/resources/commons/types/AppUser.js +10 -0
  173. package/serialization/resources/commons/types/AppUserIdentification.d.ts +13 -0
  174. package/serialization/resources/commons/types/AppUserIdentification.js +8 -0
  175. package/serialization/resources/commons/types/AppUserIdentifyingProperty.d.ts +14 -0
  176. package/serialization/resources/commons/types/AppUserIdentifyingProperty.js +9 -0
  177. package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
  178. package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
  179. package/serialization/resources/commons/types/Feedback.d.ts +1 -1
  180. package/serialization/resources/commons/types/Feedback.js +1 -1
  181. package/serialization/resources/commons/types/index.d.ts +4 -0
  182. package/serialization/resources/commons/types/index.js +4 -0
  183. package/serialization/resources/conversation/types/AskRequest.d.ts +2 -0
  184. package/serialization/resources/conversation/types/AskRequest.js +2 -0
  185. package/serialization/resources/conversation/types/Capability.d.ts +10 -0
  186. package/serialization/resources/conversation/types/Capability.js +5 -0
  187. package/serialization/resources/conversation/types/ConversationBase.d.ts +2 -0
  188. package/serialization/resources/conversation/types/ConversationBase.js +2 -0
  189. package/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
  190. package/serialization/resources/conversation/types/ResponseConfig.js +11 -0
  191. package/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
  192. package/serialization/resources/conversation/types/ResponseLength.js +5 -0
  193. package/serialization/resources/conversation/types/index.d.ts +3 -0
  194. package/serialization/resources/conversation/types/index.js +3 -0
  195. package/serialization/resources/index.d.ts +4 -4
  196. package/serialization/resources/index.js +4 -4
  197. package/serialization/resources/knowledge/types/{KnowledgeDocument.d.ts → BaseKnowledgeDocument.d.ts} +4 -5
  198. package/serialization/resources/knowledge/types/{KnowledgeDocument.js → BaseKnowledgeDocument.js} +3 -4
  199. package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.d.ts +10 -0
  200. package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
  201. package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +15 -0
  202. package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +12 -0
  203. package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +13 -0
  204. package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +10 -0
  205. package/serialization/resources/knowledge/types/index.d.ts +4 -1
  206. package/serialization/resources/knowledge/types/index.js +4 -1
  207. package/serialization/resources/triggers/types/EventTrigger.d.ts +15 -0
  208. package/serialization/resources/triggers/types/EventTrigger.js +10 -0
  209. package/serialization/resources/triggers/types/EventTriggerType.d.ts +10 -0
  210. package/serialization/resources/triggers/types/EventTriggerType.js +5 -0
  211. package/serialization/resources/triggers/types/index.d.ts +2 -0
  212. package/serialization/resources/triggers/types/index.js +2 -0
  213. package/api/resources/action/types/index.d.ts +0 -2
  214. package/api/resources/action/types/index.js +0 -2
  215. package/api/resources/actionSet/client/Client.d.ts +0 -71
  216. package/dist/api/resources/action/types/index.d.ts +0 -2
  217. package/dist/api/resources/action/types/index.js +0 -2
  218. package/dist/api/resources/actionSet/client/Client.d.ts +0 -71
  219. package/dist/serialization/resources/action/types/index.d.ts +0 -2
  220. package/dist/serialization/resources/action/types/index.js +0 -2
  221. package/dist/serialization/resources/actionSet/types/ActionSetResponse.js +0 -11
  222. package/serialization/resources/action/types/index.d.ts +0 -2
  223. package/serialization/resources/action/types/index.js +0 -2
  224. package/serialization/resources/actionSet/types/ActionSetResponse.js +0 -11
  225. /package/api/resources/{action → actions}/client/index.d.ts +0 -0
  226. /package/api/resources/{action → actions}/client/index.js +0 -0
  227. /package/api/resources/{action → actions}/index.d.ts +0 -0
  228. /package/api/resources/{action → actions}/index.js +0 -0
  229. /package/api/resources/{action → actions}/types/Action.js +0 -0
  230. /package/api/resources/{action → actions}/types/ActionParameter.d.ts +0 -0
  231. /package/api/resources/{action → actions}/types/ActionParameter.js +0 -0
  232. /package/api/resources/{actionSet → actions}/types/ActionSetBase.d.ts +0 -0
  233. /package/api/resources/{actionSet → actions}/types/ActionSetBase.js +0 -0
  234. /package/api/resources/{actionSet → actions}/types/ActionSetRequest.d.ts +0 -0
  235. /package/api/resources/{actionSet → actions}/types/ActionSetRequest.js +0 -0
  236. /package/api/resources/{actionSet → actions}/types/ActionSetResponse.js +0 -0
  237. /package/api/resources/{knowledge/types/KnowledgeDocument.js → commons/types/AppUser.js} +0 -0
  238. /package/{dist/api/resources/action/types/Action.js → api/resources/commons/types/AppUserIdentification.js} +0 -0
  239. /package/{dist/api/resources/action/types/ActionParameter.js → api/resources/commons/types/AppUserIdentifyingProperty.js} +0 -0
  240. /package/{dist/api/resources/actionSet/types/ActionSetBase.js → api/resources/conversation/types/ResponseConfig.js} +0 -0
  241. /package/{dist/api/resources/actionSet/types/ActionSetRequest.js → api/resources/knowledge/types/BaseKnowledgeDocument.js} +0 -0
  242. /package/{dist/api/resources/actionSet/types/ActionSetResponse.js → api/resources/knowledge/types/KnowledgeDocumentRequest.js} +0 -0
  243. /package/{dist/api/resources/knowledge/types/KnowledgeDocument.js → api/resources/knowledge/types/KnowledgeDocumentResponse.js} +0 -0
  244. /package/api/resources/{actionSet → triggers}/client/index.d.ts +0 -0
  245. /package/api/resources/{actionSet → triggers}/client/index.js +0 -0
  246. /package/api/resources/{actionSet → triggers}/index.d.ts +0 -0
  247. /package/api/resources/{actionSet → triggers}/index.js +0 -0
  248. /package/{dist/api/resources/action → api/resources/user}/client/index.d.ts +0 -0
  249. /package/{dist/api/resources/action → api/resources/user}/client/index.js +0 -0
  250. /package/dist/api/resources/{actionSet → actions}/client/index.d.ts +0 -0
  251. /package/dist/api/resources/{actionSet → actions}/client/index.js +0 -0
  252. /package/dist/api/resources/{action → actions}/index.d.ts +0 -0
  253. /package/dist/api/resources/{action → actions}/index.js +0 -0
  254. /package/dist/api/resources/{action → actions}/types/ActionParameter.d.ts +0 -0
  255. /package/dist/api/resources/{actionSet → actions}/types/ActionSetBase.d.ts +0 -0
  256. /package/dist/api/resources/{actionSet → actions}/types/ActionSetRequest.d.ts +0 -0
  257. /package/dist/api/resources/{actionSet → triggers}/index.d.ts +0 -0
  258. /package/dist/api/resources/{actionSet → triggers}/index.js +0 -0
  259. /package/dist/serialization/resources/{action → actions}/index.d.ts +0 -0
  260. /package/dist/serialization/resources/{action → actions}/index.js +0 -0
  261. /package/dist/serialization/resources/{action → actions}/types/Action.d.ts +0 -0
  262. /package/dist/serialization/resources/{action → actions}/types/Action.js +0 -0
  263. /package/dist/serialization/resources/{action → actions}/types/ActionParameter.d.ts +0 -0
  264. /package/dist/serialization/resources/{action → actions}/types/ActionParameter.js +0 -0
  265. /package/dist/serialization/resources/{actionSet → actions}/types/ActionSetBase.d.ts +0 -0
  266. /package/dist/serialization/resources/{actionSet → actions}/types/ActionSetBase.js +0 -0
  267. /package/dist/serialization/resources/{actionSet → actions}/types/ActionSetRequest.d.ts +0 -0
  268. /package/dist/serialization/resources/{actionSet → actions}/types/ActionSetRequest.js +0 -0
  269. /package/dist/serialization/resources/{actionSet → triggers}/index.d.ts +0 -0
  270. /package/dist/serialization/resources/{actionSet → triggers}/index.js +0 -0
  271. /package/serialization/resources/{action → actions}/index.d.ts +0 -0
  272. /package/serialization/resources/{action → actions}/index.js +0 -0
  273. /package/serialization/resources/{action → actions}/types/Action.d.ts +0 -0
  274. /package/serialization/resources/{action → actions}/types/Action.js +0 -0
  275. /package/serialization/resources/{action → actions}/types/ActionParameter.d.ts +0 -0
  276. /package/serialization/resources/{action → actions}/types/ActionParameter.js +0 -0
  277. /package/serialization/resources/{actionSet → actions}/types/ActionSetBase.d.ts +0 -0
  278. /package/serialization/resources/{actionSet → actions}/types/ActionSetBase.js +0 -0
  279. /package/serialization/resources/{actionSet → actions}/types/ActionSetRequest.d.ts +0 -0
  280. /package/serialization/resources/{actionSet → actions}/types/ActionSetRequest.js +0 -0
  281. /package/serialization/resources/{actionSet → triggers}/index.d.ts +0 -0
  282. /package/serialization/resources/{actionSet → triggers}/index.js +0 -0
@@ -0,0 +1,564 @@
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 * as serializers from "../../../../serialization/index";
17
+ import urlJoin from "url-join";
18
+ import * as errors from "../../../../errors/index";
19
+ export class Actions {
20
+ constructor(_options) {
21
+ this._options = _options;
22
+ }
23
+ /**
24
+ * Update an action set or create it if it doesn't exist
25
+ *
26
+ * @param {MavenAGI.ActionSetRequest} request
27
+ * @param {Actions.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.actions.createActionSet({
35
+ * id: "string",
36
+ * name: "string"
37
+ * })
38
+ */
39
+ createActionSet(request, requestOptions) {
40
+ var _a, _b;
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
43
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/actions/sets"),
44
+ method: "POST",
45
+ headers: {
46
+ Authorization: yield this._getAuthorizationHeader(),
47
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
48
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
49
+ "X-Fern-Language": "JavaScript",
50
+ "X-Fern-SDK-Name": "mavenagi",
51
+ "X-Fern-SDK-Version": "0.0.0-alpha.4",
52
+ "X-Fern-Runtime": core.RUNTIME.type,
53
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
54
+ },
55
+ contentType: "application/json",
56
+ body: yield serializers.ActionSetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
57
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
58
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
59
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
60
+ });
61
+ if (_response.ok) {
62
+ return yield serializers.ActionSetResponse.parseOrThrow(_response.body, {
63
+ unrecognizedObjectKeys: "passthrough",
64
+ allowUnrecognizedUnionMembers: true,
65
+ allowUnrecognizedEnumValues: true,
66
+ breadcrumbsPrefix: ["response"],
67
+ });
68
+ }
69
+ if (_response.error.reason === "status-code") {
70
+ switch (_response.error.statusCode) {
71
+ case 404:
72
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
73
+ unrecognizedObjectKeys: "passthrough",
74
+ allowUnrecognizedUnionMembers: true,
75
+ allowUnrecognizedEnumValues: true,
76
+ breadcrumbsPrefix: ["response"],
77
+ }));
78
+ case 400:
79
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
80
+ unrecognizedObjectKeys: "passthrough",
81
+ allowUnrecognizedUnionMembers: true,
82
+ allowUnrecognizedEnumValues: true,
83
+ breadcrumbsPrefix: ["response"],
84
+ }));
85
+ case 500:
86
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
87
+ unrecognizedObjectKeys: "passthrough",
88
+ allowUnrecognizedUnionMembers: true,
89
+ allowUnrecognizedEnumValues: true,
90
+ breadcrumbsPrefix: ["response"],
91
+ }));
92
+ default:
93
+ throw new errors.MavenAGIError({
94
+ statusCode: _response.error.statusCode,
95
+ body: _response.error.body,
96
+ });
97
+ }
98
+ }
99
+ switch (_response.error.reason) {
100
+ case "non-json":
101
+ throw new errors.MavenAGIError({
102
+ statusCode: _response.error.statusCode,
103
+ body: _response.error.rawBody,
104
+ });
105
+ case "timeout":
106
+ throw new errors.MavenAGITimeoutError();
107
+ case "unknown":
108
+ throw new errors.MavenAGIError({
109
+ message: _response.error.errorMessage,
110
+ });
111
+ }
112
+ });
113
+ }
114
+ /**
115
+ * Get an action set by its supplied ID
116
+ *
117
+ * @param {string} actionSetId - The ID of the action set to get
118
+ * @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
119
+ *
120
+ * @throws {@link MavenAGI.NotFoundError}
121
+ * @throws {@link MavenAGI.BadRequestError}
122
+ * @throws {@link MavenAGI.ServerError}
123
+ *
124
+ * @example
125
+ * await client.actions.getActionSet("string")
126
+ */
127
+ getActionSet(actionSetId, requestOptions) {
128
+ var _a, _b;
129
+ return __awaiter(this, void 0, void 0, function* () {
130
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
131
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/sets/${encodeURIComponent(actionSetId)}`),
132
+ method: "GET",
133
+ headers: {
134
+ Authorization: yield this._getAuthorizationHeader(),
135
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
136
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
137
+ "X-Fern-Language": "JavaScript",
138
+ "X-Fern-SDK-Name": "mavenagi",
139
+ "X-Fern-SDK-Version": "0.0.0-alpha.4",
140
+ "X-Fern-Runtime": core.RUNTIME.type,
141
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
142
+ },
143
+ contentType: "application/json",
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 {Actions.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.actions.deleteActionSet("string")
213
+ */
214
+ deleteActionSet(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/actions/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.4",
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
+ /**
284
+ * Update an action or create it if it doesn't exist
285
+ *
286
+ * @param {MavenAGI.Action} request
287
+ * @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
288
+ *
289
+ * @throws {@link MavenAGI.NotFoundError}
290
+ * @throws {@link MavenAGI.BadRequestError}
291
+ * @throws {@link MavenAGI.ServerError}
292
+ *
293
+ * @example
294
+ * await client.actions.registerAction({
295
+ * id: "string",
296
+ * actionSetId: "string",
297
+ * appId: "string",
298
+ * name: "string",
299
+ * description: "string",
300
+ * userInteractionRequired: true,
301
+ * buttonName: "string",
302
+ * requiredUserContextFieldNames: new Set(["string"]),
303
+ * userFormParameters: [{}]
304
+ * })
305
+ */
306
+ registerAction(request, requestOptions) {
307
+ var _a, _b;
308
+ return __awaiter(this, void 0, void 0, function* () {
309
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
310
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/actions"),
311
+ method: "PUT",
312
+ headers: {
313
+ Authorization: yield this._getAuthorizationHeader(),
314
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
315
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
316
+ "X-Fern-Language": "JavaScript",
317
+ "X-Fern-SDK-Name": "mavenagi",
318
+ "X-Fern-SDK-Version": "0.0.0-alpha.4",
319
+ "X-Fern-Runtime": core.RUNTIME.type,
320
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
321
+ },
322
+ contentType: "application/json",
323
+ body: yield serializers.Action.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
324
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
325
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
326
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
327
+ });
328
+ if (_response.ok) {
329
+ return yield serializers.Action.parseOrThrow(_response.body, {
330
+ unrecognizedObjectKeys: "passthrough",
331
+ allowUnrecognizedUnionMembers: true,
332
+ allowUnrecognizedEnumValues: true,
333
+ breadcrumbsPrefix: ["response"],
334
+ });
335
+ }
336
+ if (_response.error.reason === "status-code") {
337
+ switch (_response.error.statusCode) {
338
+ case 404:
339
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
340
+ unrecognizedObjectKeys: "passthrough",
341
+ allowUnrecognizedUnionMembers: true,
342
+ allowUnrecognizedEnumValues: true,
343
+ breadcrumbsPrefix: ["response"],
344
+ }));
345
+ case 400:
346
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
347
+ unrecognizedObjectKeys: "passthrough",
348
+ allowUnrecognizedUnionMembers: true,
349
+ allowUnrecognizedEnumValues: true,
350
+ breadcrumbsPrefix: ["response"],
351
+ }));
352
+ case 500:
353
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
354
+ unrecognizedObjectKeys: "passthrough",
355
+ allowUnrecognizedUnionMembers: true,
356
+ allowUnrecognizedEnumValues: true,
357
+ breadcrumbsPrefix: ["response"],
358
+ }));
359
+ default:
360
+ throw new errors.MavenAGIError({
361
+ statusCode: _response.error.statusCode,
362
+ body: _response.error.body,
363
+ });
364
+ }
365
+ }
366
+ switch (_response.error.reason) {
367
+ case "non-json":
368
+ throw new errors.MavenAGIError({
369
+ statusCode: _response.error.statusCode,
370
+ body: _response.error.rawBody,
371
+ });
372
+ case "timeout":
373
+ throw new errors.MavenAGITimeoutError();
374
+ case "unknown":
375
+ throw new errors.MavenAGIError({
376
+ message: _response.error.errorMessage,
377
+ });
378
+ }
379
+ });
380
+ }
381
+ /**
382
+ * Get an action by its supplied ID
383
+ *
384
+ * @param {string} actionId - The ID of the action to get
385
+ * @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
386
+ *
387
+ * @throws {@link MavenAGI.NotFoundError}
388
+ * @throws {@link MavenAGI.BadRequestError}
389
+ * @throws {@link MavenAGI.ServerError}
390
+ *
391
+ * @example
392
+ * await client.actions.getAction("string")
393
+ */
394
+ getAction(actionId, requestOptions) {
395
+ var _a, _b;
396
+ return __awaiter(this, void 0, void 0, function* () {
397
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
398
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/${encodeURIComponent(actionId)}`),
399
+ method: "GET",
400
+ headers: {
401
+ Authorization: yield this._getAuthorizationHeader(),
402
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
403
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
404
+ "X-Fern-Language": "JavaScript",
405
+ "X-Fern-SDK-Name": "mavenagi",
406
+ "X-Fern-SDK-Version": "0.0.0-alpha.4",
407
+ "X-Fern-Runtime": core.RUNTIME.type,
408
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
409
+ },
410
+ contentType: "application/json",
411
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
412
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
413
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
414
+ });
415
+ if (_response.ok) {
416
+ return yield serializers.Action.parseOrThrow(_response.body, {
417
+ unrecognizedObjectKeys: "passthrough",
418
+ allowUnrecognizedUnionMembers: true,
419
+ allowUnrecognizedEnumValues: true,
420
+ breadcrumbsPrefix: ["response"],
421
+ });
422
+ }
423
+ if (_response.error.reason === "status-code") {
424
+ switch (_response.error.statusCode) {
425
+ case 404:
426
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
427
+ unrecognizedObjectKeys: "passthrough",
428
+ allowUnrecognizedUnionMembers: true,
429
+ allowUnrecognizedEnumValues: true,
430
+ breadcrumbsPrefix: ["response"],
431
+ }));
432
+ case 400:
433
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
434
+ unrecognizedObjectKeys: "passthrough",
435
+ allowUnrecognizedUnionMembers: true,
436
+ allowUnrecognizedEnumValues: true,
437
+ breadcrumbsPrefix: ["response"],
438
+ }));
439
+ case 500:
440
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
441
+ unrecognizedObjectKeys: "passthrough",
442
+ allowUnrecognizedUnionMembers: true,
443
+ allowUnrecognizedEnumValues: true,
444
+ breadcrumbsPrefix: ["response"],
445
+ }));
446
+ default:
447
+ throw new errors.MavenAGIError({
448
+ statusCode: _response.error.statusCode,
449
+ body: _response.error.body,
450
+ });
451
+ }
452
+ }
453
+ switch (_response.error.reason) {
454
+ case "non-json":
455
+ throw new errors.MavenAGIError({
456
+ statusCode: _response.error.statusCode,
457
+ body: _response.error.rawBody,
458
+ });
459
+ case "timeout":
460
+ throw new errors.MavenAGITimeoutError();
461
+ case "unknown":
462
+ throw new errors.MavenAGIError({
463
+ message: _response.error.errorMessage,
464
+ });
465
+ }
466
+ });
467
+ }
468
+ /**
469
+ * Delete an action
470
+ *
471
+ * @param {string} actionId - The ID of the action to delete
472
+ * @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
473
+ *
474
+ * @throws {@link MavenAGI.NotFoundError}
475
+ * @throws {@link MavenAGI.BadRequestError}
476
+ * @throws {@link MavenAGI.ServerError}
477
+ *
478
+ * @example
479
+ * await client.actions.deleteAction("string")
480
+ */
481
+ deleteAction(actionId, requestOptions) {
482
+ var _a, _b;
483
+ return __awaiter(this, void 0, void 0, function* () {
484
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
485
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/${encodeURIComponent(actionId)}`),
486
+ method: "DELETE",
487
+ headers: {
488
+ Authorization: yield this._getAuthorizationHeader(),
489
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
490
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
491
+ "X-Fern-Language": "JavaScript",
492
+ "X-Fern-SDK-Name": "mavenagi",
493
+ "X-Fern-SDK-Version": "0.0.0-alpha.4",
494
+ "X-Fern-Runtime": core.RUNTIME.type,
495
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
496
+ },
497
+ contentType: "application/json",
498
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
499
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
500
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
501
+ });
502
+ if (_response.ok) {
503
+ return;
504
+ }
505
+ if (_response.error.reason === "status-code") {
506
+ switch (_response.error.statusCode) {
507
+ case 404:
508
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
509
+ unrecognizedObjectKeys: "passthrough",
510
+ allowUnrecognizedUnionMembers: true,
511
+ allowUnrecognizedEnumValues: true,
512
+ breadcrumbsPrefix: ["response"],
513
+ }));
514
+ case 400:
515
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
516
+ unrecognizedObjectKeys: "passthrough",
517
+ allowUnrecognizedUnionMembers: true,
518
+ allowUnrecognizedEnumValues: true,
519
+ breadcrumbsPrefix: ["response"],
520
+ }));
521
+ case 500:
522
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
523
+ unrecognizedObjectKeys: "passthrough",
524
+ allowUnrecognizedUnionMembers: true,
525
+ allowUnrecognizedEnumValues: true,
526
+ breadcrumbsPrefix: ["response"],
527
+ }));
528
+ default:
529
+ throw new errors.MavenAGIError({
530
+ statusCode: _response.error.statusCode,
531
+ body: _response.error.body,
532
+ });
533
+ }
534
+ }
535
+ switch (_response.error.reason) {
536
+ case "non-json":
537
+ throw new errors.MavenAGIError({
538
+ statusCode: _response.error.statusCode,
539
+ body: _response.error.rawBody,
540
+ });
541
+ case "timeout":
542
+ throw new errors.MavenAGITimeoutError();
543
+ case "unknown":
544
+ throw new errors.MavenAGIError({
545
+ message: _response.error.errorMessage,
546
+ });
547
+ }
548
+ });
549
+ }
550
+ _getAuthorizationHeader() {
551
+ var _a, _b;
552
+ return __awaiter(this, void 0, void 0, function* () {
553
+ 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"];
554
+ 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"];
555
+ if (appId != null && appSecret != null) {
556
+ return core.BasicAuth.toAuthorizationHeader({
557
+ username: appId,
558
+ password: appSecret,
559
+ });
560
+ }
561
+ return undefined;
562
+ });
563
+ }
564
+ }
@@ -11,11 +11,11 @@ export interface Action {
11
11
  appId: string;
12
12
  /** The name of the action */
13
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. */
14
+ /** The description of the action. This helps Maven decide when to trigger the action and is not displayed directly to the end user. */
15
15
  description: string;
16
16
  /** Whether the action requires user interaction to execute */
17
17
  userInteractionRequired: boolean;
18
- /** The name of the button that submits the action */
18
+ /** When user interaction is required, the name of the button that is shown to the end user to execute the action */
19
19
  buttonName?: string;
20
20
  /** The names of the user context fields required by the action */
21
21
  requiredUserContextFieldNames: Set<string>;
@@ -3,6 +3,4 @@
3
3
  */
4
4
  import * as MavenAGI from "../../../index";
5
5
  export interface ActionSetResponse extends MavenAGI.ActionSetBase {
6
- /** The actions in this action set */
7
- actions: MavenAGI.Action[];
8
6
  }
@@ -1,3 +1,5 @@
1
1
  export * from "./ActionSetBase";
2
2
  export * from "./ActionSetRequest";
3
3
  export * from "./ActionSetResponse";
4
+ export * from "./Action";
5
+ export * from "./ActionParameter";
@@ -1,3 +1,5 @@
1
1
  export * from "./ActionSetBase";
2
2
  export * from "./ActionSetRequest";
3
3
  export * from "./ActionSetResponse";
4
+ export * from "./Action";
5
+ export * from "./ActionParameter";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as MavenAGI from "../../../index";
5
+ export interface AppUser {
6
+ /** Externally supplied unique ID of the user */
7
+ id: string;
8
+ userIdentifiers?: MavenAGI.AppUserIdentification;
9
+ metadata?: Record<string, string>;
10
+ }
@@ -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 AppUserIdentification {
6
+ /** At least one identifying property must be provided. etc */
7
+ identifiers: MavenAGI.AppUserIdentifyingProperty[];
8
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as MavenAGI from "../../../index";
5
+ export interface AppUserIdentifyingProperty {
6
+ /** The identifying property text */
7
+ value: string;
8
+ userIdentifyingPropertyType: MavenAGI.AppUserIdentifyingPropertyType;
9
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export declare type AppUserIdentifyingPropertyType = "EMAIL" | "PHONE_NUMBER";
5
+ export declare const AppUserIdentifyingPropertyType: {
6
+ readonly Email: "EMAIL";
7
+ readonly PhoneNumber: "PHONE_NUMBER";
8
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export const AppUserIdentifyingPropertyType = {
5
+ Email: "EMAIL",
6
+ PhoneNumber: "PHONE_NUMBER",
7
+ };
@@ -12,5 +12,5 @@ export interface Feedback {
12
12
  /** The type of feedback */
13
13
  type: MavenAGI.FeedbackType;
14
14
  /** The feedback text */
15
- text: string;
15
+ text?: string;
16
16
  }
@@ -2,3 +2,7 @@ export * from "./ErrorMessage";
2
2
  export * from "./User";
3
3
  export * from "./FeedbackType";
4
4
  export * from "./Feedback";
5
+ export * from "./AppUserIdentification";
6
+ export * from "./AppUserIdentifyingProperty";
7
+ export * from "./AppUserIdentifyingPropertyType";
8
+ export * from "./AppUser";