agentmail 0.5.42 → 0.5.44

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 (245) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/calendar/types/UpdateCalendarEventRequest.d.ts +2 -1
  3. package/dist/cjs/api/resources/inboxes/resources/calendar/client/Client.d.ts +21 -21
  4. package/dist/cjs/api/resources/inboxes/resources/calendar/client/Client.js +21 -21
  5. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.d.ts +3 -0
  6. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.js +5 -0
  7. package/dist/cjs/api/resources/inboxes/resources/webhooks/exports.d.ts +1 -0
  8. package/dist/cjs/api/resources/inboxes/resources/webhooks/exports.js +1 -0
  9. package/dist/cjs/api/resources/inboxes/resources/webhooks/index.d.ts +1 -0
  10. package/dist/cjs/api/resources/inboxes/resources/webhooks/index.js +1 -0
  11. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/index.d.ts +2 -0
  12. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/index.js +41 -0
  13. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/Client.d.ts +89 -0
  14. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/Client.js +351 -0
  15. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/index.d.ts +1 -0
  16. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/index.js +17 -0
  17. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/InboxListPollingWebhooksRequest.d.ts +10 -0
  18. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/InboxListPollingWebhooksRequest.js +3 -0
  19. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/index.js +2 -0
  21. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/exports.d.ts +2 -0
  22. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/exports.js +21 -0
  23. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/index.d.ts +1 -0
  24. package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/index.js +17 -0
  25. package/dist/cjs/api/resources/index.d.ts +1 -0
  26. package/dist/cjs/api/resources/index.js +1 -0
  27. package/dist/cjs/api/resources/messages/types/MessageCalendarEventId.d.ts +1 -1
  28. package/dist/cjs/api/resources/organizations/client/Client.d.ts +41 -1
  29. package/dist/cjs/api/resources/organizations/client/Client.js +159 -0
  30. package/dist/cjs/api/resources/organizations/errors/OrganizationForbiddenError.d.ts +6 -0
  31. package/dist/cjs/api/resources/organizations/errors/OrganizationForbiddenError.js +54 -0
  32. package/dist/cjs/api/resources/organizations/errors/index.d.ts +1 -0
  33. package/dist/cjs/api/resources/organizations/errors/index.js +17 -0
  34. package/dist/cjs/api/resources/organizations/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/organizations/index.js +1 -0
  36. package/dist/cjs/api/resources/organizations/types/OrganizationLabs.d.ts +11 -0
  37. package/dist/cjs/api/resources/organizations/types/OrganizationLabs.js +3 -0
  38. package/dist/cjs/api/resources/organizations/types/index.d.ts +1 -0
  39. package/dist/cjs/api/resources/organizations/types/index.js +1 -0
  40. package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.d.ts +3 -0
  41. package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.js +5 -0
  42. package/dist/cjs/api/resources/pods/resources/webhooks/exports.d.ts +1 -0
  43. package/dist/cjs/api/resources/pods/resources/webhooks/exports.js +1 -0
  44. package/dist/cjs/api/resources/pods/resources/webhooks/index.d.ts +1 -0
  45. package/dist/cjs/api/resources/pods/resources/webhooks/index.js +1 -0
  46. package/dist/cjs/api/resources/pods/resources/webhooks/resources/index.d.ts +2 -0
  47. package/dist/cjs/api/resources/pods/resources/webhooks/resources/index.js +41 -0
  48. package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/Client.d.ts +89 -0
  49. package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/Client.js +351 -0
  50. package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/index.d.ts +1 -0
  51. package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/index.js +17 -0
  52. package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/requests/PodListPollingWebhooksRequest.d.ts +10 -0
  53. package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/requests/PodListPollingWebhooksRequest.js +3 -0
  54. package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/requests/index.d.ts +1 -0
  55. package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/requests/index.js +2 -0
  56. package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/exports.d.ts +2 -0
  57. package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/exports.js +21 -0
  58. package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/index.d.ts +1 -0
  59. package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/index.js +17 -0
  60. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +3 -0
  61. package/dist/cjs/api/resources/webhooks/client/Client.js +5 -0
  62. package/dist/cjs/api/resources/webhooks/resources/index.d.ts +3 -0
  63. package/dist/cjs/api/resources/webhooks/resources/index.js +4 -1
  64. package/dist/cjs/api/resources/webhooks/resources/polling/client/Client.d.ts +92 -0
  65. package/dist/cjs/api/resources/webhooks/resources/polling/client/Client.js +354 -0
  66. package/dist/cjs/api/resources/webhooks/resources/polling/client/index.d.ts +1 -0
  67. package/dist/cjs/api/resources/webhooks/resources/polling/client/index.js +17 -0
  68. package/dist/cjs/api/resources/webhooks/resources/polling/client/requests/ListPollingWebhooksRequest.d.ts +10 -0
  69. package/dist/cjs/api/resources/webhooks/resources/polling/client/requests/ListPollingWebhooksRequest.js +3 -0
  70. package/dist/cjs/api/resources/webhooks/resources/polling/client/requests/index.d.ts +1 -0
  71. package/dist/cjs/api/resources/webhooks/resources/polling/client/requests/index.js +2 -0
  72. package/dist/cjs/api/resources/webhooks/resources/polling/exports.d.ts +2 -0
  73. package/dist/cjs/api/resources/webhooks/resources/polling/exports.js +21 -0
  74. package/dist/cjs/api/resources/webhooks/resources/polling/index.d.ts +2 -0
  75. package/dist/cjs/api/resources/webhooks/resources/polling/index.js +18 -0
  76. package/dist/cjs/api/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.d.ts +9 -0
  77. package/dist/cjs/api/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.js +3 -0
  78. package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.d.ts +9 -0
  79. package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.js +3 -0
  80. package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.d.ts +9 -0
  81. package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.js +3 -0
  82. package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.d.ts +7 -0
  83. package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.js +3 -0
  84. package/dist/cjs/api/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.d.ts +12 -0
  85. package/dist/cjs/api/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.js +3 -0
  86. package/dist/cjs/api/resources/webhooks/resources/polling/types/PollingClientId.d.ts +7 -0
  87. package/dist/cjs/api/resources/webhooks/resources/polling/types/PollingClientId.js +3 -0
  88. package/dist/cjs/api/resources/webhooks/resources/polling/types/PollingToken.d.ts +8 -0
  89. package/dist/cjs/api/resources/webhooks/resources/polling/types/PollingToken.js +3 -0
  90. package/dist/cjs/api/resources/webhooks/resources/polling/types/PollingWebhook.d.ts +27 -0
  91. package/dist/cjs/api/resources/webhooks/resources/polling/types/PollingWebhook.js +3 -0
  92. package/dist/cjs/api/resources/webhooks/resources/polling/types/index.d.ts +8 -0
  93. package/dist/cjs/api/resources/webhooks/resources/polling/types/index.js +24 -0
  94. package/dist/cjs/serialization/resources/organizations/types/OrganizationLabs.d.ts +11 -0
  95. package/dist/cjs/serialization/resources/organizations/types/OrganizationLabs.js +43 -0
  96. package/dist/cjs/serialization/resources/organizations/types/index.d.ts +1 -0
  97. package/dist/cjs/serialization/resources/organizations/types/index.js +1 -0
  98. package/dist/cjs/serialization/resources/webhooks/resources/index.d.ts +2 -0
  99. package/dist/cjs/serialization/resources/webhooks/resources/index.js +3 -1
  100. package/dist/cjs/serialization/resources/webhooks/resources/polling/index.d.ts +1 -0
  101. package/dist/cjs/serialization/resources/webhooks/resources/polling/index.js +17 -0
  102. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.d.ts +12 -0
  103. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.js +44 -0
  104. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.d.ts +11 -0
  105. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.js +45 -0
  106. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.d.ts +11 -0
  107. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.js +45 -0
  108. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.d.ts +11 -0
  109. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.js +45 -0
  110. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.d.ts +16 -0
  111. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.js +48 -0
  112. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/PollingClientId.d.ts +8 -0
  113. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/PollingClientId.js +6 -0
  114. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/PollingToken.d.ts +7 -0
  115. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/PollingToken.js +39 -0
  116. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/PollingWebhook.d.ts +22 -0
  117. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/PollingWebhook.js +54 -0
  118. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/index.d.ts +8 -0
  119. package/dist/cjs/serialization/resources/webhooks/resources/polling/types/index.js +24 -0
  120. package/dist/cjs/version.d.ts +1 -1
  121. package/dist/cjs/version.js +1 -1
  122. package/dist/esm/BaseClient.mjs +2 -2
  123. package/dist/esm/api/resources/calendar/types/UpdateCalendarEventRequest.d.mts +2 -1
  124. package/dist/esm/api/resources/inboxes/resources/calendar/client/Client.d.mts +21 -21
  125. package/dist/esm/api/resources/inboxes/resources/calendar/client/Client.mjs +21 -21
  126. package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.d.mts +3 -0
  127. package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.mjs +5 -0
  128. package/dist/esm/api/resources/inboxes/resources/webhooks/exports.d.mts +1 -0
  129. package/dist/esm/api/resources/inboxes/resources/webhooks/exports.mjs +1 -0
  130. package/dist/esm/api/resources/inboxes/resources/webhooks/index.d.mts +1 -0
  131. package/dist/esm/api/resources/inboxes/resources/webhooks/index.mjs +1 -0
  132. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/index.d.mts +2 -0
  133. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/index.mjs +2 -0
  134. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/Client.d.mts +89 -0
  135. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/Client.mjs +314 -0
  136. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/index.d.mts +1 -0
  137. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/index.mjs +1 -0
  138. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/InboxListPollingWebhooksRequest.d.mts +10 -0
  139. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/InboxListPollingWebhooksRequest.mjs +2 -0
  140. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/index.d.mts +1 -0
  141. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/index.mjs +1 -0
  142. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/exports.d.mts +2 -0
  143. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/exports.mjs +3 -0
  144. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/index.d.mts +1 -0
  145. package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/index.mjs +1 -0
  146. package/dist/esm/api/resources/index.d.mts +1 -0
  147. package/dist/esm/api/resources/index.mjs +1 -0
  148. package/dist/esm/api/resources/messages/types/MessageCalendarEventId.d.mts +1 -1
  149. package/dist/esm/api/resources/organizations/client/Client.d.mts +41 -1
  150. package/dist/esm/api/resources/organizations/client/Client.mjs +159 -0
  151. package/dist/esm/api/resources/organizations/errors/OrganizationForbiddenError.d.mts +6 -0
  152. package/dist/esm/api/resources/organizations/errors/OrganizationForbiddenError.mjs +17 -0
  153. package/dist/esm/api/resources/organizations/errors/index.d.mts +1 -0
  154. package/dist/esm/api/resources/organizations/errors/index.mjs +1 -0
  155. package/dist/esm/api/resources/organizations/index.d.mts +1 -0
  156. package/dist/esm/api/resources/organizations/index.mjs +1 -0
  157. package/dist/esm/api/resources/organizations/types/OrganizationLabs.d.mts +11 -0
  158. package/dist/esm/api/resources/organizations/types/OrganizationLabs.mjs +2 -0
  159. package/dist/esm/api/resources/organizations/types/index.d.mts +1 -0
  160. package/dist/esm/api/resources/organizations/types/index.mjs +1 -0
  161. package/dist/esm/api/resources/pods/resources/webhooks/client/Client.d.mts +3 -0
  162. package/dist/esm/api/resources/pods/resources/webhooks/client/Client.mjs +5 -0
  163. package/dist/esm/api/resources/pods/resources/webhooks/exports.d.mts +1 -0
  164. package/dist/esm/api/resources/pods/resources/webhooks/exports.mjs +1 -0
  165. package/dist/esm/api/resources/pods/resources/webhooks/index.d.mts +1 -0
  166. package/dist/esm/api/resources/pods/resources/webhooks/index.mjs +1 -0
  167. package/dist/esm/api/resources/pods/resources/webhooks/resources/index.d.mts +2 -0
  168. package/dist/esm/api/resources/pods/resources/webhooks/resources/index.mjs +2 -0
  169. package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/Client.d.mts +89 -0
  170. package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/Client.mjs +314 -0
  171. package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/index.d.mts +1 -0
  172. package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/index.mjs +1 -0
  173. package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/requests/PodListPollingWebhooksRequest.d.mts +10 -0
  174. package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/requests/PodListPollingWebhooksRequest.mjs +2 -0
  175. package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/requests/index.d.mts +1 -0
  176. package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/requests/index.mjs +1 -0
  177. package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/exports.d.mts +2 -0
  178. package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/exports.mjs +3 -0
  179. package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/index.d.mts +1 -0
  180. package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/index.mjs +1 -0
  181. package/dist/esm/api/resources/webhooks/client/Client.d.mts +3 -0
  182. package/dist/esm/api/resources/webhooks/client/Client.mjs +5 -0
  183. package/dist/esm/api/resources/webhooks/resources/index.d.mts +3 -0
  184. package/dist/esm/api/resources/webhooks/resources/index.mjs +3 -0
  185. package/dist/esm/api/resources/webhooks/resources/polling/client/Client.d.mts +92 -0
  186. package/dist/esm/api/resources/webhooks/resources/polling/client/Client.mjs +317 -0
  187. package/dist/esm/api/resources/webhooks/resources/polling/client/index.d.mts +1 -0
  188. package/dist/esm/api/resources/webhooks/resources/polling/client/index.mjs +1 -0
  189. package/dist/esm/api/resources/webhooks/resources/polling/client/requests/ListPollingWebhooksRequest.d.mts +10 -0
  190. package/dist/esm/api/resources/webhooks/resources/polling/client/requests/ListPollingWebhooksRequest.mjs +2 -0
  191. package/dist/esm/api/resources/webhooks/resources/polling/client/requests/index.d.mts +1 -0
  192. package/dist/esm/api/resources/webhooks/resources/polling/client/requests/index.mjs +1 -0
  193. package/dist/esm/api/resources/webhooks/resources/polling/exports.d.mts +2 -0
  194. package/dist/esm/api/resources/webhooks/resources/polling/exports.mjs +3 -0
  195. package/dist/esm/api/resources/webhooks/resources/polling/index.d.mts +2 -0
  196. package/dist/esm/api/resources/webhooks/resources/polling/index.mjs +2 -0
  197. package/dist/esm/api/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.d.mts +9 -0
  198. package/dist/esm/api/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.mjs +2 -0
  199. package/dist/esm/api/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.d.mts +9 -0
  200. package/dist/esm/api/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.mjs +2 -0
  201. package/dist/esm/api/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.d.mts +9 -0
  202. package/dist/esm/api/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.mjs +2 -0
  203. package/dist/esm/api/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.d.mts +7 -0
  204. package/dist/esm/api/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.mjs +2 -0
  205. package/dist/esm/api/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.d.mts +12 -0
  206. package/dist/esm/api/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.mjs +2 -0
  207. package/dist/esm/api/resources/webhooks/resources/polling/types/PollingClientId.d.mts +7 -0
  208. package/dist/esm/api/resources/webhooks/resources/polling/types/PollingClientId.mjs +2 -0
  209. package/dist/esm/api/resources/webhooks/resources/polling/types/PollingToken.d.mts +8 -0
  210. package/dist/esm/api/resources/webhooks/resources/polling/types/PollingToken.mjs +2 -0
  211. package/dist/esm/api/resources/webhooks/resources/polling/types/PollingWebhook.d.mts +27 -0
  212. package/dist/esm/api/resources/webhooks/resources/polling/types/PollingWebhook.mjs +2 -0
  213. package/dist/esm/api/resources/webhooks/resources/polling/types/index.d.mts +8 -0
  214. package/dist/esm/api/resources/webhooks/resources/polling/types/index.mjs +8 -0
  215. package/dist/esm/serialization/resources/organizations/types/OrganizationLabs.d.mts +11 -0
  216. package/dist/esm/serialization/resources/organizations/types/OrganizationLabs.mjs +7 -0
  217. package/dist/esm/serialization/resources/organizations/types/index.d.mts +1 -0
  218. package/dist/esm/serialization/resources/organizations/types/index.mjs +1 -0
  219. package/dist/esm/serialization/resources/webhooks/resources/index.d.mts +2 -0
  220. package/dist/esm/serialization/resources/webhooks/resources/index.mjs +2 -0
  221. package/dist/esm/serialization/resources/webhooks/resources/polling/index.d.mts +1 -0
  222. package/dist/esm/serialization/resources/webhooks/resources/polling/index.mjs +1 -0
  223. package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.d.mts +12 -0
  224. package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.mjs +8 -0
  225. package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.d.mts +11 -0
  226. package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.mjs +9 -0
  227. package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.d.mts +11 -0
  228. package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.mjs +9 -0
  229. package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.d.mts +11 -0
  230. package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.mjs +9 -0
  231. package/dist/esm/serialization/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.d.mts +16 -0
  232. package/dist/esm/serialization/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.mjs +12 -0
  233. package/dist/esm/serialization/resources/webhooks/resources/polling/types/PollingClientId.d.mts +8 -0
  234. package/dist/esm/serialization/resources/webhooks/resources/polling/types/PollingClientId.mjs +3 -0
  235. package/dist/esm/serialization/resources/webhooks/resources/polling/types/PollingToken.d.mts +7 -0
  236. package/dist/esm/serialization/resources/webhooks/resources/polling/types/PollingToken.mjs +3 -0
  237. package/dist/esm/serialization/resources/webhooks/resources/polling/types/PollingWebhook.d.mts +22 -0
  238. package/dist/esm/serialization/resources/webhooks/resources/polling/types/PollingWebhook.mjs +18 -0
  239. package/dist/esm/serialization/resources/webhooks/resources/polling/types/index.d.mts +8 -0
  240. package/dist/esm/serialization/resources/webhooks/resources/polling/types/index.mjs +8 -0
  241. package/dist/esm/version.d.mts +1 -1
  242. package/dist/esm/version.mjs +1 -1
  243. package/dist/llms.txt +14 -0
  244. package/package.json +34 -1
  245. package/reference.md +1586 -575
