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
@@ -11,7 +11,7 @@ export declare namespace Threads {
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 Threads {
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 Threads {
@@ -58,5 +58,17 @@ export declare class Threads {
58
58
  */
59
59
  getAttachment(inboxId: AgentMail.inboxes.InboxId, threadId: AgentMail.ThreadId, attachmentId: AgentMail.AttachmentId, requestOptions?: Threads.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
60
60
  private __getAttachment;
61
+ /**
62
+ * @param {AgentMail.inboxes.InboxId} inboxId
63
+ * @param {AgentMail.ThreadId} threadId
64
+ * @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
65
+ *
66
+ * @throws {@link AgentMail.NotFoundError}
67
+ *
68
+ * @example
69
+ * await client.inboxes.threads.delete("inbox_id", "thread_id")
70
+ */
71
+ delete(inboxId: AgentMail.inboxes.InboxId, threadId: AgentMail.ThreadId, requestOptions?: Threads.RequestOptions): core.HttpResponsePromise<void>;
72
+ private __delete;
61
73
  protected _getAuthorizationHeader(): Promise<string>;
62
74
  }
@@ -57,7 +57,7 @@ export class Threads {
57
57
  if (ascending != null) {
58
58
  _queryParams["ascending"] = ascending.toString();
59
59
  }
60
- 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);
60
+ 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);
61
61
  const _response = yield core.fetcher({
62
62
  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/inboxes/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/threads`),
63
63
  method: "GET",
@@ -130,7 +130,7 @@ export class Threads {
130
130
  __get(inboxId, threadId, requestOptions) {
131
131
  return __awaiter(this, void 0, void 0, function* () {
132
132
  var _a, _b, _c;
133
- 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);
133
+ 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);
134
134
  const _response = yield core.fetcher({
135
135
  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/inboxes/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId, { omitUndefined: true }))}`),
136
136
  method: "GET",
@@ -196,7 +196,7 @@ export class Threads {
196
196
  __getAttachment(inboxId, threadId, attachmentId, requestOptions) {
197
197
  return __awaiter(this, void 0, void 0, function* () {
198
198
  var _a, _b, _c;
199
- 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);
199
+ 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);
200
200
  const _response = yield core.fetcher({
201
201
  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/inboxes/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId, { omitUndefined: true }))}/attachments/${encodeURIComponent(serializers.AttachmentId.jsonOrThrow(attachmentId, { omitUndefined: true }))}`),
202
202
  method: "GET",
@@ -245,6 +245,70 @@ export class Threads {
245
245
  }
246
246
  });
247
247
  }
248
+ /**
249
+ * @param {AgentMail.inboxes.InboxId} inboxId
250
+ * @param {AgentMail.ThreadId} threadId
251
+ * @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
252
+ *
253
+ * @throws {@link AgentMail.NotFoundError}
254
+ *
255
+ * @example
256
+ * await client.inboxes.threads.delete("inbox_id", "thread_id")
257
+ */
258
+ delete(inboxId, threadId, requestOptions) {
259
+ return core.HttpResponsePromise.fromPromise(this.__delete(inboxId, threadId, requestOptions));
260
+ }
261
+ __delete(inboxId, threadId, requestOptions) {
262
+ return __awaiter(this, void 0, void 0, function* () {
263
+ var _a, _b, _c;
264
+ 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);
265
+ const _response = yield core.fetcher({
266
+ 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/inboxes/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId, { omitUndefined: true }))}`),
267
+ method: "DELETE",
268
+ headers: _headers,
269
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
270
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
271
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
272
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
273
+ });
274
+ if (_response.ok) {
275
+ return { data: undefined, rawResponse: _response.rawResponse };
276
+ }
277
+ if (_response.error.reason === "status-code") {
278
+ switch (_response.error.statusCode) {
279
+ case 404:
280
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
281
+ unrecognizedObjectKeys: "passthrough",
282
+ allowUnrecognizedUnionMembers: true,
283
+ allowUnrecognizedEnumValues: true,
284
+ skipValidation: true,
285
+ breadcrumbsPrefix: ["response"],
286
+ }), _response.rawResponse);
287
+ default:
288
+ throw new errors.AgentMailError({
289
+ statusCode: _response.error.statusCode,
290
+ body: _response.error.body,
291
+ rawResponse: _response.rawResponse,
292
+ });
293
+ }
294
+ }
295
+ switch (_response.error.reason) {
296
+ case "non-json":
297
+ throw new errors.AgentMailError({
298
+ statusCode: _response.error.statusCode,
299
+ body: _response.error.rawBody,
300
+ rawResponse: _response.rawResponse,
301
+ });
302
+ case "timeout":
303
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling DELETE /v0/inboxes/{inbox_id}/threads/{thread_id}.");
304
+ case "unknown":
305
+ throw new errors.AgentMailError({
306
+ message: _response.error.errorMessage,
307
+ rawResponse: _response.rawResponse,
308
+ });
309
+ }
310
+ });
311
+ }
248
312
  _getAuthorizationHeader() {
249
313
  return __awaiter(this, void 0, void 0, function* () {
250
314
  var _a;
@@ -19,12 +19,9 @@ export interface Message {
19
19
  text?: AgentMail.MessageText;
20
20
  html?: AgentMail.MessageHtml;
21
21
  attachments?: AgentMail.MessageAttachments;
22
- /** ID of message being replied to. */
23
- inReplyTo?: string;
24
- /** IDs of previous messages in thread. */
25
- references?: string[];
26
- /** Time at which message was last updated. */
27
- updatedAt: Date;
28
- /** Time at which message was created. */
29
- createdAt: Date;
22
+ inReplyTo?: AgentMail.MessageInReplyTo;
23
+ references?: AgentMail.MessageReferences;
24
+ size: AgentMail.MessageSize;
25
+ updatedAt: AgentMail.MessageUpdatedAt;
26
+ createdAt: AgentMail.MessageCreatedAt;
30
27
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Time at which message was created.
6
+ */
7
+ export type MessageCreatedAt = Date;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * ID of message being replied to.
6
+ */
7
+ export type MessageInReplyTo = string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -15,4 +15,9 @@ export interface MessageItem {
15
15
  subject?: AgentMail.MessageSubject;
16
16
  preview?: AgentMail.MessagePreview;
17
17
  attachments?: AgentMail.MessageAttachments;
18
+ inReplyTo?: AgentMail.MessageInReplyTo;
19
+ references?: AgentMail.MessageReferences;
20
+ size: AgentMail.MessageSize;
21
+ updatedAt: AgentMail.MessageUpdatedAt;
22
+ createdAt: AgentMail.MessageCreatedAt;
18
23
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * IDs of previous messages in thread.
6
+ */
7
+ export type MessageReferences = string[];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Addresses of reply-to recipients. In format `username@domain.com` or `Display Name <username@domain.com>`.
6
+ */
7
+ export type MessageReplyTo = string[];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Size of message in bytes.
6
+ */
7
+ export type MessageSize = number;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Time at which message was last updated.
6
+ */
7
+ export type MessageUpdatedAt = Date;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -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";
@@ -11,7 +11,7 @@ export declare namespace Metrics {
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 Metrics {
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 Metrics {
@@ -49,7 +49,7 @@ export class Metrics {
49
49
  }
50
50
  _queryParams["start_timestamp"] = startTimestamp.toISOString();
51
51
  _queryParams["end_timestamp"] = endTimestamp.toISOString();
52
- 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);
52
+ 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);
53
53
  const _response = yield core.fetcher({
54
54
  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/metrics"),
55
55
  method: "GET",
@@ -11,7 +11,7 @@ export declare namespace Threads {
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 Threads {
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 Threads {
@@ -56,5 +56,16 @@ export declare class Threads {
56
56
  */
57
57
  getAttachment(threadId: AgentMail.ThreadId, attachmentId: AgentMail.AttachmentId, requestOptions?: Threads.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
58
58
  private __getAttachment;
59
+ /**
60
+ * @param {AgentMail.ThreadId} threadId
61
+ * @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
62
+ *
63
+ * @throws {@link AgentMail.NotFoundError}
64
+ *
65
+ * @example
66
+ * await client.threads.delete("thread_id")
67
+ */
68
+ delete(threadId: AgentMail.ThreadId, requestOptions?: Threads.RequestOptions): core.HttpResponsePromise<void>;
69
+ private __delete;
59
70
  protected _getAuthorizationHeader(): Promise<string>;
60
71
  }
@@ -56,7 +56,7 @@ export class Threads {
56
56
  if (ascending != null) {
57
57
  _queryParams["ascending"] = ascending.toString();
58
58
  }
59
- 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);
59
+ 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);
60
60
  const _response = yield core.fetcher({
61
61
  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/threads"),
62
62
  method: "GET",
@@ -128,7 +128,7 @@ export class Threads {
128
128
  __get(threadId, requestOptions) {
129
129
  return __awaiter(this, void 0, void 0, function* () {
130
130
  var _a, _b, _c;
131
- 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);
131
+ 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);
132
132
  const _response = yield core.fetcher({
133
133
  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/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId, { omitUndefined: true }))}`),
134
134
  method: "GET",
@@ -194,7 +194,7 @@ export class Threads {
194
194
  __getAttachment(threadId, attachmentId, requestOptions) {
195
195
  return __awaiter(this, void 0, void 0, function* () {
196
196
  var _a, _b, _c;
197
- 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);
197
+ 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);
198
198
  const _response = yield core.fetcher({
199
199
  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/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId, { omitUndefined: true }))}/attachments/${encodeURIComponent(serializers.AttachmentId.jsonOrThrow(attachmentId, { omitUndefined: true }))}`),
200
200
  method: "GET",
@@ -243,6 +243,69 @@ export class Threads {
243
243
  }
244
244
  });
245
245
  }
246
+ /**
247
+ * @param {AgentMail.ThreadId} threadId
248
+ * @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
249
+ *
250
+ * @throws {@link AgentMail.NotFoundError}
251
+ *
252
+ * @example
253
+ * await client.threads.delete("thread_id")
254
+ */
255
+ delete(threadId, requestOptions) {
256
+ return core.HttpResponsePromise.fromPromise(this.__delete(threadId, requestOptions));
257
+ }
258
+ __delete(threadId, requestOptions) {
259
+ return __awaiter(this, void 0, void 0, function* () {
260
+ var _a, _b, _c;
261
+ 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);
262
+ const _response = yield core.fetcher({
263
+ 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/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId, { omitUndefined: true }))}`),
264
+ method: "DELETE",
265
+ headers: _headers,
266
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
267
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
268
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
269
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
270
+ });
271
+ if (_response.ok) {
272
+ return { data: undefined, rawResponse: _response.rawResponse };
273
+ }
274
+ if (_response.error.reason === "status-code") {
275
+ switch (_response.error.statusCode) {
276
+ case 404:
277
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
278
+ unrecognizedObjectKeys: "passthrough",
279
+ allowUnrecognizedUnionMembers: true,
280
+ allowUnrecognizedEnumValues: true,
281
+ skipValidation: true,
282
+ breadcrumbsPrefix: ["response"],
283
+ }), _response.rawResponse);
284
+ default:
285
+ throw new errors.AgentMailError({
286
+ statusCode: _response.error.statusCode,
287
+ body: _response.error.body,
288
+ rawResponse: _response.rawResponse,
289
+ });
290
+ }
291
+ }
292
+ switch (_response.error.reason) {
293
+ case "non-json":
294
+ throw new errors.AgentMailError({
295
+ statusCode: _response.error.statusCode,
296
+ body: _response.error.rawBody,
297
+ rawResponse: _response.rawResponse,
298
+ });
299
+ case "timeout":
300
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling DELETE /v0/threads/{thread_id}.");
301
+ case "unknown":
302
+ throw new errors.AgentMailError({
303
+ message: _response.error.errorMessage,
304
+ rawResponse: _response.rawResponse,
305
+ });
306
+ }
307
+ });
308
+ }
246
309
  _getAuthorizationHeader() {
247
310
  return __awaiter(this, void 0, void 0, function* () {
248
311
  var _a;
@@ -7,16 +7,18 @@ export interface Thread {
7
7
  threadId: AgentMail.ThreadId;
8
8
  labels: AgentMail.ThreadLabels;
9
9
  timestamp: AgentMail.ThreadTimestamp;
10
+ receivedTimestamp: AgentMail.ThreadReceivedTimestamp;
11
+ sentTimestamp: AgentMail.ThreadSentTimestamp;
10
12
  senders: AgentMail.ThreadSenders;
11
13
  recipients: AgentMail.ThreadRecipients;
12
14
  subject?: AgentMail.ThreadSubject;
13
15
  preview?: AgentMail.ThreadPreview;
14
16
  attachments?: AgentMail.ThreadAttachments;
17
+ lastMessageId: AgentMail.ThreadLastMessageId;
15
18
  messageCount: AgentMail.ThreadMessageCount;
19
+ size: AgentMail.ThreadSize;
20
+ updatedAt: AgentMail.ThreadUpdatedAt;
21
+ createdAt: AgentMail.ThreadCreatedAt;
16
22
  /** Messages in thread. Ordered by `timestamp` ascending. */
17
23
  messages: AgentMail.Message[];
18
- /** Time at which thread was last updated. */
19
- updatedAt: Date;
20
- /** Time at which thread was created. */
21
- createdAt: Date;
22
24
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Time at which thread was created.
6
+ */
7
+ export type ThreadCreatedAt = Date;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -7,10 +7,16 @@ export interface ThreadItem {
7
7
  threadId: AgentMail.ThreadId;
8
8
  labels: AgentMail.ThreadLabels;
9
9
  timestamp: AgentMail.ThreadTimestamp;
10
+ receivedTimestamp: AgentMail.ThreadReceivedTimestamp;
11
+ sentTimestamp: AgentMail.ThreadSentTimestamp;
10
12
  senders: AgentMail.ThreadSenders;
11
13
  recipients: AgentMail.ThreadRecipients;
12
14
  subject?: AgentMail.ThreadSubject;
13
15
  preview?: AgentMail.ThreadPreview;
14
16
  attachments?: AgentMail.ThreadAttachments;
17
+ lastMessageId: AgentMail.ThreadLastMessageId;
15
18
  messageCount: AgentMail.ThreadMessageCount;
19
+ size: AgentMail.ThreadSize;
20
+ updatedAt: AgentMail.ThreadUpdatedAt;
21
+ createdAt: AgentMail.ThreadCreatedAt;
16
22
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * ID of last message in thread.
6
+ */
7
+ export type ThreadLastMessageId = string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Timestamp of last received message.
6
+ */
7
+ export type ThreadReceivedTimestamp = Date;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Timestamp of last sent message.
6
+ */
7
+ export type ThreadSentTimestamp = Date;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Size of thread in bytes.
6
+ */
7
+ export type ThreadSize = number;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -2,6 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * Time at which last message was sent.
5
+ * Timestamp of last sent or received message.
6
6
  */
7
7
  export type ThreadTimestamp = Date;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Time at which thread was last updated.
6
+ */
7
+ export type ThreadUpdatedAt = Date;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -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";