agentmail 0.0.57 → 0.0.64

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 (228) hide show
  1. package/dist/cjs/Client.d.ts +2 -2
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/domains/client/Client.d.ts +2 -2
  4. package/dist/cjs/api/resources/domains/client/Client.js +4 -4
  5. package/dist/cjs/api/resources/drafts/client/Client.d.ts +2 -2
  6. package/dist/cjs/api/resources/drafts/client/Client.js +2 -2
  7. package/dist/cjs/api/resources/drafts/types/CreateDraftRequest.d.ts +1 -0
  8. package/dist/cjs/api/resources/drafts/types/Draft.d.ts +1 -2
  9. package/dist/cjs/api/resources/drafts/types/DraftInReplyTo.d.ts +7 -0
  10. package/dist/cjs/api/resources/drafts/types/DraftInReplyTo.js +5 -0
  11. package/dist/cjs/api/resources/drafts/types/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/drafts/types/index.js +1 -0
  13. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +13 -2
  14. package/dist/cjs/api/resources/inboxes/client/Client.js +66 -3
  15. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +3 -2
  16. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +6 -5
  17. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +2 -2
  18. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +7 -7
  19. package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.d.ts +2 -2
  20. package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.js +1 -1
  21. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.d.ts +14 -2
  22. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +67 -3
  23. package/dist/cjs/api/resources/messages/types/Message.d.ts +5 -8
  24. package/dist/cjs/api/resources/messages/types/MessageCreatedAt.d.ts +7 -0
  25. package/dist/cjs/api/resources/messages/types/MessageCreatedAt.js +5 -0
  26. package/dist/cjs/api/resources/messages/types/MessageInReplyTo.d.ts +7 -0
  27. package/dist/cjs/api/resources/messages/types/MessageInReplyTo.js +5 -0
  28. package/dist/cjs/api/resources/messages/types/MessageItem.d.ts +5 -0
  29. package/dist/cjs/api/resources/messages/types/MessageReferences.d.ts +7 -0
  30. package/dist/cjs/api/resources/messages/types/MessageReferences.js +5 -0
  31. package/dist/cjs/api/resources/messages/types/MessageReplyTo.d.ts +7 -0
  32. package/dist/cjs/api/resources/messages/types/MessageReplyTo.js +5 -0
  33. package/dist/cjs/api/resources/messages/types/MessageSize.d.ts +7 -0
  34. package/dist/cjs/api/resources/messages/types/MessageSize.js +5 -0
  35. package/dist/cjs/api/resources/messages/types/MessageUpdatedAt.d.ts +7 -0
  36. package/dist/cjs/api/resources/messages/types/MessageUpdatedAt.js +5 -0
  37. package/dist/cjs/api/resources/messages/types/index.d.ts +6 -0
  38. package/dist/cjs/api/resources/messages/types/index.js +6 -0
  39. package/dist/cjs/api/resources/metrics/client/Client.d.ts +2 -2
  40. package/dist/cjs/api/resources/metrics/client/Client.js +1 -1
  41. package/dist/cjs/api/resources/threads/client/Client.d.ts +13 -2
  42. package/dist/cjs/api/resources/threads/client/Client.js +66 -3
  43. package/dist/cjs/api/resources/threads/types/Thread.d.ts +6 -4
  44. package/dist/cjs/api/resources/threads/types/ThreadCreatedAt.d.ts +7 -0
  45. package/dist/cjs/api/resources/threads/types/ThreadCreatedAt.js +5 -0
  46. package/dist/cjs/api/resources/threads/types/ThreadItem.d.ts +6 -0
  47. package/dist/cjs/api/resources/threads/types/ThreadLastMessageId.d.ts +7 -0
  48. package/dist/cjs/api/resources/threads/types/ThreadLastMessageId.js +5 -0
  49. package/dist/cjs/api/resources/threads/types/ThreadReceivedTimestamp.d.ts +7 -0
  50. package/dist/cjs/api/resources/threads/types/ThreadReceivedTimestamp.js +5 -0
  51. package/dist/cjs/api/resources/threads/types/ThreadSentTimestamp.d.ts +7 -0
  52. package/dist/cjs/api/resources/threads/types/ThreadSentTimestamp.js +5 -0
  53. package/dist/cjs/api/resources/threads/types/ThreadSize.d.ts +7 -0
  54. package/dist/cjs/api/resources/threads/types/ThreadSize.js +5 -0
  55. package/dist/cjs/api/resources/threads/types/ThreadTimestamp.d.ts +1 -1
  56. package/dist/cjs/api/resources/threads/types/ThreadUpdatedAt.d.ts +7 -0
  57. package/dist/cjs/api/resources/threads/types/ThreadUpdatedAt.js +5 -0
  58. package/dist/cjs/api/resources/threads/types/index.d.ts +6 -0
  59. package/dist/cjs/api/resources/threads/types/index.js +6 -0
  60. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +2 -2
  61. package/dist/cjs/api/resources/webhooks/client/Client.js +4 -4
  62. package/dist/cjs/api/resources/websockets/client/Client.d.ts +1 -1
  63. package/dist/cjs/api/resources/websockets/client/Client.js +2 -1
  64. package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -1
  65. package/dist/cjs/core/fetcher/requestWithRetries.js +44 -8
  66. package/dist/cjs/core/headers.d.ts +2 -2
  67. package/dist/cjs/core/websocket/ws.d.ts +1 -1
  68. package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.d.ts +2 -0
  69. package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.js +2 -0
  70. package/dist/cjs/serialization/resources/drafts/types/Draft.d.ts +2 -1
  71. package/dist/cjs/serialization/resources/drafts/types/Draft.js +2 -1
  72. package/dist/cjs/serialization/resources/drafts/types/DraftInReplyTo.d.ts +10 -0
  73. package/dist/cjs/serialization/resources/drafts/types/DraftInReplyTo.js +41 -0
  74. package/dist/cjs/serialization/resources/drafts/types/index.d.ts +1 -0
  75. package/dist/cjs/serialization/resources/drafts/types/index.js +1 -0
  76. package/dist/cjs/serialization/resources/messages/types/Message.d.ts +10 -4
  77. package/dist/cjs/serialization/resources/messages/types/Message.js +10 -4
  78. package/dist/cjs/serialization/resources/messages/types/MessageCreatedAt.d.ts +10 -0
  79. package/dist/cjs/serialization/resources/messages/types/MessageCreatedAt.js +41 -0
  80. package/dist/cjs/serialization/resources/messages/types/MessageInReplyTo.d.ts +10 -0
  81. package/dist/cjs/serialization/resources/messages/types/MessageInReplyTo.js +41 -0
  82. package/dist/cjs/serialization/resources/messages/types/MessageItem.d.ts +10 -0
  83. package/dist/cjs/serialization/resources/messages/types/MessageItem.js +10 -0
  84. package/dist/cjs/serialization/resources/messages/types/MessageReferences.d.ts +10 -0
  85. package/dist/cjs/serialization/resources/messages/types/MessageReferences.js +41 -0
  86. package/dist/cjs/serialization/resources/messages/types/MessageReplyTo.d.ts +10 -0
  87. package/dist/cjs/serialization/resources/messages/types/MessageReplyTo.js +41 -0
  88. package/dist/cjs/serialization/resources/messages/types/MessageSize.d.ts +10 -0
  89. package/dist/cjs/serialization/resources/messages/types/MessageSize.js +41 -0
  90. package/dist/cjs/serialization/resources/messages/types/MessageUpdatedAt.d.ts +10 -0
  91. package/dist/cjs/serialization/resources/messages/types/MessageUpdatedAt.js +41 -0
  92. package/dist/cjs/serialization/resources/messages/types/index.d.ts +6 -0
  93. package/dist/cjs/serialization/resources/messages/types/index.js +6 -0
  94. package/dist/cjs/serialization/resources/threads/types/Thread.d.ts +12 -2
  95. package/dist/cjs/serialization/resources/threads/types/Thread.js +12 -2
  96. package/dist/cjs/serialization/resources/threads/types/ThreadCreatedAt.d.ts +10 -0
  97. package/dist/cjs/serialization/resources/threads/types/ThreadCreatedAt.js +41 -0
  98. package/dist/cjs/serialization/resources/threads/types/ThreadItem.d.ts +12 -0
  99. package/dist/cjs/serialization/resources/threads/types/ThreadItem.js +12 -0
  100. package/dist/cjs/serialization/resources/threads/types/ThreadLastMessageId.d.ts +10 -0
  101. package/dist/cjs/serialization/resources/threads/types/ThreadLastMessageId.js +41 -0
  102. package/dist/cjs/serialization/resources/threads/types/ThreadReceivedTimestamp.d.ts +10 -0
  103. package/dist/cjs/serialization/resources/threads/types/ThreadReceivedTimestamp.js +41 -0
  104. package/dist/cjs/serialization/resources/threads/types/ThreadSentTimestamp.d.ts +10 -0
  105. package/dist/cjs/serialization/resources/threads/types/ThreadSentTimestamp.js +41 -0
  106. package/dist/cjs/serialization/resources/threads/types/ThreadSize.d.ts +10 -0
  107. package/dist/cjs/serialization/resources/threads/types/ThreadSize.js +41 -0
  108. package/dist/cjs/serialization/resources/threads/types/ThreadUpdatedAt.d.ts +10 -0
  109. package/dist/cjs/serialization/resources/threads/types/ThreadUpdatedAt.js +41 -0
  110. package/dist/cjs/serialization/resources/threads/types/index.d.ts +6 -0
  111. package/dist/cjs/serialization/resources/threads/types/index.js +6 -0
  112. package/dist/cjs/version.d.ts +1 -1
  113. package/dist/cjs/version.js +1 -1
  114. package/dist/esm/Client.d.mts +2 -2
  115. package/dist/esm/Client.mjs +2 -2
  116. package/dist/esm/api/resources/domains/client/Client.d.mts +2 -2
  117. package/dist/esm/api/resources/domains/client/Client.mjs +4 -4
  118. package/dist/esm/api/resources/drafts/client/Client.d.mts +2 -2
  119. package/dist/esm/api/resources/drafts/client/Client.mjs +2 -2
  120. package/dist/esm/api/resources/drafts/types/CreateDraftRequest.d.mts +1 -0
  121. package/dist/esm/api/resources/drafts/types/Draft.d.mts +1 -2
  122. package/dist/esm/api/resources/drafts/types/DraftInReplyTo.d.mts +7 -0
  123. package/dist/esm/api/resources/drafts/types/DraftInReplyTo.mjs +4 -0
  124. package/dist/esm/api/resources/drafts/types/index.d.mts +1 -0
  125. package/dist/esm/api/resources/drafts/types/index.mjs +1 -0
  126. package/dist/esm/api/resources/inboxes/client/Client.d.mts +13 -2
  127. package/dist/esm/api/resources/inboxes/client/Client.mjs +66 -3
  128. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +3 -2
  129. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +6 -5
  130. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +2 -2
  131. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +7 -7
  132. package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.d.mts +2 -2
  133. package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.mjs +1 -1
  134. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.d.mts +14 -2
  135. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +67 -3
  136. package/dist/esm/api/resources/messages/types/Message.d.mts +5 -8
  137. package/dist/esm/api/resources/messages/types/MessageCreatedAt.d.mts +7 -0
  138. package/dist/esm/api/resources/messages/types/MessageCreatedAt.mjs +4 -0
  139. package/dist/esm/api/resources/messages/types/MessageInReplyTo.d.mts +7 -0
  140. package/dist/esm/api/resources/messages/types/MessageInReplyTo.mjs +4 -0
  141. package/dist/esm/api/resources/messages/types/MessageItem.d.mts +5 -0
  142. package/dist/esm/api/resources/messages/types/MessageReferences.d.mts +7 -0
  143. package/dist/esm/api/resources/messages/types/MessageReferences.mjs +4 -0
  144. package/dist/esm/api/resources/messages/types/MessageReplyTo.d.mts +7 -0
  145. package/dist/esm/api/resources/messages/types/MessageReplyTo.mjs +4 -0
  146. package/dist/esm/api/resources/messages/types/MessageSize.d.mts +7 -0
  147. package/dist/esm/api/resources/messages/types/MessageSize.mjs +4 -0
  148. package/dist/esm/api/resources/messages/types/MessageUpdatedAt.d.mts +7 -0
  149. package/dist/esm/api/resources/messages/types/MessageUpdatedAt.mjs +4 -0
  150. package/dist/esm/api/resources/messages/types/index.d.mts +6 -0
  151. package/dist/esm/api/resources/messages/types/index.mjs +6 -0
  152. package/dist/esm/api/resources/metrics/client/Client.d.mts +2 -2
  153. package/dist/esm/api/resources/metrics/client/Client.mjs +1 -1
  154. package/dist/esm/api/resources/threads/client/Client.d.mts +13 -2
  155. package/dist/esm/api/resources/threads/client/Client.mjs +66 -3
  156. package/dist/esm/api/resources/threads/types/Thread.d.mts +6 -4
  157. package/dist/esm/api/resources/threads/types/ThreadCreatedAt.d.mts +7 -0
  158. package/dist/esm/api/resources/threads/types/ThreadCreatedAt.mjs +4 -0
  159. package/dist/esm/api/resources/threads/types/ThreadItem.d.mts +6 -0
  160. package/dist/esm/api/resources/threads/types/ThreadLastMessageId.d.mts +7 -0
  161. package/dist/esm/api/resources/threads/types/ThreadLastMessageId.mjs +4 -0
  162. package/dist/esm/api/resources/threads/types/ThreadReceivedTimestamp.d.mts +7 -0
  163. package/dist/esm/api/resources/threads/types/ThreadReceivedTimestamp.mjs +4 -0
  164. package/dist/esm/api/resources/threads/types/ThreadSentTimestamp.d.mts +7 -0
  165. package/dist/esm/api/resources/threads/types/ThreadSentTimestamp.mjs +4 -0
  166. package/dist/esm/api/resources/threads/types/ThreadSize.d.mts +7 -0
  167. package/dist/esm/api/resources/threads/types/ThreadSize.mjs +4 -0
  168. package/dist/esm/api/resources/threads/types/ThreadTimestamp.d.mts +1 -1
  169. package/dist/esm/api/resources/threads/types/ThreadUpdatedAt.d.mts +7 -0
  170. package/dist/esm/api/resources/threads/types/ThreadUpdatedAt.mjs +4 -0
  171. package/dist/esm/api/resources/threads/types/index.d.mts +6 -0
  172. package/dist/esm/api/resources/threads/types/index.mjs +6 -0
  173. package/dist/esm/api/resources/webhooks/client/Client.d.mts +2 -2
  174. package/dist/esm/api/resources/webhooks/client/Client.mjs +4 -4
  175. package/dist/esm/api/resources/websockets/client/Client.d.mts +1 -1
  176. package/dist/esm/api/resources/websockets/client/Client.mjs +2 -1
  177. package/dist/esm/core/fetcher/Fetcher.d.mts +1 -1
  178. package/dist/esm/core/fetcher/requestWithRetries.mjs +44 -8
  179. package/dist/esm/core/headers.d.mts +2 -2
  180. package/dist/esm/core/websocket/ws.d.mts +1 -1
  181. package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.d.mts +2 -0
  182. package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.mjs +2 -0
  183. package/dist/esm/serialization/resources/drafts/types/Draft.d.mts +2 -1
  184. package/dist/esm/serialization/resources/drafts/types/Draft.mjs +2 -1
  185. package/dist/esm/serialization/resources/drafts/types/DraftInReplyTo.d.mts +10 -0
  186. package/dist/esm/serialization/resources/drafts/types/DraftInReplyTo.mjs +5 -0
  187. package/dist/esm/serialization/resources/drafts/types/index.d.mts +1 -0
  188. package/dist/esm/serialization/resources/drafts/types/index.mjs +1 -0
  189. package/dist/esm/serialization/resources/messages/types/Message.d.mts +10 -4
  190. package/dist/esm/serialization/resources/messages/types/Message.mjs +10 -4
  191. package/dist/esm/serialization/resources/messages/types/MessageCreatedAt.d.mts +10 -0
  192. package/dist/esm/serialization/resources/messages/types/MessageCreatedAt.mjs +5 -0
  193. package/dist/esm/serialization/resources/messages/types/MessageInReplyTo.d.mts +10 -0
  194. package/dist/esm/serialization/resources/messages/types/MessageInReplyTo.mjs +5 -0
  195. package/dist/esm/serialization/resources/messages/types/MessageItem.d.mts +10 -0
  196. package/dist/esm/serialization/resources/messages/types/MessageItem.mjs +10 -0
  197. package/dist/esm/serialization/resources/messages/types/MessageReferences.d.mts +10 -0
  198. package/dist/esm/serialization/resources/messages/types/MessageReferences.mjs +5 -0
  199. package/dist/esm/serialization/resources/messages/types/MessageReplyTo.d.mts +10 -0
  200. package/dist/esm/serialization/resources/messages/types/MessageReplyTo.mjs +5 -0
  201. package/dist/esm/serialization/resources/messages/types/MessageSize.d.mts +10 -0
  202. package/dist/esm/serialization/resources/messages/types/MessageSize.mjs +5 -0
  203. package/dist/esm/serialization/resources/messages/types/MessageUpdatedAt.d.mts +10 -0
  204. package/dist/esm/serialization/resources/messages/types/MessageUpdatedAt.mjs +5 -0
  205. package/dist/esm/serialization/resources/messages/types/index.d.mts +6 -0
  206. package/dist/esm/serialization/resources/messages/types/index.mjs +6 -0
  207. package/dist/esm/serialization/resources/threads/types/Thread.d.mts +12 -2
  208. package/dist/esm/serialization/resources/threads/types/Thread.mjs +12 -2
  209. package/dist/esm/serialization/resources/threads/types/ThreadCreatedAt.d.mts +10 -0
  210. package/dist/esm/serialization/resources/threads/types/ThreadCreatedAt.mjs +5 -0
  211. package/dist/esm/serialization/resources/threads/types/ThreadItem.d.mts +12 -0
  212. package/dist/esm/serialization/resources/threads/types/ThreadItem.mjs +12 -0
  213. package/dist/esm/serialization/resources/threads/types/ThreadLastMessageId.d.mts +10 -0
  214. package/dist/esm/serialization/resources/threads/types/ThreadLastMessageId.mjs +5 -0
  215. package/dist/esm/serialization/resources/threads/types/ThreadReceivedTimestamp.d.mts +10 -0
  216. package/dist/esm/serialization/resources/threads/types/ThreadReceivedTimestamp.mjs +5 -0
  217. package/dist/esm/serialization/resources/threads/types/ThreadSentTimestamp.d.mts +10 -0
  218. package/dist/esm/serialization/resources/threads/types/ThreadSentTimestamp.mjs +5 -0
  219. package/dist/esm/serialization/resources/threads/types/ThreadSize.d.mts +10 -0
  220. package/dist/esm/serialization/resources/threads/types/ThreadSize.mjs +5 -0
  221. package/dist/esm/serialization/resources/threads/types/ThreadUpdatedAt.d.mts +10 -0
  222. package/dist/esm/serialization/resources/threads/types/ThreadUpdatedAt.mjs +5 -0
  223. package/dist/esm/serialization/resources/threads/types/index.d.mts +6 -0
  224. package/dist/esm/serialization/resources/threads/types/index.mjs +6 -0
  225. package/dist/esm/version.d.mts +1 -1
  226. package/dist/esm/version.mjs +1 -1
  227. package/package.json +1 -1
  228. package/reference.md +393 -0