@@ -0,0 +1,314 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../../../../../core/headers.mjs";
13
+ import * as core from "../../../../../../../../core/index.mjs";
14
+ import * as environments from "../../../../../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../../../../../errors/index.mjs";
17
+ import * as serializers from "../../../../../../../../serialization/index.mjs";
18
+ import * as AgentMail from "../../../../../../../index.mjs";
19
+ export class PollingClient {
20
+ constructor(options = {}) {
21
+ this._options = normalizeClientOptionsWithAuth(options);
22
+ }
23
+ /**
24
+ * Lists the polling webhooks created through this inbox route.
25
+ *
26
+ * **CLI:**
27
+ * ```bash
28
+ * agentmail inboxes webhooks polling list --inbox-id <inbox_id>
29
+ * ```
30
+ *
31
+ * @param {AgentMail.inboxes.InboxId} inbox_id
32
+ * @param {AgentMail.inboxes.webhooks.InboxListPollingWebhooksRequest} request
33
+ * @param {PollingClient.RequestOptions} requestOptions - Request-specific configuration.
34
+ *
35
+ * @throws {@link AgentMail.ValidationError}
36
+ *
37
+ * @example
38
+ * await client.inboxes.webhooks.polling.list("inbox_id")
39
+ */
40
+ list(inbox_id, request = {}, requestOptions) {
41
+ return core.HttpResponsePromise.fromPromise(this.__list(inbox_id, request, requestOptions));
42
+ }
43
+ __list(inbox_id_1) {
44
+ return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
45
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
46
+ const { limit, pageToken, ascending } = request;
47
+ const _queryParams = {
48
+ limit,
49
+ page_token: pageToken,
50
+ ascending,
51
+ };
52
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
53
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
54
+ const _response = yield core.fetcher({
55
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
56
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/webhooks/polling`),
57
+ method: "GET",
58
+ headers: _headers,
59
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
60
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
61
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
62
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
63
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
64
+ logging: this._options.logging,
65
+ });
66
+ if (_response.ok) {
67
+ return {
68
+ data: serializers.webhooks.ListPollingWebhooksResponse.parseOrThrow(_response.body, {
69
+ unrecognizedObjectKeys: "passthrough",
70
+ allowUnrecognizedUnionMembers: true,
71
+ allowUnrecognizedEnumValues: true,
72
+ skipValidation: true,
73
+ breadcrumbsPrefix: ["response"],
74
+ }),
75
+ rawResponse: _response.rawResponse,
76
+ };
77
+ }
78
+ if (_response.error.reason === "status-code") {
79
+ switch (_response.error.statusCode) {
80
+ case 400:
81
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
82
+ unrecognizedObjectKeys: "passthrough",
83
+ allowUnrecognizedUnionMembers: true,
84
+ allowUnrecognizedEnumValues: true,
85
+ skipValidation: true,
86
+ breadcrumbsPrefix: ["response"],
87
+ }), _response.rawResponse);
88
+ default:
89
+ throw new errors.AgentMailError({
90
+ statusCode: _response.error.statusCode,
91
+ body: _response.error.body,
92
+ rawResponse: _response.rawResponse,
93
+ });
94
+ }
95
+ }
96
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/webhooks/polling");
97
+ });
98
+ }
99
+ /**
100
+ * **CLI:**
101
+ * ```bash
102
+ * agentmail inboxes webhooks polling get --inbox-id <inbox_id> --webhook-id <webhook_id>
103
+ * ```
104
+ *
105
+ * @param {AgentMail.inboxes.InboxId} inbox_id
106
+ * @param {AgentMail.webhooks.WebhookId} webhook_id
107
+ * @param {PollingClient.RequestOptions} requestOptions - Request-specific configuration.
108
+ *
109
+ * @throws {@link AgentMail.NotFoundError}
110
+ *
111
+ * @example
112
+ * await client.inboxes.webhooks.polling.get("inbox_id", "webhook_id")
113
+ */
114
+ get(inbox_id, webhook_id, requestOptions) {
115
+ return core.HttpResponsePromise.fromPromise(this.__get(inbox_id, webhook_id, requestOptions));
116
+ }
117
+ __get(inbox_id, webhook_id, requestOptions) {
118
+ return __awaiter(this, void 0, void 0, function* () {
119
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
120
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
121
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
122
+ const _response = yield core.fetcher({
123
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
124
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/webhooks/polling/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}`),
125
+ method: "GET",
126
+ headers: _headers,
127
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
128
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
129
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
130
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
131
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
132
+ logging: this._options.logging,
133
+ });
134
+ if (_response.ok) {
135
+ return {
136
+ data: serializers.webhooks.PollingWebhook.parseOrThrow(_response.body, {
137
+ unrecognizedObjectKeys: "passthrough",
138
+ allowUnrecognizedUnionMembers: true,
139
+ allowUnrecognizedEnumValues: true,
140
+ skipValidation: true,
141
+ breadcrumbsPrefix: ["response"],
142
+ }),
143
+ rawResponse: _response.rawResponse,
144
+ };
145
+ }
146
+ if (_response.error.reason === "status-code") {
147
+ switch (_response.error.statusCode) {
148
+ case 404:
149
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
150
+ unrecognizedObjectKeys: "passthrough",
151
+ allowUnrecognizedUnionMembers: true,
152
+ allowUnrecognizedEnumValues: true,
153
+ skipValidation: true,
154
+ breadcrumbsPrefix: ["response"],
155
+ }), _response.rawResponse);
156
+ default:
157
+ throw new errors.AgentMailError({
158
+ statusCode: _response.error.statusCode,
159
+ body: _response.error.body,
160
+ rawResponse: _response.rawResponse,
161
+ });
162
+ }
163
+ }
164
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/webhooks/polling/{webhook_id}");
165
+ });
166
+ }
167
+ /**
168
+ * Create a polling webhook scoped to this inbox and return the `token` that reads it.
169
+ *
170
+ * **CLI:**
171
+ * ```bash
172
+ * agentmail inboxes webhooks polling create --inbox-id <inbox_id> --client-id my-agent --event-types message.received
173
+ * ```
174
+ *
175
+ * @param {AgentMail.inboxes.InboxId} inbox_id
176
+ * @param {AgentMail.webhooks.CreateInboxPollingWebhookRequest} request
177
+ * @param {PollingClient.RequestOptions} requestOptions - Request-specific configuration.
178
+ *
179
+ * @throws {@link AgentMail.ValidationError}
180
+ * @throws {@link AgentMail.ConflictError}
181
+ *
182
+ * @example
183
+ * await client.inboxes.webhooks.polling.create("inbox_id", {
184
+ * clientId: "client_id",
185
+ * eventTypes: ["message.received", "message.received"]
186
+ * })
187
+ */
188
+ create(inbox_id, request, requestOptions) {
189
+ return core.HttpResponsePromise.fromPromise(this.__create(inbox_id, request, requestOptions));
190
+ }
191
+ __create(inbox_id, request, requestOptions) {
192
+ return __awaiter(this, void 0, void 0, function* () {
193
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
194
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
195
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
196
+ const _response = yield core.fetcher({
197
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
198
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/webhooks/polling`),
199
+ method: "POST",
200
+ headers: _headers,
201
+ contentType: "application/json",
202
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
203
+ requestType: "json",
204
+ body: serializers.webhooks.CreateInboxPollingWebhookRequest.jsonOrThrow(request, {
205
+ unrecognizedObjectKeys: "strip",
206
+ omitUndefined: true,
207
+ }),
208
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
209
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
210
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
211
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
212
+ logging: this._options.logging,
213
+ });
214
+ if (_response.ok) {
215
+ return {
216
+ data: serializers.webhooks.CreatePollingWebhookResponse.parseOrThrow(_response.body, {
217
+ unrecognizedObjectKeys: "passthrough",
218
+ allowUnrecognizedUnionMembers: true,
219
+ allowUnrecognizedEnumValues: true,
220
+ skipValidation: true,
221
+ breadcrumbsPrefix: ["response"],
222
+ }),
223
+ rawResponse: _response.rawResponse,
224
+ };
225
+ }
226
+ if (_response.error.reason === "status-code") {
227
+ switch (_response.error.statusCode) {
228
+ case 400:
229
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
230
+ unrecognizedObjectKeys: "passthrough",
231
+ allowUnrecognizedUnionMembers: true,
232
+ allowUnrecognizedEnumValues: true,
233
+ skipValidation: true,
234
+ breadcrumbsPrefix: ["response"],
235
+ }), _response.rawResponse);
236
+ case 409:
237
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
238
+ unrecognizedObjectKeys: "passthrough",
239
+ allowUnrecognizedUnionMembers: true,
240
+ allowUnrecognizedEnumValues: true,
241
+ skipValidation: true,
242
+ breadcrumbsPrefix: ["response"],
243
+ }), _response.rawResponse);
244
+ default:
245
+ throw new errors.AgentMailError({
246
+ statusCode: _response.error.statusCode,
247
+ body: _response.error.body,
248
+ rawResponse: _response.rawResponse,
249
+ });
250
+ }
251
+ }
252
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/webhooks/polling");
253
+ });
254
+ }
255
+ /**
256
+ * **CLI:**
257
+ * ```bash
258
+ * agentmail inboxes webhooks polling delete --inbox-id <inbox_id> --webhook-id <webhook_id>
259
+ * ```
260
+ *
261
+ * @param {AgentMail.inboxes.InboxId} inbox_id
262
+ * @param {AgentMail.webhooks.WebhookId} webhook_id
263
+ * @param {PollingClient.RequestOptions} requestOptions - Request-specific configuration.
264
+ *
265
+ * @throws {@link AgentMail.NotFoundError}
266
+ *
267
+ * @example
268
+ * await client.inboxes.webhooks.polling.delete("inbox_id", "webhook_id")
269
+ */
270
+ delete(inbox_id, webhook_id, requestOptions) {
271
+ return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, webhook_id, requestOptions));
272
+ }
273
+ __delete(inbox_id, webhook_id, requestOptions) {
274
+ return __awaiter(this, void 0, void 0, function* () {
275
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
276
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
277
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
278
+ const _response = yield core.fetcher({
279
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
280
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/webhooks/polling/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}`),
281
+ method: "DELETE",
282
+ headers: _headers,
283
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
284
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
285
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
286
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
287
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
288
+ logging: this._options.logging,
289
+ });
290
+ if (_response.ok) {
291
+ return { data: undefined, rawResponse: _response.rawResponse };
292
+ }
293
+ if (_response.error.reason === "status-code") {
294
+ switch (_response.error.statusCode) {
295
+ case 404:
296
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
297
+ unrecognizedObjectKeys: "passthrough",
298
+ allowUnrecognizedUnionMembers: true,
299
+ allowUnrecognizedEnumValues: true,
300
+ skipValidation: true,
301
+ breadcrumbsPrefix: ["response"],
302
+ }), _response.rawResponse);
303
+ default:
304
+ throw new errors.AgentMailError({
305
+ statusCode: _response.error.statusCode,
306
+ body: _response.error.body,
307
+ rawResponse: _response.rawResponse,
308
+ });
309
+ }
310
+ }
311
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/inboxes/{inbox_id}/webhooks/polling/{webhook_id}");
312
+ });
313
+ }
314
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,10 @@
1
+ import type * as AgentMail from "../../../../../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface InboxListPollingWebhooksRequest {
7
+ limit?: AgentMail.Limit;
8
+ pageToken?: AgentMail.PageToken;
9
+ ascending?: AgentMail.Ascending;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { InboxListPollingWebhooksRequest } from "./InboxListPollingWebhooksRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export { PollingClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { PollingClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -37,6 +37,7 @@ export * from "./messages/types/index.mjs";
37
37
  export * from "./metrics/client/requests/index.mjs";
