agentmail 0.0.27 → 0.0.28

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 (38) hide show
  1. package/api/resources/drafts/client/Client.js +2 -2
  2. package/api/resources/inboxes/client/Client.js +3 -3
  3. package/api/resources/inboxes/resources/drafts/client/Client.js +3 -3
  4. package/api/resources/inboxes/resources/messages/client/Client.d.ts +18 -2
  5. package/api/resources/inboxes/resources/messages/client/Client.js +92 -14
  6. package/api/resources/inboxes/resources/messages/types/UpdateMessageRequest.d.ts +9 -0
  7. package/api/resources/inboxes/resources/messages/types/UpdateMessageRequest.js +5 -0
  8. package/api/resources/inboxes/resources/messages/types/index.d.ts +1 -0
  9. package/api/resources/inboxes/resources/messages/types/index.js +1 -0
  10. package/api/resources/inboxes/resources/threads/client/Client.js +2 -2
  11. package/api/resources/threads/client/Client.js +2 -2
  12. package/api/resources/webhooks/client/Client.js +4 -4
  13. package/dist/api/resources/drafts/client/Client.js +2 -2
  14. package/dist/api/resources/inboxes/client/Client.js +3 -3
  15. package/dist/api/resources/inboxes/resources/drafts/client/Client.js +3 -3
  16. package/dist/api/resources/inboxes/resources/messages/client/Client.d.ts +18 -2
  17. package/dist/api/resources/inboxes/resources/messages/client/Client.js +92 -14
  18. package/dist/api/resources/inboxes/resources/messages/types/UpdateMessageRequest.d.ts +9 -0
  19. package/dist/api/resources/inboxes/resources/messages/types/UpdateMessageRequest.js +5 -0
  20. package/dist/api/resources/inboxes/resources/messages/types/index.d.ts +1 -0
  21. package/dist/api/resources/inboxes/resources/messages/types/index.js +1 -0
  22. package/dist/api/resources/inboxes/resources/threads/client/Client.js +2 -2
  23. package/dist/api/resources/threads/client/Client.js +2 -2
  24. package/dist/api/resources/webhooks/client/Client.js +4 -4
  25. package/dist/serialization/resources/inboxes/resources/messages/types/UpdateMessageRequest.d.ts +13 -0
  26. package/dist/serialization/resources/inboxes/resources/messages/types/UpdateMessageRequest.js +44 -0
  27. package/dist/serialization/resources/inboxes/resources/messages/types/index.d.ts +1 -0
  28. package/dist/serialization/resources/inboxes/resources/messages/types/index.js +1 -0
  29. package/dist/version.d.ts +1 -1
  30. package/dist/version.js +1 -1
  31. package/package.json +1 -1
  32. package/reference.md +67 -0
  33. package/serialization/resources/inboxes/resources/messages/types/UpdateMessageRequest.d.ts +13 -0
  34. package/serialization/resources/inboxes/resources/messages/types/UpdateMessageRequest.js +44 -0
  35. package/serialization/resources/inboxes/resources/messages/types/index.d.ts +1 -0
  36. package/serialization/resources/inboxes/resources/messages/types/index.js +1 -0
  37. package/version.d.ts +1 -1
  38. package/version.js +1 -1