@@ -1,12 +1,18 @@
1
1
  export * from "./ThreadId.mjs";
2
2
  export * from "./ThreadLabels.mjs";
3
3
  export * from "./ThreadTimestamp.mjs";
4
+ export * from "./ThreadReceivedTimestamp.mjs";
5
+ export * from "./ThreadSentTimestamp.mjs";
4
6
  export * from "./ThreadSenders.mjs";
5
7
  export * from "./ThreadRecipients.mjs";
6
8
  export * from "./ThreadSubject.mjs";
7
9
  export * from "./ThreadPreview.mjs";
8
10
  export * from "./ThreadAttachments.mjs";
11
+ export * from "./ThreadLastMessageId.mjs";
9
12
  export * from "./ThreadMessageCount.mjs";
13
+ export * from "./ThreadSize.mjs";
14
+ export * from "./ThreadUpdatedAt.mjs";
15
+ export * from "./ThreadCreatedAt.mjs";
10
16
  export * from "./ThreadItem.mjs";
11
17
  export * from "./Thread.mjs";
12
18
  export * from "./ListThreadsResponse.mjs";
@@ -11,7 +11,7 @@ export declare namespace Webhooks {
11
11
  baseUrl?: core.Supplier<string>;
12
12
  apiKey?: core.Supplier<core.BearerToken | undefined>;
13
13
  /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
15
  }
