agentmail 0.0.29 → 0.0.30

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 (60) hide show
  1. package/api/resources/drafts/client/Client.js +6 -3
  2. package/api/resources/drafts/client/requests/DraftsListDraftsRequest.d.ts +1 -0
  3. package/api/resources/inboxes/client/Client.js +3 -3
  4. package/api/resources/inboxes/resources/drafts/client/Client.d.ts +4 -3
  5. package/api/resources/inboxes/resources/drafts/client/Client.js +12 -8
  6. package/api/resources/inboxes/resources/drafts/client/requests/ListDraftsRequest.d.ts +1 -0
  7. package/api/resources/inboxes/resources/drafts/types/index.d.ts +0 -1
  8. package/api/resources/inboxes/resources/drafts/types/index.js +0 -1
  9. package/api/resources/inboxes/resources/messages/client/Client.js +10 -7
  10. package/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -0
  11. package/api/resources/inboxes/resources/threads/client/Client.js +6 -3
  12. package/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
  13. package/api/resources/threads/client/Client.js +6 -3
  14. package/api/resources/threads/client/requests/ThreadsListThreadsRequest.d.ts +1 -0
  15. package/api/resources/webhooks/client/Client.js +4 -4
  16. package/api/types/Ascending.d.ts +7 -0
  17. package/api/types/index.d.ts +1 -0
  18. package/api/types/index.js +1 -0
  19. package/dist/api/resources/drafts/client/Client.js +6 -3
  20. package/dist/api/resources/drafts/client/requests/DraftsListDraftsRequest.d.ts +1 -0
  21. package/dist/api/resources/inboxes/client/Client.js +3 -3
  22. package/dist/api/resources/inboxes/resources/drafts/client/Client.d.ts +4 -3
  23. package/dist/api/resources/inboxes/resources/drafts/client/Client.js +12 -8
  24. package/dist/api/resources/inboxes/resources/drafts/client/requests/ListDraftsRequest.d.ts +1 -0
  25. package/dist/api/resources/inboxes/resources/drafts/types/index.d.ts +0 -1
  26. package/dist/api/resources/inboxes/resources/drafts/types/index.js +0 -1
  27. package/dist/api/resources/inboxes/resources/messages/client/Client.js +10 -7
  28. package/dist/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -0
  29. package/dist/api/resources/inboxes/resources/threads/client/Client.js +6 -3
  30. package/dist/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
  31. package/dist/api/resources/threads/client/Client.js +6 -3
  32. package/dist/api/resources/threads/client/requests/ThreadsListThreadsRequest.d.ts +1 -0
  33. package/dist/api/resources/webhooks/client/Client.js +4 -4
  34. package/dist/api/types/Ascending.d.ts +7 -0
  35. package/dist/api/types/index.d.ts +1 -0
  36. package/dist/api/types/index.js +1 -0
  37. package/dist/serialization/resources/inboxes/resources/drafts/types/index.d.ts +0 -1
  38. package/dist/serialization/resources/inboxes/resources/drafts/types/index.js +0 -1
  39. package/dist/serialization/types/Ascending.d.ts +10 -0
  40. package/dist/serialization/{resources/inboxes/resources/drafts/types/SendDraftRequest.js → types/Ascending.js} +3 -6
  41. package/dist/serialization/types/index.d.ts +1 -0
  42. package/dist/serialization/types/index.js +1 -0
  43. package/dist/version.d.ts +1 -1
  44. package/dist/version.js +1 -1
  45. package/package.json +1 -1
  46. package/reference.md +3 -2
  47. package/serialization/resources/inboxes/resources/drafts/types/index.d.ts +0 -1
  48. package/serialization/resources/inboxes/resources/drafts/types/index.js +0 -1
  49. package/serialization/types/Ascending.d.ts +10 -0
  50. package/serialization/{resources/inboxes/resources/drafts/types/SendDraftRequest.js → types/Ascending.js} +3 -6
  51. package/serialization/types/index.d.ts +1 -0
  52. package/serialization/types/index.js +1 -0
  53. package/version.d.ts +1 -1
  54. package/version.js +1 -1
  55. package/api/resources/inboxes/resources/drafts/types/SendDraftRequest.d.ts +0 -7
  56. package/dist/api/resources/inboxes/resources/drafts/types/SendDraftRequest.d.ts +0 -7
  57. package/dist/serialization/resources/inboxes/resources/drafts/types/SendDraftRequest.d.ts +0 -13
  58. package/serialization/resources/inboxes/resources/drafts/types/SendDraftRequest.d.ts +0 -13
  59. /package/api/{resources/inboxes/resources/drafts/types/SendDraftRequest.js → types/Ascending.js} +0 -0
  60. /package/dist/api/{resources/inboxes/resources/drafts/types/SendDraftRequest.js → types/Ascending.js} +0 -0