38
38
  export * as metrics from "./metrics/index.mjs";
39
39
  export * from "./metrics/types/index.mjs";
40
+ export * from "./organizations/errors/index.mjs";
40
41
  export * as organizations from "./organizations/index.mjs";
41
42
  export * from "./organizations/types/index.mjs";
42
43
  export * as pods from "./pods/index.mjs";
@@ -37,6 +37,7 @@ export * from "./messages/types/index.mjs";
37
37
  export * from "./metrics/client/requests/index.mjs";
38
38
  export * as metrics from "./metrics/index.mjs";
39
39
  export * from "./metrics/types/index.mjs";
40
+ export * from "./organizations/errors/index.mjs";
40
41
  export * as organizations from "./organizations/index.mjs";
41
42
  export * from "./organizations/types/index.mjs";
42
43
  export * as pods from "./pods/index.mjs";
@@ -3,6 +3,6 @@
3
3
  * invitation, update, cancellation or attendee reply changed the inbox's calendar, a few seconds
4
4
  * after the email arrives. For an email about one date of a recurring event, it is that date's
5
5
  * event ID. Absent on other emails, and on invitations that were not imported. Calendar is in
6
- * private beta.
6
+ * AgentMail Labs.
7
7
  */
8
8
  export type MessageCalendarEventId = string;