16
16
  interface RequestOptions {
17
17
  /** The maximum time to wait for a response in seconds. */
@@ -23,7 +23,7 @@ export declare namespace Webhooks {
23
23
  /** Additional query string parameters to include in the request. */
24
24
  queryParams?: Record<string, unknown>;
25
25
  /** Additional headers to include in the request. */
26
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
26
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
27
27
  }
28
28
  }
29
29
  export declare class Webhooks {
@@ -41,7 +41,7 @@ export class Webhooks {
41
41
  if (pageToken != null) {
42
42
  _queryParams["page_token"] = pageToken;
43
43
  }
44
- var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
44
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
45
45
  const _response = yield core.fetcher({
46
46
  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.Production).http, "/v0/webhooks"),
47
47
  method: "GET",
@@ -102,7 +102,7 @@ export class Webhooks {
102
102
  __get(webhookId, requestOptions) {
103
103
  return __awaiter(this, void 0, void 0, function* () {
104
104
  var _a, _b, _c;
105
- var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
105
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
106
106
  const _response = yield core.fetcher({
107
107
  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.Production).http, `/v0/webhooks/${encodeURIComponent(serializers.webhooks.WebhookId.jsonOrThrow(webhookId, { omitUndefined: true }))}`),
108
108
  method: "GET",
@@ -179,7 +179,7 @@ export class Webhooks {
179
179
  __create(request, requestOptions) {
180
180
  return __awaiter(this, void 0, void 0, function* () {
181
181
  var _a, _b, _c;
182
- var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
182
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
183
183
  const _response = yield core.fetcher({
184
184
  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.Production).http, "/v0/webhooks"),
185
185
  method: "POST",
@@ -257,7 +257,7 @@ export class Webhooks {
257
257
  __delete(webhookId, requestOptions) {
258
258
  return __awaiter(this, void 0, void 0, function* () {
259
259
  var _a, _b, _c;
260
- var _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
260
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
261
261
  const _response = yield core.fetcher({
262
262
  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.Production).http, `/v0/webhooks/${encodeURIComponent(serializers.webhooks.WebhookId.jsonOrThrow(webhookId, { omitUndefined: true }))}`),
263
263
  method: "DELETE",
@@ -11,7 +11,7 @@ export declare namespace Websockets {
11
11
  baseUrl?: core.Supplier<string>;
12
12
  apiKey?: core.Supplier<core.BearerToken | undefined>;
13
13
  /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
15
  }
16
16
  interface ConnectArgs {
17
17
  authToken?: string | undefined;
@@ -12,6 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
12
12
  };
13
13
  import * as environments from "../../../../environments.mjs";
14
14
  import * as core from "../../../../core/index.mjs";
15
+ import { mergeOnlyDefinedHeaders, mergeHeaders } from "../../../../core/headers.mjs";
15
16
  import { WebsocketsSocket } from "./Socket.mjs";
16
17
  import * as errors from "../../../../errors/index.mjs";
17
18
  export class Websockets {
@@ -26,7 +27,7 @@ export class Websockets {
26
27
  if (authToken != null) {
27
28
  _queryParams["auth_token"] = authToken;
28
29
  }
29
- let _headers = Object.assign({}, headers);
30
+ let _headers = mergeHeaders(mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), headers);
30
31
  const socket = new core.ReconnectingWebSocket({
31
32
  url: core.url.join((_a = (yield core.Supplier.get(this._options["baseUrl"]))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options["environment"]))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production).websockets, "/v0"),
32
33
  protocols: [],
@@ -6,7 +6,7 @@ export declare namespace Fetcher {
6
6
  url: string;
7
7
  method: string;
8
8
  contentType?: string;
9
- headers?: Record<string, string | Supplier<string | undefined> | undefined>;
9
+ headers?: Record<string, string | Supplier<string | null | undefined> | null | undefined>;
10
10
  queryParameters?: Record<string, unknown>;
11
11
  body?: unknown;
12
12
  timeoutMs?: number;
@@ -11,21 +11,57 @@ const INITIAL_RETRY_DELAY = 1000; // in milliseconds
11
11
  const MAX_RETRY_DELAY = 60000; // in milliseconds
12
12
  const DEFAULT_MAX_RETRIES = 2;
13
13
  const JITTER_FACTOR = 0.2; // 20% random jitter
14
- function addJitter(delay) {
15
- // Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR
16
- const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR;
14
+ function addPositiveJitter(delay) {
15
+ // Generate a random value between 0 and +JITTER_FACTOR
16
+ const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR;
17
17
  return delay * jitterMultiplier;
18
18
  }
19
+ function addSymmetricJitter(delay) {
20
+ // Generate a random value in a JITTER_FACTOR-sized percentage range around delay
21
+ const jitterMultiplier = 1 + (Math.random() - 0.5) * JITTER_FACTOR;
22
+ return delay * jitterMultiplier;
23
+ }
24
+ function getRetryDelayFromHeaders(response, retryAttempt) {
25
+ // Check for Retry-After header first (RFC 7231), with no jitter
26
+ const retryAfter = response.headers.get("Retry-After");
27
+ if (retryAfter) {
28
+ // Parse as number of seconds...
29
+ const retryAfterSeconds = parseInt(retryAfter, 10);
30
+ if (!isNaN(retryAfterSeconds) && retryAfterSeconds > 0) {
31
+ return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY);
32
+ }
33
+ // ...or as an HTTP date; both are valid
34
+ const retryAfterDate = new Date(retryAfter);
35
+ if (!isNaN(retryAfterDate.getTime())) {
36
+ const delay = retryAfterDate.getTime() - Date.now();
37
+ if (delay > 0) {
38
+ return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY);
39
+ }
40
+ }
41
+ }
42
+ // Then check for industry-standard X-RateLimit-Reset header, with positive jitter
43
+ const rateLimitReset = response.headers.get("X-RateLimit-Reset");
44
+ if (rateLimitReset) {
45
+ const resetTime = parseInt(rateLimitReset, 10);
46
+ if (!isNaN(resetTime)) {
47
+ // Assume Unix timestamp in epoch seconds
48
+ const delay = resetTime * 1000 - Date.now();
49
+ if (delay > 0) {
50
+ return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY));
51
+ }
52
+ }
53
+ }
54
+ // Fall back to exponential backoff, with symmetric jitter
55
+ return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * Math.pow(2, retryAttempt), MAX_RETRY_DELAY));
56
+ }
19
57
  export function requestWithRetries(requestFn_1) {
20
58
  return __awaiter(this, arguments, void 0, function* (requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
21
59
  let response = yield requestFn();
22
60
  for (let i = 0; i < maxRetries; ++i) {
23
61
  if ([408, 429].includes(response.status) || response.status >= 500) {
24
- // Calculate base delay using exponential backoff (in milliseconds)
25
- const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY);
26
- // Add jitter to the delay
27
- const delayWithJitter = addJitter(baseDelay);
28
- yield new Promise((resolve) => setTimeout(resolve, delayWithJitter));
62
+ // Get delay with appropriate jitter applied
63
+ const delay = getRetryDelayFromHeaders(response, i);
64
+ yield new Promise((resolve) => setTimeout(resolve, delay));
29
65
  response = yield requestFn();
30
66
  }
31
67
  else {
@@ -1,3 +1,3 @@
1
1
  import * as core from "./index.mjs";
2
- export declare function mergeHeaders(...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]): Record<string, string | core.Supplier<string | undefined>>;
3
- export declare function mergeOnlyDefinedHeaders(...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]): Record<string, string | core.Supplier<string | undefined>>;
2
+ export declare function mergeHeaders(...headersArray: (Record<string, string | core.Supplier<string | null | undefined> | null | undefined> | null | undefined)[]): Record<string, string | core.Supplier<string | null | undefined>>;
3
+ export declare function mergeOnlyDefinedHeaders(...headersArray: (Record<string, string | core.Supplier<string | null | undefined> | null | undefined> | null | undefined)[]): Record<string, string | core.Supplier<string | null | undefined>>;
@@ -7,7 +7,7 @@ export declare namespace ReconnectingWebSocket {
7
7
  url: string;
8
8
  protocols?: string | string[];
9
9
  options?: ReconnectingWebSocket.Options;
10
- headers?: Record<string, string>;
10
+ headers?: Record<string, unknown>;
11
11
  queryParameters?: Record<string, string | string[] | object | object[] | null | undefined>;
12
12
  }
13
13
  type Options = {
@@ -12,6 +12,7 @@ import { DraftBcc } from "./DraftBcc.mjs";
12
12
  import { DraftSubject } from "./DraftSubject.mjs";
13
13
  import { DraftText } from "./DraftText.mjs";
14
14
  import { DraftHtml } from "./DraftHtml.mjs";
15
+ import { DraftInReplyTo } from "./DraftInReplyTo.mjs";
15
16
  import { DraftSendAt } from "./DraftSendAt.mjs";
16
17
  export declare const CreateDraftRequest: core.serialization.ObjectSchema<serializers.CreateDraftRequest.Raw, AgentMail.CreateDraftRequest>;
17
18
  export declare namespace CreateDraftRequest {
@@ -24,6 +25,7 @@ export declare namespace CreateDraftRequest {
24
25
  subject?: DraftSubject.Raw | null;
25
26
  text?: DraftText.Raw | null;
26
27
  html?: DraftHtml.Raw | null;
28
+ in_reply_to?: DraftInReplyTo.Raw | null;
27
29
  send_at?: DraftSendAt.Raw | null;
28
30
  }
29
31
  }
@@ -10,6 +10,7 @@ import { DraftBcc } from "./DraftBcc.mjs";
10
10
  import { DraftSubject } from "./DraftSubject.mjs";
11
11
  import { DraftText } from "./DraftText.mjs";
12
12
  import { DraftHtml } from "./DraftHtml.mjs";
13
+ import { DraftInReplyTo } from "./DraftInReplyTo.mjs";
13
14
  import { DraftSendAt } from "./DraftSendAt.mjs";
14
15
  export const CreateDraftRequest = core.serialization.object({
15
16
  labels: DraftLabels.optional(),
@@ -20,5 +21,6 @@ export const CreateDraftRequest = core.serialization.object({
20
21
  subject: DraftSubject.optional(),
21
22
  text: DraftText.optional(),
22
23
  html: DraftHtml.optional(),
24
+ inReplyTo: core.serialization.property("in_reply_to", DraftInReplyTo.optional()),
23
25
  sendAt: core.serialization.property("send_at", DraftSendAt.optional()),
24
26
  });
@@ -17,6 +17,7 @@ import { DraftPreview } from "./DraftPreview.mjs";
17
17
  import { DraftText } from "./DraftText.mjs";
18
18
  import { DraftHtml } from "./DraftHtml.mjs";
19
19
  import { DraftAttachments } from "./DraftAttachments.mjs";
20
+ import { DraftInReplyTo } from "./DraftInReplyTo.mjs";
20
21
  import { DraftSendStatus } from "./DraftSendStatus.mjs";
21
22
  import { DraftSendAt } from "./DraftSendAt.mjs";
22
23
  import { DraftUpdatedAt } from "./DraftUpdatedAt.mjs";
@@ -36,7 +37,7 @@ export declare namespace Draft {
36
37
  text?: DraftText.Raw | null;
37
38
  html?: DraftHtml.Raw | null;
38
39
  attachments?: DraftAttachments.Raw | null;
39
- in_reply_to?: string | null;
40
+ in_reply_to?: DraftInReplyTo.Raw | null;
40
41
  references?: string[] | null;
41
42
  send_status?: DraftSendStatus.Raw | null;
42
43
  send_at?: DraftSendAt.Raw | null;
@@ -15,6 +15,7 @@ import { DraftPreview } from "./DraftPreview.mjs";
15
15
  import { DraftText } from "./DraftText.mjs";
16
16
  import { DraftHtml } from "./DraftHtml.mjs";
17
17
  import { DraftAttachments } from "./DraftAttachments.mjs";
18
+ import { DraftInReplyTo } from "./DraftInReplyTo.mjs";
18
19
  import { DraftSendStatus } from "./DraftSendStatus.mjs";
19
20
  import { DraftSendAt } from "./DraftSendAt.mjs";
20
21
  import { DraftUpdatedAt } from "./DraftUpdatedAt.mjs";
@@ -32,7 +33,7 @@ export const Draft = core.serialization.object({
32
33
  text: DraftText.optional(),
33
34
  html: DraftHtml.optional(),
34
35
  attachments: DraftAttachments.optional(),
35
- inReplyTo: core.serialization.property("in_reply_to", core.serialization.string().optional()),
36
+ inReplyTo: core.serialization.property("in_reply_to", DraftInReplyTo.optional()),
36
37
  references: core.serialization.list(core.serialization.string()).optional(),
37
38
  sendStatus: core.serialization.property("send_status", DraftSendStatus.optional()),
38
39
  sendAt: core.serialization.property("send_at", DraftSendAt.optional()),
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index.mjs";
5
+ import * as AgentMail from "../../../../api/index.mjs";
6
+ import * as core from "../../../../core/index.mjs";
7
+ export declare const DraftInReplyTo: core.serialization.Schema<serializers.DraftInReplyTo.Raw, AgentMail.DraftInReplyTo>;
8
+ export declare namespace DraftInReplyTo {
9
+ type Raw = string;
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../core/index.mjs";
5
+ export const DraftInReplyTo = core.serialization.string();
@@ -9,6 +9,7 @@ export * from "./DraftPreview.mjs";
9
9
  export * from "./DraftText.mjs";
10
10
  export * from "./DraftHtml.mjs";
11
11
  export * from "./DraftAttachments.mjs";
12
+ export * from "./DraftInReplyTo.mjs";
12
13
  export * from "./DraftSendStatus.mjs";
13
14
  export * from "./DraftSendAt.mjs";
14
15
  export * from "./DraftUpdatedAt.mjs";
@@ -9,6 +9,7 @@ export * from "./DraftPreview.mjs";
9
9
  export * from "./DraftText.mjs";
10
10
  export * from "./DraftHtml.mjs";
11
11
  export * from "./DraftAttachments.mjs";
12
+ export * from "./DraftInReplyTo.mjs";
12
13
  export * from "./DraftSendStatus.mjs";
13
14
  export * from "./DraftSendAt.mjs";
14
15
  export * from "./DraftUpdatedAt.mjs";
@@ -18,6 +18,11 @@ import { MessagePreview } from "./MessagePreview.mjs";
18
18
  import { MessageText } from "./MessageText.mjs";
19
19
  import { MessageHtml } from "./MessageHtml.mjs";
20
20
  import { MessageAttachments } from "./MessageAttachments.mjs";
21
+ import { MessageInReplyTo } from "./MessageInReplyTo.mjs";
22
+ import { MessageReferences } from "./MessageReferences.mjs";
23
+ import { MessageSize } from "./MessageSize.mjs";
24
+ import { MessageUpdatedAt } from "./MessageUpdatedAt.mjs";
25
+ import { MessageCreatedAt } from "./MessageCreatedAt.mjs";
21
26
  export declare const Message: core.serialization.ObjectSchema<serializers.Message.Raw, AgentMail.Message>;
22
27
  export declare namespace Message {
23
28
  interface Raw {
@@ -36,9 +41,10 @@ export declare namespace Message {
36
41
  text?: MessageText.Raw | null;
37
42
  html?: MessageHtml.Raw | null;
38
43
  attachments?: MessageAttachments.Raw | null;
39
- in_reply_to?: string | null;
40
- references?: string[] | null;
41
- updated_at: string;
42
- created_at: string;
44
+ in_reply_to?: MessageInReplyTo.Raw | null;
45
+ references?: MessageReferences.Raw | null;
46
+ size: MessageSize.Raw;
47
+ updated_at: MessageUpdatedAt.Raw;
48
+ created_at: MessageCreatedAt.Raw;
43
49
  }
44
50
  }
@@ -16,6 +16,11 @@ import { MessagePreview } from "./MessagePreview.mjs";
16
16
  import { MessageText } from "./MessageText.mjs";
17
17
  import { MessageHtml } from "./MessageHtml.mjs";
18
18
  import { MessageAttachments } from "./MessageAttachments.mjs";
19
+ import { MessageInReplyTo } from "./MessageInReplyTo.mjs";
20
+ import { MessageReferences } from "./MessageReferences.mjs";
21
+ import { MessageSize } from "./MessageSize.mjs";
22
+ import { MessageUpdatedAt } from "./MessageUpdatedAt.mjs";
23
+ import { MessageCreatedAt } from "./MessageCreatedAt.mjs";
19
24
  export const Message = core.serialization.object({
20
25
  inboxId: core.serialization.property("inbox_id", InboxId),
21
26
  threadId: core.serialization.property("thread_id", ThreadId),
@@ -32,8 +37,9 @@ export const Message = core.serialization.object({
32
37
  text: MessageText.optional(),
33
38
  html: MessageHtml.optional(),
34
39
  attachments: MessageAttachments.optional(),
35
- inReplyTo: core.serialization.property("in_reply_to", core.serialization.string().optional()),
36
- references: core.serialization.list(core.serialization.string()).optional(),
37
- updatedAt: core.serialization.property("updated_at", core.serialization.date()),
38
- createdAt: core.serialization.property("created_at", core.serialization.date()),
40
+ inReplyTo: core.serialization.property("in_reply_to", MessageInReplyTo.optional()),
41
+ references: MessageReferences.optional(),
42
+ size: MessageSize,
43
+ updatedAt: core.serialization.property("updated_at", MessageUpdatedAt),
44
+ createdAt: core.serialization.property("created_at", MessageCreatedAt),
39
45
  });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index.mjs";
5
+ import * as AgentMail from "../../../../api/index.mjs";
6
+ import * as core from "../../../../core/index.mjs";
7
+ export declare const MessageCreatedAt: core.serialization.Schema<serializers.MessageCreatedAt.Raw, AgentMail.MessageCreatedAt>;
8
+ export declare namespace MessageCreatedAt {
9
+ type Raw = string;
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../core/index.mjs";
5
+ export const MessageCreatedAt = core.serialization.date();
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index.mjs";
5
+ import * as AgentMail from "../../../../api/index.mjs";
6
+ import * as core from "../../../../core/index.mjs";
7
+ export declare const MessageInReplyTo: core.serialization.Schema<serializers.MessageInReplyTo.Raw, AgentMail.MessageInReplyTo>;
8
+ export declare namespace MessageInReplyTo {
9
+ type Raw = string;
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../core/index.mjs";
5
+ export const MessageInReplyTo = core.serialization.string();
@@ -16,6 +16,11 @@ import { MessageBcc } from "./MessageBcc.mjs";
16
16
  import { MessageSubject } from "./MessageSubject.mjs";
17
17
  import { MessagePreview } from "./MessagePreview.mjs";
18
18
  import { MessageAttachments } from "./MessageAttachments.mjs";
19
+ import { MessageInReplyTo } from "./MessageInReplyTo.mjs";
20
+ import { MessageReferences } from "./MessageReferences.mjs";
21
+ import { MessageSize } from "./MessageSize.mjs";
22
+ import { MessageUpdatedAt } from "./MessageUpdatedAt.mjs";
23
+ import { MessageCreatedAt } from "./MessageCreatedAt.mjs";
19
24
  export declare const MessageItem: core.serialization.ObjectSchema<serializers.MessageItem.Raw, AgentMail.MessageItem>;
20
25
  export declare namespace MessageItem {
21
26
  interface Raw {
@@ -31,5 +36,10 @@ export declare namespace MessageItem {
31
36
  subject?: MessageSubject.Raw | null;
32
37
  preview?: MessagePreview.Raw | null;
33
38
  attachments?: MessageAttachments.Raw | null;
39
+ in_reply_to?: MessageInReplyTo.Raw | null;
40
+ references?: MessageReferences.Raw | null;
41
+ size: MessageSize.Raw;
42
+ updated_at: MessageUpdatedAt.Raw;
43
+ created_at: MessageCreatedAt.Raw;
34
44
  }
35
45
  }
@@ -14,6 +14,11 @@ import { MessageBcc } from "./MessageBcc.mjs";
14
14
  import { MessageSubject } from "./MessageSubject.mjs";
15
15
  import { MessagePreview } from "./MessagePreview.mjs";
16
16
  import { MessageAttachments } from "./MessageAttachments.mjs";
17
+ import { MessageInReplyTo } from "./MessageInReplyTo.mjs";
18
+ import { MessageReferences } from "./MessageReferences.mjs";
19
+ import { MessageSize } from "./MessageSize.mjs";
20
+ import { MessageUpdatedAt } from "./MessageUpdatedAt.mjs";
21
+ import { MessageCreatedAt } from "./MessageCreatedAt.mjs";
17
22
  export const MessageItem = core.serialization.object({
18
23
  inboxId: core.serialization.property("inbox_id", InboxId),
19
24
  threadId: core.serialization.property("thread_id", ThreadId),
@@ -27,4 +32,9 @@ export const MessageItem = core.serialization.object({
27
32
  subject: MessageSubject.optional(),
28
33
  preview: MessagePreview.optional(),
29
34
  attachments: MessageAttachments.optional(),
35
+ inReplyTo: core.serialization.property("in_reply_to", MessageInReplyTo.optional()),
36
+ references: MessageReferences.optional(),
37
+ size: MessageSize,
38
+ updatedAt: core.serialization.property("updated_at", MessageUpdatedAt),
39
+ createdAt: core.serialization.property("created_at", MessageCreatedAt),
30
40
  });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index.mjs";
5
+ import * as AgentMail from "../../../../api/index.mjs";
6
+ import * as core from "../../../../core/index.mjs";
7
+ export declare const MessageReferences: core.serialization.Schema<serializers.MessageReferences.Raw, AgentMail.MessageReferences>;
8
+ export declare namespace MessageReferences {
9
+ type Raw = string[];
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../core/index.mjs";
5
+ export const MessageReferences = core.serialization.list(core.serialization.string());
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index.mjs";
5
+ import * as AgentMail from "../../../../api/index.mjs";
6
+ import * as core from "../../../../core/index.mjs";
7
+ export declare const MessageReplyTo: core.serialization.Schema<serializers.MessageReplyTo.Raw, AgentMail.MessageReplyTo>;
8
+ export declare namespace MessageReplyTo {
9
+ type Raw = string[];
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../core/index.mjs";
5
+ export const MessageReplyTo = core.serialization.list(core.serialization.string());
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index.mjs";
5
+ import * as AgentMail from "../../../../api/index.mjs";
6
+ import * as core from "../../../../core/index.mjs";
7
+ export declare const MessageSize: core.serialization.Schema<serializers.MessageSize.Raw, AgentMail.MessageSize>;
8
+ export declare namespace MessageSize {
9
+ type Raw = number;
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../core/index.mjs";
5
+ export const MessageSize = core.serialization.number();
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index.mjs";
5
+ import * as AgentMail from "../../../../api/index.mjs";
6
+ import * as core from "../../../../core/index.mjs";
7
+ export declare const MessageUpdatedAt: core.serialization.Schema<serializers.MessageUpdatedAt.Raw, AgentMail.MessageUpdatedAt>;
8
+ export declare namespace MessageUpdatedAt {
9
+ type Raw = string;
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../core/index.mjs";
5
+ export const MessageUpdatedAt = core.serialization.date();
@@ -2,6 +2,7 @@ export * from "./MessageId.mjs";
2
2
  export * from "./MessageLabels.mjs";
3
3
  export * from "./MessageTimestamp.mjs";
4
4
  export * from "./MessageFrom.mjs";
5
+ export * from "./MessageReplyTo.mjs";
5
6
  export * from "./MessageTo.mjs";
6
7
  export * from "./MessageCc.mjs";
7
8
  export * from "./MessageBcc.mjs";
@@ -10,6 +11,11 @@ export * from "./MessagePreview.mjs";
10
11
  export * from "./MessageText.mjs";
11
12
  export * from "./MessageHtml.mjs";
12
13
  export * from "./MessageAttachments.mjs";
14
+ export * from "./MessageInReplyTo.mjs";
15
+ export * from "./MessageReferences.mjs";
16
+ export * from "./MessageSize.mjs";
17
+ export * from "./MessageUpdatedAt.mjs";
18
+ export * from "./MessageCreatedAt.mjs";
13
19
  export * from "./MessageItem.mjs";
14
20
  export * from "./Message.mjs";
15
21
  export * from "./ListMessagesResponse.mjs";
@@ -2,6 +2,7 @@ export * from "./MessageId.mjs";
2
2
  export * from "./MessageLabels.mjs";
3
3
  export * from "./MessageTimestamp.mjs";
4
4
  export * from "./MessageFrom.mjs";
5
+ export * from "./MessageReplyTo.mjs";
5
6
  export * from "./MessageTo.mjs";
6
7
  export * from "./MessageCc.mjs";
7
8
  export * from "./MessageBcc.mjs";
@@ -10,6 +11,11 @@ export * from "./MessagePreview.mjs";
10
11
  export * from "./MessageText.mjs";
11
12
  export * from "./MessageHtml.mjs";
12
13
  export * from "./MessageAttachments.mjs";
14
+ export * from "./MessageInReplyTo.mjs";
15
+ export * from "./MessageReferences.mjs";
16
+ export * from "./MessageSize.mjs";
17
+ export * from "./MessageUpdatedAt.mjs";
18
+ export * from "./MessageCreatedAt.mjs";
13
19
  export * from "./MessageItem.mjs";
14
20
  export * from "./Message.mjs";
15
21
  export * from "./ListMessagesResponse.mjs";
@@ -8,12 +8,18 @@ import { InboxId } from "../../inboxes/types/InboxId.mjs";
8
8
  import { ThreadId } from "./ThreadId.mjs";
9
9
  import { ThreadLabels } from "./ThreadLabels.mjs";
10
10
  import { ThreadTimestamp } from "./ThreadTimestamp.mjs";
11
+ import { ThreadReceivedTimestamp } from "./ThreadReceivedTimestamp.mjs";
12
+ import { ThreadSentTimestamp } from "./ThreadSentTimestamp.mjs";
11
13
  import { ThreadSenders } from "./ThreadSenders.mjs";
12
14
  import { ThreadRecipients } from "./ThreadRecipients.mjs";
13
15
  import { ThreadSubject } from "./ThreadSubject.mjs";
14
16
  import { ThreadPreview } from "./ThreadPreview.mjs";
15
17
  import { ThreadAttachments } from "./ThreadAttachments.mjs";
18
+ import { ThreadLastMessageId } from "./ThreadLastMessageId.mjs";
16
19
  import { ThreadMessageCount } from "./ThreadMessageCount.mjs";
20
+ import { ThreadSize } from "./ThreadSize.mjs";
21
+ import { ThreadUpdatedAt } from "./ThreadUpdatedAt.mjs";
22
+ import { ThreadCreatedAt } from "./ThreadCreatedAt.mjs";
17
23
  import { Message } from "../../messages/types/Message.mjs";
18
24
  export declare const Thread: core.serialization.ObjectSchema<serializers.Thread.Raw, AgentMail.Thread>;
19
25
  export declare namespace Thread {
@@ -22,14 +28,18 @@ export declare namespace Thread {
22
28
  thread_id: ThreadId.Raw;
23
29
  labels: ThreadLabels.Raw;
24
30
  timestamp: ThreadTimestamp.Raw;
31
+ received_timestamp: ThreadReceivedTimestamp.Raw;
32
+ sent_timestamp: ThreadSentTimestamp.Raw;
25
33
  senders: ThreadSenders.Raw;
26
34
  recipients: ThreadRecipients.Raw;
27
35
  subject?: ThreadSubject.Raw | null;
28
36
  preview?: ThreadPreview.Raw | null;
29
37
  attachments?: ThreadAttachments.Raw | null;
38
+ last_message_id: ThreadLastMessageId.Raw;
30
39
  message_count: ThreadMessageCount.Raw;
40
+ size: ThreadSize.Raw;
41
+ updated_at: ThreadUpdatedAt.Raw;
42
+ created_at: ThreadCreatedAt.Raw;
31
43
  messages: Message.Raw[];
32
- updated_at: string;
33
- created_at: string;
34
44
  }
35
45
  }