@@ -72,7 +72,7 @@ class Drafts {
72
72
  list() {
73
73
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
74
74
  var _a, _b;
75
- const { limit, lastKey, labels } = request;
75
+ const { limit, lastKey, labels, ascending } = request;
76
76
  const _queryParams = {};
77
77
  if (limit != null) {
78
78
  _queryParams["limit"] = limit.toString();
@@ -83,10 +83,13 @@ class Drafts {
83
83
  if (labels != null) {
84
84
  _queryParams["labels"] = (0, json_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip" }));
85
85
  }
86
+ if (ascending != null) {
87
+ _queryParams["ascending"] = ascending.toString();
88
+ }
86
89
  const _response = yield core.fetcher({
87
90
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, "/v0/drafts"),
88
91
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
93
  contentType: "application/json",
91
94
  queryParameters: _queryParams,
92
95
  requestType: "json",
@@ -150,7 +153,7 @@ class Drafts {
150
153
  const _response = yield core.fetcher({
151
154
  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
155
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
154
157
  contentType: "application/json",
155
158
  requestType: "json",
156
159
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -10,4 +10,5 @@ export interface DraftsListDraftsRequest {
10
10
  limit?: AgentMail.Limit;
11
11
  lastKey?: AgentMail.LastKey;
12
12
  labels?: AgentMail.Labels;
13
+ ascending?: AgentMail.Ascending;
13
14
  }
@@ -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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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" }),
@@ -69,7 +69,7 @@ export declare class Drafts {
69
69
  /**
70
70
  * @param {AgentMail.inboxes.InboxId} inboxId
71
71
  * @param {AgentMail.inboxes.DraftId} draftId
72
- * @param {AgentMail.inboxes.SendDraftRequest} request
72
+ * @param {AgentMail.inboxes.UpdateMessageRequest} request
73
73
  * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration.
74
74
  *
75
75
  * @throws {@link AgentMail.NotFoundError}
@@ -78,9 +78,10 @@ export declare class Drafts {
78
78
  *
79
79
  * @example
80
80
  * await client.inboxes.drafts.send("inbox_id", "draft_id", {
81
- * labels: undefined
81
+ * addLabels: undefined,
82
+ * removeLabels: undefined
82
83
  * })
83
84
  */
84
- send(inboxId: AgentMail.inboxes.InboxId, draftId: AgentMail.inboxes.DraftId, request: AgentMail.inboxes.SendDraftRequest, requestOptions?: Drafts.RequestOptions): Promise<AgentMail.inboxes.SendMessageResponse>;
85
+ send(inboxId: AgentMail.inboxes.InboxId, draftId: AgentMail.inboxes.DraftId, request: AgentMail.inboxes.UpdateMessageRequest, requestOptions?: Drafts.RequestOptions): Promise<AgentMail.inboxes.SendMessageResponse>;
85
86
  protected _getAuthorizationHeader(): Promise<string>;
86
87
  }
@@ -73,7 +73,7 @@ class Drafts {
73
73
  list(inboxId_1) {
74
74
  return __awaiter(this, arguments, void 0, function* (inboxId, request = {}, requestOptions) {
75
75
  var _a, _b;
76
- const { limit, lastKey, labels } = request;
76
+ const { limit, lastKey, labels, ascending } = request;
77
77
  const _queryParams = {};
78
78
  if (limit != null) {
79
79
  _queryParams["limit"] = limit.toString();
@@ -84,10 +84,13 @@ class Drafts {
84
84
  if (labels != null) {
85
85
  _queryParams["labels"] = (0, json_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip" }));
86
86
  }
87
+ if (ascending != null) {
88
+ _queryParams["ascending"] = ascending.toString();
89
+ }
87
90
  const _response = yield core.fetcher({
88
91
  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
92
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
93
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
94
  contentType: "application/json",
92
95
  queryParameters: _queryParams,
93
96
  requestType: "json",
@@ -152,7 +155,7 @@ class Drafts {
152
155
  const _response = yield core.fetcher({
153
156
  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
157
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
159
  contentType: "application/json",
157
160
  requestType: "json",
158
161
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -224,7 +227,7 @@ class Drafts {
224
227
  const _response = yield core.fetcher({
225
228
  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
229
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
230
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
228
231
  contentType: "application/json",
229
232
  requestType: "json",
230
233
  body: serializers.inboxes.CreateDraftRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -276,7 +279,7 @@ class Drafts {
276
279
  /**
277
280
  * @param {AgentMail.inboxes.InboxId} inboxId
278
281
  * @param {AgentMail.inboxes.DraftId} draftId
279
- * @param {AgentMail.inboxes.SendDraftRequest} request
282
+ * @param {AgentMail.inboxes.UpdateMessageRequest} request
280
283
  * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration.
281
284
  *
282
285
  * @throws {@link AgentMail.NotFoundError}
@@ -285,7 +288,8 @@ class Drafts {
285
288
  *
286
289
  * @example
287
290
  * await client.inboxes.drafts.send("inbox_id", "draft_id", {
288
- * labels: undefined
291
+ * addLabels: undefined,
292
+ * removeLabels: undefined
289
293
  * })
290
294
  */
291
295
  send(inboxId, draftId, request, requestOptions) {
@@ -294,10 +298,10 @@ class Drafts {
294
298
  const _response = yield core.fetcher({
295
299
  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))}/send`),
296
300
  method: "POST",
297
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
301
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
298
302
  contentType: "application/json",
299
303
  requestType: "json",
300
- body: serializers.inboxes.SendDraftRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
304
+ body: serializers.inboxes.UpdateMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
301
305
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
302
306
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
303
307
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -10,4 +10,5 @@ export interface ListDraftsRequest {
10
10
  limit?: AgentMail.Limit;
11
11
  lastKey?: AgentMail.LastKey;
12
12
  labels?: AgentMail.Labels;
13
+ ascending?: AgentMail.Ascending;
13
14
  }
@@ -17,4 +17,3 @@ export * from "./DraftItem";
17
17
  export * from "./Draft";
18
18
  export * from "./ListDraftsResponse";
19
19
  export * from "./CreateDraftRequest";
20
- export * from "./SendDraftRequest";
@@ -33,4 +33,3 @@ __exportStar(require("./DraftItem"), exports);
33
33
  __exportStar(require("./Draft"), exports);
34
34
  __exportStar(require("./ListDraftsResponse"), exports);
35
35
  __exportStar(require("./CreateDraftRequest"), exports);
36
- __exportStar(require("./SendDraftRequest"), exports);
@@ -73,7 +73,7 @@ class Messages {
73
73
  list(inboxId_1) {
74
74
  return __awaiter(this, arguments, void 0, function* (inboxId, request = {}, requestOptions) {
75
75
  var _a, _b;
76
- const { limit, lastKey, labels } = request;
76
+ const { limit, lastKey, labels, ascending } = request;
77
77
  const _queryParams = {};
78
78
  if (limit != null) {
79
79
  _queryParams["limit"] = limit.toString();
@@ -84,10 +84,13 @@ class Messages {
84
84
  if (labels != null) {
85
85
  _queryParams["labels"] = (0, json_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip" }));
86
86
  }
87
+ if (ascending != null) {
88
+ _queryParams["ascending"] = ascending.toString();
89
+ }
87
90
  const _response = yield core.fetcher({
88
91
  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
92
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
93
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
94
  contentType: "application/json",
92
95
  queryParameters: _queryParams,
93
96
  requestType: "json",
@@ -152,7 +155,7 @@ class Messages {
152
155
  const _response = yield core.fetcher({
153
156
  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
157
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
159
  contentType: "application/json",
157
160
  requestType: "json",
158
161
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -209,7 +212,7 @@ class Messages {
209
212
  const _response = yield core.fetcher({
210
213
  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
214
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
215
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
213
216
  contentType: "application/json",
214
217
  requestType: "json",
215
218
  responseType: "streaming",
@@ -279,7 +282,7 @@ class Messages {
279
282
  const _response = yield core.fetcher({
280
283
  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`),
281
284
  method: "POST",
282
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
285
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
283
286
  contentType: "application/json",
284
287
  requestType: "json",
285
288
  body: serializers.inboxes.SendMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -370,7 +373,7 @@ class Messages {
370
373
  const _response = yield core.fetcher({
371
374
  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`),
372
375
  method: "POST",
373
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
376
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
374
377
  contentType: "application/json",
375
378
  requestType: "json",
376
379
  body: serializers.inboxes.ReplyToMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -456,7 +459,7 @@ class Messages {
456
459
  const _response = yield core.fetcher({
457
460
  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))}`),
458
461
  method: "PATCH",
459
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
462
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
460
463
  contentType: "application/json",
461
464
  requestType: "json",
462
465
  body: serializers.inboxes.UpdateMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -10,4 +10,5 @@ export interface ListMessagesRequest {
10
10
  limit?: AgentMail.Limit;
11
11
  lastKey?: AgentMail.LastKey;
12
12
  labels?: AgentMail.Labels;
13
+ ascending?: AgentMail.Ascending;
13
14
  }
@@ -73,7 +73,7 @@ class Threads {
73
73
  list(inboxId_1) {
74
74
  return __awaiter(this, arguments, void 0, function* (inboxId, request = {}, requestOptions) {
75
75
  var _a, _b;
76
- const { limit, lastKey, labels } = request;
76
+ const { limit, lastKey, labels, ascending } = request;
77
77
  const _queryParams = {};
78
78
  if (limit != null) {
79
79
  _queryParams["limit"] = limit.toString();
@@ -84,10 +84,13 @@ class Threads {
84
84
  if (labels != null) {
85
85
  _queryParams["labels"] = (0, json_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip" }));
86
86
  }
87
+ if (ascending != null) {
88
+ _queryParams["ascending"] = ascending.toString();
89
+ }
87
90
  const _response = yield core.fetcher({
88
91
  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
92
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
93
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
94
  contentType: "application/json",
92
95
  queryParameters: _queryParams,
93
96
  requestType: "json",
@@ -152,7 +155,7 @@ class Threads {
152
155
  const _response = yield core.fetcher({
153
156
  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
157
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
159
  contentType: "application/json",
157
160
  requestType: "json",
158
161
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -10,4 +10,5 @@ export interface ListThreadsRequest {
10
10
  limit?: AgentMail.Limit;
11
11
  lastKey?: AgentMail.LastKey;
12
12
  labels?: AgentMail.Labels;
13
+ ascending?: AgentMail.Ascending;
13
14
  }
@@ -72,7 +72,7 @@ class Threads {
72
72
  list() {
73
73
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
74
74
  var _a, _b;
75
- const { limit, lastKey, labels } = request;
75
+ const { limit, lastKey, labels, ascending } = request;
76
76
  const _queryParams = {};
77
77
  if (limit != null) {
78
78
  _queryParams["limit"] = limit.toString();
@@ -83,10 +83,13 @@ class Threads {
83
83
  if (labels != null) {
84
84
  _queryParams["labels"] = (0, json_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip" }));
85
85
  }
86
+ if (ascending != null) {
87
+ _queryParams["ascending"] = ascending.toString();
88
+ }
86
89
  const _response = yield core.fetcher({
87
90
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, "/v0/threads"),
88
91
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
93
  contentType: "application/json",
91
94
  queryParameters: _queryParams,
92
95
  requestType: "json",
@@ -150,7 +153,7 @@ class Threads {
150
153
  const _response = yield core.fetcher({
151
154
  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
155
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
154
157
  contentType: "application/json",
155
158
  requestType: "json",
156
159
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -10,4 +10,5 @@ export interface ThreadsListThreadsRequest {
10
10
  limit?: AgentMail.Limit;
11
11
  lastKey?: AgentMail.LastKey;
12
12
  labels?: AgentMail.Labels;
13
+ ascending?: AgentMail.Ascending;
13
14
  }
@@ -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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Whether to sort in ascending temporal order.
6
+ */
7
+ export type Ascending = boolean;
@@ -2,6 +2,7 @@ export * from "./Limit";
2
2
  export * from "./Count";
3
3
  export * from "./LastKey";
4
4
  export * from "./Labels";
5
+ export * from "./Ascending";
5
6
  export * from "./OrganizationId";
6
7
  export * from "./ErrorName";
7
8
  export * from "./ErrorResponse";
@@ -18,6 +18,7 @@ __exportStar(require("./Limit"), exports);
18
18
  __exportStar(require("./Count"), exports);
19
19
  __exportStar(require("./LastKey"), exports);
20
20
  __exportStar(require("./Labels"), exports);
21
+ __exportStar(require("./Ascending"), exports);
21
22
  __exportStar(require("./OrganizationId"), exports);
22
23
  __exportStar(require("./ErrorName"), exports);
23
24
  __exportStar(require("./ErrorResponse"), exports);
@@ -72,7 +72,7 @@ class Drafts {
72
72
  list() {
73
73
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
74
74
  var _a, _b;
75
- const { limit, lastKey, labels } = request;
75
+ const { limit, lastKey, labels, ascending } = request;
76
76
  const _queryParams = {};
77
77
  if (limit != null) {
78
78
  _queryParams["limit"] = limit.toString();
@@ -83,10 +83,13 @@ class Drafts {
83
83
  if (labels != null) {
84
84
  _queryParams["labels"] = (0, json_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip" }));
85
85
  }
86
+ if (ascending != null) {
87
+ _queryParams["ascending"] = ascending.toString();
88
+ }
86
89
  const _response = yield core.fetcher({
87
90
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, "/v0/drafts"),
88
91
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
93
  contentType: "application/json",
91
94
  queryParameters: _queryParams,
92
95
  requestType: "json",
@@ -150,7 +153,7 @@ class Drafts {
150
153
  const _response = yield core.fetcher({
151
154
  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
155
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
154
157
  contentType: "application/json",
155
158
  requestType: "json",
156
159
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -10,4 +10,5 @@ export interface DraftsListDraftsRequest {
10
10
  limit?: AgentMail.Limit;
11
11
  lastKey?: AgentMail.LastKey;
12
12
  labels?: AgentMail.Labels;
13
+ ascending?: AgentMail.Ascending;
13
14
  }
@@ -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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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" }),
@@ -69,7 +69,7 @@ export declare class Drafts {
69
69
  /**
70
70
  * @param {AgentMail.inboxes.InboxId} inboxId
71
71
  * @param {AgentMail.inboxes.DraftId} draftId
72
- * @param {AgentMail.inboxes.SendDraftRequest} request
72
+ * @param {AgentMail.inboxes.UpdateMessageRequest} request
73
73
  * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration.
74
74
  *
75
75
  * @throws {@link AgentMail.NotFoundError}
@@ -78,9 +78,10 @@ export declare class Drafts {
78
78
  *
79
79
  * @example
80
80
  * await client.inboxes.drafts.send("inbox_id", "draft_id", {
81
- * labels: undefined
81
+ * addLabels: undefined,
82
+ * removeLabels: undefined
82
83
  * })
83
84
  */
84
- send(inboxId: AgentMail.inboxes.InboxId, draftId: AgentMail.inboxes.DraftId, request: AgentMail.inboxes.SendDraftRequest, requestOptions?: Drafts.RequestOptions): Promise<AgentMail.inboxes.SendMessageResponse>;
85
+ send(inboxId: AgentMail.inboxes.InboxId, draftId: AgentMail.inboxes.DraftId, request: AgentMail.inboxes.UpdateMessageRequest, requestOptions?: Drafts.RequestOptions): Promise<AgentMail.inboxes.SendMessageResponse>;
85
86
  protected _getAuthorizationHeader(): Promise<string>;
86
87
  }
@@ -73,7 +73,7 @@ class Drafts {
73
73
  list(inboxId_1) {
74
74
  return __awaiter(this, arguments, void 0, function* (inboxId, request = {}, requestOptions) {
75
75
  var _a, _b;
76
- const { limit, lastKey, labels } = request;
76
+ const { limit, lastKey, labels, ascending } = request;
77
77
  const _queryParams = {};
78
78
  if (limit != null) {
79
79
  _queryParams["limit"] = limit.toString();
@@ -84,10 +84,13 @@ class Drafts {
84
84
  if (labels != null) {
85
85
  _queryParams["labels"] = (0, json_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip" }));
86
86
  }
87
+ if (ascending != null) {
88
+ _queryParams["ascending"] = ascending.toString();
89
+ }
87
90
  const _response = yield core.fetcher({
88
91
  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
92
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
93
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
94
  contentType: "application/json",
92
95
  queryParameters: _queryParams,
93
96
  requestType: "json",
@@ -152,7 +155,7 @@ class Drafts {
152
155
  const _response = yield core.fetcher({
153
156
  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
157
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
159
  contentType: "application/json",
157
160
  requestType: "json",
158
161
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -224,7 +227,7 @@ class Drafts {
224
227
  const _response = yield core.fetcher({
225
228
  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
229
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
230
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
228
231
  contentType: "application/json",
229
232
  requestType: "json",
230
233
  body: serializers.inboxes.CreateDraftRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -276,7 +279,7 @@ class Drafts {
276
279
  /**
277
280
  * @param {AgentMail.inboxes.InboxId} inboxId
278
281
  * @param {AgentMail.inboxes.DraftId} draftId
279
- * @param {AgentMail.inboxes.SendDraftRequest} request
282
+ * @param {AgentMail.inboxes.UpdateMessageRequest} request
280
283
  * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration.
281
284
  *
282
285
  * @throws {@link AgentMail.NotFoundError}
@@ -285,7 +288,8 @@ class Drafts {
285
288
  *
286
289
  * @example
287
290
  * await client.inboxes.drafts.send("inbox_id", "draft_id", {
288
- * labels: undefined
291
+ * addLabels: undefined,
292
+ * removeLabels: undefined
289
293
  * })
290
294
  */
291
295
  send(inboxId, draftId, request, requestOptions) {
@@ -294,10 +298,10 @@ class Drafts {
294
298
  const _response = yield core.fetcher({
295
299
  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))}/send`),
296
300
  method: "POST",
297
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
301
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
298
302
  contentType: "application/json",
299
303
  requestType: "json",
300
- body: serializers.inboxes.SendDraftRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
304
+ body: serializers.inboxes.UpdateMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
301
305
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
302
306
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
303
307
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -10,4 +10,5 @@ export interface ListDraftsRequest {
10
10
  limit?: AgentMail.Limit;
11
11
  lastKey?: AgentMail.LastKey;
12
12
  labels?: AgentMail.Labels;
13
+ ascending?: AgentMail.Ascending;
13
14
  }
@@ -17,4 +17,3 @@ export * from "./DraftItem";
17
17
  export * from "./Draft";
18
18
  export * from "./ListDraftsResponse";
19
19
  export * from "./CreateDraftRequest";
20
- export * from "./SendDraftRequest";
@@ -33,4 +33,3 @@ __exportStar(require("./DraftItem"), exports);
33
33
  __exportStar(require("./Draft"), exports);
34
34
  __exportStar(require("./ListDraftsResponse"), exports);
35
35
  __exportStar(require("./CreateDraftRequest"), exports);
36
- __exportStar(require("./SendDraftRequest"), exports);
@@ -73,7 +73,7 @@ class Messages {
73
73
  list(inboxId_1) {
74
74
  return __awaiter(this, arguments, void 0, function* (inboxId, request = {}, requestOptions) {
75
75
  var _a, _b;
76
- const { limit, lastKey, labels } = request;
76
+ const { limit, lastKey, labels, ascending } = request;
77
77
  const _queryParams = {};
78
78
  if (limit != null) {
79
79
  _queryParams["limit"] = limit.toString();
@@ -84,10 +84,13 @@ class Messages {
84
84
  if (labels != null) {
85
85
  _queryParams["labels"] = (0, json_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip" }));
86
86
  }
87
+ if (ascending != null) {
88
+ _queryParams["ascending"] = ascending.toString();
89
+ }
87
90
  const _response = yield core.fetcher({
88
91
  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
92
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
93
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
94
  contentType: "application/json",
92
95
  queryParameters: _queryParams,
93
96
  requestType: "json",
@@ -152,7 +155,7 @@ class Messages {
152
155
  const _response = yield core.fetcher({
153
156
  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
157
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
159
  contentType: "application/json",
157
160
  requestType: "json",
158
161
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -209,7 +212,7 @@ class Messages {
209
212
  const _response = yield core.fetcher({
210
213
  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
214
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
215
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
213
216
  contentType: "application/json",
214
217
  requestType: "json",
215
218
  responseType: "streaming",
@@ -279,7 +282,7 @@ class Messages {
279
282
  const _response = yield core.fetcher({
280
283
  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`),
281
284
  method: "POST",
282
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
285
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
283
286
  contentType: "application/json",
284
287
  requestType: "json",
285
288
  body: serializers.inboxes.SendMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -370,7 +373,7 @@ class Messages {
370
373
  const _response = yield core.fetcher({
371
374
  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`),
372
375
  method: "POST",
373
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
376
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
374
377
  contentType: "application/json",
375
378
  requestType: "json",
376
379
  body: serializers.inboxes.ReplyToMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -456,7 +459,7 @@ class Messages {
456
459
  const _response = yield core.fetcher({
457
460
  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))}`),
458
461
  method: "PATCH",
459
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
462
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
460
463
  contentType: "application/json",
461
464
  requestType: "json",
462
465
  body: serializers.inboxes.UpdateMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -10,4 +10,5 @@ export interface ListMessagesRequest {
10
10
  limit?: AgentMail.Limit;
11
11
  lastKey?: AgentMail.LastKey;
12
12
  labels?: AgentMail.Labels;
13
+ ascending?: AgentMail.Ascending;
13
14
  }
@@ -73,7 +73,7 @@ class Threads {
73
73
  list(inboxId_1) {
74
74
  return __awaiter(this, arguments, void 0, function* (inboxId, request = {}, requestOptions) {
75
75
  var _a, _b;
76
- const { limit, lastKey, labels } = request;
76
+ const { limit, lastKey, labels, ascending } = request;
77
77
  const _queryParams = {};
78
78
  if (limit != null) {
79
79
  _queryParams["limit"] = limit.toString();
@@ -84,10 +84,13 @@ class Threads {
84
84
  if (labels != null) {
85
85
  _queryParams["labels"] = (0, json_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip" }));
86
86
  }
87
+ if (ascending != null) {
88
+ _queryParams["ascending"] = ascending.toString();
89
+ }
87
90
  const _response = yield core.fetcher({
88
91
  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
92
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
93
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
94
  contentType: "application/json",
92
95
  queryParameters: _queryParams,
93
96
  requestType: "json",
@@ -152,7 +155,7 @@ class Threads {
152
155
  const _response = yield core.fetcher({
153
156
  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
157
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
159
  contentType: "application/json",
157
160
  requestType: "json",
158
161
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -10,4 +10,5 @@ export interface ListThreadsRequest {
10
10
  limit?: AgentMail.Limit;
11
11
  lastKey?: AgentMail.LastKey;
12
12
  labels?: AgentMail.Labels;
13
+ ascending?: AgentMail.Ascending;
13
14
  }
@@ -72,7 +72,7 @@ class Threads {
72
72
  list() {
73
73
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
74
74
  var _a, _b;
75
- const { limit, lastKey, labels } = request;
75
+ const { limit, lastKey, labels, ascending } = request;
76
76
  const _queryParams = {};
77
77
  if (limit != null) {
78
78
  _queryParams["limit"] = limit.toString();
@@ -83,10 +83,13 @@ class Threads {
83
83
  if (labels != null) {
84
84
  _queryParams["labels"] = (0, json_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip" }));
85
85
  }
86
+ if (ascending != null) {
87
+ _queryParams["ascending"] = ascending.toString();
88
+ }
86
89
  const _response = yield core.fetcher({
87
90
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, "/v0/threads"),
88
91
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
93
  contentType: "application/json",
91
94
  queryParameters: _queryParams,
92
95
  requestType: "json",
@@ -150,7 +153,7 @@ class Threads {
150
153
  const _response = yield core.fetcher({
151
154
  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
155
  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.29", "User-Agent": "agentmail/0.0.29", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.30", "User-Agent": "agentmail/0.0.30", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
154
157
  contentType: "application/json",
155
158
  requestType: "json",
156
159
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -10,4 +10,5 @@ export interface ThreadsListThreadsRequest {
10
10
  limit?: AgentMail.Limit;
11
11
  lastKey?: AgentMail.LastKey;
12
12
  labels?: AgentMail.Labels;
13
+ ascending?: AgentMail.Ascending;
13
14
  }
@@ -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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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.29", "User-Agent": "agentmail/0.0.29", "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.30", "User-Agent": "agentmail/0.0.30", "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,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Whether to sort in ascending temporal order.
6
+ */
7
+ export type Ascending = boolean;
@@ -2,6 +2,7 @@ export * from "./Limit";
2
2
  export * from "./Count";
3
3
  export * from "./LastKey";
4
4
  export * from "./Labels";
5
+ export * from "./Ascending";
5
6
  export * from "./OrganizationId";
6
7
  export * from "./ErrorName";
7
8
  export * from "./ErrorResponse";
@@ -18,6 +18,7 @@ __exportStar(require("./Limit"), exports);
18
18
  __exportStar(require("./Count"), exports);
19
19
  __exportStar(require("./LastKey"), exports);
20
20
  __exportStar(require("./Labels"), exports);
21
+ __exportStar(require("./Ascending"), exports);
21
22
  __exportStar(require("./OrganizationId"), exports);
22
23
  __exportStar(require("./ErrorName"), exports);
23
24
  __exportStar(require("./ErrorResponse"), exports);
@@ -17,4 +17,3 @@ export * from "./DraftItem";
17
17
  export * from "./Draft";
18
18
  export * from "./ListDraftsResponse";
19
19
  export * from "./CreateDraftRequest";
20
- export * from "./SendDraftRequest";
@@ -33,4 +33,3 @@ __exportStar(require("./DraftItem"), exports);
33
33
  __exportStar(require("./Draft"), exports);
34
34
  __exportStar(require("./ListDraftsResponse"), exports);
35
35
  __exportStar(require("./CreateDraftRequest"), exports);
36
- __exportStar(require("./SendDraftRequest"), exports);
@@ -0,0 +1,10 @@
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 Ascending: core.serialization.Schema<serializers.Ascending.Raw, AgentMail.Ascending>;
8
+ export declare namespace Ascending {
9
+ type Raw = boolean;
10
+ }
@@ -36,9 +36,6 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.SendDraftRequest = void 0;
40
- const core = __importStar(require("../../../../../../core"));
41
- const DraftLabels_1 = require("./DraftLabels");
42
- exports.SendDraftRequest = core.serialization.object({
43
- labels: DraftLabels_1.DraftLabels.optional(),
44
- });
39
+ exports.Ascending = void 0;
40
+ const core = __importStar(require("../../core"));
41
+ exports.Ascending = core.serialization.boolean();
@@ -2,6 +2,7 @@ export * from "./Limit";
2
2
  export * from "./Count";
3
3
  export * from "./LastKey";
4
4
  export * from "./Labels";
5
+ export * from "./Ascending";
5
6
  export * from "./OrganizationId";
6
7
  export * from "./ErrorName";
7
8
  export * from "./ErrorResponse";
@@ -18,6 +18,7 @@ __exportStar(require("./Limit"), exports);
18
18
  __exportStar(require("./Count"), exports);
19
19
  __exportStar(require("./LastKey"), exports);
20
20
  __exportStar(require("./Labels"), exports);
21
+ __exportStar(require("./Ascending"), exports);
21
22
  __exportStar(require("./OrganizationId"), exports);
22
23
  __exportStar(require("./ErrorName"), exports);
23
24
  __exportStar(require("./ErrorResponse"), exports);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.29";
1
+ export declare const SDK_VERSION = "0.0.30";
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.29";
4
+ exports.SDK_VERSION = "0.0.30";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentmail",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "private": false,
5
5
  "repository": "https://github.com/agentmail-to/agentmail-node",
6
6
  "main": "./index.js",
package/reference.md CHANGED
@@ -440,7 +440,8 @@ await client.inboxes.drafts.create("inbox_id", {
440
440
 
441
441
  ```typescript
442
442
  await client.inboxes.drafts.send("inbox_id", "draft_id", {
443
- labels: undefined,
443
+ addLabels: undefined,
444
+ removeLabels: undefined,
444
445
  });
445
446
  ```
446
447
 
@@ -473,7 +474,7 @@ await client.inboxes.drafts.send("inbox_id", "draft_id", {
473
474
  <dl>
474
475
  <dd>
475
476
 
476
- **request:** `AgentMail.SendDraftRequest`
477
+ **request:** `AgentMail.UpdateMessageRequest`
477
478
 
478
479
  </dd>
479
480
  </dl>
@@ -17,4 +17,3 @@ export * from "./DraftItem";
17
17
  export * from "./Draft";
18
18
  export * from "./ListDraftsResponse";
19
19
  export * from "./CreateDraftRequest";
20
- export * from "./SendDraftRequest";
@@ -33,4 +33,3 @@ __exportStar(require("./DraftItem"), exports);
33
33
  __exportStar(require("./Draft"), exports);
34
34
  __exportStar(require("./ListDraftsResponse"), exports);
35
35
  __exportStar(require("./CreateDraftRequest"), exports);
36
- __exportStar(require("./SendDraftRequest"), exports);
@@ -0,0 +1,10 @@
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 Ascending: core.serialization.Schema<serializers.Ascending.Raw, AgentMail.Ascending>;
8
+ export declare namespace Ascending {
9
+ type Raw = boolean;
10
+ }
@@ -36,9 +36,6 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.SendDraftRequest = void 0;
40
- const core = __importStar(require("../../../../../../core"));
41
- const DraftLabels_1 = require("./DraftLabels");
42
- exports.SendDraftRequest = core.serialization.object({
43
- labels: DraftLabels_1.DraftLabels.optional(),
44
- });
39
+ exports.Ascending = void 0;
40
+ const core = __importStar(require("../../core"));
41
+ exports.Ascending = core.serialization.boolean();
@@ -2,6 +2,7 @@ export * from "./Limit";
2
2
  export * from "./Count";
3
3
  export * from "./LastKey";
4
4
  export * from "./Labels";
5
+ export * from "./Ascending";
5
6
  export * from "./OrganizationId";
6
7
  export * from "./ErrorName";
7
8
  export * from "./ErrorResponse";
@@ -18,6 +18,7 @@ __exportStar(require("./Limit"), exports);
18
18
  __exportStar(require("./Count"), exports);
19
19
  __exportStar(require("./LastKey"), exports);
20
20
  __exportStar(require("./Labels"), exports);
21
+ __exportStar(require("./Ascending"), exports);
21
22
  __exportStar(require("./OrganizationId"), exports);
22
23
  __exportStar(require("./ErrorName"), exports);
23
24
  __exportStar(require("./ErrorResponse"), exports);
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.29";
1
+ export declare const SDK_VERSION = "0.0.30";
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.29";
4
+ exports.SDK_VERSION = "0.0.30";
@@ -1,7 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as AgentMail from "../../../../../index";
5
- export interface SendDraftRequest {
6
- labels?: AgentMail.inboxes.DraftLabels;
7
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as AgentMail from "../../../../../index";
5
- export interface SendDraftRequest {
6
- labels?: AgentMail.inboxes.DraftLabels;
7
- }
@@ -1,13 +0,0 @@
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
- import { DraftLabels } from "./DraftLabels";
8
- export declare const SendDraftRequest: core.serialization.ObjectSchema<serializers.inboxes.SendDraftRequest.Raw, AgentMail.inboxes.SendDraftRequest>;
9
- export declare namespace SendDraftRequest {
10
- interface Raw {
11
- labels?: DraftLabels.Raw | null;
12
- }
13
- }
@@ -1,13 +0,0 @@
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
- import { DraftLabels } from "./DraftLabels";
8
- export declare const SendDraftRequest: core.serialization.ObjectSchema<serializers.inboxes.SendDraftRequest.Raw, AgentMail.inboxes.SendDraftRequest>;
9
- export declare namespace SendDraftRequest {
10
- interface Raw {
11
- labels?: DraftLabels.Raw | null;
12
- }
13
- }