agentmail 0.5.12 → 0.5.14

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 (219) hide show
  1. package/dist/cjs/BaseClient.d.ts +3 -0
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/api/errors/ConflictError.d.ts +6 -0
  4. package/dist/cjs/api/errors/ConflictError.js +54 -0
  5. package/dist/cjs/api/errors/index.d.ts +1 -0
  6. package/dist/cjs/api/errors/index.js +1 -0
  7. package/dist/cjs/api/resources/drafts/types/CreateDraftForwardRequest.d.ts +21 -0
  8. package/dist/cjs/api/resources/drafts/types/CreateDraftForwardRequest.js +3 -0
  9. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +17 -0
  10. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyAllRequest.js +3 -0
  11. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyRequest.d.ts +22 -0
  12. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyRequest.js +3 -0
  13. package/dist/cjs/api/resources/drafts/types/Draft.d.ts +1 -0
  14. package/dist/cjs/api/resources/drafts/types/DraftForwardOf.d.ts +4 -0
  15. package/dist/cjs/api/resources/drafts/types/DraftForwardOf.js +3 -0
  16. package/dist/cjs/api/resources/drafts/types/DraftItem.d.ts +1 -0
  17. package/dist/cjs/api/resources/drafts/types/DraftReplyAll.d.ts +4 -0
  18. package/dist/cjs/api/resources/drafts/types/DraftReplyAll.js +3 -0
  19. package/dist/cjs/api/resources/drafts/types/index.d.ts +5 -0
  20. package/dist/cjs/api/resources/drafts/types/index.js +5 -0
  21. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +3 -0
  22. package/dist/cjs/api/resources/inboxes/client/Client.js +5 -0
  23. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +6 -3
  24. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +11 -2
  25. package/dist/cjs/api/resources/inboxes/resources/index.d.ts +2 -0
  26. package/dist/cjs/api/resources/inboxes/resources/index.js +3 -1
  27. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +84 -9
  28. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +308 -8
  29. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.d.ts +103 -0
  30. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.js +411 -0
  31. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/index.d.ts +1 -0
  32. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/index.js +17 -0
  33. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.d.ts +10 -0
  34. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.js +3 -0
  35. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/index.d.ts +1 -0
  36. package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/index.js +2 -0
  37. package/dist/cjs/api/resources/inboxes/resources/webhooks/exports.d.ts +2 -0
  38. package/dist/cjs/api/resources/inboxes/resources/webhooks/exports.js +21 -0
  39. package/dist/cjs/api/resources/inboxes/resources/webhooks/index.d.ts +1 -0
  40. package/dist/cjs/api/resources/inboxes/resources/webhooks/index.js +17 -0
  41. package/dist/cjs/api/resources/pods/client/Client.d.ts +3 -0
  42. package/dist/cjs/api/resources/pods/client/Client.js +5 -0
  43. package/dist/cjs/api/resources/pods/resources/index.d.ts +2 -0
  44. package/dist/cjs/api/resources/pods/resources/index.js +3 -1
  45. package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.d.ts +103 -0
  46. package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.js +411 -0
  47. package/dist/cjs/api/resources/pods/resources/webhooks/client/index.d.ts +1 -0
  48. package/dist/cjs/api/resources/pods/resources/webhooks/client/index.js +17 -0
  49. package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.d.ts +10 -0
  50. package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.js +3 -0
  51. package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/index.d.ts +1 -0
  52. package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/index.js +2 -0
  53. package/dist/cjs/api/resources/pods/resources/webhooks/exports.d.ts +2 -0
  54. package/dist/cjs/api/resources/pods/resources/webhooks/exports.js +21 -0
  55. package/dist/cjs/api/resources/pods/resources/webhooks/index.d.ts +1 -0
  56. package/dist/cjs/api/resources/pods/resources/webhooks/index.js +17 -0
  57. package/dist/cjs/api/resources/webhooks/types/CreateInboxWebhookRequest.d.ts +10 -0
  58. package/dist/cjs/api/resources/webhooks/types/CreateInboxWebhookRequest.js +3 -0
  59. package/dist/cjs/api/resources/webhooks/types/CreatePodWebhookRequest.d.ts +9 -0
  60. package/dist/cjs/api/resources/webhooks/types/CreatePodWebhookRequest.js +3 -0
  61. package/dist/cjs/api/resources/webhooks/types/CreateWebhookEventTypes.d.ts +7 -0
  62. package/dist/cjs/api/resources/webhooks/types/CreateWebhookEventTypes.js +3 -0
  63. package/dist/cjs/api/resources/webhooks/types/CreateWebhookRequest.d.ts +1 -10
  64. package/dist/cjs/api/resources/webhooks/types/UpdateInboxWebhookRequest.d.ts +7 -0
  65. package/dist/cjs/api/resources/webhooks/types/UpdateInboxWebhookRequest.js +3 -0
  66. package/dist/cjs/api/resources/webhooks/types/UpdatePodWebhookRequest.d.ts +11 -0
  67. package/dist/cjs/api/resources/webhooks/types/UpdatePodWebhookRequest.js +3 -0
  68. package/dist/cjs/api/resources/webhooks/types/UpdateWebhookEventTypes.d.ts +10 -0
  69. package/dist/cjs/api/resources/webhooks/types/UpdateWebhookEventTypes.js +3 -0
  70. package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequest.d.ts +1 -14
  71. package/dist/cjs/api/resources/webhooks/types/index.d.ts +6 -0
  72. package/dist/cjs/api/resources/webhooks/types/index.js +6 -0
  73. package/dist/cjs/serialization/resources/drafts/types/CreateDraftForwardRequest.d.ts +30 -0
  74. package/dist/cjs/serialization/resources/drafts/types/CreateDraftForwardRequest.js +62 -0
  75. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +24 -0
  76. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyAllRequest.js +56 -0
  77. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.d.ts +32 -0
  78. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.js +64 -0
  79. package/dist/cjs/serialization/resources/drafts/types/Draft.d.ts +2 -0
  80. package/dist/cjs/serialization/resources/drafts/types/Draft.js +2 -0
  81. package/dist/cjs/serialization/resources/drafts/types/DraftForwardOf.d.ts +7 -0
  82. package/dist/cjs/serialization/resources/drafts/types/DraftForwardOf.js +39 -0
  83. package/dist/cjs/serialization/resources/drafts/types/DraftItem.d.ts +2 -0
  84. package/dist/cjs/serialization/resources/drafts/types/DraftItem.js +2 -0
  85. package/dist/cjs/serialization/resources/drafts/types/DraftReplyAll.d.ts +7 -0
  86. package/dist/cjs/serialization/resources/drafts/types/DraftReplyAll.js +39 -0
  87. package/dist/cjs/serialization/resources/drafts/types/index.d.ts +5 -0
  88. package/dist/cjs/serialization/resources/drafts/types/index.js +5 -0
  89. package/dist/cjs/serialization/resources/webhooks/types/CreateInboxWebhookRequest.d.ts +14 -0
  90. package/dist/cjs/serialization/resources/webhooks/types/CreateInboxWebhookRequest.js +46 -0
  91. package/dist/cjs/serialization/resources/webhooks/types/CreatePodWebhookRequest.d.ts +11 -0
  92. package/dist/cjs/serialization/resources/webhooks/types/CreatePodWebhookRequest.js +45 -0
  93. package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookEventTypes.d.ts +8 -0
  94. package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookEventTypes.js +6 -0
  95. package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookRequest.d.ts +2 -9
  96. package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookRequest.js +5 -10
  97. package/dist/cjs/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.d.ts +10 -0
  98. package/dist/cjs/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.js +42 -0
  99. package/dist/cjs/serialization/resources/webhooks/types/UpdatePodWebhookRequest.d.ts +12 -0
  100. package/dist/cjs/serialization/resources/webhooks/types/UpdatePodWebhookRequest.js +46 -0
  101. package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookEventTypes.d.ts +8 -0
  102. package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookEventTypes.js +6 -0
  103. package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookRequest.d.ts +2 -6
  104. package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookRequest.js +5 -7
  105. package/dist/cjs/serialization/resources/webhooks/types/index.d.ts +6 -0
  106. package/dist/cjs/serialization/resources/webhooks/types/index.js +6 -0
  107. package/dist/cjs/version.d.ts +1 -1
  108. package/dist/cjs/version.js +1 -1
  109. package/dist/esm/BaseClient.d.mts +3 -0
  110. package/dist/esm/BaseClient.mjs +2 -2
  111. package/dist/esm/api/errors/ConflictError.d.mts +6 -0
  112. package/dist/esm/api/errors/ConflictError.mjs +17 -0
  113. package/dist/esm/api/errors/index.d.mts +1 -0
  114. package/dist/esm/api/errors/index.mjs +1 -0
  115. package/dist/esm/api/resources/drafts/types/CreateDraftForwardRequest.d.mts +21 -0
  116. package/dist/esm/api/resources/drafts/types/CreateDraftForwardRequest.mjs +2 -0
  117. package/dist/esm/api/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +17 -0
  118. package/dist/esm/api/resources/drafts/types/CreateDraftReplyAllRequest.mjs +2 -0
  119. package/dist/esm/api/resources/drafts/types/CreateDraftReplyRequest.d.mts +22 -0
  120. package/dist/esm/api/resources/drafts/types/CreateDraftReplyRequest.mjs +2 -0
  121. package/dist/esm/api/resources/drafts/types/Draft.d.mts +1 -0
  122. package/dist/esm/api/resources/drafts/types/DraftForwardOf.d.mts +4 -0
  123. package/dist/esm/api/resources/drafts/types/DraftForwardOf.mjs +2 -0
  124. package/dist/esm/api/resources/drafts/types/DraftItem.d.mts +1 -0
  125. package/dist/esm/api/resources/drafts/types/DraftReplyAll.d.mts +4 -0
  126. package/dist/esm/api/resources/drafts/types/DraftReplyAll.mjs +2 -0
  127. package/dist/esm/api/resources/drafts/types/index.d.mts +5 -0
  128. package/dist/esm/api/resources/drafts/types/index.mjs +5 -0
  129. package/dist/esm/api/resources/inboxes/client/Client.d.mts +3 -0
  130. package/dist/esm/api/resources/inboxes/client/Client.mjs +5 -0
  131. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +6 -3
  132. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +12 -3
  133. package/dist/esm/api/resources/inboxes/resources/index.d.mts +2 -0
  134. package/dist/esm/api/resources/inboxes/resources/index.mjs +2 -0
  135. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +84 -9
  136. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +309 -9
  137. package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.d.mts +103 -0
  138. package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.mjs +374 -0
  139. package/dist/esm/api/resources/inboxes/resources/webhooks/client/index.d.mts +1 -0
  140. package/dist/esm/api/resources/inboxes/resources/webhooks/client/index.mjs +1 -0
  141. package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.d.mts +10 -0
  142. package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.mjs +2 -0
  143. package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/index.d.mts +1 -0
  144. package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/index.mjs +1 -0
  145. package/dist/esm/api/resources/inboxes/resources/webhooks/exports.d.mts +2 -0
  146. package/dist/esm/api/resources/inboxes/resources/webhooks/exports.mjs +3 -0
  147. package/dist/esm/api/resources/inboxes/resources/webhooks/index.d.mts +1 -0
  148. package/dist/esm/api/resources/inboxes/resources/webhooks/index.mjs +1 -0
  149. package/dist/esm/api/resources/pods/client/Client.d.mts +3 -0
  150. package/dist/esm/api/resources/pods/client/Client.mjs +5 -0
  151. package/dist/esm/api/resources/pods/resources/index.d.mts +2 -0
  152. package/dist/esm/api/resources/pods/resources/index.mjs +2 -0
  153. package/dist/esm/api/resources/pods/resources/webhooks/client/Client.d.mts +103 -0
  154. package/dist/esm/api/resources/pods/resources/webhooks/client/Client.mjs +374 -0
  155. package/dist/esm/api/resources/pods/resources/webhooks/client/index.d.mts +1 -0
  156. package/dist/esm/api/resources/pods/resources/webhooks/client/index.mjs +1 -0
  157. package/dist/esm/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.d.mts +10 -0
  158. package/dist/esm/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.mjs +2 -0
  159. package/dist/esm/api/resources/pods/resources/webhooks/client/requests/index.d.mts +1 -0
  160. package/dist/esm/api/resources/pods/resources/webhooks/client/requests/index.mjs +1 -0
  161. package/dist/esm/api/resources/pods/resources/webhooks/exports.d.mts +2 -0
  162. package/dist/esm/api/resources/pods/resources/webhooks/exports.mjs +3 -0
  163. package/dist/esm/api/resources/pods/resources/webhooks/index.d.mts +1 -0
  164. package/dist/esm/api/resources/pods/resources/webhooks/index.mjs +1 -0
  165. package/dist/esm/api/resources/webhooks/types/CreateInboxWebhookRequest.d.mts +10 -0
  166. package/dist/esm/api/resources/webhooks/types/CreateInboxWebhookRequest.mjs +2 -0
  167. package/dist/esm/api/resources/webhooks/types/CreatePodWebhookRequest.d.mts +9 -0
  168. package/dist/esm/api/resources/webhooks/types/CreatePodWebhookRequest.mjs +2 -0
  169. package/dist/esm/api/resources/webhooks/types/CreateWebhookEventTypes.d.mts +7 -0
  170. package/dist/esm/api/resources/webhooks/types/CreateWebhookEventTypes.mjs +2 -0
  171. package/dist/esm/api/resources/webhooks/types/CreateWebhookRequest.d.mts +1 -10
  172. package/dist/esm/api/resources/webhooks/types/UpdateInboxWebhookRequest.d.mts +7 -0
  173. package/dist/esm/api/resources/webhooks/types/UpdateInboxWebhookRequest.mjs +2 -0
  174. package/dist/esm/api/resources/webhooks/types/UpdatePodWebhookRequest.d.mts +11 -0
  175. package/dist/esm/api/resources/webhooks/types/UpdatePodWebhookRequest.mjs +2 -0
  176. package/dist/esm/api/resources/webhooks/types/UpdateWebhookEventTypes.d.mts +10 -0
  177. package/dist/esm/api/resources/webhooks/types/UpdateWebhookEventTypes.mjs +2 -0
  178. package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequest.d.mts +1 -14
  179. package/dist/esm/api/resources/webhooks/types/index.d.mts +6 -0
  180. package/dist/esm/api/resources/webhooks/types/index.mjs +6 -0
  181. package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.d.mts +30 -0
  182. package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.mjs +26 -0
  183. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +24 -0
  184. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.mjs +20 -0
  185. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.d.mts +32 -0
  186. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.mjs +28 -0
  187. package/dist/esm/serialization/resources/drafts/types/Draft.d.mts +2 -0
  188. package/dist/esm/serialization/resources/drafts/types/Draft.mjs +2 -0
  189. package/dist/esm/serialization/resources/drafts/types/DraftForwardOf.d.mts +7 -0
  190. package/dist/esm/serialization/resources/drafts/types/DraftForwardOf.mjs +3 -0
  191. package/dist/esm/serialization/resources/drafts/types/DraftItem.d.mts +2 -0
  192. package/dist/esm/serialization/resources/drafts/types/DraftItem.mjs +2 -0
  193. package/dist/esm/serialization/resources/drafts/types/DraftReplyAll.d.mts +7 -0
  194. package/dist/esm/serialization/resources/drafts/types/DraftReplyAll.mjs +3 -0
  195. package/dist/esm/serialization/resources/drafts/types/index.d.mts +5 -0
  196. package/dist/esm/serialization/resources/drafts/types/index.mjs +5 -0
  197. package/dist/esm/serialization/resources/webhooks/types/CreateInboxWebhookRequest.d.mts +14 -0
  198. package/dist/esm/serialization/resources/webhooks/types/CreateInboxWebhookRequest.mjs +10 -0
  199. package/dist/esm/serialization/resources/webhooks/types/CreatePodWebhookRequest.d.mts +11 -0
  200. package/dist/esm/serialization/resources/webhooks/types/CreatePodWebhookRequest.mjs +9 -0
  201. package/dist/esm/serialization/resources/webhooks/types/CreateWebhookEventTypes.d.mts +8 -0
  202. package/dist/esm/serialization/resources/webhooks/types/CreateWebhookEventTypes.mjs +3 -0
  203. package/dist/esm/serialization/resources/webhooks/types/CreateWebhookRequest.d.mts +2 -9
  204. package/dist/esm/serialization/resources/webhooks/types/CreateWebhookRequest.mjs +5 -10
  205. package/dist/esm/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.d.mts +10 -0
  206. package/dist/esm/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.mjs +6 -0
  207. package/dist/esm/serialization/resources/webhooks/types/UpdatePodWebhookRequest.d.mts +12 -0
  208. package/dist/esm/serialization/resources/webhooks/types/UpdatePodWebhookRequest.mjs +10 -0
  209. package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookEventTypes.d.mts +8 -0
  210. package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookEventTypes.mjs +3 -0
  211. package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookRequest.d.mts +2 -6
  212. package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookRequest.mjs +5 -7
  213. package/dist/esm/serialization/resources/webhooks/types/index.d.mts +6 -0
  214. package/dist/esm/serialization/resources/webhooks/types/index.mjs +6 -0
  215. package/dist/esm/version.d.mts +1 -1
  216. package/dist/esm/version.mjs +1 -1
  217. package/dist/llms.txt +21 -4
  218. package/package.json +23 -1
  219. package/reference.md +1466 -440