@@ -1,7 +1,7 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
3
  import * as core from "../../../../core/index.mjs";
4
- import type * as AgentMail from "../../../index.mjs";
4
+ import * as AgentMail from "../../../index.mjs";
5
5
  export declare namespace OrganizationsClient {
6
6
  type Options = BaseClientOptions;
7
7
  interface RequestOptions extends BaseRequestOptions {
@@ -25,4 +25,44 @@ export declare class OrganizationsClient {
25
25
  */
26
26
  get(requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Organization>;
27
27
  private __get;
28
+ /**
29
+ * Returns whether the organization is in [AgentMail Labs](https://docs.agentmail.to/calendar), which turns on features that are still in preview, such as calendar. Requires an organization-scoped API key.
30
+ *
31
+ * **CLI:**
32
+ * ```bash
33
+ * agentmail organizations get-labs
34
+ * ```
35
+ *
36
+ * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
37
+ *
38
+ * @throws {@link AgentMail.OrganizationForbiddenError}
39
+ *
40
+ * @example
41
+ * await client.organizations.getLabs()
42
+ */
43
+ getLabs(requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<AgentMail.OrganizationLabs>;
44
+ private __getLabs;
45
+ /**
46
+ * Joins AgentMail Labs for the whole organization, which turns on every feature in Labs for every inbox. Joining again has no effect. There is no leave on the API; an organization admin can leave in the console under [Settings, then Labs](https://console.agentmail.to/dashboard/settings/labs).
47
+ *
48
+ * Join only when your organization has decided to. Get Labs reads the same for an organization that never joined and one whose admin left Labs on purpose, so don't join just because `enabled` is `false`.
49
+ *
50
+ * Requires an organization-scoped API key with no permissions restriction, and a verified organization. API keys see the change within five minutes. Where Labs isn't offered (`available` is `false` on Get Labs), joining returns `403`.
51
+ *
52
+ * **CLI:**
53
+ * ```bash
54
+ * agentmail organizations join-labs
55
+ * ```
56
+ *
57
+ * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
58
+ *
59
+ * @throws {@link AgentMail.OrganizationForbiddenError}
60
+ * @throws {@link AgentMail.ValidationError}
61
+ * @throws {@link AgentMail.ConflictError}
62
+ *
63
+ * @example
64
+ * await client.organizations.joinLabs()
65
+ */
66
+ joinLabs(requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<AgentMail.OrganizationLabs>;
67
+ private __joinLabs;
28
68
  }
@@ -15,6 +15,7 @@ import * as environments from "../../../../environments.mjs";
15
15
  import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
16
  import * as errors from "../../../../errors/index.mjs";
17
17
  import * as serializers from "../../../../serialization/index.mjs";
18
+ import * as AgentMail from "../../../index.mjs";
18
19
  export class OrganizationsClient {
19
20
  constructor(options = {}) {
20
21
  this._options = normalizeClientOptionsWithAuth(options);
@@ -74,4 +75,162 @@ export class OrganizationsClient {
74
75
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/organizations");
75
76
  });
76
77
  }
78
+ /**
79
+ * Returns whether the organization is in [AgentMail Labs](https://docs.agentmail.to/calendar), which turns on features that are still in preview, such as calendar. Requires an organization-scoped API key.
80
+ *
81
+ * **CLI:**
82
+ * ```bash
83
+ * agentmail organizations get-labs
84
+ * ```
85
+ *
86
+ * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
87
+ *
88
+ * @throws {@link AgentMail.OrganizationForbiddenError}
89
+ *
90
+ * @example
91
+ * await client.organizations.getLabs()
92
+ */
93
+ getLabs(requestOptions) {
94
+ return core.HttpResponsePromise.fromPromise(this.__getLabs(requestOptions));
95
+ }
96
+ __getLabs(requestOptions) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
99
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
100
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
101
+ const _response = yield core.fetcher({
102
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
103
+ .http, "/v0/organizations/labs"),
104
+ method: "GET",
105
+ headers: _headers,
106
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
107
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
108
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
109
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
110
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
111
+ logging: this._options.logging,
112
+ });
113
+ if (_response.ok) {
114
+ return {
115
+ data: serializers.OrganizationLabs.parseOrThrow(_response.body, {
116
+ unrecognizedObjectKeys: "passthrough",
117
+ allowUnrecognizedUnionMembers: true,
118
+ allowUnrecognizedEnumValues: true,
119
+ skipValidation: true,
120
+ breadcrumbsPrefix: ["response"],
121
+ }),
122
+ rawResponse: _response.rawResponse,
123
+ };
124
+ }
125
+ if (_response.error.reason === "status-code") {
126
+ switch (_response.error.statusCode) {
127
+ case 403:
128
+ throw new AgentMail.OrganizationForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
129
+ unrecognizedObjectKeys: "passthrough",
130
+ allowUnrecognizedUnionMembers: true,
131
+ allowUnrecognizedEnumValues: true,
132
+ skipValidation: true,
133
+ breadcrumbsPrefix: ["response"],
134
+ }), _response.rawResponse);
135
+ default:
136
+ throw new errors.AgentMailError({
137
+ statusCode: _response.error.statusCode,
138
+ body: _response.error.body,
139
+ rawResponse: _response.rawResponse,
140
+ });
141
+ }
142
+ }
143
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/organizations/labs");
144
+ });
145
+ }
146
+ /**
147
+ * Joins AgentMail Labs for the whole organization, which turns on every feature in Labs for every inbox. Joining again has no effect. There is no leave on the API; an organization admin can leave in the console under [Settings, then Labs](https://console.agentmail.to/dashboard/settings/labs).
148
+ *
149
+ * Join only when your organization has decided to. Get Labs reads the same for an organization that never joined and one whose admin left Labs on purpose, so don't join just because `enabled` is `false`.
150
+ *
151
+ * Requires an organization-scoped API key with no permissions restriction, and a verified organization. API keys see the change within five minutes. Where Labs isn't offered (`available` is `false` on Get Labs), joining returns `403`.
152
+ *
153
+ * **CLI:**
154
+ * ```bash
155
+ * agentmail organizations join-labs
156
+ * ```
157
+ *
158
+ * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
159
+ *
160
+ * @throws {@link AgentMail.OrganizationForbiddenError}
161
+ * @throws {@link AgentMail.ValidationError}
162
+ * @throws {@link AgentMail.ConflictError}
163
+ *
164
+ * @example
165
+ * await client.organizations.joinLabs()
166
+ */
167
+ joinLabs(requestOptions) {
168
+ return core.HttpResponsePromise.fromPromise(this.__joinLabs(requestOptions));
169
+ }
170
+ __joinLabs(requestOptions) {
171
+ return __awaiter(this, void 0, void 0, function* () {
172
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
173
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
174
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
175
+ const _response = yield core.fetcher({
176
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
177
+ .http, "/v0/organizations/labs"),
178
+ method: "POST",
179
+ headers: _headers,
180
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
181
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
182
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
183
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
184
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
185
+ logging: this._options.logging,
186
+ });
187
+ if (_response.ok) {
188
+ return {
189
+ data: serializers.OrganizationLabs.parseOrThrow(_response.body, {
190
+ unrecognizedObjectKeys: "passthrough",
191
+ allowUnrecognizedUnionMembers: true,
192
+ allowUnrecognizedEnumValues: true,
193
+ skipValidation: true,
194
+ breadcrumbsPrefix: ["response"],
195
+ }),
196
+ rawResponse: _response.rawResponse,
197
+ };
198
+ }
199
+ if (_response.error.reason === "status-code") {
200
+ switch (_response.error.statusCode) {
201
+ case 403:
202
+ throw new AgentMail.OrganizationForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
203
+ unrecognizedObjectKeys: "passthrough",
204
+ allowUnrecognizedUnionMembers: true,
205
+ allowUnrecognizedEnumValues: true,
206
+ skipValidation: true,
207
+ breadcrumbsPrefix: ["response"],
208
+ }), _response.rawResponse);
209
+ case 400:
210
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
211
+ unrecognizedObjectKeys: "passthrough",
212
+ allowUnrecognizedUnionMembers: true,
213
+ allowUnrecognizedEnumValues: true,
214
+ skipValidation: true,
215
+ breadcrumbsPrefix: ["response"],
216
+ }), _response.rawResponse);
217
+ case 409:
218
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
219
+ unrecognizedObjectKeys: "passthrough",
220
+ allowUnrecognizedUnionMembers: true,
221
+ allowUnrecognizedEnumValues: true,
222
+ skipValidation: true,
223
+ breadcrumbsPrefix: ["response"],
224
+ }), _response.rawResponse);
225
+ default:
226
+ throw new errors.AgentMailError({
227
+ statusCode: _response.error.statusCode,
228
+ body: _response.error.body,
229
+ rawResponse: _response.rawResponse,
230
+ });
231
+ }
232
+ }
233
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/organizations/labs");
234
+ });
235
+ }
77
236
  }
@@ -0,0 +1,6 @@
1
+ import type * as core from "../../../../core/index.mjs";
2
+ import * as errors from "../../../../errors/index.mjs";
3
+ import type * as AgentMail from "../../../index.mjs";
4
+ export declare class OrganizationForbiddenError extends errors.AgentMailError {
5
+ constructor(body: AgentMail.ErrorResponse, rawResponse?: core.RawResponse);
6
+ }
@@ -0,0 +1,17 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as errors from "../../../../errors/index.mjs";
3
+ export class OrganizationForbiddenError extends errors.AgentMailError {
4
+ constructor(body, rawResponse) {
5
+ super({
6
+ message: "OrganizationForbiddenError",
7
+ statusCode: 403,
8
+ body: body,
9
+ rawResponse: rawResponse,
10
+ });
11
+ Object.setPrototypeOf(this, new.target.prototype);
12
+ if (Error.captureStackTrace) {
13
+ Error.captureStackTrace(this, this.constructor);
14
+ }
15
+ this.name = this.constructor.name;
16
+ }
17
+ }
@@ -0,0 +1 @@
1
+ export * from "./OrganizationForbiddenError.mjs";
@@ -0,0 +1 @@
1
+ export * from "./OrganizationForbiddenError.mjs";