agentmail 0.0.17 → 0.0.19

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 (168) hide show
  1. package/api/resources/inboxes/client/Client.js +3 -3
  2. package/api/resources/messages/client/Client.d.ts +0 -2
  3. package/api/resources/messages/client/Client.js +5 -7
  4. package/api/resources/messages/types/ListMessagesResponse.d.ts +6 -2
  5. package/api/resources/messages/types/Message.d.ts +15 -13
  6. package/{dist/api/resources/messages/types/MessageThreadId.d.ts → api/resources/messages/types/MessageEventId.d.ts} +2 -2
  7. package/api/resources/messages/types/MessageInReplyTo.d.ts +7 -0
  8. package/api/resources/messages/types/MessageItem.d.ts +6 -4
  9. package/api/resources/messages/types/{MessageThreadId.d.ts → MessageLabels.d.ts} +2 -2
  10. package/api/resources/messages/types/MessageReferences.d.ts +7 -0
  11. package/api/resources/messages/types/MessageReplyTo.d.ts +7 -0
  12. package/api/resources/messages/types/MessageTimestamp.d.ts +7 -0
  13. package/api/resources/messages/types/index.d.ts +6 -2
  14. package/api/resources/messages/types/index.js +6 -2
  15. package/api/resources/threads/client/Client.d.ts +0 -2
  16. package/api/resources/threads/client/Client.js +2 -4
  17. package/api/resources/threads/types/ListThreadsResponse.d.ts +8 -4
  18. package/api/resources/threads/types/Thread.d.ts +22 -15
  19. package/api/resources/{messages/types/MessageSentAt.d.ts → threads/types/ThreadEventId.d.ts} +2 -2
  20. package/api/resources/threads/types/ThreadItem.d.ts +5 -3
  21. package/{dist/api/resources/messages/types/MessageSentAt.d.ts → api/resources/threads/types/ThreadLabels.d.ts} +2 -2
  22. package/api/resources/threads/types/ThreadSenders.d.ts +7 -0
  23. package/api/resources/threads/types/ThreadSenders.js +5 -0
  24. package/api/resources/threads/types/ThreadTimestamp.d.ts +7 -0
  25. package/api/resources/threads/types/ThreadTimestamp.js +5 -0
  26. package/api/resources/threads/types/index.d.ts +4 -2
  27. package/api/resources/threads/types/index.js +4 -2
  28. package/api/types/OrganizationId.d.ts +7 -0
  29. package/api/types/OrganizationId.js +5 -0
  30. package/api/types/Received.d.ts +1 -1
  31. package/api/types/Sent.d.ts +1 -1
  32. package/api/types/index.d.ts +1 -0
  33. package/api/types/index.js +1 -0
  34. package/dist/api/resources/inboxes/client/Client.js +3 -3
  35. package/dist/api/resources/messages/client/Client.d.ts +0 -2
  36. package/dist/api/resources/messages/client/Client.js +5 -7
  37. package/dist/api/resources/messages/types/ListMessagesResponse.d.ts +6 -2
  38. package/dist/api/resources/messages/types/Message.d.ts +15 -13
  39. package/dist/api/resources/messages/types/MessageEventId.d.ts +7 -0
  40. package/dist/api/resources/messages/types/MessageEventId.js +5 -0
  41. package/dist/api/resources/messages/types/MessageInReplyTo.d.ts +7 -0
  42. package/dist/api/resources/messages/types/MessageInReplyTo.js +5 -0
  43. package/dist/api/resources/messages/types/MessageItem.d.ts +6 -4
  44. package/dist/api/resources/messages/types/MessageLabels.d.ts +7 -0
  45. package/dist/api/resources/messages/types/MessageLabels.js +5 -0
  46. package/dist/api/resources/messages/types/MessageReferences.d.ts +7 -0
  47. package/dist/api/resources/messages/types/MessageReferences.js +5 -0
  48. package/dist/api/resources/messages/types/MessageReplyTo.d.ts +7 -0
  49. package/dist/api/resources/messages/types/MessageReplyTo.js +5 -0
  50. package/dist/api/resources/messages/types/MessageTimestamp.d.ts +7 -0
  51. package/dist/api/resources/messages/types/MessageTimestamp.js +5 -0
  52. package/dist/api/resources/messages/types/index.d.ts +6 -2
  53. package/dist/api/resources/messages/types/index.js +6 -2
  54. package/dist/api/resources/threads/client/Client.d.ts +0 -2
  55. package/dist/api/resources/threads/client/Client.js +2 -4
  56. package/dist/api/resources/threads/types/ListThreadsResponse.d.ts +8 -4
  57. package/dist/api/resources/threads/types/Thread.d.ts +22 -15
  58. package/dist/api/resources/threads/types/ThreadEventId.d.ts +7 -0
  59. package/dist/api/resources/threads/types/ThreadEventId.js +5 -0
  60. package/dist/api/resources/threads/types/ThreadItem.d.ts +5 -3
  61. package/dist/api/resources/threads/types/ThreadLabels.d.ts +7 -0
  62. package/dist/api/resources/threads/types/ThreadLabels.js +5 -0
  63. package/dist/api/resources/threads/types/ThreadSenders.d.ts +7 -0
  64. package/dist/api/resources/threads/types/ThreadSenders.js +5 -0
  65. package/dist/api/resources/threads/types/ThreadTimestamp.d.ts +7 -0
  66. package/dist/api/resources/threads/types/ThreadTimestamp.js +5 -0
  67. package/dist/api/resources/threads/types/index.d.ts +4 -2
  68. package/dist/api/resources/threads/types/index.js +4 -2
  69. package/dist/api/types/OrganizationId.d.ts +7 -0
  70. package/dist/api/types/OrganizationId.js +5 -0
  71. package/dist/api/types/Received.d.ts +1 -1
  72. package/dist/api/types/Sent.d.ts +1 -1
  73. package/dist/api/types/index.d.ts +1 -0
  74. package/dist/api/types/index.js +1 -0
  75. package/dist/serialization/resources/messages/types/Message.d.ts +18 -8
  76. package/dist/serialization/resources/messages/types/Message.js +18 -8
  77. package/dist/serialization/resources/{threads/types/ThreadUpdatedAt.d.ts → messages/types/MessageEventId.d.ts} +2 -2
  78. package/{serialization/resources/threads/types/ThreadUpdatedAt.js → dist/serialization/resources/messages/types/MessageEventId.js} +2 -2
  79. package/dist/serialization/resources/messages/types/MessageInReplyTo.d.ts +10 -0
  80. package/dist/serialization/resources/messages/types/MessageInReplyTo.js +41 -0
  81. package/dist/serialization/resources/messages/types/MessageItem.d.ts +12 -8
  82. package/dist/serialization/resources/messages/types/MessageItem.js +12 -8
  83. package/dist/serialization/resources/{threads/types/ThreadParticipants.d.ts → messages/types/MessageLabels.d.ts} +2 -2
  84. package/dist/serialization/resources/messages/types/MessageLabels.js +41 -0
  85. package/dist/serialization/resources/messages/types/MessageReferences.d.ts +10 -0
  86. package/dist/serialization/resources/{threads/types/ThreadParticipants.js → messages/types/MessageReferences.js} +2 -2
  87. package/dist/serialization/resources/messages/types/MessageReplyTo.d.ts +10 -0
  88. package/dist/serialization/resources/messages/types/MessageReplyTo.js +41 -0
  89. package/dist/serialization/resources/messages/types/MessageTimestamp.d.ts +10 -0
  90. package/dist/serialization/resources/messages/types/{MessageThreadId.js → MessageTimestamp.js} +2 -2
  91. package/dist/serialization/resources/messages/types/index.d.ts +6 -2
  92. package/dist/serialization/resources/messages/types/index.js +6 -2
  93. package/dist/serialization/resources/threads/types/Thread.d.ts +16 -11
  94. package/dist/serialization/resources/threads/types/Thread.js +16 -11
  95. package/{serialization/resources/messages/types/MessageSentAt.d.ts → dist/serialization/resources/threads/types/ThreadEventId.d.ts} +2 -2
  96. package/dist/serialization/resources/{messages/types/MessageSentAt.js → threads/types/ThreadEventId.js} +2 -2
  97. package/dist/serialization/resources/threads/types/ThreadItem.d.ts +10 -6
  98. package/dist/serialization/resources/threads/types/ThreadItem.js +10 -6
  99. package/{serialization/resources/threads/types/ThreadParticipants.d.ts → dist/serialization/resources/threads/types/ThreadLabels.d.ts} +2 -2
  100. package/dist/serialization/resources/threads/types/ThreadLabels.js +41 -0
  101. package/dist/serialization/resources/threads/types/ThreadSenders.d.ts +10 -0
  102. package/dist/serialization/resources/threads/types/ThreadSenders.js +41 -0
  103. package/dist/serialization/resources/{messages/types/MessageThreadId.d.ts → threads/types/ThreadTimestamp.d.ts} +2 -2
  104. package/dist/serialization/resources/threads/types/{ThreadUpdatedAt.js → ThreadTimestamp.js} +2 -2
  105. package/dist/serialization/resources/threads/types/index.d.ts +4 -2
  106. package/dist/serialization/resources/threads/types/index.js +4 -2
  107. package/dist/serialization/types/OrganizationId.d.ts +10 -0
  108. package/dist/serialization/types/OrganizationId.js +41 -0
  109. package/dist/serialization/types/index.d.ts +1 -0
  110. package/dist/serialization/types/index.js +1 -0
  111. package/dist/version.d.ts +1 -1
  112. package/dist/version.js +1 -1
  113. package/package.json +1 -1
  114. package/reference.md +0 -30
  115. package/serialization/resources/messages/types/Message.d.ts +18 -8
  116. package/serialization/resources/messages/types/Message.js +18 -8
  117. package/serialization/resources/messages/types/MessageEventId.d.ts +10 -0
  118. package/serialization/resources/messages/types/MessageEventId.js +41 -0
  119. package/serialization/resources/messages/types/MessageInReplyTo.d.ts +10 -0
  120. package/serialization/resources/messages/types/MessageInReplyTo.js +41 -0
  121. package/serialization/resources/messages/types/MessageItem.d.ts +12 -8
  122. package/serialization/resources/messages/types/MessageItem.js +12 -8
  123. package/serialization/resources/messages/types/MessageLabels.d.ts +10 -0
  124. package/serialization/resources/messages/types/MessageLabels.js +41 -0
  125. package/serialization/resources/messages/types/MessageReferences.d.ts +10 -0
  126. package/serialization/resources/messages/types/MessageReferences.js +41 -0
  127. package/serialization/resources/messages/types/MessageReplyTo.d.ts +10 -0
  128. package/serialization/resources/messages/types/MessageReplyTo.js +41 -0
  129. package/serialization/resources/messages/types/MessageTimestamp.d.ts +10 -0
  130. package/serialization/resources/messages/types/MessageTimestamp.js +41 -0
  131. package/serialization/resources/messages/types/index.d.ts +6 -2
  132. package/serialization/resources/messages/types/index.js +6 -2
  133. package/serialization/resources/threads/types/Thread.d.ts +16 -11
  134. package/serialization/resources/threads/types/Thread.js +16 -11
  135. package/{dist/serialization/resources/messages/types/MessageSentAt.d.ts → serialization/resources/threads/types/ThreadEventId.d.ts} +2 -2
  136. package/serialization/resources/{messages/types/MessageSentAt.js → threads/types/ThreadEventId.js} +2 -2
  137. package/serialization/resources/threads/types/ThreadItem.d.ts +10 -6
  138. package/serialization/resources/threads/types/ThreadItem.js +10 -6
  139. package/serialization/resources/threads/types/ThreadLabels.d.ts +10 -0
  140. package/serialization/resources/threads/types/ThreadLabels.js +41 -0
  141. package/serialization/resources/threads/types/ThreadSenders.d.ts +10 -0
  142. package/serialization/resources/threads/types/ThreadSenders.js +41 -0
  143. package/serialization/resources/threads/types/ThreadTimestamp.d.ts +10 -0
  144. package/serialization/resources/threads/types/ThreadTimestamp.js +41 -0
  145. package/serialization/resources/threads/types/index.d.ts +4 -2
  146. package/serialization/resources/threads/types/index.js +4 -2
  147. package/serialization/types/OrganizationId.d.ts +10 -0
  148. package/serialization/types/OrganizationId.js +41 -0
  149. package/serialization/types/index.d.ts +1 -0
  150. package/serialization/types/index.js +1 -0
  151. package/version.d.ts +1 -1
  152. package/version.js +1 -1
  153. package/api/resources/threads/types/ThreadParticipants.d.ts +0 -7
  154. package/api/resources/threads/types/ThreadUpdatedAt.d.ts +0 -7
  155. package/dist/api/resources/threads/types/ThreadParticipants.d.ts +0 -7
  156. package/dist/api/resources/threads/types/ThreadUpdatedAt.d.ts +0 -7
  157. package/serialization/resources/messages/types/MessageThreadId.d.ts +0 -10
  158. package/serialization/resources/messages/types/MessageThreadId.js +0 -41
  159. package/serialization/resources/threads/types/ThreadParticipants.js +0 -41
  160. package/serialization/resources/threads/types/ThreadUpdatedAt.d.ts +0 -10
  161. /package/api/resources/messages/types/{MessageSentAt.js → MessageEventId.js} +0 -0
  162. /package/api/resources/messages/types/{MessageThreadId.js → MessageInReplyTo.js} +0 -0
  163. /package/api/resources/{threads/types/ThreadParticipants.js → messages/types/MessageLabels.js} +0 -0
  164. /package/api/resources/{threads/types/ThreadUpdatedAt.js → messages/types/MessageReferences.js} +0 -0
  165. /package/{dist/api/resources/messages/types/MessageSentAt.js → api/resources/messages/types/MessageReplyTo.js} +0 -0
  166. /package/{dist/api/resources/messages/types/MessageThreadId.js → api/resources/messages/types/MessageTimestamp.js} +0 -0
  167. /package/{dist/api/resources/threads/types/ThreadParticipants.js → api/resources/threads/types/ThreadEventId.js} +0 -0
  168. /package/{dist/api/resources/threads/types/ThreadUpdatedAt.js → api/resources/threads/types/ThreadLabels.js} +0 -0