@@ -28,6 +28,9 @@ export interface BaseRequestOptions {
28
28
  /** Additional headers to include in the request. */
29
29
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
30
30
  }
31
+ export interface BaseIdempotentRequestOptions {
32
+ idempotencyKey?: string | undefined;
33
+ }
31
34
  export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
32
35
  logging: core.logging.Logger;
33
36
  authProvider?: core.AuthProvider;
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "agentmail",
46
- "X-Fern-SDK-Version": "0.5.12",
47
- "User-Agent": "agentmail/0.5.12",
46
+ "X-Fern-SDK-Version": "0.5.14",
47
+ "User-Agent": "agentmail/0.5.14",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -0,0 +1,6 @@
1
+ import type * as core from "../../core/index.js";
2
+ import * as errors from "../../errors/index.js";
3
+ import type * as AgentMail from "../index.js";
4
+ export declare class ConflictError extends errors.AgentMailError {
5
+ constructor(body: AgentMail.ErrorResponse, rawResponse?: core.RawResponse);
6
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.ConflictError = void 0;
38
+ const errors = __importStar(require("../../errors/index.js"));
39
+ class ConflictError extends errors.AgentMailError {
40
+ constructor(body, rawResponse) {
41
+ super({
42
+ message: "ConflictError",
43
+ statusCode: 409,
44
+ body: body,
45
+ rawResponse: rawResponse,
46
+ });
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = this.constructor.name;
52
+ }
53
+ }
54
+ exports.ConflictError = ConflictError;
@@ -1,3 +1,4 @@
1
+ export * from "./ConflictError.js";
1
2
  export * from "./IsTakenError.js";
2
3
  export * from "./NotFoundError.js";
3
4
  export * from "./UnprocessableError.js";
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ConflictError.js"), exports);
17
18
  __exportStar(require("./IsTakenError.js"), exports);
18
19
  __exportStar(require("./NotFoundError.js"), exports);
19
20
  __exportStar(require("./UnprocessableError.js"), exports);
@@ -0,0 +1,21 @@
1
+ import type * as AgentMail from "../../../index.js";
2
+ /**
3
+ * Body for creating a draft that forwards a message. The subject and
4
+ * threading are derived from the source message, whose body and attachments
5
+ * are merged in at send time. Recipients are optional, so a forward draft can
6
+ * be saved without an address and addressed later.
7
+ */
8
+ export interface CreateDraftForwardRequest {
9
+ labels?: AgentMail.DraftLabels;
10
+ replyTo?: AgentMail.DraftReplyTo;
11
+ to?: AgentMail.DraftTo;
12
+ cc?: AgentMail.DraftCc;
13
+ bcc?: AgentMail.DraftBcc;
14
+ subject?: AgentMail.DraftSubject;
15
+ text?: AgentMail.DraftText;
16
+ html?: AgentMail.DraftHtml;
17
+ /** Attachments to include in draft. */
18
+ attachments?: AgentMail.SendAttachment[];
19
+ sendAt?: AgentMail.DraftSendAt;
20
+ clientId?: AgentMail.DraftClientId;
21
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import type * as AgentMail from "../../../index.js";
2
+ /**
3
+ * Body for creating a draft that replies to the whole thread. Recipients,
4
+ * `in_reply_to`, `references`, and the subject are always derived from the
5
+ * source message, so `to`, `cc`, and `bcc` are not accepted.
6
+ */
7
+ export interface CreateDraftReplyAllRequest {
8
+ labels?: AgentMail.DraftLabels;
9
+ replyTo?: AgentMail.DraftReplyTo;
10
+ subject?: AgentMail.DraftSubject;
11
+ text?: AgentMail.DraftText;
12
+ html?: AgentMail.DraftHtml;
13
+ /** Attachments to include in draft. */
14
+ attachments?: AgentMail.SendAttachment[];
15
+ sendAt?: AgentMail.DraftSendAt;
16
+ clientId?: AgentMail.DraftClientId;
17
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import type * as AgentMail from "../../../index.js";
2
+ /**
3
+ * Body for creating a draft that replies to a message. `in_reply_to`,
4
+ * `references`, and the subject are derived from the source message. Set
5
+ * `reply_all` to address the whole thread (you cannot then also pass `to`,
6
+ * `cc`, or `bcc`).
7
+ */
8
+ export interface CreateDraftReplyRequest {
9
+ labels?: AgentMail.DraftLabels;
10
+ replyTo?: AgentMail.DraftReplyTo;
11
+ to?: AgentMail.DraftTo;
12
+ cc?: AgentMail.DraftCc;
13
+ bcc?: AgentMail.DraftBcc;
14
+ replyAll?: AgentMail.DraftReplyAll;
15
+ subject?: AgentMail.DraftSubject;
16
+ text?: AgentMail.DraftText;
17
+ html?: AgentMail.DraftHtml;
18
+ /** Attachments to include in draft. */
19
+ attachments?: AgentMail.SendAttachment[];
20
+ sendAt?: AgentMail.DraftSendAt;
21
+ clientId?: AgentMail.DraftClientId;
22
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -14,6 +14,7 @@ export interface Draft {
14
14
  html?: AgentMail.DraftHtml;
15
15
  attachments?: AgentMail.DraftAttachments;
16
16
  inReplyTo?: AgentMail.DraftInReplyTo;
17
+ forwardOf?: AgentMail.DraftForwardOf;
17
18
  /** IDs of previous messages in thread. */
18
19
  references?: string[];
19
20
  sendStatus?: AgentMail.DraftSendStatus;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * ID of message being forwarded.
3
+ */
4
+ export type DraftForwardOf = string;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -10,6 +10,7 @@ export interface DraftItem {
10
10
  preview?: AgentMail.DraftPreview;
11
11
  attachments?: AgentMail.DraftAttachments;
12
12
  inReplyTo?: AgentMail.DraftInReplyTo;
13
+ forwardOf?: AgentMail.DraftForwardOf;
13
14
  sendStatus?: AgentMail.DraftSendStatus;
14
15
  sendAt?: AgentMail.DraftSendAt;
15
16
  updatedAt: AgentMail.DraftUpdatedAt;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Reply to all recipients of the original message.
3
+ */
4
+ export type DraftReplyAll = boolean;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,15 +1,20 @@
1
+ export * from "./CreateDraftForwardRequest.js";
2
+ export * from "./CreateDraftReplyAllRequest.js";
3
+ export * from "./CreateDraftReplyRequest.js";
1
4
  export * from "./CreateDraftRequest.js";
2
5
  export * from "./Draft.js";
3
6
  export * from "./DraftAttachments.js";
4
7
  export * from "./DraftBcc.js";
5
8
  export * from "./DraftCc.js";
6
9
  export * from "./DraftClientId.js";
10
+ export * from "./DraftForwardOf.js";
7
11
  export * from "./DraftHtml.js";
8
12
  export * from "./DraftId.js";
9
13
  export * from "./DraftInReplyTo.js";
10
14
  export * from "./DraftItem.js";
11
15
  export * from "./DraftLabels.js";
12
16
  export * from "./DraftPreview.js";
17
+ export * from "./DraftReplyAll.js";
13
18
  export * from "./DraftReplyTo.js";
14
19
  export * from "./DraftSendAt.js";
15
20
  export * from "./DraftSendStatus.js";
@@ -14,18 +14,23 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./CreateDraftForwardRequest.js"), exports);
18
+ __exportStar(require("./CreateDraftReplyAllRequest.js"), exports);
19
+ __exportStar(require("./CreateDraftReplyRequest.js"), exports);
17
20
  __exportStar(require("./CreateDraftRequest.js"), exports);
18
21
  __exportStar(require("./Draft.js"), exports);
19
22
  __exportStar(require("./DraftAttachments.js"), exports);
20
23
  __exportStar(require("./DraftBcc.js"), exports);
21
24
  __exportStar(require("./DraftCc.js"), exports);
22
25
  __exportStar(require("./DraftClientId.js"), exports);
26
+ __exportStar(require("./DraftForwardOf.js"), exports);
23
27
  __exportStar(require("./DraftHtml.js"), exports);
24
28
  __exportStar(require("./DraftId.js"), exports);
25
29
  __exportStar(require("./DraftInReplyTo.js"), exports);
26
30
  __exportStar(require("./DraftItem.js"), exports);
27
31
  __exportStar(require("./DraftLabels.js"), exports);
28
32
  __exportStar(require("./DraftPreview.js"), exports);
33
+ __exportStar(require("./DraftReplyAll.js"), exports);
29
34
  __exportStar(require("./DraftReplyTo.js"), exports);
30
35
  __exportStar(require("./DraftSendAt.js"), exports);
31
36
  __exportStar(require("./DraftSendStatus.js"), exports);
@@ -9,6 +9,7 @@ import { ListsClient } from "../resources/lists/client/Client.js";
9
9
  import { MessagesClient } from "../resources/messages/client/Client.js";
10
10
  import { MetricsClient } from "../resources/metrics/client/Client.js";
11
11
  import { ThreadsClient } from "../resources/threads/client/Client.js";
12
+ import { WebhooksClient } from "../resources/webhooks/client/Client.js";
12
13
  export declare namespace InboxesClient {
13
14
  type Options = BaseClientOptions;
14
15
  interface RequestOptions extends BaseRequestOptions {
@@ -19,6 +20,7 @@ export declare class InboxesClient {
19
20
  protected _threads: ThreadsClient | undefined;
20
21
  protected _messages: MessagesClient | undefined;
21
22
  protected _drafts: DraftsClient | undefined;
23
+ protected _webhooks: WebhooksClient | undefined;
22
24
  protected _lists: ListsClient | undefined;
23
25
  protected _metrics: MetricsClient | undefined;
24
26
  protected _events: EventsClient | undefined;
@@ -27,6 +29,7 @@ export declare class InboxesClient {
27
29
  get threads(): ThreadsClient;
28
30
  get messages(): MessagesClient;
29
31
  get drafts(): DraftsClient;
32
+ get webhooks(): WebhooksClient;
30
33
  get lists(): ListsClient;
31
34
  get metrics(): MetricsClient;
32
35
  get events(): EventsClient;
@@ -59,6 +59,7 @@ const Client_js_4 = require("../resources/lists/client/Client.js");
59
59
  const Client_js_5 = require("../resources/messages/client/Client.js");
60
60
  const Client_js_6 = require("../resources/metrics/client/Client.js");
61
61
  const Client_js_7 = require("../resources/threads/client/Client.js");
62
+ const Client_js_8 = require("../resources/webhooks/client/Client.js");
62
63
  class InboxesClient {
63
64
  constructor(options = {}) {
64
65
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
@@ -75,6 +76,10 @@ class InboxesClient {
75
76
  var _a;
76
77
  return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new Client_js_2.DraftsClient(this._options)));
77
78
  }
79
+ get webhooks() {
80
+ var _a;
81
+ return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_8.WebhooksClient(this._options)));
82
+ }
78
83
  get lists() {
79
84
  var _a;
80
85
  return ((_a = this._lists) !== null && _a !== void 0 ? _a : (this._lists = new Client_js_4.ListsClient(this._options)));
@@ -1,4 +1,4 @@
1
- import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
1
+ import type { BaseClientOptions, BaseIdempotentRequestOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
3
3
  import * as core from "../../../../../../core/index.js";
4
4
  import * as AgentMail from "../../../../../index.js";
@@ -6,6 +6,8 @@ export declare namespace DraftsClient {
6
6
  type Options = BaseClientOptions;
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
+ interface IdempotentRequestOptions extends RequestOptions, BaseIdempotentRequestOptions {
10
+ }
9
11
  }
10
12
  export declare class DraftsClient {
11
13
  protected readonly _options: NormalizedClientOptionsWithAuth<DraftsClient.Options>;
@@ -123,15 +125,16 @@ export declare class DraftsClient {
123
125
  * @param {AgentMail.inboxes.InboxId} inbox_id
124
126
  * @param {AgentMail.DraftId} draft_id
125
127
  * @param {AgentMail.UpdateMessageRequest} request
126
- * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
128
+ * @param {DraftsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
127
129
  *
128
130
  * @throws {@link AgentMail.NotFoundError}
129
131
  * @throws {@link AgentMail.ValidationError}
132
+ * @throws {@link AgentMail.ConflictError}
130
133
  * @throws {@link AgentMail.MessageRejectedError}
131
134
  *
132
135
  * @example
133
136
  * await client.inboxes.drafts.send("inbox_id", "draft_id", {})
134
137
  */
135
- send(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, request: AgentMail.UpdateMessageRequest, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
138
+ send(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, request: AgentMail.UpdateMessageRequest, requestOptions?: DraftsClient.IdempotentRequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
136
139
  private __send;
137
140
  }
@@ -497,10 +497,11 @@ class DraftsClient {
497
497
  * @param {AgentMail.inboxes.InboxId} inbox_id
498
498
  * @param {AgentMail.DraftId} draft_id
499
499
  * @param {AgentMail.UpdateMessageRequest} request
500
- * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
500
+ * @param {DraftsClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
501
501
  *
502
502
  * @throws {@link AgentMail.NotFoundError}
503
503
  * @throws {@link AgentMail.ValidationError}
504
+ * @throws {@link AgentMail.ConflictError}
504
505
  * @throws {@link AgentMail.MessageRejectedError}
505
506
  *
506
507
  * @example
@@ -513,7 +514,7 @@ class DraftsClient {
513
514
  return __awaiter(this, void 0, void 0, function* () {
514
515
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
515
516
  const _authRequest = yield this._options.authProvider.getAuthRequest();
516
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
517
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
517
518
  const _response = yield core.fetcher({
518
519
  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)
519
520
  .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}/send`),
@@ -562,6 +563,14 @@ class DraftsClient {
562
563
  skipValidation: true,
563
564
  breadcrumbsPrefix: ["response"],
564
565
  }), _response.rawResponse);
566
+ case 409:
567
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
568
+ unrecognizedObjectKeys: "passthrough",
569
+ allowUnrecognizedUnionMembers: true,
570
+ allowUnrecognizedEnumValues: true,
571
+ skipValidation: true,
572
+ breadcrumbsPrefix: ["response"],
573
+ }), _response.rawResponse);
565
574
  case 403:
566
575
  throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
567
576
  unrecognizedObjectKeys: "passthrough",
@@ -12,3 +12,5 @@ export * from "./metrics/client/requests/index.js";
12
12
  export * as metrics from "./metrics/index.js";
13
13
  export * from "./threads/client/requests/index.js";
14
14
  export * as threads from "./threads/index.js";
15
+ export * from "./webhooks/client/requests/index.js";
16
+ export * as webhooks from "./webhooks/index.js";
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.threads = exports.metrics = exports.messages = exports.lists = exports.events = exports.drafts = exports.apiKeys = void 0;
39
+ exports.webhooks = exports.threads = exports.metrics = exports.messages = exports.lists = exports.events = exports.drafts = exports.apiKeys = void 0;
40
40
  __exportStar(require("./apiKeys/client/requests/index.js"), exports);
41
41
  exports.apiKeys = __importStar(require("./apiKeys/index.js"));
42
42
  __exportStar(require("./drafts/client/requests/index.js"), exports);
@@ -51,3 +51,5 @@ __exportStar(require("./metrics/client/requests/index.js"), exports);
51
51
  exports.metrics = __importStar(require("./metrics/index.js"));
52
52
  __exportStar(require("./threads/client/requests/index.js"), exports);
53
53
  exports.threads = __importStar(require("./threads/index.js"));
54
+ __exportStar(require("./webhooks/client/requests/index.js"), exports);
55
+ exports.webhooks = __importStar(require("./webhooks/index.js"));
@@ -1,4 +1,4 @@
1
- import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
1
+ import type { BaseClientOptions, BaseIdempotentRequestOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
3
3
  import * as core from "../../../../../../core/index.js";
4
4
  import * as AgentMail from "../../../../../index.js";
@@ -6,6 +6,8 @@ export declare namespace MessagesClient {
6
6
  type Options = BaseClientOptions;
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
+ interface IdempotentRequestOptions extends RequestOptions, BaseIdempotentRequestOptions {
10
+ }
9
11
  }
10
12
  export declare class MessagesClient {
11
13
  protected readonly _options: NormalizedClientOptionsWithAuth<MessagesClient.Options>;
@@ -200,16 +202,17 @@ export declare class MessagesClient {
200
202
  *
201
203
  * @param {AgentMail.inboxes.InboxId} inbox_id
202
204
  * @param {AgentMail.SendMessageRequest} request
203
- * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
205
+ * @param {MessagesClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
204
206
  *
205
207
  * @throws {@link AgentMail.ValidationError}
206
208
  * @throws {@link AgentMail.NotFoundError}
209
+ * @throws {@link AgentMail.ConflictError}
207
210
  * @throws {@link AgentMail.MessageRejectedError}
208
211
  *
209
212
  * @example
210
213
  * await client.inboxes.messages.send("inbox_id", {})
211
214
  */
212
- send(inbox_id: AgentMail.inboxes.InboxId, request: AgentMail.SendMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
215
+ send(inbox_id: AgentMail.inboxes.InboxId, request: AgentMail.SendMessageRequest, requestOptions?: MessagesClient.IdempotentRequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
213
216
  private __send;
214
217
  /**
215
218
  * **CLI:**
@@ -220,16 +223,17 @@ export declare class MessagesClient {
220
223
  * @param {AgentMail.inboxes.InboxId} inbox_id
221
224
  * @param {AgentMail.MessageId} message_id
222
225
  * @param {AgentMail.ReplyToMessageRequest} request
223
- * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
226
+ * @param {MessagesClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
224
227
  *
225
228
  * @throws {@link AgentMail.ValidationError}
226
229
  * @throws {@link AgentMail.NotFoundError}
230
+ * @throws {@link AgentMail.ConflictError}
227
231
  * @throws {@link AgentMail.MessageRejectedError}
228
232
  *
229
233
  * @example
230
234
  * await client.inboxes.messages.reply("inbox_id", "message_id", {})
231
235
  */
232
- reply(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.ReplyToMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
236
+ reply(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.ReplyToMessageRequest, requestOptions?: MessagesClient.IdempotentRequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
233
237
  private __reply;
234
238
  /**
235
239
  * **CLI:**
@@ -240,16 +244,17 @@ export declare class MessagesClient {
240
244
  * @param {AgentMail.inboxes.InboxId} inbox_id
241
245
  * @param {AgentMail.MessageId} message_id
242
246
  * @param {AgentMail.ReplyAllMessageRequest} request
243
- * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
247
+ * @param {MessagesClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
244
248
  *
245
249
  * @throws {@link AgentMail.ValidationError}
246
250
  * @throws {@link AgentMail.NotFoundError}
251
+ * @throws {@link AgentMail.ConflictError}
247
252
  * @throws {@link AgentMail.MessageRejectedError}
248
253
  *
249
254
  * @example
250
255
  * await client.inboxes.messages.replyAll("inbox_id", "message_id", {})
251
256
  */
252
- replyAll(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.ReplyAllMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
257
+ replyAll(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.ReplyAllMessageRequest, requestOptions?: MessagesClient.IdempotentRequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
253
258
  private __replyAll;
254
259
  /**
255
260
  * **CLI:**
@@ -260,15 +265,85 @@ export declare class MessagesClient {
260
265
  * @param {AgentMail.inboxes.InboxId} inbox_id
261
266
  * @param {AgentMail.MessageId} message_id
262
267
  * @param {AgentMail.SendMessageRequest} request
263
- * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
268
+ * @param {MessagesClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
264
269
  *
265
270
  * @throws {@link AgentMail.ValidationError}
266
271
  * @throws {@link AgentMail.NotFoundError}
272
+ * @throws {@link AgentMail.ConflictError}
267
273
  * @throws {@link AgentMail.MessageRejectedError}
268
274
  *
269
275
  * @example
270
276
  * await client.inboxes.messages.forward("inbox_id", "message_id", {})
271
277
  */
272
- forward(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.SendMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
278
+ forward(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.SendMessageRequest, requestOptions?: MessagesClient.IdempotentRequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
273
279
  private __forward;
280
+ /**
281
+ * Create a draft that replies to a message instead of sending it. The
282
+ * recipients, subject, and threading are derived from the source message.
283
+ * Send it later with `Send Draft`.
284
+ *
285
+ * **CLI:**
286
+ * ```bash
287
+ * agentmail inboxes:messages draft-reply --inbox-id <inbox_id> --message-id <message_id> --text "Reply text"
288
+ * ```
289
+ *
290
+ * @param {AgentMail.inboxes.InboxId} inbox_id
291
+ * @param {AgentMail.MessageId} message_id
292
+ * @param {AgentMail.CreateDraftReplyRequest} request
293
+ * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
294
+ *
295
+ * @throws {@link AgentMail.ValidationError}
296
+ * @throws {@link AgentMail.NotFoundError}
297
+ *
298
+ * @example
299
+ * await client.inboxes.messages.draftReply("inbox_id", "message_id", {})
300
+ */
301
+ draftReply(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.CreateDraftReplyRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
302
+ private __draftReply;
303
+ /**
304
+ * Create a draft that replies to every recipient of a message instead of
305
+ * sending it. Recipients, subject, and threading are derived from the
306
+ * source message. Send it later with `Send Draft`.
307
+ *
308
+ * **CLI:**
309
+ * ```bash
310
+ * agentmail inboxes:messages draft-reply-all --inbox-id <inbox_id> --message-id <message_id> --text "Reply text"
311
+ * ```
312
+ *
313
+ * @param {AgentMail.inboxes.InboxId} inbox_id
314
+ * @param {AgentMail.MessageId} message_id
315
+ * @param {AgentMail.CreateDraftReplyAllRequest} request
316
+ * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
317
+ *
318
+ * @throws {@link AgentMail.ValidationError}
319
+ * @throws {@link AgentMail.NotFoundError}
320
+ *
321
+ * @example
322
+ * await client.inboxes.messages.draftReplyAll("inbox_id", "message_id", {})
323
+ */
324
+ draftReplyAll(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.CreateDraftReplyAllRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
325
+ private __draftReplyAll;
326
+ /**
327
+ * Create a draft that forwards a message instead of sending it. The subject
328
+ * and threading are derived from the source message, whose body and
329
+ * attachments are merged in at send time. Send it later with `Send Draft`.
330
+ *
331
+ * **CLI:**
332
+ * ```bash
333
+ * agentmail inboxes:messages draft-forward --inbox-id <inbox_id> --message-id <message_id> --to recipient@example.com
334
+ * ```
335
+ *
336
+ * @param {AgentMail.inboxes.InboxId} inbox_id
337
+ * @param {AgentMail.MessageId} message_id
338
+ * @param {AgentMail.CreateDraftForwardRequest} request
339
+ * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
340
+ *
341
+ * @throws {@link AgentMail.ValidationError}
342
+ * @throws {@link AgentMail.NotFoundError}
343
+ *
344
+ * @example
345
+ * await client.inboxes.messages.draftForward("inbox_id", "message_id", {})
346
+ */
347
+ draftForward(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.CreateDraftForwardRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
348
+ private __draftForward;
274
349
  }