agentmail 0.0.22 → 0.0.23

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 (85) hide show
  1. package/api/resources/inboxes/client/Client.js +3 -3
  2. package/api/resources/index.d.ts +1 -0
  3. package/api/resources/index.js +1 -0
  4. package/api/resources/messages/client/Client.d.ts +2 -0
  5. package/api/resources/messages/client/Client.js +26 -12
  6. package/api/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -2
  7. package/api/resources/messages/errors/MessageRejectedError.d.ts +8 -0
  8. package/{dist/serialization/resources/webhooks/types/Payload.js → api/resources/messages/errors/MessageRejectedError.js} +13 -8
  9. package/api/resources/messages/errors/index.d.ts +1 -0
  10. package/api/resources/messages/errors/index.js +17 -0
  11. package/api/resources/messages/index.d.ts +1 -0
  12. package/api/resources/messages/index.js +1 -0
  13. package/api/resources/messages/types/SendMessageResponse.d.ts +1 -0
  14. package/api/resources/threads/client/Client.js +7 -9
  15. package/api/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -2
  16. package/api/resources/webhooks/client/Client.js +4 -4
  17. package/api/resources/webhooks/types/MessageReceivedPayload.d.ts +3 -1
  18. package/api/resources/webhooks/types/index.d.ts +0 -1
  19. package/api/resources/webhooks/types/index.js +0 -1
  20. package/api/types/{Sent.d.ts → Labels.d.ts} +2 -2
  21. package/api/types/index.d.ts +1 -2
  22. package/api/types/index.js +1 -2
  23. package/dist/api/resources/inboxes/client/Client.js +3 -3
  24. package/dist/api/resources/index.d.ts +1 -0
  25. package/dist/api/resources/index.js +1 -0
  26. package/dist/api/resources/messages/client/Client.d.ts +2 -0
  27. package/dist/api/resources/messages/client/Client.js +26 -12
  28. package/dist/api/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -2
  29. package/dist/api/resources/messages/errors/MessageRejectedError.d.ts +8 -0
  30. package/dist/{serialization/types/Sent.js → api/resources/messages/errors/MessageRejectedError.js} +13 -3
  31. package/dist/api/resources/messages/errors/index.d.ts +1 -0
  32. package/dist/api/resources/messages/errors/index.js +17 -0
  33. package/dist/api/resources/messages/index.d.ts +1 -0
  34. package/dist/api/resources/messages/index.js +1 -0
  35. package/dist/api/resources/messages/types/SendMessageResponse.d.ts +1 -0
  36. package/dist/api/resources/threads/client/Client.js +7 -9
  37. package/dist/api/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -2
  38. package/dist/api/resources/webhooks/client/Client.js +4 -4
  39. package/dist/api/resources/webhooks/types/MessageReceivedPayload.d.ts +3 -1
  40. package/dist/api/resources/webhooks/types/index.d.ts +0 -1
  41. package/dist/api/resources/webhooks/types/index.js +0 -1
  42. package/dist/api/types/{Sent.d.ts → Labels.d.ts} +2 -2
  43. package/dist/api/types/index.d.ts +1 -2
  44. package/dist/api/types/index.js +1 -2
  45. package/dist/serialization/resources/messages/types/SendMessageResponse.d.ts +2 -0
  46. package/dist/serialization/resources/messages/types/SendMessageResponse.js +2 -0
  47. package/dist/serialization/resources/webhooks/types/MessageReceivedPayload.d.ts +5 -2
  48. package/dist/serialization/resources/webhooks/types/MessageReceivedPayload.js +6 -5
  49. package/dist/serialization/resources/webhooks/types/index.d.ts +0 -1
  50. package/dist/serialization/resources/webhooks/types/index.js +0 -1
  51. package/{serialization/types/Sent.d.ts → dist/serialization/types/Labels.d.ts} +3 -3
  52. package/{serialization/types/Received.js → dist/serialization/types/Labels.js} +2 -2
  53. package/dist/serialization/types/index.d.ts +1 -2
  54. package/dist/serialization/types/index.js +1 -2
  55. package/dist/version.d.ts +1 -1
  56. package/dist/version.js +1 -1
  57. package/package.json +1 -1
  58. package/serialization/resources/messages/types/SendMessageResponse.d.ts +2 -0
  59. package/serialization/resources/messages/types/SendMessageResponse.js +2 -0
  60. package/serialization/resources/webhooks/types/MessageReceivedPayload.d.ts +5 -2
  61. package/serialization/resources/webhooks/types/MessageReceivedPayload.js +6 -5
  62. package/serialization/resources/webhooks/types/index.d.ts +0 -1
  63. package/serialization/resources/webhooks/types/index.js +0 -1
  64. package/{dist/serialization/types/Sent.d.ts → serialization/types/Labels.d.ts} +3 -3
  65. package/{dist/serialization/types/Received.js → serialization/types/Labels.js} +2 -2
  66. package/serialization/types/index.d.ts +1 -2
  67. package/serialization/types/index.js +1 -2
  68. package/version.d.ts +1 -1
  69. package/version.js +1 -1
  70. package/api/resources/webhooks/types/Payload.d.ts +0 -8
  71. package/api/types/Received.d.ts +0 -7
  72. package/api/types/Sent.js +0 -5
  73. package/dist/api/resources/webhooks/types/Payload.d.ts +0 -8
  74. package/dist/api/resources/webhooks/types/Payload.js +0 -5
  75. package/dist/api/types/Received.d.ts +0 -7
  76. package/dist/api/types/Received.js +0 -5
  77. package/dist/api/types/Sent.js +0 -5
  78. package/dist/serialization/resources/webhooks/types/Payload.d.ts +0 -15
  79. package/dist/serialization/types/Received.d.ts +0 -10
  80. package/serialization/resources/webhooks/types/Payload.d.ts +0 -15
  81. package/serialization/resources/webhooks/types/Payload.js +0 -46
  82. package/serialization/types/Received.d.ts +0 -10
  83. package/serialization/types/Sent.js +0 -41
  84. /package/api/{resources/webhooks/types/Payload.js → types/Labels.js} +0 -0
  85. /package/{api/types/Received.js → dist/api/types/Labels.js} +0 -0