@@ -27,8 +27,6 @@ export declare class Messages {
27
27
  protected readonly _options: Messages.Options;
28
28
  constructor(_options?: Messages.Options);
29
29
  /**
30
- * List messages in inbox. If neither or both `received` and `sent` query parameters are set, all messages are returned.
31
- *
32
30
  * @param {AgentMail.InboxId} inboxId
33
31
  * @param {AgentMail.ListMessagesRequest} request
34
32
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
@@ -60,8 +60,6 @@ class Messages {
60
60
  this._options = _options;
61
61
  }
62
62
  /**
63
- * List messages in inbox. If neither or both `received` and `sent` query parameters are set, all messages are returned.
64
- *
65
63
  * @param {AgentMail.InboxId} inboxId
66
64
  * @param {AgentMail.ListMessagesRequest} request
67
65
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
@@ -93,7 +91,7 @@ class Messages {
93
91
  const _response = yield core.fetcher({
94
92
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/messages`),
95
93
  method: "GET",
96
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.17", "User-Agent": "agentmail/0.0.17", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
94
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.19", "User-Agent": "agentmail/0.0.19", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
97
95
  contentType: "application/json",
98
96
  queryParameters: _queryParams,
99
97
  requestType: "json",
@@ -156,7 +154,7 @@ class Messages {
156
154
  const _response = yield core.fetcher({
157
155
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.MessageId.jsonOrThrow(messageId))}`),
158
156
  method: "GET",
159
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.17", "User-Agent": "agentmail/0.0.17", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
157
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.19", "User-Agent": "agentmail/0.0.19", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
160
158
  contentType: "application/json",
161
159
  requestType: "json",
162
160
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -211,7 +209,7 @@ class Messages {
211
209
  const _response = yield core.fetcher({
212
210
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.MessageId.jsonOrThrow(messageId))}/attachments/${encodeURIComponent(serializers.AttachmentId.jsonOrThrow(attachmentId))}`),
213
211
  method: "GET",
214
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.17", "User-Agent": "agentmail/0.0.17", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
212
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.19", "User-Agent": "agentmail/0.0.19", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
215
213
  contentType: "application/json",
216
214
  requestType: "json",
217
215
  responseType: "streaming",
@@ -277,7 +275,7 @@ class Messages {
277
275
  const _response = yield core.fetcher({
278
276
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/messages/send`),
279
277
  method: "POST",
280
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.17", "User-Agent": "agentmail/0.0.17", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
278
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.19", "User-Agent": "agentmail/0.0.19", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
281
279
  contentType: "application/json",
282
280
  requestType: "json",
283
281
  body: serializers.SendMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -354,7 +352,7 @@ class Messages {
354
352
  const _response = yield core.fetcher({
355
353
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.MessageId.jsonOrThrow(messageId))}/reply`),
356
354
  method: "POST",
357
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.17", "User-Agent": "agentmail/0.0.17", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
355
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.19", "User-Agent": "agentmail/0.0.19", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
358
356
  contentType: "application/json",
359
357
  requestType: "json",
360
358
  body: serializers.ReplyToMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -8,7 +8,9 @@ import * as AgentMail from "../../../index";
8
8
  * messages: [{
9
9
  * messageId: "msg_123",
10
10
  * threadId: "thread_123",
11
- * sentAt: "2024-01-15T09:30:00Z",
11
+ * eventId: "event_123",
12
+ * labels: ["RECEIVED", "UNREAD"],
13
+ * timestamp: "2024-01-15T09:30:00Z",
12
14
  * from: "alice@example.com",
13
15
  * to: ["bob@example.com"],
14
16
  * subject: "Project Discussion",
@@ -25,7 +27,9 @@ import * as AgentMail from "../../../index";
25
27
  * }, {
26
28
  * messageId: "msg_456",
27
29
  * threadId: "thread_123",
28
- * sentAt: "2024-01-15T10:15:00Z",
30
+ * eventId: "event_456",
31
+ * labels: ["SENT"],
32
+ * timestamp: "2024-01-15T10:15:00Z",
29
33
  * from: "bob@example.com",
30
34
  * to: ["alice@example.com"],
31
35
  * subject: "Re: Project Discussion",
@@ -7,8 +7,9 @@ import * as AgentMail from "../../../index";
7
7
  * {
8
8
  * messageId: "msg_123",
9
9
  * threadId: "thread_123",
10
- * sentAt: "2024-01-15T09:30:00Z",
11
- * receivedAt: "2024-01-15T09:30:00Z",
10
+ * eventId: "event_123",
11
+ * labels: ["RECEIVED", "UNREAD"],
12
+ * timestamp: "2024-01-15T09:30:00Z",
12
13
  * from: "alice@example.com",
13
14
  * replyTo: "alice.work@example.com",
14
15
  * to: ["bob@example.com"],
@@ -26,18 +27,19 @@ import * as AgentMail from "../../../index";
26
27
  * inline: false
27
28
  * }],
28
29
  * inReplyTo: "msg_122",
29
- * references: ["msg_121", "msg_122"]
30
+ * references: ["msg_121", "msg_122"],
31
+ * inboxId: "yourinbox@agentmail.to",
32
+ * organizationId: "org_123"
30
33
  * }
31
34
  */
32
35
  export interface Message {
36
+ threadId: AgentMail.ThreadId;
33
37
  messageId: AgentMail.MessageId;
34
- threadId: AgentMail.MessageThreadId;
35
- sentAt: AgentMail.MessageSentAt;
36
- /** Time at which message was received. */
37
- receivedAt?: Date;
38
+ eventId: AgentMail.MessageEventId;
39
+ labels: AgentMail.MessageLabels;
40
+ timestamp: AgentMail.MessageTimestamp;
38
41
  from: AgentMail.MessageFrom;
39
- /** Address to reply to. In format `username@domain.com` or `Display Name <username@domain.com>`. */
40
- replyTo?: string;
42
+ replyTo?: AgentMail.MessageReplyTo;
41
43
  subject?: AgentMail.MessageSubject;
42
44
  preview?: AgentMail.MessagePreview;
43
45
  to: AgentMail.MessageTo;
@@ -46,8 +48,8 @@ export interface Message {
46
48
  text?: AgentMail.MessageText;
47
49
  html?: AgentMail.MessageHtml;
48
50
  attachments?: AgentMail.MessageAttachments;
49
- /** ID of message being replied to. */
50
- inReplyTo?: string;
51
- /** IDs of previous messages in thread. */
52
- references?: string[];
51
+ inReplyTo?: AgentMail.MessageInReplyTo;
52
+ references?: AgentMail.MessageReferences;
53
+ inboxId: AgentMail.InboxId;
54
+ organizationId: AgentMail.OrganizationId;
53
55
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Event ID of message.
6
+ */
7
+ export type MessageEventId = string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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 | undefined;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,14 +3,16 @@
3
3
  */
4
4
  import * as AgentMail from "../../../index";
5
5
  export interface MessageItem {
6
- messageId: AgentMail.MessageId;
7
6
  threadId: AgentMail.ThreadId;
8
- sentAt: AgentMail.MessageSentAt;
7
+ messageId: AgentMail.MessageId;
8
+ eventId: AgentMail.MessageEventId;
9
+ labels: AgentMail.MessageLabels;
10
+ timestamp: AgentMail.MessageTimestamp;
9
11
  from: AgentMail.MessageFrom;
10
- subject?: AgentMail.MessageSubject;
11
- preview?: AgentMail.MessagePreview;
12
12
  to: AgentMail.MessageTo;
13
13
  cc?: AgentMail.MessageCc;
14
14
  bcc?: AgentMail.MessageBcc;
15
+ subject?: AgentMail.MessageSubject;
16
+ preview?: AgentMail.MessagePreview;
15
17
  attachments?: AgentMail.MessageAttachments;
16
18
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Labels of message.
6
+ */
7
+ export type MessageLabels = string[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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[] | undefined;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Address to reply to. In format `username@domain.com` or `Display Name <username@domain.com>`.
6
+ */
7
+ export type MessageReplyTo = string | undefined;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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 sent or drafted.
6
+ */
7
+ export type MessageTimestamp = Date;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,16 +5,20 @@ export * from "./AttachmentSize";
5
5
  export * from "./AttachmentInline";
6
6
  export * from "./Attachment";
7
7
  export * from "./MessageId";
8
- export * from "./MessageSentAt";
8
+ export * from "./MessageEventId";
9
+ export * from "./MessageLabels";
10
+ export * from "./MessageTimestamp";
9
11
  export * from "./MessageFrom";
12
+ export * from "./MessageReplyTo";
10
13
  export * from "./MessageSubject";
11
14
  export * from "./MessagePreview";
12
15
  export * from "./MessageTo";
13
16
  export * from "./MessageCc";
14
17
  export * from "./MessageBcc";
15
18
  export * from "./MessageAttachments";
19
+ export * from "./MessageInReplyTo";
20
+ export * from "./MessageReferences";
16
21
  export * from "./MessageItem";
17
- export * from "./MessageThreadId";
18
22
  export * from "./MessageText";
19
23
  export * from "./MessageHtml";
20
24
  export * from "./Message";
@@ -21,16 +21,20 @@ __exportStar(require("./AttachmentSize"), exports);
21
21
  __exportStar(require("./AttachmentInline"), exports);
22
22
  __exportStar(require("./Attachment"), exports);
23
23
  __exportStar(require("./MessageId"), exports);
24
- __exportStar(require("./MessageSentAt"), exports);
24
+ __exportStar(require("./MessageEventId"), exports);
25
+ __exportStar(require("./MessageLabels"), exports);
26
+ __exportStar(require("./MessageTimestamp"), exports);
25
27
  __exportStar(require("./MessageFrom"), exports);
28
+ __exportStar(require("./MessageReplyTo"), exports);
26
29
  __exportStar(require("./MessageSubject"), exports);
27
30
  __exportStar(require("./MessagePreview"), exports);
28
31
  __exportStar(require("./MessageTo"), exports);
29
32
  __exportStar(require("./MessageCc"), exports);
30
33
  __exportStar(require("./MessageBcc"), exports);
31
34
  __exportStar(require("./MessageAttachments"), exports);
35
+ __exportStar(require("./MessageInReplyTo"), exports);
36
+ __exportStar(require("./MessageReferences"), exports);
32
37
  __exportStar(require("./MessageItem"), exports);
33
- __exportStar(require("./MessageThreadId"), exports);
34
38
  __exportStar(require("./MessageText"), exports);
35
39
  __exportStar(require("./MessageHtml"), exports);
36
40
  __exportStar(require("./Message"), exports);
@@ -26,8 +26,6 @@ export declare class Threads {
26
26
  protected readonly _options: Threads.Options;
27
27
  constructor(_options?: Threads.Options);
28
28
  /**
29
- * List threads in inbox. If neither or both `received` and `sent` query parameters are set, all threads are returned.
30
- *
31
29
  * @param {AgentMail.InboxId} inboxId
32
30
  * @param {AgentMail.ListThreadsRequest} request
33
31
  * @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
@@ -60,8 +60,6 @@ class Threads {
60
60
  this._options = _options;
61
61
  }
62
62
  /**
63
- * List threads in inbox. If neither or both `received` and `sent` query parameters are set, all threads are returned.
64
- *
65
63
  * @param {AgentMail.InboxId} inboxId
66
64
  * @param {AgentMail.ListThreadsRequest} request
67
65
  * @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
@@ -93,7 +91,7 @@ class Threads {
93
91
  const _response = yield core.fetcher({
94
92
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/threads`),
95
93
  method: "GET",
96
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.17", "User-Agent": "agentmail/0.0.17", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
94
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.19", "User-Agent": "agentmail/0.0.19", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
97
95
  contentType: "application/json",
98
96
  queryParameters: _queryParams,
99
97
  requestType: "json",
@@ -156,7 +154,7 @@ class Threads {
156
154
  const _response = yield core.fetcher({
157
155
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId))}`),
158
156
  method: "GET",
159
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.17", "User-Agent": "agentmail/0.0.17", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
157
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.19", "User-Agent": "agentmail/0.0.19", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
160
158
  contentType: "application/json",
161
159
  requestType: "json",
162
160
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -7,16 +7,20 @@ import * as AgentMail from "../../../index";
7
7
  * {
8
8
  * threads: [{
9
9
  * threadId: "thread_123",
10
- * updatedAt: "2024-01-15T09:30:00Z",
11
- * participants: ["alice@example.com", "bob@example.com"],
10
+ * eventId: "event_123",
11
+ * labels: ["RECEIVED", "UNREAD"],
12
+ * timestamp: "2024-01-15T09:30:00Z",
13
+ * senders: ["alice@example.com", "bob@example.com"],
12
14
  * recipients: ["alice@example.com", "bob@example.com"],
13
15
  * messageCount: 3,
14
16
  * subject: "Project Discussion",
15
17
  * preview: "Let's review the timeline for..."
16
18
  * }, {
17
19
  * threadId: "thread_456",
18
- * updatedAt: "2024-01-15T10:15:00Z",
19
- * participants: ["charlie@example.com"],
20
+ * eventId: "event_456",
21
+ * labels: ["SENT"],
22
+ * timestamp: "2024-01-15T10:15:00Z",
23
+ * senders: ["charlie@example.com"],
20
24
  * recipients: ["david@example.com"],
21
25
  * messageCount: 1,
22
26
  * subject: "Weekly Update",
@@ -5,37 +5,44 @@ import * as AgentMail from "../../../index";
5
5
  /**
6
6
  * @example
7
7
  * {
8
- * threadId: "thread_123",
8
+ * organizationId: "org_123",
9
9
  * inboxId: "yourinbox@agentmail.to",
10
- * createdAt: "2024-01-15T09:30:00Z",
11
- * updatedAt: "2024-01-15T10:15:00Z",
12
- * subject: "Project Discussion",
13
- * participants: ["alice@example.com"],
10
+ * threadId: "thread_123",
11
+ * eventId: "event_123",
12
+ * labels: ["RECEIVED", "UNREAD"],
13
+ * timestamp: "2024-01-15T09:30:00Z",
14
+ * senders: ["alice@example.com"],
14
15
  * recipients: ["bob@example.com"],
15
16
  * messageCount: 1,
17
+ * subject: "Project Discussion",
18
+ * preview: "Let's review the timeline for...",
16
19
  * messages: [{
17
20
  * messageId: "msg_123",
18
21
  * threadId: "thread_123",
19
- * sentAt: "2024-01-15T09:30:00Z",
20
- * receivedAt: "2024-01-15T09:30:00Z",
22
+ * eventId: "event_123",
23
+ * labels: ["RECEIVED", "UNREAD"],
24
+ * timestamp: "2024-01-15T09:30:00Z",
21
25
  * from: "alice@example.com",
22
26
  * to: ["bob@example.com"],
23
- * text: "Let's review the timeline for the project."
27
+ * text: "Let's review the timeline for the project.",
28
+ * inboxId: "yourinbox@agentmail.to",
29
+ * organizationId: "org_123"
24
30
  * }]
25
31
  * }
26
32
  */
27
33
  export interface Thread {
28
34
  threadId: AgentMail.ThreadId;
29
- inboxId: AgentMail.InboxId;
30
- /** Time at which thread was created. */
31
- createdAt: Date;
32
- updatedAt: AgentMail.ThreadUpdatedAt;
33
- participants: AgentMail.ThreadParticipants;
35
+ eventId: AgentMail.ThreadEventId;
36
+ labels: AgentMail.ThreadLabels;
37
+ timestamp: AgentMail.ThreadTimestamp;
38
+ senders: AgentMail.ThreadSenders;
34
39
  recipients: AgentMail.ThreadRecipients;
40
+ messageCount: AgentMail.ThreadMessageCount;
35
41
  subject?: AgentMail.ThreadSubject;
36
42
  preview?: AgentMail.ThreadPreview;
37
- messageCount: AgentMail.ThreadMessageCount;
43
+ attachments?: AgentMail.ThreadAttachments;
38
44
  /** Messages in thread. Ordered by `sent_at` ascending. */
39
45
  messages: AgentMail.Message[];
40
- attachments?: AgentMail.ThreadAttachments;
46
+ inboxId: AgentMail.InboxId;
47
+ organizationId: AgentMail.OrganizationId;
41
48
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Event ID of thread.
6
+ */
7
+ export type ThreadEventId = string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,11 +4,13 @@
4
4
  import * as AgentMail from "../../../index";
5
5
  export interface ThreadItem {
6
6
  threadId: AgentMail.ThreadId;
7
- updatedAt: AgentMail.ThreadUpdatedAt;
8
- participants: AgentMail.ThreadParticipants;
7
+ eventId: AgentMail.ThreadEventId;
8
+ labels: AgentMail.ThreadLabels;
9
+ timestamp: AgentMail.ThreadTimestamp;
10
+ senders: AgentMail.ThreadSenders;
9
11
  recipients: AgentMail.ThreadRecipients;
12
+ messageCount: AgentMail.ThreadMessageCount;
10
13
  subject?: AgentMail.ThreadSubject;
11
14
  preview?: AgentMail.ThreadPreview;
12
- messageCount: AgentMail.ThreadMessageCount;
13
15
  attachments?: AgentMail.ThreadAttachments;
14
16
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Labels of thread.
6
+ */
7
+ export type ThreadLabels = string[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Addresses of senders in thread. In format `username@domain.com` or `Display Name <username@domain.com>`
6
+ */
7
+ export type ThreadSenders = string[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Time at which last message was sent.
6
+ */
7
+ export type ThreadTimestamp = Date;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,9 @@
1
1
  export * from "./ThreadAttachment";
2
2
  export * from "./ThreadId";
3
- export * from "./ThreadUpdatedAt";
4
- export * from "./ThreadParticipants";
3
+ export * from "./ThreadEventId";
4
+ export * from "./ThreadLabels";
5
+ export * from "./ThreadTimestamp";
6
+ export * from "./ThreadSenders";
5
7
  export * from "./ThreadRecipients";
6
8
  export * from "./ThreadMessageCount";
7
9
  export * from "./ThreadSubject";
@@ -16,8 +16,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ThreadAttachment"), exports);
18
18
  __exportStar(require("./ThreadId"), exports);
19
- __exportStar(require("./ThreadUpdatedAt"), exports);
20
- __exportStar(require("./ThreadParticipants"), exports);
19
+ __exportStar(require("./ThreadEventId"), exports);
20
+ __exportStar(require("./ThreadLabels"), exports);
21
+ __exportStar(require("./ThreadTimestamp"), exports);
22
+ __exportStar(require("./ThreadSenders"), exports);
21
23
  __exportStar(require("./ThreadRecipients"), exports);
22
24
  __exportStar(require("./ThreadMessageCount"), exports);
23
25
  __exportStar(require("./ThreadSubject"), exports);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * ID of organization.
6
+ */
7
+ export type OrganizationId = string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,6 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * Whether to include received messages.
5
+ * Whether to filter by received threads/messages.
6
6
  */
7
7
  export type Received = boolean;
@@ -2,6 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * Whether to include sent messages.
5
+ * Whether to filter by sent threads/messages.
6
6
  */
7
7
  export type Sent = boolean;
@@ -3,6 +3,7 @@ export * from "./Sent";
3
3
  export * from "./Limit";
4
4
  export * from "./Count";
5
5
  export * from "./LastKey";
6
+ export * from "./OrganizationId";
6
7
  export * from "./ErrorName";
7
8
  export * from "./ErrorResponse";
8
9
  export * from "./ValidationErrorResponse";
@@ -19,6 +19,7 @@ __exportStar(require("./Sent"), exports);
19
19
  __exportStar(require("./Limit"), exports);
20
20
  __exportStar(require("./Count"), exports);
21
21
  __exportStar(require("./LastKey"), exports);
22
+ __exportStar(require("./OrganizationId"), exports);
22
23
  __exportStar(require("./ErrorName"), exports);
23
24
  __exportStar(require("./ErrorResponse"), exports);
24
25
  __exportStar(require("./ValidationErrorResponse"), exports);