@@ -86,7 +86,7 @@ class Drafts {
86
86
  const _response = yield core.fetcher({
87
87
  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/drafts"),
88
88
  method: "GET",
89
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
89
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
90
  contentType: "application/json",
91
91
  queryParameters: _queryParams,
92
92
  requestType: "json",
@@ -150,7 +150,7 @@ class Drafts {
150
150
  const _response = yield core.fetcher({
151
151
  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/drafts/${encodeURIComponent(serializers.inboxes.DraftId.jsonOrThrow(draftId))}`),
152
152
  method: "GET",
153
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
153
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
154
154
  contentType: "application/json",
155
155
  requestType: "json",
156
156
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -95,7 +95,7 @@ class Inboxes {
95
95
  const _response = yield core.fetcher({
96
96
  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"),
97
97
  method: "GET",
98
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
98
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
99
99
  contentType: "application/json",
100
100
  queryParameters: _queryParams,
101
101
  requestType: "json",
@@ -148,7 +148,7 @@ class Inboxes {
148
148
  const _response = yield core.fetcher({
149
149
  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.inboxes.InboxId.jsonOrThrow(inboxId))}`),
150
150
  method: "GET",
151
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
151
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
152
152
  contentType: "application/json",
153
153
  requestType: "json",
154
154
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -215,7 +215,7 @@ class Inboxes {
215
215
  const _response = yield core.fetcher({
216
216
  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"),
217
217
  method: "POST",
218
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
218
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
219
219
  contentType: "application/json",
220
220
  requestType: "json",
221
221
  body: serializers.inboxes.CreateInboxRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -87,7 +87,7 @@ class Drafts {
87
87
  const _response = yield core.fetcher({
88
88
  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.inboxes.InboxId.jsonOrThrow(inboxId))}/drafts`),
89
89
  method: "GET",
90
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
91
  contentType: "application/json",
92
92
  queryParameters: _queryParams,
93
93
  requestType: "json",
@@ -152,7 +152,7 @@ class Drafts {
152
152
  const _response = yield core.fetcher({
153
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.inboxes.InboxId.jsonOrThrow(inboxId))}/drafts/${encodeURIComponent(serializers.inboxes.DraftId.jsonOrThrow(draftId))}`),
154
154
  method: "GET",
155
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "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.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
156
  contentType: "application/json",
157
157
  requestType: "json",
158
158
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -224,7 +224,7 @@ class Drafts {
224
224
  const _response = yield core.fetcher({
225
225
  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.inboxes.InboxId.jsonOrThrow(inboxId))}/drafts`),
226
226
  method: "POST",
227
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
227
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
228
228
  contentType: "application/json",
229
229
  requestType: "json",
230
230
  body: serializers.inboxes.CreateDraftRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -57,8 +57,8 @@ export declare class Messages {
57
57
  * @param {AgentMail.inboxes.SendMessageRequest} request
58
58
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
59
59
  *
60
- * @throws {@link AgentMail.NotFoundError}
61
60
  * @throws {@link AgentMail.ValidationError}
61
+ * @throws {@link AgentMail.NotFoundError}
62
62
  * @throws {@link AgentMail.inboxes.MessageRejectedError}
63
63
  *
64
64
  * @example
@@ -79,8 +79,8 @@ export declare class Messages {
79
79
  * @param {AgentMail.inboxes.ReplyToMessageRequest} request
80
80
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
81
81
  *
82
- * @throws {@link AgentMail.NotFoundError}
83
82
  * @throws {@link AgentMail.ValidationError}
83
+ * @throws {@link AgentMail.NotFoundError}
84
84
  * @throws {@link AgentMail.inboxes.MessageRejectedError}
85
85
  *
86
86
  * @example
@@ -94,5 +94,21 @@ export declare class Messages {
94
94
  * })
95
95
  */
96
96
  reply(inboxId: AgentMail.inboxes.InboxId, messageId: AgentMail.inboxes.MessageId, request: AgentMail.inboxes.ReplyToMessageRequest, requestOptions?: Messages.RequestOptions): Promise<AgentMail.inboxes.SendMessageResponse>;
97
+ /**
98
+ * @param {AgentMail.inboxes.InboxId} inboxId
99
+ * @param {AgentMail.inboxes.MessageId} messageId
100
+ * @param {AgentMail.inboxes.UpdateMessageRequest} request
101
+ * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
102
+ *
103
+ * @throws {@link AgentMail.ValidationError}
104
+ * @throws {@link AgentMail.NotFoundError}
105
+ *
106
+ * @example
107
+ * await client.inboxes.messages.update("inbox_id", "message_id", {
108
+ * addLabels: undefined,
109
+ * removeLabels: undefined
110
+ * })
111
+ */
112
+ update(inboxId: AgentMail.inboxes.InboxId, messageId: AgentMail.inboxes.MessageId, request: AgentMail.inboxes.UpdateMessageRequest, requestOptions?: Messages.RequestOptions): Promise<AgentMail.inboxes.Message>;
97
113
  protected _getAuthorizationHeader(): Promise<string>;
98
114
  }
@@ -87,7 +87,7 @@ class Messages {
87
87
  const _response = yield core.fetcher({
88
88
  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.inboxes.InboxId.jsonOrThrow(inboxId))}/messages`),
89
89
  method: "GET",
90
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
91
  contentType: "application/json",
92
92
  queryParameters: _queryParams,
93
93
  requestType: "json",
@@ -152,7 +152,7 @@ class Messages {
152
152
  const _response = yield core.fetcher({
153
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.inboxes.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.inboxes.MessageId.jsonOrThrow(messageId))}`),
154
154
  method: "GET",
155
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "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.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
156
  contentType: "application/json",
157
157
  requestType: "json",
158
158
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -209,7 +209,7 @@ class Messages {
209
209
  const _response = yield core.fetcher({
210
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.inboxes.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.inboxes.MessageId.jsonOrThrow(messageId))}/attachments/${encodeURIComponent(serializers.inboxes.AttachmentId.jsonOrThrow(attachmentId))}`),
211
211
  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.27", "User-Agent": "agentmail/0.0.27", "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.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
213
213
  contentType: "application/json",
214
214
  requestType: "json",
215
215
  responseType: "streaming",
@@ -257,8 +257,8 @@ class Messages {
257
257
  * @param {AgentMail.inboxes.SendMessageRequest} request
258
258
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
259
259
  *
260
- * @throws {@link AgentMail.NotFoundError}
261
260
  * @throws {@link AgentMail.ValidationError}
261
+ * @throws {@link AgentMail.NotFoundError}
262
262
  * @throws {@link AgentMail.inboxes.MessageRejectedError}
263
263
  *
264
264
  * @example
@@ -278,7 +278,7 @@ class Messages {
278
278
  const _response = yield core.fetcher({
279
279
  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.inboxes.InboxId.jsonOrThrow(inboxId))}/messages/send`),
280
280
  method: "POST",
281
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
281
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
282
282
  contentType: "application/json",
283
283
  requestType: "json",
284
284
  body: serializers.inboxes.SendMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -297,16 +297,16 @@ class Messages {
297
297
  }
298
298
  if (_response.error.reason === "status-code") {
299
299
  switch (_response.error.statusCode) {
300
- case 404:
301
- throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
300
+ case 400:
301
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
302
302
  unrecognizedObjectKeys: "passthrough",
303
303
  allowUnrecognizedUnionMembers: true,
304
304
  allowUnrecognizedEnumValues: true,
305
305
  skipValidation: true,
306
306
  breadcrumbsPrefix: ["response"],
307
307
  }));
308
- case 400:
309
- throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
308
+ case 404:
309
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
310
310
  unrecognizedObjectKeys: "passthrough",
311
311
  allowUnrecognizedUnionMembers: true,
312
312
  allowUnrecognizedEnumValues: true,
@@ -349,8 +349,8 @@ class Messages {
349
349
  * @param {AgentMail.inboxes.ReplyToMessageRequest} request
350
350
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
351
351
  *
352
- * @throws {@link AgentMail.NotFoundError}
353
352
  * @throws {@link AgentMail.ValidationError}
353
+ * @throws {@link AgentMail.NotFoundError}
354
354
  * @throws {@link AgentMail.inboxes.MessageRejectedError}
355
355
  *
356
356
  * @example
@@ -369,7 +369,7 @@ class Messages {
369
369
  const _response = yield core.fetcher({
370
370
  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.inboxes.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.inboxes.MessageId.jsonOrThrow(messageId))}/reply`),
371
371
  method: "POST",
372
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
372
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
373
373
  contentType: "application/json",
374
374
  requestType: "json",
375
375
  body: serializers.inboxes.ReplyToMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -388,6 +388,14 @@ class Messages {
388
388
  }
389
389
  if (_response.error.reason === "status-code") {
390
390
  switch (_response.error.statusCode) {
391
+ case 400:
392
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
393
+ unrecognizedObjectKeys: "passthrough",
394
+ allowUnrecognizedUnionMembers: true,
395
+ allowUnrecognizedEnumValues: true,
396
+ skipValidation: true,
397
+ breadcrumbsPrefix: ["response"],
398
+ }));
391
399
  case 404:
392
400
  throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
393
401
  unrecognizedObjectKeys: "passthrough",
@@ -396,6 +404,76 @@ class Messages {
396
404
  skipValidation: true,
397
405
  breadcrumbsPrefix: ["response"],
398
406
  }));
407
+ case 403:
408
+ throw new AgentMail.inboxes.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
409
+ unrecognizedObjectKeys: "passthrough",
410
+ allowUnrecognizedUnionMembers: true,
411
+ allowUnrecognizedEnumValues: true,
412
+ skipValidation: true,
413
+ breadcrumbsPrefix: ["response"],
414
+ }));
415
+ default:
416
+ throw new errors.AgentMailError({
417
+ statusCode: _response.error.statusCode,
418
+ body: _response.error.body,
419
+ });
420
+ }
421
+ }
422
+ switch (_response.error.reason) {
423
+ case "non-json":
424
+ throw new errors.AgentMailError({
425
+ statusCode: _response.error.statusCode,
426
+ body: _response.error.rawBody,
427
+ });
428
+ case "timeout":
429
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling POST /v0/inboxes/{inbox_id}/messages/{message_id}/reply.");
430
+ case "unknown":
431
+ throw new errors.AgentMailError({
432
+ message: _response.error.errorMessage,
433
+ });
434
+ }
435
+ });
436
+ }
437
+ /**
438
+ * @param {AgentMail.inboxes.InboxId} inboxId
439
+ * @param {AgentMail.inboxes.MessageId} messageId
440
+ * @param {AgentMail.inboxes.UpdateMessageRequest} request
441
+ * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
442
+ *
443
+ * @throws {@link AgentMail.ValidationError}
444
+ * @throws {@link AgentMail.NotFoundError}
445
+ *
446
+ * @example
447
+ * await client.inboxes.messages.update("inbox_id", "message_id", {
448
+ * addLabels: undefined,
449
+ * removeLabels: undefined
450
+ * })
451
+ */
452
+ update(inboxId, messageId, request, requestOptions) {
453
+ return __awaiter(this, void 0, void 0, function* () {
454
+ var _a, _b;
455
+ const _response = yield core.fetcher({
456
+ 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.inboxes.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.inboxes.MessageId.jsonOrThrow(messageId))}`),
457
+ method: "PATCH",
458
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
459
+ contentType: "application/json",
460
+ requestType: "json",
461
+ body: serializers.inboxes.UpdateMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
462
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
463
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
464
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
465
+ });
466
+ if (_response.ok) {
467
+ return serializers.inboxes.Message.parseOrThrow(_response.body, {
468
+ unrecognizedObjectKeys: "passthrough",
469
+ allowUnrecognizedUnionMembers: true,
470
+ allowUnrecognizedEnumValues: true,
471
+ skipValidation: true,
472
+ breadcrumbsPrefix: ["response"],
473
+ });
474
+ }
475
+ if (_response.error.reason === "status-code") {
476
+ switch (_response.error.statusCode) {
399
477
  case 400:
400
478
  throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
401
479
  unrecognizedObjectKeys: "passthrough",
@@ -404,8 +482,8 @@ class Messages {
404
482
  skipValidation: true,
405
483
  breadcrumbsPrefix: ["response"],
406
484
  }));
407
- case 403:
408
- throw new AgentMail.inboxes.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
485
+ case 404:
486
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
409
487
  unrecognizedObjectKeys: "passthrough",
410
488
  allowUnrecognizedUnionMembers: true,
411
489
  allowUnrecognizedEnumValues: true,
@@ -426,7 +504,7 @@ class Messages {
426
504
  body: _response.error.rawBody,
427
505
  });
428
506
  case "timeout":
429
- throw new errors.AgentMailTimeoutError("Timeout exceeded when calling POST /v0/inboxes/{inbox_id}/messages/{message_id}/reply.");
507
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling PATCH /v0/inboxes/{inbox_id}/messages/{message_id}.");
430
508
  case "unknown":
431
509
  throw new errors.AgentMailError({
432
510
  message: _response.error.errorMessage,
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface UpdateMessageRequest {
5
+ /** Labels to add to message. */
6
+ addLabels?: string[];
7
+ /** Labels to remove from message. */
8
+ removeLabels?: string[];
9
+ }
@@ -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 });
@@ -32,3 +32,4 @@ export * from "./SendMessageAttachments";
32
32
  export * from "./SendMessageRequest";
33
33
  export * from "./SendMessageResponse";
34
34
  export * from "./ReplyToMessageRequest";
35
+ export * from "./UpdateMessageRequest";
@@ -48,3 +48,4 @@ __exportStar(require("./SendMessageAttachments"), exports);
48
48
  __exportStar(require("./SendMessageRequest"), exports);
49
49
  __exportStar(require("./SendMessageResponse"), exports);
50
50
  __exportStar(require("./ReplyToMessageRequest"), exports);
51
+ __exportStar(require("./UpdateMessageRequest"), exports);
@@ -87,7 +87,7 @@ class Threads {
87
87
  const _response = yield core.fetcher({
88
88
  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.inboxes.InboxId.jsonOrThrow(inboxId))}/threads`),
89
89
  method: "GET",
90
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
91
  contentType: "application/json",
92
92
  queryParameters: _queryParams,
93
93
  requestType: "json",
@@ -152,7 +152,7 @@ class Threads {
152
152
  const _response = yield core.fetcher({
153
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.inboxes.InboxId.jsonOrThrow(inboxId))}/threads/${encodeURIComponent(serializers.inboxes.ThreadId.jsonOrThrow(threadId))}`),
154
154
  method: "GET",
155
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "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.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
156
  contentType: "application/json",
157
157
  requestType: "json",
158
158
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -86,7 +86,7 @@ class Threads {
86
86
  const _response = yield core.fetcher({
87
87
  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/threads"),
88
88
  method: "GET",
89
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
89
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
90
  contentType: "application/json",
91
91
  queryParameters: _queryParams,
92
92
  requestType: "json",
@@ -150,7 +150,7 @@ class Threads {
150
150
  const _response = yield core.fetcher({
151
151
  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/threads/${encodeURIComponent(serializers.inboxes.ThreadId.jsonOrThrow(threadId))}`),
152
152
  method: "GET",
153
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
153
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
154
154
  contentType: "application/json",
155
155
  requestType: "json",
156
156
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -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.27", "User-Agent": "agentmail/0.0.27", "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.28", "User-Agent": "agentmail/0.0.28", "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",
@@ -133,7 +133,7 @@ class Webhooks {
133
133
  const _response = yield core.fetcher({
134
134
  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))}`),
135
135
  method: "GET",
136
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
136
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
137
137
  contentType: "application/json",
138
138
  requestType: "json",
139
139
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -200,7 +200,7 @@ class Webhooks {
200
200
  const _response = yield core.fetcher({
201
201
  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"),
202
202
  method: "POST",
203
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
203
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
204
204
  contentType: "application/json",
205
205
  requestType: "json",
206
206
  body: serializers.CreateWebhookRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -264,7 +264,7 @@ class Webhooks {
264
264
  const _response = yield core.fetcher({
265
265
  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))}`),
266
266
  method: "DELETE",
267
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
267
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
268
268
  contentType: "application/json",
269
269
  requestType: "json",
270
270
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -86,7 +86,7 @@ class Drafts {
86
86
  const _response = yield core.fetcher({
87
87
  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/drafts"),
88
88
  method: "GET",
89
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
89
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
90
  contentType: "application/json",
91
91
  queryParameters: _queryParams,
92
92
  requestType: "json",
@@ -150,7 +150,7 @@ class Drafts {
150
150
  const _response = yield core.fetcher({
151
151
  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/drafts/${encodeURIComponent(serializers.inboxes.DraftId.jsonOrThrow(draftId))}`),
152
152
  method: "GET",
153
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
153
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
154
154
  contentType: "application/json",
155
155
  requestType: "json",
156
156
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -95,7 +95,7 @@ class Inboxes {
95
95
  const _response = yield core.fetcher({
96
96
  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"),
97
97
  method: "GET",
98
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
98
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
99
99
  contentType: "application/json",
100
100
  queryParameters: _queryParams,
101
101
  requestType: "json",
@@ -148,7 +148,7 @@ class Inboxes {
148
148
  const _response = yield core.fetcher({
149
149
  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.inboxes.InboxId.jsonOrThrow(inboxId))}`),
150
150
  method: "GET",
151
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
151
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
152
152
  contentType: "application/json",
153
153
  requestType: "json",
154
154
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -215,7 +215,7 @@ class Inboxes {
215
215
  const _response = yield core.fetcher({
216
216
  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"),
217
217
  method: "POST",
218
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
218
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
219
219
  contentType: "application/json",
220
220
  requestType: "json",
221
221
  body: serializers.inboxes.CreateInboxRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -87,7 +87,7 @@ class Drafts {
87
87
  const _response = yield core.fetcher({
88
88
  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.inboxes.InboxId.jsonOrThrow(inboxId))}/drafts`),
89
89
  method: "GET",
90
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
91
  contentType: "application/json",
92
92
  queryParameters: _queryParams,
93
93
  requestType: "json",
@@ -152,7 +152,7 @@ class Drafts {
152
152
  const _response = yield core.fetcher({
153
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.inboxes.InboxId.jsonOrThrow(inboxId))}/drafts/${encodeURIComponent(serializers.inboxes.DraftId.jsonOrThrow(draftId))}`),
154
154
  method: "GET",
155
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "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.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
156
  contentType: "application/json",
157
157
  requestType: "json",
158
158
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -224,7 +224,7 @@ class Drafts {
224
224
  const _response = yield core.fetcher({
225
225
  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.inboxes.InboxId.jsonOrThrow(inboxId))}/drafts`),
226
226
  method: "POST",
227
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
227
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
228
228
  contentType: "application/json",
229
229
  requestType: "json",
230
230
  body: serializers.inboxes.CreateDraftRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -57,8 +57,8 @@ export declare class Messages {
57
57
  * @param {AgentMail.inboxes.SendMessageRequest} request
58
58
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
59
59
  *
60
- * @throws {@link AgentMail.NotFoundError}
61
60
  * @throws {@link AgentMail.ValidationError}
61
+ * @throws {@link AgentMail.NotFoundError}
62
62
  * @throws {@link AgentMail.inboxes.MessageRejectedError}
63
63
  *
64
64
  * @example
@@ -79,8 +79,8 @@ export declare class Messages {
79
79
  * @param {AgentMail.inboxes.ReplyToMessageRequest} request
80
80
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
81
81
  *
82
- * @throws {@link AgentMail.NotFoundError}
83
82
  * @throws {@link AgentMail.ValidationError}
83
+ * @throws {@link AgentMail.NotFoundError}
84
84
  * @throws {@link AgentMail.inboxes.MessageRejectedError}
85
85
  *
86
86
  * @example
@@ -94,5 +94,21 @@ export declare class Messages {
94
94
  * })
95
95
  */
96
96
  reply(inboxId: AgentMail.inboxes.InboxId, messageId: AgentMail.inboxes.MessageId, request: AgentMail.inboxes.ReplyToMessageRequest, requestOptions?: Messages.RequestOptions): Promise<AgentMail.inboxes.SendMessageResponse>;
97
+ /**
98
+ * @param {AgentMail.inboxes.InboxId} inboxId
99
+ * @param {AgentMail.inboxes.MessageId} messageId
100
+ * @param {AgentMail.inboxes.UpdateMessageRequest} request
101
+ * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
102
+ *
103
+ * @throws {@link AgentMail.ValidationError}
104
+ * @throws {@link AgentMail.NotFoundError}
105
+ *
106
+ * @example
107
+ * await client.inboxes.messages.update("inbox_id", "message_id", {
108
+ * addLabels: undefined,
109
+ * removeLabels: undefined
110
+ * })
111
+ */
112
+ update(inboxId: AgentMail.inboxes.InboxId, messageId: AgentMail.inboxes.MessageId, request: AgentMail.inboxes.UpdateMessageRequest, requestOptions?: Messages.RequestOptions): Promise<AgentMail.inboxes.Message>;
97
113
  protected _getAuthorizationHeader(): Promise<string>;
98
114
  }
@@ -87,7 +87,7 @@ class Messages {
87
87
  const _response = yield core.fetcher({
88
88
  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.inboxes.InboxId.jsonOrThrow(inboxId))}/messages`),
89
89
  method: "GET",
90
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
91
  contentType: "application/json",
92
92
  queryParameters: _queryParams,
93
93
  requestType: "json",
@@ -152,7 +152,7 @@ class Messages {
152
152
  const _response = yield core.fetcher({
153
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.inboxes.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.inboxes.MessageId.jsonOrThrow(messageId))}`),
154
154
  method: "GET",
155
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "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.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
156
  contentType: "application/json",
157
157
  requestType: "json",
158
158
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -209,7 +209,7 @@ class Messages {
209
209
  const _response = yield core.fetcher({
210
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.inboxes.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.inboxes.MessageId.jsonOrThrow(messageId))}/attachments/${encodeURIComponent(serializers.inboxes.AttachmentId.jsonOrThrow(attachmentId))}`),
211
211
  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.27", "User-Agent": "agentmail/0.0.27", "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.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
213
213
  contentType: "application/json",
214
214
  requestType: "json",
215
215
  responseType: "streaming",
@@ -257,8 +257,8 @@ class Messages {
257
257
  * @param {AgentMail.inboxes.SendMessageRequest} request
258
258
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
259
259
  *
260
- * @throws {@link AgentMail.NotFoundError}
261
260
  * @throws {@link AgentMail.ValidationError}
261
+ * @throws {@link AgentMail.NotFoundError}
262
262
  * @throws {@link AgentMail.inboxes.MessageRejectedError}
263
263
  *
264
264
  * @example
@@ -278,7 +278,7 @@ class Messages {
278
278
  const _response = yield core.fetcher({
279
279
  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.inboxes.InboxId.jsonOrThrow(inboxId))}/messages/send`),
280
280
  method: "POST",
281
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
281
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
282
282
  contentType: "application/json",
283
283
  requestType: "json",
284
284
  body: serializers.inboxes.SendMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -297,16 +297,16 @@ class Messages {
297
297
  }
298
298
  if (_response.error.reason === "status-code") {
299
299
  switch (_response.error.statusCode) {
300
- case 404:
301
- throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
300
+ case 400:
301
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
302
302
  unrecognizedObjectKeys: "passthrough",
303
303
  allowUnrecognizedUnionMembers: true,
304
304
  allowUnrecognizedEnumValues: true,
305
305
  skipValidation: true,
306
306
  breadcrumbsPrefix: ["response"],
307
307
  }));
308
- case 400:
309
- throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
308
+ case 404:
309
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
310
310
  unrecognizedObjectKeys: "passthrough",
311
311
  allowUnrecognizedUnionMembers: true,
312
312
  allowUnrecognizedEnumValues: true,
@@ -349,8 +349,8 @@ class Messages {
349
349
  * @param {AgentMail.inboxes.ReplyToMessageRequest} request
350
350
  * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
351
351
  *
352
- * @throws {@link AgentMail.NotFoundError}
353
352
  * @throws {@link AgentMail.ValidationError}
353
+ * @throws {@link AgentMail.NotFoundError}
354
354
  * @throws {@link AgentMail.inboxes.MessageRejectedError}
355
355
  *
356
356
  * @example
@@ -369,7 +369,7 @@ class Messages {
369
369
  const _response = yield core.fetcher({
370
370
  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.inboxes.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.inboxes.MessageId.jsonOrThrow(messageId))}/reply`),
371
371
  method: "POST",
372
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
372
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
373
373
  contentType: "application/json",
374
374
  requestType: "json",
375
375
  body: serializers.inboxes.ReplyToMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -388,6 +388,14 @@ class Messages {
388
388
  }
389
389
  if (_response.error.reason === "status-code") {
390
390
  switch (_response.error.statusCode) {
391
+ case 400:
392
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
393
+ unrecognizedObjectKeys: "passthrough",
394
+ allowUnrecognizedUnionMembers: true,
395
+ allowUnrecognizedEnumValues: true,
396
+ skipValidation: true,
397
+ breadcrumbsPrefix: ["response"],
398
+ }));
391
399
  case 404:
392
400
  throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
393
401
  unrecognizedObjectKeys: "passthrough",
@@ -396,6 +404,76 @@ class Messages {
396
404
  skipValidation: true,
397
405
  breadcrumbsPrefix: ["response"],
398
406
  }));
407
+ case 403:
408
+ throw new AgentMail.inboxes.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
409
+ unrecognizedObjectKeys: "passthrough",
410
+ allowUnrecognizedUnionMembers: true,
411
+ allowUnrecognizedEnumValues: true,
412
+ skipValidation: true,
413
+ breadcrumbsPrefix: ["response"],
414
+ }));
415
+ default:
416
+ throw new errors.AgentMailError({
417
+ statusCode: _response.error.statusCode,
418
+ body: _response.error.body,
419
+ });
420
+ }
421
+ }
422
+ switch (_response.error.reason) {
423
+ case "non-json":
424
+ throw new errors.AgentMailError({
425
+ statusCode: _response.error.statusCode,
426
+ body: _response.error.rawBody,
427
+ });
428
+ case "timeout":
429
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling POST /v0/inboxes/{inbox_id}/messages/{message_id}/reply.");
430
+ case "unknown":
431
+ throw new errors.AgentMailError({
432
+ message: _response.error.errorMessage,
433
+ });
434
+ }
435
+ });
436
+ }
437
+ /**
438
+ * @param {AgentMail.inboxes.InboxId} inboxId
439
+ * @param {AgentMail.inboxes.MessageId} messageId
440
+ * @param {AgentMail.inboxes.UpdateMessageRequest} request
441
+ * @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
442
+ *
443
+ * @throws {@link AgentMail.ValidationError}
444
+ * @throws {@link AgentMail.NotFoundError}
445
+ *
446
+ * @example
447
+ * await client.inboxes.messages.update("inbox_id", "message_id", {
448
+ * addLabels: undefined,
449
+ * removeLabels: undefined
450
+ * })
451
+ */
452
+ update(inboxId, messageId, request, requestOptions) {
453
+ return __awaiter(this, void 0, void 0, function* () {
454
+ var _a, _b;
455
+ const _response = yield core.fetcher({
456
+ 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.inboxes.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.inboxes.MessageId.jsonOrThrow(messageId))}`),
457
+ method: "PATCH",
458
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
459
+ contentType: "application/json",
460
+ requestType: "json",
461
+ body: serializers.inboxes.UpdateMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
462
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
463
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
464
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
465
+ });
466
+ if (_response.ok) {
467
+ return serializers.inboxes.Message.parseOrThrow(_response.body, {
468
+ unrecognizedObjectKeys: "passthrough",
469
+ allowUnrecognizedUnionMembers: true,
470
+ allowUnrecognizedEnumValues: true,
471
+ skipValidation: true,
472
+ breadcrumbsPrefix: ["response"],
473
+ });
474
+ }
475
+ if (_response.error.reason === "status-code") {
476
+ switch (_response.error.statusCode) {
399
477
  case 400:
400
478
  throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
401
479
  unrecognizedObjectKeys: "passthrough",
@@ -404,8 +482,8 @@ class Messages {
404
482
  skipValidation: true,
405
483
  breadcrumbsPrefix: ["response"],
406
484
  }));
407
- case 403:
408
- throw new AgentMail.inboxes.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
485
+ case 404:
486
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
409
487
  unrecognizedObjectKeys: "passthrough",
410
488
  allowUnrecognizedUnionMembers: true,
411
489
  allowUnrecognizedEnumValues: true,
@@ -426,7 +504,7 @@ class Messages {
426
504
  body: _response.error.rawBody,
427
505
  });
428
506
  case "timeout":
429
- throw new errors.AgentMailTimeoutError("Timeout exceeded when calling POST /v0/inboxes/{inbox_id}/messages/{message_id}/reply.");
507
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling PATCH /v0/inboxes/{inbox_id}/messages/{message_id}.");
430
508
  case "unknown":
431
509
  throw new errors.AgentMailError({
432
510
  message: _response.error.errorMessage,
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface UpdateMessageRequest {
5
+ /** Labels to add to message. */
6
+ addLabels?: string[];
7
+ /** Labels to remove from message. */
8
+ removeLabels?: string[];
9
+ }
@@ -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 });
@@ -32,3 +32,4 @@ export * from "./SendMessageAttachments";
32
32
  export * from "./SendMessageRequest";
33
33
  export * from "./SendMessageResponse";
34
34
  export * from "./ReplyToMessageRequest";
35
+ export * from "./UpdateMessageRequest";
@@ -48,3 +48,4 @@ __exportStar(require("./SendMessageAttachments"), exports);
48
48
  __exportStar(require("./SendMessageRequest"), exports);
49
49
  __exportStar(require("./SendMessageResponse"), exports);
50
50
  __exportStar(require("./ReplyToMessageRequest"), exports);
51
+ __exportStar(require("./UpdateMessageRequest"), exports);
@@ -87,7 +87,7 @@ class Threads {
87
87
  const _response = yield core.fetcher({
88
88
  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.inboxes.InboxId.jsonOrThrow(inboxId))}/threads`),
89
89
  method: "GET",
90
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
91
  contentType: "application/json",
92
92
  queryParameters: _queryParams,
93
93
  requestType: "json",
@@ -152,7 +152,7 @@ class Threads {
152
152
  const _response = yield core.fetcher({
153
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.inboxes.InboxId.jsonOrThrow(inboxId))}/threads/${encodeURIComponent(serializers.inboxes.ThreadId.jsonOrThrow(threadId))}`),
154
154
  method: "GET",
155
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "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.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
156
  contentType: "application/json",
157
157
  requestType: "json",
158
158
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -86,7 +86,7 @@ class Threads {
86
86
  const _response = yield core.fetcher({
87
87
  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/threads"),
88
88
  method: "GET",
89
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
89
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
90
  contentType: "application/json",
91
91
  queryParameters: _queryParams,
92
92
  requestType: "json",
@@ -150,7 +150,7 @@ class Threads {
150
150
  const _response = yield core.fetcher({
151
151
  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/threads/${encodeURIComponent(serializers.inboxes.ThreadId.jsonOrThrow(threadId))}`),
152
152
  method: "GET",
153
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
153
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
154
154
  contentType: "application/json",
155
155
  requestType: "json",
156
156
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -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.27", "User-Agent": "agentmail/0.0.27", "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.28", "User-Agent": "agentmail/0.0.28", "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",
@@ -133,7 +133,7 @@ class Webhooks {
133
133
  const _response = yield core.fetcher({
134
134
  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))}`),
135
135
  method: "GET",
136
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
136
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
137
137
  contentType: "application/json",
138
138
  requestType: "json",
139
139
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -200,7 +200,7 @@ class Webhooks {
200
200
  const _response = yield core.fetcher({
201
201
  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"),
202
202
  method: "POST",
203
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
203
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
204
204
  contentType: "application/json",
205
205
  requestType: "json",
206
206
  body: serializers.CreateWebhookRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -264,7 +264,7 @@ class Webhooks {
264
264
  const _response = yield core.fetcher({
265
265
  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))}`),
266
266
  method: "DELETE",
267
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.27", "User-Agent": "agentmail/0.0.27", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
267
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.28", "User-Agent": "agentmail/0.0.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
268
268
  contentType: "application/json",
269
269
  requestType: "json",
270
270
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../../../index";
5
+ import * as AgentMail from "../../../../../../api/index";
6
+ import * as core from "../../../../../../core";
7
+ export declare const UpdateMessageRequest: core.serialization.ObjectSchema<serializers.inboxes.UpdateMessageRequest.Raw, AgentMail.inboxes.UpdateMessageRequest>;
8
+ export declare namespace UpdateMessageRequest {
9
+ interface Raw {
10
+ add_labels?: string[] | null;
11
+ remove_labels?: string[] | null;
12
+ }
13
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.UpdateMessageRequest = void 0;
40
+ const core = __importStar(require("../../../../../../core"));
41
+ exports.UpdateMessageRequest = core.serialization.object({
42
+ addLabels: core.serialization.property("add_labels", core.serialization.list(core.serialization.string()).optional()),
43
+ removeLabels: core.serialization.property("remove_labels", core.serialization.list(core.serialization.string()).optional()),
44
+ });
@@ -32,3 +32,4 @@ export * from "./SendMessageAttachments";
32
32
  export * from "./SendMessageRequest";
33
33
  export * from "./SendMessageResponse";
34
34
  export * from "./ReplyToMessageRequest";
35
+ export * from "./UpdateMessageRequest";
@@ -48,3 +48,4 @@ __exportStar(require("./SendMessageAttachments"), exports);
48
48
  __exportStar(require("./SendMessageRequest"), exports);
49
49
  __exportStar(require("./SendMessageResponse"), exports);
50
50
  __exportStar(require("./ReplyToMessageRequest"), exports);
51
+ __exportStar(require("./UpdateMessageRequest"), exports);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.27";
1
+ export declare const SDK_VERSION = "0.0.28";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.27";
4
+ exports.SDK_VERSION = "0.0.28";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentmail",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "private": false,
5
5
  "repository": "https://github.com/agentmail-to/agentmail-node",
6
6
  "main": "./index.js",
package/reference.md CHANGED
@@ -675,6 +675,73 @@ await client.inboxes.messages.reply("inbox_id", "message_id", {
675
675
  </dl>
676
676
  </details>
677
677
 
678
+ <details><summary><code>client.inboxes.messages.<a href="/src/api/resources/inboxes/resources/messages/client/Client.ts">update</a>(inboxId, messageId, { ...params }) -> AgentMail.Message</code></summary>
679
+ <dl>
680
+ <dd>
681
+
682
+ #### 🔌 Usage
683
+
684
+ <dl>
685
+ <dd>
686
+
687
+ <dl>
688
+ <dd>
689
+
690
+ ```typescript
691
+ await client.inboxes.messages.update("inbox_id", "message_id", {
692
+ addLabels: undefined,
693
+ removeLabels: undefined,
694
+ });
695
+ ```
696
+
697
+ </dd>
698
+ </dl>
699
+ </dd>
700
+ </dl>
701
+
702
+ #### ⚙️ Parameters
703
+
704
+ <dl>
705
+ <dd>
706
+
707
+ <dl>
708
+ <dd>
709
+
710
+ **inboxId:** `AgentMail.InboxId`
711
+
712
+ </dd>
713
+ </dl>
714
+
715
+ <dl>
716
+ <dd>
717
+
718
+ **messageId:** `AgentMail.MessageId`
719
+
720
+ </dd>
721
+ </dl>
722
+
723
+ <dl>
724
+ <dd>
725
+
726
+ **request:** `AgentMail.UpdateMessageRequest`
727
+
728
+ </dd>
729
+ </dl>
730
+
731
+ <dl>
732
+ <dd>
733
+
734
+ **requestOptions:** `Messages.RequestOptions`
735
+
736
+ </dd>
737
+ </dl>
738
+ </dd>
739
+ </dl>
740
+
741
+ </dd>
742
+ </dl>
743
+ </details>
744
+
678
745
  ## Inboxes Threads
679
746
 
680
747
  <details><summary><code>client.inboxes.threads.<a href="/src/api/resources/inboxes/resources/threads/client/Client.ts">list</a>(inboxId, { ...params }) -> AgentMail.ListThreadsResponse</code></summary>
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../../../index";
5
+ import * as AgentMail from "../../../../../../api/index";
6
+ import * as core from "../../../../../../core";
7
+ export declare const UpdateMessageRequest: core.serialization.ObjectSchema<serializers.inboxes.UpdateMessageRequest.Raw, AgentMail.inboxes.UpdateMessageRequest>;
8
+ export declare namespace UpdateMessageRequest {
9
+ interface Raw {
10
+ add_labels?: string[] | null;
11
+ remove_labels?: string[] | null;
12
+ }
13
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.UpdateMessageRequest = void 0;
40
+ const core = __importStar(require("../../../../../../core"));
41
+ exports.UpdateMessageRequest = core.serialization.object({
42
+ addLabels: core.serialization.property("add_labels", core.serialization.list(core.serialization.string()).optional()),
43
+ removeLabels: core.serialization.property("remove_labels", core.serialization.list(core.serialization.string()).optional()),
44
+ });
@@ -32,3 +32,4 @@ export * from "./SendMessageAttachments";
32
32
  export * from "./SendMessageRequest";
33
33
  export * from "./SendMessageResponse";
34
34
  export * from "./ReplyToMessageRequest";
35
+ export * from "./UpdateMessageRequest";
@@ -48,3 +48,4 @@ __exportStar(require("./SendMessageAttachments"), exports);
48
48
  __exportStar(require("./SendMessageRequest"), exports);
49
49
  __exportStar(require("./SendMessageResponse"), exports);
50
50
  __exportStar(require("./ReplyToMessageRequest"), exports);
51
+ __exportStar(require("./UpdateMessageRequest"), exports);
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.27";
1
+ export declare const SDK_VERSION = "0.0.28";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.27";
4
+ exports.SDK_VERSION = "0.0.28";