agentmail 0.5.45 → 0.5.46

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 (334) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/agentArmor/types/AgentArmorCompleteResult.d.ts +2 -0
  3. package/dist/cjs/api/resources/agentArmor/types/AgentArmorCompletedEventResult.d.ts +1 -1
  4. package/dist/cjs/api/resources/agentArmor/types/AgentArmorManualOverride.d.ts +15 -0
  5. package/dist/cjs/api/resources/agentArmor/types/AgentArmorManualOverride.js +3 -0
  6. package/dist/cjs/api/resources/agentArmor/types/AgentArmorReleaseActor.d.ts +13 -0
  7. package/dist/cjs/api/resources/agentArmor/types/AgentArmorReleaseActor.js +3 -0
  8. package/dist/cjs/api/resources/agentArmor/types/AgentArmorReleaseApiKeyActor.d.ts +4 -0
  9. package/dist/cjs/api/resources/agentArmor/types/AgentArmorReleaseApiKeyActor.js +3 -0
  10. package/dist/cjs/api/resources/agentArmor/types/AgentArmorReleaseConsoleActor.d.ts +1 -0
  11. package/dist/cjs/api/resources/agentArmor/types/AgentArmorReleaseConsoleActor.js +3 -0
  12. package/dist/cjs/api/resources/agentArmor/types/ReleaseAgentArmorMessageRequest.d.ts +4 -0
  13. package/dist/cjs/api/resources/agentArmor/types/ReleaseAgentArmorMessageRequest.js +3 -0
  14. package/dist/cjs/api/resources/agentArmor/types/ReleaseAgentArmorMessageResponse.d.ts +4 -0
  15. package/dist/cjs/api/resources/agentArmor/types/ReleaseAgentArmorMessageResponse.js +3 -0
  16. package/dist/cjs/api/resources/agentArmor/types/index.d.ts +6 -0
  17. package/dist/cjs/api/resources/agentArmor/types/index.js +6 -0
  18. package/dist/cjs/api/resources/apiKeys/types/ApiKeyPermissions.d.ts +13 -0
  19. package/dist/cjs/api/resources/events/types/EventType.d.ts +2 -0
  20. package/dist/cjs/api/resources/events/types/EventType.js +2 -0
  21. package/dist/cjs/api/resources/events/types/MessageSecurityCompletedEvent.d.ts +4 -3
  22. package/dist/cjs/api/resources/events/types/MessageSecurityOverride.d.ts +10 -0
  23. package/dist/cjs/api/resources/events/types/MessageSecurityOverride.js +3 -0
  24. package/dist/cjs/api/resources/events/types/MessageSecurityOverrideEvent.d.ts +13 -0
  25. package/dist/cjs/api/resources/events/types/MessageSecurityOverrideEvent.js +3 -0
  26. package/dist/cjs/api/resources/events/types/MessageSecurityReviewEvent.d.ts +13 -0
  27. package/dist/cjs/api/resources/events/types/MessageSecurityReviewEvent.js +3 -0
  28. package/dist/cjs/api/resources/events/types/index.d.ts +3 -0
  29. package/dist/cjs/api/resources/events/types/index.js +3 -0
  30. package/dist/cjs/api/resources/files/errors/FileForbiddenError.d.ts +6 -0
  31. package/dist/cjs/api/resources/files/errors/FileForbiddenError.js +54 -0
  32. package/dist/cjs/api/resources/files/errors/index.d.ts +1 -0
  33. package/dist/cjs/api/resources/files/errors/index.js +17 -0
  34. package/dist/cjs/api/resources/files/exports.d.ts +1 -0
  35. package/dist/cjs/api/resources/files/exports.js +18 -0
  36. package/dist/cjs/api/resources/files/index.d.ts +2 -0
  37. package/dist/cjs/api/resources/files/index.js +18 -0
  38. package/dist/cjs/api/resources/files/types/CreateFileRequest.d.ts +12 -0
  39. package/dist/cjs/api/resources/files/types/CreateFileRequest.js +3 -0
  40. package/dist/cjs/api/resources/files/types/CreateFileResponse.d.ts +7 -0
  41. package/dist/cjs/api/resources/files/types/CreateFileResponse.js +3 -0
  42. package/dist/cjs/api/resources/files/types/FileContentType.d.ts +4 -0
  43. package/dist/cjs/api/resources/files/types/FileContentType.js +3 -0
  44. package/dist/cjs/api/resources/files/types/FileExpiresAt.d.ts +5 -0
  45. package/dist/cjs/api/resources/files/types/FileExpiresAt.js +3 -0
  46. package/dist/cjs/api/resources/files/types/FileId.d.ts +4 -0
  47. package/dist/cjs/api/resources/files/types/FileId.js +3 -0
  48. package/dist/cjs/api/resources/files/types/FileItem.d.ts +20 -0
  49. package/dist/cjs/api/resources/files/types/FileItem.js +3 -0
  50. package/dist/cjs/api/resources/files/types/FileName.d.ts +4 -0
  51. package/dist/cjs/api/resources/files/types/FileName.js +3 -0
  52. package/dist/cjs/api/resources/files/types/FilePath.d.ts +7 -0
  53. package/dist/cjs/api/resources/files/types/FilePath.js +3 -0
  54. package/dist/cjs/api/resources/files/types/FileSha256.d.ts +5 -0
  55. package/dist/cjs/api/resources/files/types/FileSha256.js +3 -0
  56. package/dist/cjs/api/resources/files/types/FileSize.d.ts +4 -0
  57. package/dist/cjs/api/resources/files/types/FileSize.js +3 -0
  58. package/dist/cjs/api/resources/files/types/FileStatus.d.ts +9 -0
  59. package/dist/cjs/api/resources/files/types/FileStatus.js +12 -0
  60. package/dist/cjs/api/resources/files/types/FileUpload.d.ts +15 -0
  61. package/dist/cjs/api/resources/files/types/FileUpload.js +3 -0
  62. package/dist/cjs/api/resources/files/types/File_.d.ts +14 -0
  63. package/dist/cjs/api/resources/files/types/File_.js +3 -0
  64. package/dist/cjs/api/resources/files/types/ListFilesResponse.d.ts +8 -0
  65. package/dist/cjs/api/resources/files/types/ListFilesResponse.js +3 -0
  66. package/dist/cjs/api/resources/files/types/index.d.ts +14 -0
  67. package/dist/cjs/api/resources/files/types/index.js +30 -0
  68. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +3 -0
  69. package/dist/cjs/api/resources/inboxes/client/Client.js +15 -10
  70. package/dist/cjs/api/resources/inboxes/resources/files/client/Client.d.ts +156 -0
  71. package/dist/cjs/api/resources/inboxes/resources/files/client/Client.js +558 -0
  72. package/dist/cjs/api/resources/inboxes/resources/files/client/index.d.ts +1 -0
  73. package/dist/cjs/api/resources/inboxes/resources/files/client/index.js +17 -0
  74. package/dist/cjs/api/resources/inboxes/resources/files/client/requests/CreateFileRequestWrapper.d.ts +12 -0
  75. package/dist/cjs/api/resources/inboxes/resources/files/client/requests/CreateFileRequestWrapper.js +3 -0
  76. package/dist/cjs/api/resources/inboxes/resources/files/client/requests/ListFilesRequest.d.ts +16 -0
  77. package/dist/cjs/api/resources/inboxes/resources/files/client/requests/ListFilesRequest.js +3 -0
  78. package/dist/cjs/api/resources/inboxes/resources/files/client/requests/index.d.ts +2 -0
  79. package/dist/cjs/api/resources/inboxes/resources/files/client/requests/index.js +2 -0
  80. package/dist/cjs/api/resources/inboxes/resources/files/exports.d.ts +2 -0
  81. package/dist/cjs/api/resources/inboxes/resources/files/exports.js +21 -0
  82. package/dist/cjs/api/resources/inboxes/resources/files/index.d.ts +1 -0
  83. package/dist/cjs/api/resources/inboxes/resources/files/index.js +17 -0
  84. package/dist/cjs/api/resources/inboxes/resources/index.d.ts +2 -0
  85. package/dist/cjs/api/resources/inboxes/resources/index.js +3 -1
  86. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +28 -0
  87. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +101 -0
  88. package/dist/cjs/api/resources/index.d.ts +3 -0
  89. package/dist/cjs/api/resources/index.js +4 -1
  90. package/dist/cjs/api/resources/websockets/client/Socket.d.ts +1 -1
  91. package/dist/cjs/serialization/resources/agentArmor/types/AgentArmorCompleteResult.d.ts +2 -0
  92. package/dist/cjs/serialization/resources/agentArmor/types/AgentArmorCompleteResult.js +2 -0
  93. package/dist/cjs/serialization/resources/agentArmor/types/AgentArmorManualOverride.d.ts +14 -0
  94. package/dist/cjs/serialization/resources/agentArmor/types/AgentArmorManualOverride.js +46 -0
  95. package/dist/cjs/serialization/resources/agentArmor/types/AgentArmorReleaseActor.d.ts +15 -0
  96. package/dist/cjs/serialization/resources/agentArmor/types/AgentArmorReleaseActor.js +49 -0
  97. package/dist/cjs/serialization/resources/agentArmor/types/AgentArmorReleaseApiKeyActor.d.ts +9 -0
  98. package/dist/cjs/serialization/resources/agentArmor/types/AgentArmorReleaseApiKeyActor.js +41 -0
  99. package/dist/cjs/serialization/resources/agentArmor/types/AgentArmorReleaseConsoleActor.d.ts +7 -0
  100. package/dist/cjs/serialization/resources/agentArmor/types/AgentArmorReleaseConsoleActor.js +39 -0
  101. package/dist/cjs/serialization/resources/agentArmor/types/ReleaseAgentArmorMessageRequest.d.ts +9 -0
  102. package/dist/cjs/serialization/resources/agentArmor/types/ReleaseAgentArmorMessageRequest.js +41 -0
  103. package/dist/cjs/serialization/resources/agentArmor/types/ReleaseAgentArmorMessageResponse.d.ts +10 -0
  104. package/dist/cjs/serialization/resources/agentArmor/types/ReleaseAgentArmorMessageResponse.js +42 -0
  105. package/dist/cjs/serialization/resources/agentArmor/types/index.d.ts +6 -0
  106. package/dist/cjs/serialization/resources/agentArmor/types/index.js +6 -0
  107. package/dist/cjs/serialization/resources/apiKeys/types/ApiKeyPermissions.d.ts +5 -0
  108. package/dist/cjs/serialization/resources/apiKeys/types/ApiKeyPermissions.js +5 -0
  109. package/dist/cjs/serialization/resources/events/types/EventType.d.ts +1 -1
  110. package/dist/cjs/serialization/resources/events/types/EventType.js +2 -0
  111. package/dist/cjs/serialization/resources/events/types/MessageSecurityOverride.d.ts +16 -0
  112. package/dist/cjs/serialization/resources/events/types/MessageSecurityOverride.js +48 -0
  113. package/dist/cjs/serialization/resources/events/types/MessageSecurityOverrideEvent.d.ts +14 -0
  114. package/dist/cjs/serialization/resources/events/types/MessageSecurityOverrideEvent.js +46 -0
  115. package/dist/cjs/serialization/resources/events/types/MessageSecurityReviewEvent.d.ts +14 -0
  116. package/dist/cjs/serialization/resources/events/types/MessageSecurityReviewEvent.js +46 -0
  117. package/dist/cjs/serialization/resources/events/types/index.d.ts +3 -0
  118. package/dist/cjs/serialization/resources/events/types/index.js +3 -0
  119. package/dist/cjs/serialization/resources/files/index.d.ts +1 -0
  120. package/dist/cjs/serialization/resources/files/index.js +17 -0
  121. package/dist/cjs/serialization/resources/files/types/CreateFileRequest.d.ts +18 -0
  122. package/dist/cjs/serialization/resources/files/types/CreateFileRequest.js +50 -0
  123. package/dist/cjs/serialization/resources/files/types/CreateFileResponse.d.ts +11 -0
  124. package/dist/cjs/serialization/resources/files/types/CreateFileResponse.js +45 -0
  125. package/dist/cjs/serialization/resources/files/types/FileContentType.d.ts +7 -0
  126. package/dist/cjs/serialization/resources/files/types/FileContentType.js +39 -0
  127. package/dist/cjs/serialization/resources/files/types/FileExpiresAt.d.ts +7 -0
  128. package/dist/cjs/serialization/resources/files/types/FileExpiresAt.js +39 -0
  129. package/dist/cjs/serialization/resources/files/types/FileId.d.ts +7 -0
  130. package/dist/cjs/serialization/resources/files/types/FileId.js +39 -0
  131. package/dist/cjs/serialization/resources/files/types/FileItem.d.ts +30 -0
  132. package/dist/cjs/serialization/resources/files/types/FileItem.js +62 -0
  133. package/dist/cjs/serialization/resources/files/types/FileName.d.ts +7 -0
  134. package/dist/cjs/serialization/resources/files/types/FileName.js +39 -0
  135. package/dist/cjs/serialization/resources/files/types/FilePath.d.ts +7 -0
  136. package/dist/cjs/serialization/resources/files/types/FilePath.js +39 -0
  137. package/dist/cjs/serialization/resources/files/types/FileSha256.d.ts +7 -0
  138. package/dist/cjs/serialization/resources/files/types/FileSha256.js +39 -0
  139. package/dist/cjs/serialization/resources/files/types/FileSize.d.ts +7 -0
  140. package/dist/cjs/serialization/resources/files/types/FileSize.js +39 -0
  141. package/dist/cjs/serialization/resources/files/types/FileStatus.d.ts +7 -0
  142. package/dist/cjs/serialization/resources/files/types/FileStatus.js +39 -0
  143. package/dist/cjs/serialization/resources/files/types/FileUpload.d.ts +12 -0
  144. package/dist/cjs/serialization/resources/files/types/FileUpload.js +44 -0
  145. package/dist/cjs/serialization/resources/files/types/File_.d.ts +11 -0
  146. package/dist/cjs/serialization/resources/files/types/File_.js +45 -0
  147. package/dist/cjs/serialization/resources/files/types/ListFilesResponse.d.ts +16 -0
  148. package/dist/cjs/serialization/resources/files/types/ListFilesResponse.js +48 -0
  149. package/dist/cjs/serialization/resources/files/types/index.d.ts +14 -0
  150. package/dist/cjs/serialization/resources/files/types/index.js +30 -0
  151. package/dist/cjs/serialization/resources/inboxes/resources/files/client/index.d.ts +1 -0
  152. package/dist/cjs/serialization/resources/inboxes/resources/files/client/index.js +17 -0
  153. package/dist/cjs/serialization/resources/inboxes/resources/files/client/requests/CreateFileRequestWrapper.d.ts +9 -0
  154. package/dist/cjs/serialization/resources/inboxes/resources/files/client/requests/CreateFileRequestWrapper.js +40 -0
  155. package/dist/cjs/serialization/resources/inboxes/resources/files/client/requests/index.d.ts +1 -0
  156. package/dist/cjs/serialization/resources/inboxes/resources/files/client/requests/index.js +5 -0
  157. package/dist/cjs/serialization/resources/inboxes/resources/files/index.d.ts +1 -0
  158. package/dist/cjs/serialization/resources/inboxes/resources/files/index.js +17 -0
  159. package/dist/cjs/serialization/resources/inboxes/resources/index.d.ts +2 -0
  160. package/dist/cjs/serialization/resources/inboxes/resources/index.js +3 -1
  161. package/dist/cjs/serialization/resources/index.d.ts +2 -0
  162. package/dist/cjs/serialization/resources/index.js +3 -1
  163. package/dist/cjs/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.ts +4 -2
  164. package/dist/cjs/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.js +4 -0
  165. package/dist/cjs/version.d.ts +1 -1
  166. package/dist/cjs/version.js +1 -1
  167. package/dist/esm/BaseClient.mjs +2 -2
  168. package/dist/esm/api/resources/agentArmor/types/AgentArmorCompleteResult.d.mts +2 -0
  169. package/dist/esm/api/resources/agentArmor/types/AgentArmorCompletedEventResult.d.mts +1 -1
  170. package/dist/esm/api/resources/agentArmor/types/AgentArmorManualOverride.d.mts +15 -0
  171. package/dist/esm/api/resources/agentArmor/types/AgentArmorManualOverride.mjs +2 -0
  172. package/dist/esm/api/resources/agentArmor/types/AgentArmorReleaseActor.d.mts +13 -0
  173. package/dist/esm/api/resources/agentArmor/types/AgentArmorReleaseActor.mjs +2 -0
  174. package/dist/esm/api/resources/agentArmor/types/AgentArmorReleaseApiKeyActor.d.mts +4 -0
  175. package/dist/esm/api/resources/agentArmor/types/AgentArmorReleaseApiKeyActor.mjs +2 -0
  176. package/dist/esm/api/resources/agentArmor/types/AgentArmorReleaseConsoleActor.d.mts +1 -0
  177. package/dist/esm/api/resources/agentArmor/types/AgentArmorReleaseConsoleActor.mjs +2 -0
  178. package/dist/esm/api/resources/agentArmor/types/ReleaseAgentArmorMessageRequest.d.mts +4 -0
  179. package/dist/esm/api/resources/agentArmor/types/ReleaseAgentArmorMessageRequest.mjs +2 -0
  180. package/dist/esm/api/resources/agentArmor/types/ReleaseAgentArmorMessageResponse.d.mts +4 -0
  181. package/dist/esm/api/resources/agentArmor/types/ReleaseAgentArmorMessageResponse.mjs +2 -0
  182. package/dist/esm/api/resources/agentArmor/types/index.d.mts +6 -0
  183. package/dist/esm/api/resources/agentArmor/types/index.mjs +6 -0
  184. package/dist/esm/api/resources/apiKeys/types/ApiKeyPermissions.d.mts +13 -0
  185. package/dist/esm/api/resources/events/types/EventType.d.mts +2 -0
  186. package/dist/esm/api/resources/events/types/EventType.mjs +2 -0
  187. package/dist/esm/api/resources/events/types/MessageSecurityCompletedEvent.d.mts +4 -3
  188. package/dist/esm/api/resources/events/types/MessageSecurityOverride.d.mts +10 -0
  189. package/dist/esm/api/resources/events/types/MessageSecurityOverride.mjs +2 -0
  190. package/dist/esm/api/resources/events/types/MessageSecurityOverrideEvent.d.mts +13 -0
  191. package/dist/esm/api/resources/events/types/MessageSecurityOverrideEvent.mjs +2 -0
  192. package/dist/esm/api/resources/events/types/MessageSecurityReviewEvent.d.mts +13 -0
  193. package/dist/esm/api/resources/events/types/MessageSecurityReviewEvent.mjs +2 -0
  194. package/dist/esm/api/resources/events/types/index.d.mts +3 -0
  195. package/dist/esm/api/resources/events/types/index.mjs +3 -0
  196. package/dist/esm/api/resources/files/errors/FileForbiddenError.d.mts +6 -0
  197. package/dist/esm/api/resources/files/errors/FileForbiddenError.mjs +17 -0
  198. package/dist/esm/api/resources/files/errors/index.d.mts +1 -0
  199. package/dist/esm/api/resources/files/errors/index.mjs +1 -0
  200. package/dist/esm/api/resources/files/exports.d.mts +1 -0
  201. package/dist/esm/api/resources/files/exports.mjs +2 -0
  202. package/dist/esm/api/resources/files/index.d.mts +2 -0
  203. package/dist/esm/api/resources/files/index.mjs +2 -0
  204. package/dist/esm/api/resources/files/types/CreateFileRequest.d.mts +12 -0
  205. package/dist/esm/api/resources/files/types/CreateFileRequest.mjs +2 -0
  206. package/dist/esm/api/resources/files/types/CreateFileResponse.d.mts +7 -0
  207. package/dist/esm/api/resources/files/types/CreateFileResponse.mjs +2 -0
  208. package/dist/esm/api/resources/files/types/FileContentType.d.mts +4 -0
  209. package/dist/esm/api/resources/files/types/FileContentType.mjs +2 -0
  210. package/dist/esm/api/resources/files/types/FileExpiresAt.d.mts +5 -0
  211. package/dist/esm/api/resources/files/types/FileExpiresAt.mjs +2 -0
  212. package/dist/esm/api/resources/files/types/FileId.d.mts +4 -0
  213. package/dist/esm/api/resources/files/types/FileId.mjs +2 -0
  214. package/dist/esm/api/resources/files/types/FileItem.d.mts +20 -0
  215. package/dist/esm/api/resources/files/types/FileItem.mjs +2 -0
  216. package/dist/esm/api/resources/files/types/FileName.d.mts +4 -0
  217. package/dist/esm/api/resources/files/types/FileName.mjs +2 -0
  218. package/dist/esm/api/resources/files/types/FilePath.d.mts +7 -0
  219. package/dist/esm/api/resources/files/types/FilePath.mjs +2 -0
  220. package/dist/esm/api/resources/files/types/FileSha256.d.mts +5 -0
  221. package/dist/esm/api/resources/files/types/FileSha256.mjs +2 -0
  222. package/dist/esm/api/resources/files/types/FileSize.d.mts +4 -0
  223. package/dist/esm/api/resources/files/types/FileSize.mjs +2 -0
  224. package/dist/esm/api/resources/files/types/FileStatus.d.mts +9 -0
  225. package/dist/esm/api/resources/files/types/FileStatus.mjs +9 -0
  226. package/dist/esm/api/resources/files/types/FileUpload.d.mts +15 -0
  227. package/dist/esm/api/resources/files/types/FileUpload.mjs +2 -0
  228. package/dist/esm/api/resources/files/types/File_.d.mts +14 -0
  229. package/dist/esm/api/resources/files/types/File_.mjs +2 -0
  230. package/dist/esm/api/resources/files/types/ListFilesResponse.d.mts +8 -0
  231. package/dist/esm/api/resources/files/types/ListFilesResponse.mjs +2 -0
  232. package/dist/esm/api/resources/files/types/index.d.mts +14 -0
  233. package/dist/esm/api/resources/files/types/index.mjs +14 -0
  234. package/dist/esm/api/resources/inboxes/client/Client.d.mts +3 -0
  235. package/dist/esm/api/resources/inboxes/client/Client.mjs +5 -0
  236. package/dist/esm/api/resources/inboxes/resources/files/client/Client.d.mts +156 -0
  237. package/dist/esm/api/resources/inboxes/resources/files/client/Client.mjs +521 -0
  238. package/dist/esm/api/resources/inboxes/resources/files/client/index.d.mts +1 -0
  239. package/dist/esm/api/resources/inboxes/resources/files/client/index.mjs +1 -0
  240. package/dist/esm/api/resources/inboxes/resources/files/client/requests/CreateFileRequestWrapper.d.mts +12 -0
  241. package/dist/esm/api/resources/inboxes/resources/files/client/requests/CreateFileRequestWrapper.mjs +2 -0
  242. package/dist/esm/api/resources/inboxes/resources/files/client/requests/ListFilesRequest.d.mts +16 -0
  243. package/dist/esm/api/resources/inboxes/resources/files/client/requests/ListFilesRequest.mjs +2 -0
  244. package/dist/esm/api/resources/inboxes/resources/files/client/requests/index.d.mts +2 -0
  245. package/dist/esm/api/resources/inboxes/resources/files/client/requests/index.mjs +1 -0
  246. package/dist/esm/api/resources/inboxes/resources/files/exports.d.mts +2 -0
  247. package/dist/esm/api/resources/inboxes/resources/files/exports.mjs +3 -0
  248. package/dist/esm/api/resources/inboxes/resources/files/index.d.mts +1 -0
  249. package/dist/esm/api/resources/inboxes/resources/files/index.mjs +1 -0
  250. package/dist/esm/api/resources/inboxes/resources/index.d.mts +2 -0
  251. package/dist/esm/api/resources/inboxes/resources/index.mjs +2 -0
  252. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +28 -0
  253. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +101 -0
  254. package/dist/esm/api/resources/index.d.mts +3 -0
  255. package/dist/esm/api/resources/index.mjs +3 -0
  256. package/dist/esm/api/resources/websockets/client/Socket.d.mts +1 -1
  257. package/dist/esm/serialization/resources/agentArmor/types/AgentArmorCompleteResult.d.mts +2 -0
  258. package/dist/esm/serialization/resources/agentArmor/types/AgentArmorCompleteResult.mjs +2 -0
  259. package/dist/esm/serialization/resources/agentArmor/types/AgentArmorManualOverride.d.mts +14 -0
  260. package/dist/esm/serialization/resources/agentArmor/types/AgentArmorManualOverride.mjs +10 -0
  261. package/dist/esm/serialization/resources/agentArmor/types/AgentArmorReleaseActor.d.mts +15 -0
  262. package/dist/esm/serialization/resources/agentArmor/types/AgentArmorReleaseActor.mjs +13 -0
  263. package/dist/esm/serialization/resources/agentArmor/types/AgentArmorReleaseApiKeyActor.d.mts +9 -0
  264. package/dist/esm/serialization/resources/agentArmor/types/AgentArmorReleaseApiKeyActor.mjs +5 -0
  265. package/dist/esm/serialization/resources/agentArmor/types/AgentArmorReleaseConsoleActor.d.mts +7 -0
  266. package/dist/esm/serialization/resources/agentArmor/types/AgentArmorReleaseConsoleActor.mjs +3 -0
  267. package/dist/esm/serialization/resources/agentArmor/types/ReleaseAgentArmorMessageRequest.d.mts +9 -0
  268. package/dist/esm/serialization/resources/agentArmor/types/ReleaseAgentArmorMessageRequest.mjs +5 -0
  269. package/dist/esm/serialization/resources/agentArmor/types/ReleaseAgentArmorMessageResponse.d.mts +10 -0
  270. package/dist/esm/serialization/resources/agentArmor/types/ReleaseAgentArmorMessageResponse.mjs +6 -0
  271. package/dist/esm/serialization/resources/agentArmor/types/index.d.mts +6 -0
  272. package/dist/esm/serialization/resources/agentArmor/types/index.mjs +6 -0
  273. package/dist/esm/serialization/resources/apiKeys/types/ApiKeyPermissions.d.mts +5 -0
  274. package/dist/esm/serialization/resources/apiKeys/types/ApiKeyPermissions.mjs +5 -0
  275. package/dist/esm/serialization/resources/events/types/EventType.d.mts +1 -1
  276. package/dist/esm/serialization/resources/events/types/EventType.mjs +2 -0
  277. package/dist/esm/serialization/resources/events/types/MessageSecurityOverride.d.mts +16 -0
  278. package/dist/esm/serialization/resources/events/types/MessageSecurityOverride.mjs +12 -0
  279. package/dist/esm/serialization/resources/events/types/MessageSecurityOverrideEvent.d.mts +14 -0
  280. package/dist/esm/serialization/resources/events/types/MessageSecurityOverrideEvent.mjs +10 -0
  281. package/dist/esm/serialization/resources/events/types/MessageSecurityReviewEvent.d.mts +14 -0
  282. package/dist/esm/serialization/resources/events/types/MessageSecurityReviewEvent.mjs +10 -0
  283. package/dist/esm/serialization/resources/events/types/index.d.mts +3 -0
  284. package/dist/esm/serialization/resources/events/types/index.mjs +3 -0
  285. package/dist/esm/serialization/resources/files/index.d.mts +1 -0
  286. package/dist/esm/serialization/resources/files/index.mjs +1 -0
  287. package/dist/esm/serialization/resources/files/types/CreateFileRequest.d.mts +18 -0
  288. package/dist/esm/serialization/resources/files/types/CreateFileRequest.mjs +14 -0
  289. package/dist/esm/serialization/resources/files/types/CreateFileResponse.d.mts +11 -0
  290. package/dist/esm/serialization/resources/files/types/CreateFileResponse.mjs +9 -0
  291. package/dist/esm/serialization/resources/files/types/FileContentType.d.mts +7 -0
  292. package/dist/esm/serialization/resources/files/types/FileContentType.mjs +3 -0
  293. package/dist/esm/serialization/resources/files/types/FileExpiresAt.d.mts +7 -0
  294. package/dist/esm/serialization/resources/files/types/FileExpiresAt.mjs +3 -0
  295. package/dist/esm/serialization/resources/files/types/FileId.d.mts +7 -0
  296. package/dist/esm/serialization/resources/files/types/FileId.mjs +3 -0
  297. package/dist/esm/serialization/resources/files/types/FileItem.d.mts +30 -0
  298. package/dist/esm/serialization/resources/files/types/FileItem.mjs +26 -0
  299. package/dist/esm/serialization/resources/files/types/FileName.d.mts +7 -0
  300. package/dist/esm/serialization/resources/files/types/FileName.mjs +3 -0
  301. package/dist/esm/serialization/resources/files/types/FilePath.d.mts +7 -0
  302. package/dist/esm/serialization/resources/files/types/FilePath.mjs +3 -0
  303. package/dist/esm/serialization/resources/files/types/FileSha256.d.mts +7 -0
  304. package/dist/esm/serialization/resources/files/types/FileSha256.mjs +3 -0
  305. package/dist/esm/serialization/resources/files/types/FileSize.d.mts +7 -0
  306. package/dist/esm/serialization/resources/files/types/FileSize.mjs +3 -0
  307. package/dist/esm/serialization/resources/files/types/FileStatus.d.mts +7 -0
  308. package/dist/esm/serialization/resources/files/types/FileStatus.mjs +3 -0
  309. package/dist/esm/serialization/resources/files/types/FileUpload.d.mts +12 -0
  310. package/dist/esm/serialization/resources/files/types/FileUpload.mjs +8 -0
  311. package/dist/esm/serialization/resources/files/types/File_.d.mts +11 -0
  312. package/dist/esm/serialization/resources/files/types/File_.mjs +9 -0
  313. package/dist/esm/serialization/resources/files/types/ListFilesResponse.d.mts +16 -0
  314. package/dist/esm/serialization/resources/files/types/ListFilesResponse.mjs +12 -0
  315. package/dist/esm/serialization/resources/files/types/index.d.mts +14 -0
  316. package/dist/esm/serialization/resources/files/types/index.mjs +14 -0
  317. package/dist/esm/serialization/resources/inboxes/resources/files/client/index.d.mts +1 -0
  318. package/dist/esm/serialization/resources/inboxes/resources/files/client/index.mjs +1 -0
  319. package/dist/esm/serialization/resources/inboxes/resources/files/client/requests/CreateFileRequestWrapper.d.mts +9 -0
  320. package/dist/esm/serialization/resources/inboxes/resources/files/client/requests/CreateFileRequestWrapper.mjs +4 -0
  321. package/dist/esm/serialization/resources/inboxes/resources/files/client/requests/index.d.mts +1 -0
  322. package/dist/esm/serialization/resources/inboxes/resources/files/client/requests/index.mjs +1 -0
  323. package/dist/esm/serialization/resources/inboxes/resources/files/index.d.mts +1 -0
  324. package/dist/esm/serialization/resources/inboxes/resources/files/index.mjs +1 -0
  325. package/dist/esm/serialization/resources/inboxes/resources/index.d.mts +2 -0
  326. package/dist/esm/serialization/resources/inboxes/resources/index.mjs +2 -0
  327. package/dist/esm/serialization/resources/index.d.mts +2 -0
  328. package/dist/esm/serialization/resources/index.mjs +2 -0
  329. package/dist/esm/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.mts +4 -2
  330. package/dist/esm/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.mjs +4 -0
  331. package/dist/esm/version.d.mts +1 -1
  332. package/dist/esm/version.mjs +1 -1
  333. package/package.json +12 -1
  334. package/reference.md +495 -0