@@ -83,7 +83,7 @@ class Inboxes {
83
83
  const _response = yield core.fetcher({
84
84
  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"),
85
85
  method: "GET",
86
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
86
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
87
  contentType: "application/json",
88
88
  queryParameters: _queryParams,
89
89
  requestType: "json",
@@ -135,7 +135,7 @@ class Inboxes {
135
135
  const _response = yield core.fetcher({
136
136
  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))}`),
137
137
  method: "GET",
138
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
138
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
139
139
  contentType: "application/json",
140
140
  requestType: "json",
141
141
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -204,7 +204,7 @@ class Inboxes {
204
204
  const _response = yield core.fetcher({
205
205
  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"),
206
206
  method: "POST",
207
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
207
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
208
208
  contentType: "application/json",
209
209
  requestType: "json",
210
210
  body: serializers.CreateInboxRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -6,6 +6,7 @@ export * as threads from "./threads";
6
6
  export * from "./threads/types";
7
7
  export * as webhooks from "./webhooks";
8
8
  export * from "./webhooks/types";
9
+ export * from "./messages/errors";
9
10
  export * from "./inboxes/client/requests";
10
11
  export * from "./messages/client/requests";
11
12
  export * from "./threads/client/requests";
@@ -45,6 +45,7 @@ exports.threads = __importStar(require("./threads"));
45
45
  __exportStar(require("./threads/types"), exports);
46
46
  exports.webhooks = __importStar(require("./webhooks"));
47
47
  __exportStar(require("./webhooks/types"), exports);
48
+ __exportStar(require("./messages/errors"), exports);
48
49
  __exportStar(require("./inboxes/client/requests"), exports);
49
50
  __exportStar(require("./messages/client/requests"), exports);
50
51
  __exportStar(require("./threads/client/requests"), exports);
@@ -61,6 +61,7 @@ export declare class Messages {
61
61
  *
62
62
  * @throws {@link AgentMail.NotFoundError}
63
63
  * @throws {@link AgentMail.ValidationError}
64
+ * @throws {@link AgentMail.MessageRejectedError}
64
65
  *
65
66
  * @example
66
67
  * await client.messages.send("yourinbox@agentmail.to", {
@@ -81,6 +82,7 @@ export declare class Messages {
81
82
  *
82
83
  * @throws {@link AgentMail.NotFoundError}
83
84
  * @throws {@link AgentMail.ValidationError}
85
+ * @throws {@link AgentMail.MessageRejectedError}
84
86
  *
85
87
  * @example
86
88
  * await client.messages.reply("yourinbox@agentmail.to", "msg_123", {
@@ -53,6 +53,7 @@ const environments = __importStar(require("../../../../environments"));
53
53
  const core = __importStar(require("../../../../core"));
54
54
  const AgentMail = __importStar(require("../../../index"));
55
55
  const serializers = __importStar(require("../../../../serialization/index"));
56
+ const json_1 = require("../../../../core/json");
56
57
  const url_join_1 = __importDefault(require("url-join"));
57
58
  const errors = __importStar(require("../../../../errors/index"));
58
59
  class Messages {
@@ -74,24 +75,21 @@ class Messages {
74
75
  list(inboxId_1) {
75
76
  return __awaiter(this, arguments, void 0, function* (inboxId, request = {}, requestOptions) {
76
77
  var _a, _b;
77
- const { received, sent, limit, lastKey } = request;
78
+ const { limit, lastKey, labels } = request;
78
79
  const _queryParams = {};
79
- if (received != null) {
80
- _queryParams["received"] = received.toString();
81
- }
82
- if (sent != null) {
83
- _queryParams["sent"] = sent.toString();
84
- }
85
80
  if (limit != null) {
86
81
  _queryParams["limit"] = limit.toString();
87
82
  }
88
83
  if (lastKey != null) {
89
84
  _queryParams["last_key"] = lastKey;
90
85
  }
86
+ if (labels != null) {
87
+ _queryParams["labels"] = (0, json_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip" }));
88
+ }
91
89
  const _response = yield core.fetcher({
92
90
  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`),
93
91
  method: "GET",
94
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
95
93
  contentType: "application/json",
96
94
  queryParameters: _queryParams,
97
95
  requestType: "json",
@@ -154,7 +152,7 @@ class Messages {
154
152
  const _response = yield core.fetcher({
155
153
  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))}`),
156
154
  method: "GET",
157
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
155
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
156
  contentType: "application/json",
159
157
  requestType: "json",
160
158
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -209,7 +207,7 @@ class Messages {
209
207
  const _response = yield core.fetcher({
210
208
  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))}`),
211
209
  method: "GET",
212
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
210
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
213
211
  contentType: "application/json",
214
212
  requestType: "json",
215
213
  responseType: "streaming",
@@ -258,6 +256,7 @@ class Messages {
258
256
  *
259
257
  * @throws {@link AgentMail.NotFoundError}
260
258
  * @throws {@link AgentMail.ValidationError}
259
+ * @throws {@link AgentMail.MessageRejectedError}
261
260
  *
262
261
  * @example
263
262
  * await client.messages.send("yourinbox@agentmail.to", {
@@ -275,7 +274,7 @@ class Messages {
275
274
  const _response = yield core.fetcher({
276
275
  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`),
277
276
  method: "POST",
278
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
277
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
279
278
  contentType: "application/json",
280
279
  requestType: "json",
281
280
  body: serializers.SendMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -307,6 +306,13 @@ class Messages {
307
306
  allowUnrecognizedEnumValues: true,
308
307
  breadcrumbsPrefix: ["response"],
309
308
  }));
309
+ case 403:
310
+ throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
311
+ unrecognizedObjectKeys: "passthrough",
312
+ allowUnrecognizedUnionMembers: true,
313
+ allowUnrecognizedEnumValues: true,
314
+ breadcrumbsPrefix: ["response"],
315
+ }));
310
316
  default:
311
317
  throw new errors.AgentMailError({
312
318
  statusCode: _response.error.statusCode,
@@ -337,6 +343,7 @@ class Messages {
337
343
  *
338
344
  * @throws {@link AgentMail.NotFoundError}
339
345
  * @throws {@link AgentMail.ValidationError}
346
+ * @throws {@link AgentMail.MessageRejectedError}
340
347
  *
341
348
  * @example
342
349
  * await client.messages.reply("yourinbox@agentmail.to", "msg_123", {
@@ -352,7 +359,7 @@ class Messages {
352
359
  const _response = yield core.fetcher({
353
360
  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`),
354
361
  method: "POST",
355
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
362
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
356
363
  contentType: "application/json",
357
364
  requestType: "json",
358
365
  body: serializers.ReplyToMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -384,6 +391,13 @@ class Messages {
384
391
  allowUnrecognizedEnumValues: true,
385
392
  breadcrumbsPrefix: ["response"],
386
393
  }));
394
+ case 403:
395
+ throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
396
+ unrecognizedObjectKeys: "passthrough",
397
+ allowUnrecognizedUnionMembers: true,
398
+ allowUnrecognizedEnumValues: true,
399
+ breadcrumbsPrefix: ["response"],
400
+ }));
387
401
  default:
388
402
  throw new errors.AgentMailError({
389
403
  statusCode: _response.error.statusCode,
@@ -9,8 +9,7 @@ import * as AgentMail from "../../../../index";
9
9
  * }
10
10
  */
11
11
  export interface ListMessagesRequest {
12
- received?: AgentMail.Received;
13
- sent?: AgentMail.Sent;
14
12
  limit?: AgentMail.Limit;
15
13
  lastKey?: AgentMail.LastKey;
14
+ labels?: AgentMail.Labels;
16
15
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as errors from "../../../../errors/index";
5
+ import * as AgentMail from "../../../index";
6
+ export declare class MessageRejectedError extends errors.AgentMailError {
7
+ constructor(body: AgentMail.ErrorResponse);
8
+ }
@@ -36,11 +36,16 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.Payload = void 0;
40
- const core = __importStar(require("../../../../core"));
41
- const EventType_1 = require("./EventType");
42
- const EventId_1 = require("./EventId");
43
- exports.Payload = core.serialization.object({
44
- eventType: core.serialization.property("event_type", EventType_1.EventType),
45
- eventId: core.serialization.property("event_id", EventId_1.EventId),
46
- });
39
+ exports.MessageRejectedError = void 0;
40
+ const errors = __importStar(require("../../../../errors/index"));
41
+ class MessageRejectedError extends errors.AgentMailError {
42
+ constructor(body) {
43
+ super({
44
+ message: "MessageRejectedError",
45
+ statusCode: 403,
46
+ body: body,
47
+ });
48
+ Object.setPrototypeOf(this, MessageRejectedError.prototype);
49
+ }
50
+ }
51
+ exports.MessageRejectedError = MessageRejectedError;
@@ -0,0 +1 @@
1
+ export * from "./MessageRejectedError";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./MessageRejectedError"), exports);
@@ -1,2 +1,3 @@
1
1
  export * from "./types";
2
+ export * from "./errors";
2
3
  export * from "./client";
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./types"), exports);
18
+ __exportStar(require("./errors"), exports);
18
19
  __exportStar(require("./client"), exports);
@@ -4,4 +4,5 @@
4
4
  import * as AgentMail from "../../../index";
5
5
  export interface SendMessageResponse {
6
6
  messageId: AgentMail.MessageId;
7
+ threadId: AgentMail.ThreadId;
7
8
  }
@@ -53,6 +53,7 @@ const environments = __importStar(require("../../../../environments"));
53
53
  const core = __importStar(require("../../../../core"));
54
54
  const AgentMail = __importStar(require("../../../index"));
55
55
  const serializers = __importStar(require("../../../../serialization/index"));
56
+ const json_1 = require("../../../../core/json");
56
57
  const url_join_1 = __importDefault(require("url-join"));
57
58
  const errors = __importStar(require("../../../../errors/index"));
58
59
  class Threads {
@@ -74,24 +75,21 @@ class Threads {
74
75
  list(inboxId_1) {
75
76
  return __awaiter(this, arguments, void 0, function* (inboxId, request = {}, requestOptions) {
76
77
  var _a, _b;
77
- const { received, sent, limit, lastKey } = request;
78
+ const { limit, lastKey, labels } = request;
78
79
  const _queryParams = {};
79
- if (received != null) {
80
- _queryParams["received"] = received.toString();
81
- }
82
- if (sent != null) {
83
- _queryParams["sent"] = sent.toString();
84
- }
85
80
  if (limit != null) {
86
81
  _queryParams["limit"] = limit.toString();
87
82
  }
88
83
  if (lastKey != null) {
89
84
  _queryParams["last_key"] = lastKey;
90
85
  }
86
+ if (labels != null) {
87
+ _queryParams["labels"] = (0, json_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip" }));
88
+ }
91
89
  const _response = yield core.fetcher({
92
90
  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`),
93
91
  method: "GET",
94
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
95
93
  contentType: "application/json",
96
94
  queryParameters: _queryParams,
97
95
  requestType: "json",
@@ -154,7 +152,7 @@ class Threads {
154
152
  const _response = yield core.fetcher({
155
153
  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))}`),
156
154
  method: "GET",
157
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
155
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
156
  contentType: "application/json",
159
157
  requestType: "json",
160
158
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -9,8 +9,7 @@ import * as AgentMail from "../../../../index";
9
9
  * }
10
10
  */
11
11
  export interface ListThreadsRequest {
12
- received?: AgentMail.Received;
13
- sent?: AgentMail.Sent;
14
12
  limit?: AgentMail.Limit;
15
13
  lastKey?: AgentMail.LastKey;
14
+ labels?: AgentMail.Labels;
16
15
  }
@@ -80,7 +80,7 @@ class Webhooks {
80
80
  const _response = yield core.fetcher({
81
81
  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/webhooks"),
82
82
  method: "GET",
83
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
84
84
  contentType: "application/json",
85
85
  queryParameters: _queryParams,
86
86
  requestType: "json",
@@ -132,7 +132,7 @@ class Webhooks {
132
132
  const _response = yield core.fetcher({
133
133
  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/webhooks/${encodeURIComponent(serializers.WebhookId.jsonOrThrow(webhookId))}`),
134
134
  method: "GET",
135
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
135
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
136
136
  contentType: "application/json",
137
137
  requestType: "json",
138
138
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -197,7 +197,7 @@ class Webhooks {
197
197
  const _response = yield core.fetcher({
198
198
  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/webhooks"),
199
199
  method: "POST",
200
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
200
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
201
201
  contentType: "application/json",
202
202
  requestType: "json",
203
203
  body: serializers.CreateWebhookRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -259,7 +259,7 @@ class Webhooks {
259
259
  const _response = yield core.fetcher({
260
260
  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/webhooks/${encodeURIComponent(serializers.WebhookId.jsonOrThrow(webhookId))}`),
261
261
  method: "DELETE",
262
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
262
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
263
263
  contentType: "application/json",
264
264
  requestType: "json",
265
265
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -2,6 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as AgentMail from "../../../index";
5
- export interface MessageReceivedPayload extends AgentMail.Payload {
5
+ export interface MessageReceivedPayload {
6
+ eventType: AgentMail.EventType;
7
+ eventId: AgentMail.EventId;
6
8
  message: AgentMail.Message;
7
9
  }
@@ -7,7 +7,6 @@ export * from "./Webhook";
7
7
  export * from "./ListWebhooksResponse";
8
8
  export * from "./CreateWebhookRequest";
9
9
  export * from "./EventId";
10
- export * from "./Payload";
11
10
  export * from "./MessageReceivedPayload";
12
11
  export * from "./SvixId";
13
12
  export * from "./SvixTimestamp";
@@ -23,7 +23,6 @@ __exportStar(require("./Webhook"), exports);
23
23
  __exportStar(require("./ListWebhooksResponse"), exports);
24
24
  __exportStar(require("./CreateWebhookRequest"), exports);
25
25
  __exportStar(require("./EventId"), exports);
26
- __exportStar(require("./Payload"), exports);
27
26
  __exportStar(require("./MessageReceivedPayload"), exports);
28
27
  __exportStar(require("./SvixId"), exports);
29
28
  __exportStar(require("./SvixTimestamp"), exports);
@@ -2,6 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * Whether to filter by sent threads/messages.
5
+ * Labels to filter by.
6
6
  */
7
- export type Sent = boolean;
7
+ export type Labels = string[];
@@ -1,8 +1,7 @@
1
- export * from "./Received";
2
- export * from "./Sent";
3
1
  export * from "./Limit";
4
2
  export * from "./Count";
5
3
  export * from "./LastKey";
4
+ export * from "./Labels";
6
5
  export * from "./OrganizationId";
7
6
  export * from "./ErrorName";
8
7
  export * from "./ErrorResponse";
@@ -14,11 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Received"), exports);
18
- __exportStar(require("./Sent"), exports);
19
17
  __exportStar(require("./Limit"), exports);
20
18
  __exportStar(require("./Count"), exports);
21
19
  __exportStar(require("./LastKey"), exports);
20
+ __exportStar(require("./Labels"), exports);
22
21
  __exportStar(require("./OrganizationId"), exports);
23
22
  __exportStar(require("./ErrorName"), exports);
24
23
  __exportStar(require("./ErrorResponse"), exports);
@@ -83,7 +83,7 @@ class Inboxes {
83
83
  const _response = yield core.fetcher({
84
84
  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"),
85
85
  method: "GET",
86
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
86
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
87
  contentType: "application/json",
88
88
  queryParameters: _queryParams,
89
89
  requestType: "json",
@@ -135,7 +135,7 @@ class Inboxes {
135
135
  const _response = yield core.fetcher({
136
136
  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))}`),
137
137
  method: "GET",
138
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
138
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
139
139
  contentType: "application/json",
140
140
  requestType: "json",
141
141
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -204,7 +204,7 @@ class Inboxes {
204
204
  const _response = yield core.fetcher({
205
205
  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"),
206
206
  method: "POST",
207
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
207
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.23", "User-Agent": "agentmail/0.0.23", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
208
208
  contentType: "application/json",
209
209
  requestType: "json",
210
210
  body: serializers.CreateInboxRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -6,6 +6,7 @@ export * as threads from "./threads";
6
6
  export * from "./threads/types";
7
7
  export * as webhooks from "./webhooks";
8
8
  export * from "./webhooks/types";
9
+ export * from "./messages/errors";
9
10
  export * from "./inboxes/client/requests";
10
11
  export * from "./messages/client/requests";
11
12
  export * from "./threads/client/requests";
@@ -45,6 +45,7 @@ exports.threads = __importStar(require("./threads"));
45
45
  __exportStar(require("./threads/types"), exports);
46
46
  exports.webhooks = __importStar(require("./webhooks"));
47
47
  __exportStar(require("./webhooks/types"), exports);
48
+ __exportStar(require("./messages/errors"), exports);
48
49
  __exportStar(require("./inboxes/client/requests"), exports);
49
50
  __exportStar(require("./messages/client/requests"), exports);
50
51
  __exportStar(require("./threads/client/requests"), exports);
@@ -61,6 +61,7 @@ export declare class Messages {
61
61
  *
62
62
  * @throws {@link AgentMail.NotFoundError}
63
63
  * @throws {@link AgentMail.ValidationError}
64
+ * @throws {@link AgentMail.MessageRejectedError}
64
65
  *
65
66
  * @example
66
67
  * await client.messages.send("yourinbox@agentmail.to", {
@@ -81,6 +82,7 @@ export declare class Messages {
81
82
  *
82
83
  * @throws {@link AgentMail.NotFoundError}
83
84
  * @throws {@link AgentMail.ValidationError}
85
+ * @throws {@link AgentMail.MessageRejectedError}
84
86
  *
85
87
  * @example
86
88
  * await client.messages.reply("yourinbox@agentmail.to", "msg_123", {