@@ -0,0 +1,521 @@
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 FilesClient {
20
+ constructor(options = {}) {
21
+ this._options = normalizeClientOptionsWithAuth(options);
22
+ }
23
+ /**
24
+ * @beta This endpoint is in pre-release and may change.
25
+ *
26
+ * Starts an upload: creates a pending file at `path` and returns an `upload` to `PUT` its bytes to. The bytes go
27
+ * straight to storage, not through the API. Then call Complete File to make the file `ready`.
28
+ *
29
+ * Retry-safe: sending the identical request again (same `path`, `size`, `sha256`, `content_type` and
30
+ * `expires_at`) returns the existing file with `200` instead of `201`: a pending one with a fresh `upload`, or
31
+ * a `ready` one without. If its bytes were uploaded but the upload was never completed, it is completed then. A
32
+ * different request at a path whose file is still pending and has no bytes replaces that file; at any other
33
+ * taken path it returns `409`.
34
+ *
35
+ * The file counts against the organization's Drive quota from creation, pending or not: 1 GiB and 10,000 files
36
+ * by default. A file that doesn't fit returns `403` with code `limit_exceeded`. Deleting a file frees its
37
+ * space within seconds. Expired files count until a create needs their space: a create that doesn't fit first
38
+ * gives back what expired files hold, a batch at a time, so retry a refusal while many expired files remain.
39
+ *
40
+ * Requires the `file_create` permission, which an unverified organization's keys don't have at any scope until
41
+ * it completes agent verification. A key without `file_read` can still create files, but gets the plain `409` at
42
+ * any taken path, even for an identical request at a file it didn't create.
43
+ *
44
+ * Agent Drive is in AgentMail Labs, available in US production (`api.agentmail.to`) but not yet in EU
45
+ * production (`api.agentmail.eu`). Organizations that have not joined Labs receive a `403`.
46
+ *
47
+ * @param {AgentMail.inboxes.InboxId} inbox_id
48
+ * @param {AgentMail.inboxes.CreateFileRequestWrapper} request
49
+ * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.
50
+ *
51
+ * @throws {@link AgentMail.ValidationError}
52
+ * @throws {@link AgentMail.FileForbiddenError}
53
+ * @throws {@link AgentMail.NotFoundError}
54
+ * @throws {@link AgentMail.ConflictError}
55
+ *
56
+ * @example
57
+ * await client.inboxes.files.create("reports@agentmail.to", {
58
+ * path: "reports/q3.pdf",
59
+ * size: 48213,
60
+ * sha256: "n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=",
61
+ * contentType: "application/pdf"
62
+ * })
63
+ */
64
+ create(inbox_id, request, requestOptions) {
65
+ return core.HttpResponsePromise.fromPromise(this.__create(inbox_id, request, requestOptions));
66
+ }
67
+ __create(inbox_id, request, requestOptions) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
70
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
71
+ 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);
72
+ const _response = yield core.fetcher({
73
+ 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)
74
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/files`),
75
+ method: "POST",
76
+ headers: _headers,
77
+ contentType: "application/json",
78
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
79
+ requestType: "json",
80
+ body: serializers.inboxes.CreateFileRequestWrapper.jsonOrThrow(request, {
81
+ unrecognizedObjectKeys: "strip",
82
+ omitUndefined: true,
83
+ }),
84
+ 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,
85
+ 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,
86
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
87
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
88
+ logging: this._options.logging,
89
+ });
90
+ if (_response.ok) {
91
+ return {
92
+ data: serializers.CreateFileResponse.parseOrThrow(_response.body, {
93
+ unrecognizedObjectKeys: "passthrough",
94
+ allowUnrecognizedUnionMembers: true,
95
+ allowUnrecognizedEnumValues: true,
96
+ skipValidation: true,
97
+ breadcrumbsPrefix: ["response"],
98
+ }),
99
+ rawResponse: _response.rawResponse,
100
+ };
101
+ }
102
+ if (_response.error.reason === "status-code") {
103
+ switch (_response.error.statusCode) {
104
+ case 400:
105
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
106
+ unrecognizedObjectKeys: "passthrough",
107
+ allowUnrecognizedUnionMembers: true,
108
+ allowUnrecognizedEnumValues: true,
109
+ skipValidation: true,
110
+ breadcrumbsPrefix: ["response"],
111
+ }), _response.rawResponse);
112
+ case 403:
113
+ throw new AgentMail.FileForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
114
+ unrecognizedObjectKeys: "passthrough",
115
+ allowUnrecognizedUnionMembers: true,
116
+ allowUnrecognizedEnumValues: true,
117
+ skipValidation: true,
118
+ breadcrumbsPrefix: ["response"],
119
+ }), _response.rawResponse);
120
+ case 404:
121
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
122
+ unrecognizedObjectKeys: "passthrough",
123
+ allowUnrecognizedUnionMembers: true,
124
+ allowUnrecognizedEnumValues: true,
125
+ skipValidation: true,
126
+ breadcrumbsPrefix: ["response"],
127
+ }), _response.rawResponse);
128
+ case 409:
129
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
130
+ unrecognizedObjectKeys: "passthrough",
131
+ allowUnrecognizedUnionMembers: true,
132
+ allowUnrecognizedEnumValues: true,
133
+ skipValidation: true,
134
+ breadcrumbsPrefix: ["response"],
135
+ }), _response.rawResponse);
136
+ default:
137
+ throw new errors.AgentMailError({
138
+ statusCode: _response.error.statusCode,
139
+ body: _response.error.body,
140
+ rawResponse: _response.rawResponse,
141
+ });
142
+ }
143
+ }
144
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/files");
145
+ });
146
+ }
147
+ /**
148
+ * @beta This endpoint is in pre-release and may change.
149
+ *
150
+ * Makes a pending file `ready` once its bytes are uploaded, and returns it, with its `download_url` if the key
151
+ * has `file_read`. Calling it on a file that is already `ready` returns the file.
152
+ *
153
+ * Returns `409` if the bytes haven't been uploaded yet, or if what was uploaded doesn't match the file's `size`
154
+ * and `sha256`. Returns `404` for a file that has expired or was deleted, including a pending file not
155
+ * completed within a day of its creation.
156
+ *
157
+ * Requires the `file_create` permission. Only a key with `file_read`, or the key that created the file, can
158
+ * complete it; any other key gets `404`.
159
+ *
160
+ * @param {AgentMail.inboxes.InboxId} inbox_id
161
+ * @param {AgentMail.FileId} file_id
162
+ * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.
163
+ *
164
+ * @throws {@link AgentMail.ValidationError}
165
+ * @throws {@link AgentMail.FileForbiddenError}
166
+ * @throws {@link AgentMail.NotFoundError}
167
+ * @throws {@link AgentMail.ConflictError}
168
+ *
169
+ * @example
170
+ * await client.inboxes.files.complete("reports@agentmail.to", "6f1c2f4e-8d3b-4a5e-9c7d-1b2a3c4d5e6f")
171
+ */
172
+ complete(inbox_id, file_id, requestOptions) {
173
+ return core.HttpResponsePromise.fromPromise(this.__complete(inbox_id, file_id, requestOptions));
174
+ }
175
+ __complete(inbox_id, file_id, requestOptions) {
176
+ return __awaiter(this, void 0, void 0, function* () {
177
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
178
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
179
+ 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);
180
+ const _response = yield core.fetcher({
181
+ 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)
182
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/files/${core.url.encodePathParam(serializers.FileId.jsonOrThrow(file_id, { omitUndefined: true }))}/complete`),
183
+ method: "POST",
184
+ headers: _headers,
185
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
186
+ 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,
187
+ 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,
188
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
189
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
190
+ logging: this._options.logging,
191
+ });
192
+ if (_response.ok) {
193
+ return {
194
+ data: serializers.File_.parseOrThrow(_response.body, {
195
+ unrecognizedObjectKeys: "passthrough",
196
+ allowUnrecognizedUnionMembers: true,
197
+ allowUnrecognizedEnumValues: true,
198
+ skipValidation: true,
199
+ breadcrumbsPrefix: ["response"],
200
+ }),
201
+ rawResponse: _response.rawResponse,
202
+ };
203
+ }
204
+ if (_response.error.reason === "status-code") {
205
+ switch (_response.error.statusCode) {
206
+ case 400:
207
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
208
+ unrecognizedObjectKeys: "passthrough",
209
+ allowUnrecognizedUnionMembers: true,
210
+ allowUnrecognizedEnumValues: true,
211
+ skipValidation: true,
212
+ breadcrumbsPrefix: ["response"],
213
+ }), _response.rawResponse);
214
+ case 403:
215
+ throw new AgentMail.FileForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
216
+ unrecognizedObjectKeys: "passthrough",
217
+ allowUnrecognizedUnionMembers: true,
218
+ allowUnrecognizedEnumValues: true,
219
+ skipValidation: true,
220
+ breadcrumbsPrefix: ["response"],
221
+ }), _response.rawResponse);
222
+ case 404:
223
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
224
+ unrecognizedObjectKeys: "passthrough",
225
+ allowUnrecognizedUnionMembers: true,
226
+ allowUnrecognizedEnumValues: true,
227
+ skipValidation: true,
228
+ breadcrumbsPrefix: ["response"],
229
+ }), _response.rawResponse);
230
+ case 409:
231
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
232
+ unrecognizedObjectKeys: "passthrough",
233
+ allowUnrecognizedUnionMembers: true,
234
+ allowUnrecognizedEnumValues: true,
235
+ skipValidation: true,
236
+ breadcrumbsPrefix: ["response"],
237
+ }), _response.rawResponse);
238
+ default:
239
+ throw new errors.AgentMailError({
240
+ statusCode: _response.error.statusCode,
241
+ body: _response.error.body,
242
+ rawResponse: _response.rawResponse,
243
+ });
244
+ }
245
+ }
246
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/files/{file_id}/complete");
247
+ });
248
+ }
249
+ /**
250
+ * @beta This endpoint is in pre-release and may change.
251
+ *
252
+ * Gets a file. A `ready` file comes with a fresh `download_url`, valid for up to an hour.
253
+ *
254
+ * A get reads the region that serves the request, so for about a second after a delete it can still return
255
+ * the deleted file. A file that has expired returns `404` at once.
256
+ *
257
+ * Requires the `file_read` permission.
258
+ *
259
+ * @param {AgentMail.inboxes.InboxId} inbox_id
260
+ * @param {AgentMail.FileId} file_id
261
+ * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.
262
+ *
263
+ * @throws {@link AgentMail.ValidationError}
264
+ * @throws {@link AgentMail.FileForbiddenError}
265
+ * @throws {@link AgentMail.NotFoundError}
266
+ *
267
+ * @example
268
+ * await client.inboxes.files.get("reports@agentmail.to", "6f1c2f4e-8d3b-4a5e-9c7d-1b2a3c4d5e6f")
269
+ */
270
+ get(inbox_id, file_id, requestOptions) {
271
+ return core.HttpResponsePromise.fromPromise(this.__get(inbox_id, file_id, requestOptions));
272
+ }
273
+ __get(inbox_id, file_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 }))}/files/${core.url.encodePathParam(serializers.FileId.jsonOrThrow(file_id, { omitUndefined: true }))}`),
281
+ method: "GET",
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 {
292
+ data: serializers.File_.parseOrThrow(_response.body, {
293
+ unrecognizedObjectKeys: "passthrough",
294
+ allowUnrecognizedUnionMembers: true,
295
+ allowUnrecognizedEnumValues: true,
296
+ skipValidation: true,
297
+ breadcrumbsPrefix: ["response"],
298
+ }),
299
+ rawResponse: _response.rawResponse,
300
+ };
301
+ }
302
+ if (_response.error.reason === "status-code") {
303
+ switch (_response.error.statusCode) {
304
+ case 400:
305
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
306
+ unrecognizedObjectKeys: "passthrough",
307
+ allowUnrecognizedUnionMembers: true,
308
+ allowUnrecognizedEnumValues: true,
309
+ skipValidation: true,
310
+ breadcrumbsPrefix: ["response"],
311
+ }), _response.rawResponse);
312
+ case 403:
313
+ throw new AgentMail.FileForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
314
+ unrecognizedObjectKeys: "passthrough",
315
+ allowUnrecognizedUnionMembers: true,
316
+ allowUnrecognizedEnumValues: true,
317
+ skipValidation: true,
318
+ breadcrumbsPrefix: ["response"],
319
+ }), _response.rawResponse);
320
+ case 404:
321
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
322
+ unrecognizedObjectKeys: "passthrough",
323
+ allowUnrecognizedUnionMembers: true,
324
+ allowUnrecognizedEnumValues: true,
325
+ skipValidation: true,
326
+ breadcrumbsPrefix: ["response"],
327
+ }), _response.rawResponse);
328
+ default:
329
+ throw new errors.AgentMailError({
330
+ statusCode: _response.error.statusCode,
331
+ body: _response.error.body,
332
+ rawResponse: _response.rawResponse,
333
+ });
334
+ }
335
+ }
336
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/files/{file_id}");
337
+ });
338
+ }
339
+ /**
340
+ * @beta This endpoint is in pre-release and may change.
341
+ *
342
+ * Lists the inbox's files in path order, pending ones included, optionally only those whose path starts with
343
+ * `path_prefix`. A prefix matches characters, not whole segments: `reports/q` matches `reports/q3.pdf`. Items
344
+ * carry no download URL; get a file for one.
345
+ *
346
+ * The list is read in the region that serves the request, so a file created or deleted a moment ago may not
347
+ * show yet. Expired files never show.
348
+ *
349
+ * Requires the `file_read` permission.
350
+ *
351
+ * @param {AgentMail.inboxes.InboxId} inbox_id
352
+ * @param {AgentMail.inboxes.ListFilesRequest} request
353
+ * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.
354
+ *
355
+ * @throws {@link AgentMail.ValidationError}
356
+ * @throws {@link AgentMail.FileForbiddenError}
357
+ * @throws {@link AgentMail.NotFoundError}
358
+ *
359
+ * @example
360
+ * await client.inboxes.files.list("reports@agentmail.to", {
361
+ * pathPrefix: "reports/"
362
+ * })
363
+ */
364
+ list(inbox_id, request = {}, requestOptions) {
365
+ return core.HttpResponsePromise.fromPromise(this.__list(inbox_id, request, requestOptions));
366
+ }
367
+ __list(inbox_id_1) {
368
+ return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
369
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
370
+ const { pathPrefix, limit, pageToken, ascending } = request;
371
+ const _queryParams = {
372
+ path_prefix: pathPrefix,
373
+ limit,
374
+ page_token: pageToken,
375
+ ascending,
376
+ };
377
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
378
+ 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);
379
+ const _response = yield core.fetcher({
380
+ 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)
381
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/files`),
382
+ method: "GET",
383
+ headers: _headers,
384
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
385
+ 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,
386
+ 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,
387
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
388
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
389
+ logging: this._options.logging,
390
+ });
391
+ if (_response.ok) {
392
+ return {
393
+ data: serializers.ListFilesResponse.parseOrThrow(_response.body, {
394
+ unrecognizedObjectKeys: "passthrough",
395
+ allowUnrecognizedUnionMembers: true,
396
+ allowUnrecognizedEnumValues: true,
397
+ skipValidation: true,
398
+ breadcrumbsPrefix: ["response"],
399
+ }),
400
+ rawResponse: _response.rawResponse,
401
+ };
402
+ }
403
+ if (_response.error.reason === "status-code") {
404
+ switch (_response.error.statusCode) {
405
+ case 400:
406
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
407
+ unrecognizedObjectKeys: "passthrough",
408
+ allowUnrecognizedUnionMembers: true,
409
+ allowUnrecognizedEnumValues: true,
410
+ skipValidation: true,
411
+ breadcrumbsPrefix: ["response"],
412
+ }), _response.rawResponse);
413
+ case 403:
414
+ throw new AgentMail.FileForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
415
+ unrecognizedObjectKeys: "passthrough",
416
+ allowUnrecognizedUnionMembers: true,
417
+ allowUnrecognizedEnumValues: true,
418
+ skipValidation: true,
419
+ breadcrumbsPrefix: ["response"],
420
+ }), _response.rawResponse);
421
+ case 404:
422
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
423
+ unrecognizedObjectKeys: "passthrough",
424
+ allowUnrecognizedUnionMembers: true,
425
+ allowUnrecognizedEnumValues: true,
426
+ skipValidation: true,
427
+ breadcrumbsPrefix: ["response"],
428
+ }), _response.rawResponse);
429
+ default:
430
+ throw new errors.AgentMailError({
431
+ statusCode: _response.error.statusCode,
432
+ body: _response.error.body,
433
+ rawResponse: _response.rawResponse,
434
+ });
435
+ }
436
+ }
437
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/files");
438
+ });
439
+ }
440
+ /**
441
+ * @beta This endpoint is in pre-release and may change.
442
+ *
443
+ * Deletes a file, pending or `ready`, and frees its path at once. Its bytes are deleted, and its space given
444
+ * back to the organization's quota, within seconds. A download URL signed before the delete keeps working
445
+ * until it expires, at most an hour. Deleting a file that is already gone returns `404`.
446
+ *
447
+ * Requires the `file_delete` permission. Only a key with `file_read`, or the key that created the file, can
448
+ * delete it; any other key gets `404`.
449
+ *
450
+ * @param {AgentMail.inboxes.InboxId} inbox_id
451
+ * @param {AgentMail.FileId} file_id
452
+ * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.
453
+ *
454
+ * @throws {@link AgentMail.ValidationError}
455
+ * @throws {@link AgentMail.FileForbiddenError}
456
+ * @throws {@link AgentMail.NotFoundError}
457
+ *
458
+ * @example
459
+ * await client.inboxes.files.delete("reports@agentmail.to", "6f1c2f4e-8d3b-4a5e-9c7d-1b2a3c4d5e6f")
460
+ */
461
+ delete(inbox_id, file_id, requestOptions) {
462
+ return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, file_id, requestOptions));
463
+ }
464
+ __delete(inbox_id, file_id, requestOptions) {
465
+ return __awaiter(this, void 0, void 0, function* () {
466
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
467
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
468
+ 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);
469
+ const _response = yield core.fetcher({
470
+ 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)
471
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/files/${core.url.encodePathParam(serializers.FileId.jsonOrThrow(file_id, { omitUndefined: true }))}`),
472
+ method: "DELETE",
473
+ headers: _headers,
474
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
475
+ 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,
476
+ 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,
477
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
478
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
479
+ logging: this._options.logging,
480
+ });
481
+ if (_response.ok) {
482
+ return { data: undefined, rawResponse: _response.rawResponse };
483
+ }
484
+ if (_response.error.reason === "status-code") {
485
+ switch (_response.error.statusCode) {
486
+ case 400:
487
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
488
+ unrecognizedObjectKeys: "passthrough",
489
+ allowUnrecognizedUnionMembers: true,
490
+ allowUnrecognizedEnumValues: true,
491
+ skipValidation: true,
492
+ breadcrumbsPrefix: ["response"],
493
+ }), _response.rawResponse);
494
+ case 403:
495
+ throw new AgentMail.FileForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
496
+ unrecognizedObjectKeys: "passthrough",
497
+ allowUnrecognizedUnionMembers: true,
498
+ allowUnrecognizedEnumValues: true,
499
+ skipValidation: true,
500
+ breadcrumbsPrefix: ["response"],
501
+ }), _response.rawResponse);
502
+ case 404:
503
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
504
+ unrecognizedObjectKeys: "passthrough",
505
+ allowUnrecognizedUnionMembers: true,
506
+ allowUnrecognizedEnumValues: true,
507
+ skipValidation: true,
508
+ breadcrumbsPrefix: ["response"],
509
+ }), _response.rawResponse);
510
+ default:
511
+ throw new errors.AgentMailError({
512
+ statusCode: _response.error.statusCode,
513
+ body: _response.error.body,
514
+ rawResponse: _response.rawResponse,
515
+ });
516
+ }
517
+ }
518
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/inboxes/{inbox_id}/files/{file_id}");
519
+ });
520
+ }
521
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,12 @@
1
+ import type * as AgentMail from "../../../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * path: "reports/q3.pdf",
6
+ * size: 48213,
7
+ * sha256: "n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=",
8
+ * contentType: "application/pdf"
9
+ * }
10
+ */
11
+ export interface CreateFileRequestWrapper extends AgentMail.CreateFileRequest {
12
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,16 @@
1
+ import type * as AgentMail from "../../../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * pathPrefix: "reports/"
6
+ * }
7
+ */
8
+ export interface ListFilesRequest {
9
+ /** Only files whose path starts with this. Held to the path rules, except it may stop partway. */
10
+ pathPrefix?: string;
11
+ /** Page size, 100 by default and at most 500. */
12
+ limit?: AgentMail.Limit;
13
+ pageToken?: AgentMail.PageToken;
14
+ /** Path order, `true` by default. `false` lists in reverse. */
15
+ ascending?: boolean;
16
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,2 @@
1
+ export type { CreateFileRequestWrapper } from "./CreateFileRequestWrapper.mjs";
2
+ export type { ListFilesRequest } from "./ListFilesRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export { FilesClient } 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 { FilesClient } 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";
@@ -8,6 +8,8 @@ export * from "./drafts/client/requests/index.mjs";
8
8
  export * as drafts from "./drafts/index.mjs";
9
9
  export * from "./events/client/requests/index.mjs";
10
10
  export * as events from "./events/index.mjs";
11
+ export * from "./files/client/requests/index.mjs";
12
+ export * as files from "./files/index.mjs";
11
13
  export * from "./lists/client/requests/index.mjs";
12
14
  export * as lists from "./lists/index.mjs";
13
15
  export * from "./messages/client/requests/index.mjs";
@@ -8,6 +8,8 @@ export * from "./drafts/client/requests/index.mjs";
8
8
  export * as drafts from "./drafts/index.mjs";
9
9
  export * from "./events/client/requests/index.mjs";
10
10
  export * as events from "./events/index.mjs";
11
+ export * from "./files/client/requests/index.mjs";
12
+ export * as files from "./files/index.mjs";
11
13
  export * from "./lists/client/requests/index.mjs";
12
14
  export * as lists from "./lists/index.mjs";
13
15
  export * from "./messages/client/requests/index.mjs";
@@ -94,6 +94,34 @@ export declare class MessagesClient {
94
94
  */
95
95
  createAgentArmorFeedback(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.CreateAgentArmorFeedbackRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.AgentArmorFeedback>;
96
96
  private __createAgentArmorFeedback;
97
+ /**
98
+ * @beta This endpoint is in pre-release and may change.
99
+ *
100
+ * Release a message Agent Armor held for review in hold mode: your agents are sent its `message.received`
101
+ * event, `message.security.override` is sent too, in either order, and its `agent-armor-held` label is removed.
102
+ * Only a message whose verdict is `review` and that is still held can be released; anything else answers `409`.
103
+ * Repeating a release with the same reason and the same API key returns the first release; any other repeat
104
+ * answers `409`.
105
+ *
106
+ * Requires the opt-in `agent_armor_release` permission and permission to read the message. An organization
107
+ * admin can also release from the console.
108
+ *
109
+ * @param {AgentMail.inboxes.InboxId} inbox_id
110
+ * @param {AgentMail.MessageId} message_id
111
+ * @param {AgentMail.ReleaseAgentArmorMessageRequest} request
112
+ * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
113
+ *
114
+ * @throws {@link AgentMail.ValidationError}
115
+ * @throws {@link AgentMail.NotFoundError}
116
+ * @throws {@link AgentMail.ConflictError}
117
+ *
118
+ * @example
119
+ * await client.inboxes.messages.releaseAgentArmorMessage("inbox_id", "message_id", {
120
+ * reason: "reason"
121
+ * })
122
+ */
123
+ releaseAgentArmorMessage(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.ReleaseAgentArmorMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.ReleaseAgentArmorMessageResponse>;
124
+ private __releaseAgentArmorMessage;
97
125
  /**
98
126
  * Fetch metadata for up to 500 messages in one request. Missing or
99
127
  * restricted IDs are silently omitted; compare `count` against `limit`