agentmail 0.5.14 → 0.5.16

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 (127) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/drafts/types/CreateDraftRequest.d.ts +17 -0
  3. package/dist/cjs/api/resources/drafts/types/UpdateDraftRequest.d.ts +22 -8
  4. package/dist/cjs/api/resources/drafts/types/index.d.ts +0 -3
  5. package/dist/cjs/api/resources/drafts/types/index.js +0 -3
  6. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +13 -0
  7. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +37 -0
  8. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +0 -69
  9. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +0 -264
  10. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.d.ts +2 -3
  11. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +6 -11
  12. package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/index.d.ts +0 -1
  13. package/dist/cjs/api/resources/pods/resources/threads/client/Client.d.ts +2 -3
  14. package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +6 -11
  15. package/dist/cjs/api/resources/pods/resources/threads/client/requests/index.d.ts +0 -1
  16. package/dist/cjs/api/resources/threads/client/Client.d.ts +2 -3
  17. package/dist/cjs/api/resources/threads/client/Client.js +6 -11
  18. package/dist/cjs/api/resources/threads/client/requests/index.d.ts +0 -1
  19. package/dist/cjs/api/types/ErrorCode.d.ts +4 -0
  20. package/dist/cjs/api/types/ErrorDocs.d.ts +4 -0
  21. package/dist/cjs/api/types/ErrorFix.d.ts +4 -0
  22. package/dist/cjs/api/types/ErrorResponse.d.ts +3 -0
  23. package/dist/cjs/api/types/ValidationErrorResponse.d.ts +5 -1
  24. package/dist/cjs/api/types/index.d.ts +3 -0
  25. package/dist/cjs/api/types/index.js +3 -0
  26. package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.d.ts +4 -0
  27. package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.js +4 -0
  28. package/dist/cjs/serialization/resources/drafts/types/UpdateDraftRequest.d.ts +15 -8
  29. package/dist/cjs/serialization/resources/drafts/types/UpdateDraftRequest.js +15 -8
  30. package/dist/cjs/serialization/resources/drafts/types/index.d.ts +0 -3
  31. package/dist/cjs/serialization/resources/drafts/types/index.js +0 -3
  32. package/dist/cjs/serialization/types/ErrorCode.d.ts +7 -0
  33. package/dist/cjs/serialization/{resources/drafts/types/CreateDraftReplyAllRequest.js → types/ErrorCode.js} +3 -20
  34. package/dist/cjs/serialization/types/ErrorDocs.d.ts +7 -0
  35. package/dist/cjs/serialization/{resources/drafts/types/CreateDraftForwardRequest.js → types/ErrorDocs.js} +3 -26
  36. package/dist/cjs/serialization/types/ErrorFix.d.ts +7 -0
  37. package/dist/cjs/serialization/types/ErrorFix.js +39 -0
  38. package/dist/cjs/serialization/types/ErrorResponse.d.ts +6 -0
  39. package/dist/cjs/serialization/types/ErrorResponse.js +6 -0
  40. package/dist/cjs/serialization/types/ValidationErrorResponse.d.ts +8 -0
  41. package/dist/cjs/serialization/types/ValidationErrorResponse.js +8 -0
  42. package/dist/cjs/serialization/types/index.d.ts +3 -0
  43. package/dist/cjs/serialization/types/index.js +3 -0
  44. package/dist/cjs/version.d.ts +1 -1
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/esm/BaseClient.mjs +2 -2
  47. package/dist/esm/api/resources/drafts/types/CreateDraftRequest.d.mts +17 -0
  48. package/dist/esm/api/resources/drafts/types/UpdateDraftRequest.d.mts +22 -8
  49. package/dist/esm/api/resources/drafts/types/index.d.mts +0 -3
  50. package/dist/esm/api/resources/drafts/types/index.mjs +0 -3
  51. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +13 -0
  52. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +37 -0
  53. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +0 -69
  54. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +0 -264
  55. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.d.mts +2 -3
  56. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +6 -11
  57. package/dist/esm/api/resources/inboxes/resources/threads/client/requests/index.d.mts +0 -1
  58. package/dist/esm/api/resources/pods/resources/threads/client/Client.d.mts +2 -3
  59. package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +6 -11
  60. package/dist/esm/api/resources/pods/resources/threads/client/requests/index.d.mts +0 -1
  61. package/dist/esm/api/resources/threads/client/Client.d.mts +2 -3
  62. package/dist/esm/api/resources/threads/client/Client.mjs +6 -11
  63. package/dist/esm/api/resources/threads/client/requests/index.d.mts +0 -1
  64. package/dist/esm/api/types/ErrorCode.d.mts +4 -0
  65. package/dist/esm/api/types/ErrorDocs.d.mts +4 -0
  66. package/dist/esm/api/types/ErrorFix.d.mts +4 -0
  67. package/dist/esm/api/types/ErrorResponse.d.mts +3 -0
  68. package/dist/esm/api/types/ValidationErrorResponse.d.mts +5 -1
  69. package/dist/esm/api/types/index.d.mts +3 -0
  70. package/dist/esm/api/types/index.mjs +3 -0
  71. package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.d.mts +4 -0
  72. package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.mjs +4 -0
  73. package/dist/esm/serialization/resources/drafts/types/UpdateDraftRequest.d.mts +15 -8
  74. package/dist/esm/serialization/resources/drafts/types/UpdateDraftRequest.mjs +15 -8
  75. package/dist/esm/serialization/resources/drafts/types/index.d.mts +0 -3
  76. package/dist/esm/serialization/resources/drafts/types/index.mjs +0 -3
  77. package/dist/esm/serialization/types/ErrorCode.d.mts +7 -0
  78. package/dist/esm/serialization/types/ErrorCode.mjs +3 -0
  79. package/dist/esm/serialization/types/ErrorDocs.d.mts +7 -0
  80. package/dist/esm/serialization/types/ErrorDocs.mjs +3 -0
  81. package/dist/esm/serialization/types/ErrorFix.d.mts +7 -0
  82. package/dist/esm/serialization/types/ErrorFix.mjs +3 -0
  83. package/dist/esm/serialization/types/ErrorResponse.d.mts +6 -0
  84. package/dist/esm/serialization/types/ErrorResponse.mjs +6 -0
  85. package/dist/esm/serialization/types/ValidationErrorResponse.d.mts +8 -0
  86. package/dist/esm/serialization/types/ValidationErrorResponse.mjs +8 -0
  87. package/dist/esm/serialization/types/index.d.mts +3 -0
  88. package/dist/esm/serialization/types/index.mjs +3 -0
  89. package/dist/esm/version.d.mts +1 -1
  90. package/dist/esm/version.mjs +1 -1
  91. package/dist/llms.txt +2 -4
  92. package/package.json +1 -1
  93. package/reference.md +16 -288
  94. package/dist/cjs/api/resources/drafts/types/CreateDraftForwardRequest.d.ts +0 -21
  95. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +0 -17
  96. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyRequest.d.ts +0 -22
  97. package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/DeleteThreadRequest.d.ts +0 -8
  98. package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/DeleteThreadRequest.js +0 -3
  99. package/dist/cjs/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.d.ts +0 -8
  100. package/dist/cjs/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.js +0 -3
  101. package/dist/cjs/api/resources/threads/client/requests/DeleteThreadRequest.d.ts +0 -8
  102. package/dist/cjs/api/resources/threads/client/requests/DeleteThreadRequest.js +0 -3
  103. package/dist/cjs/serialization/resources/drafts/types/CreateDraftForwardRequest.d.ts +0 -30
  104. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +0 -24
  105. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.d.ts +0 -32
  106. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.js +0 -64
  107. package/dist/esm/api/resources/drafts/types/CreateDraftForwardRequest.d.mts +0 -21
  108. package/dist/esm/api/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +0 -17
  109. package/dist/esm/api/resources/drafts/types/CreateDraftReplyRequest.d.mts +0 -22
  110. package/dist/esm/api/resources/inboxes/resources/threads/client/requests/DeleteThreadRequest.d.mts +0 -8
  111. package/dist/esm/api/resources/inboxes/resources/threads/client/requests/DeleteThreadRequest.mjs +0 -2
  112. package/dist/esm/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.d.mts +0 -8
  113. package/dist/esm/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.mjs +0 -2
  114. package/dist/esm/api/resources/threads/client/requests/DeleteThreadRequest.d.mts +0 -8
  115. package/dist/esm/api/resources/threads/client/requests/DeleteThreadRequest.mjs +0 -2
  116. package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.d.mts +0 -30
  117. package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.mjs +0 -26
  118. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +0 -24
  119. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.mjs +0 -20
  120. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.d.mts +0 -32
  121. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.mjs +0 -28
  122. /package/dist/cjs/api/{resources/drafts/types/CreateDraftForwardRequest.js → types/ErrorCode.js} +0 -0
  123. /package/dist/cjs/api/{resources/drafts/types/CreateDraftReplyAllRequest.js → types/ErrorDocs.js} +0 -0
  124. /package/dist/cjs/api/{resources/drafts/types/CreateDraftReplyRequest.js → types/ErrorFix.js} +0 -0
  125. /package/dist/esm/api/{resources/drafts/types/CreateDraftForwardRequest.mjs → types/ErrorCode.mjs} +0 -0
  126. /package/dist/esm/api/{resources/drafts/types/CreateDraftReplyAllRequest.mjs → types/ErrorDocs.mjs} +0 -0
  127. /package/dist/esm/api/{resources/drafts/types/CreateDraftReplyRequest.mjs → types/ErrorFix.mjs} +0 -0
@@ -438,7 +438,7 @@ export class ThreadsClient {
438
438
  });
439
439
  }
440
440
  /**
441
- * Moves the thread to trash by adding a trash label to all messages. If the thread is already in trash, it will be permanently deleted. Use `permanent=true` to force permanent deletion.
441
+ * Permanently deletes a thread and all of its messages.
442
442
  *
443
443
  * **CLI:**
444
444
  * ```bash
@@ -447,7 +447,6 @@ export class ThreadsClient {
447
447
  *
448
448
  * @param {AgentMail.pods.PodId} pod_id
449
449
  * @param {AgentMail.ThreadId} thread_id
450
- * @param {AgentMail.pods.DeleteThreadRequest} request
451
450
  * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
452
451
  *
453
452
  * @throws {@link AgentMail.NotFoundError}
@@ -455,16 +454,12 @@ export class ThreadsClient {
455
454
  * @example
456
455
  * await client.pods.threads.delete("pod_id", "thread_id")
457
456
  */
458
- delete(pod_id, thread_id, request = {}, requestOptions) {
459
- return core.HttpResponsePromise.fromPromise(this.__delete(pod_id, thread_id, request, requestOptions));
457
+ delete(pod_id, thread_id, requestOptions) {
458
+ return core.HttpResponsePromise.fromPromise(this.__delete(pod_id, thread_id, requestOptions));
460
459
  }
461
- __delete(pod_id_1, thread_id_1) {
462
- return __awaiter(this, arguments, void 0, function* (pod_id, thread_id, request = {}, requestOptions) {
460
+ __delete(pod_id, thread_id, requestOptions) {
461
+ return __awaiter(this, void 0, void 0, function* () {
463
462
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
464
- const { permanent } = request;
465
- const _queryParams = {
466
- permanent,
467
- };
468
463
  const _authRequest = yield this._options.authProvider.getAuthRequest();
469
464
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
470
465
  const _response = yield core.fetcher({
@@ -472,7 +467,7 @@ export class ThreadsClient {
472
467
  .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/threads/${core.url.encodePathParam(serializers.ThreadId.jsonOrThrow(thread_id, { omitUndefined: true }))}`),
473
468
  method: "DELETE",
474
469
  headers: _headers,
475
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
470
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
476
471
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
477
472
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
478
473
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -1,3 +1,2 @@
1
- export type { DeleteThreadRequest } from "./DeleteThreadRequest.mjs";
2
1
  export type { ListThreadsRequest } from "./ListThreadsRequest.mjs";
3
2
  export type { SearchThreadsRequest } from "./SearchThreadsRequest.mjs";
@@ -102,7 +102,7 @@ export declare class ThreadsClient {
102
102
  update(thread_id: AgentMail.ThreadId, request: AgentMail.UpdateThreadRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<AgentMail.UpdateThreadResponse>;
103
103
  private __update;
104
104
  /**
105
- * Moves the thread to trash by adding a trash label to all messages. If the thread is already in trash, it will be permanently deleted. Use `permanent=true` to force permanent deletion.
105
+ * Permanently deletes a thread and all of its messages.
106
106
  *
107
107
  * **CLI:**
108
108
  * ```bash
@@ -110,7 +110,6 @@ export declare class ThreadsClient {
110
110
  * ```
111
111
  *
112
112
  * @param {AgentMail.ThreadId} thread_id
113
- * @param {AgentMail.DeleteThreadRequest} request
114
113
  * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
115
114
  *
116
115
  * @throws {@link AgentMail.NotFoundError}
@@ -118,6 +117,6 @@ export declare class ThreadsClient {
118
117
  * @example
119
118
  * await client.threads.delete("thread_id")
120
119
  */
121
- delete(thread_id: AgentMail.ThreadId, request?: AgentMail.DeleteThreadRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<void>;
120
+ delete(thread_id: AgentMail.ThreadId, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<void>;
122
121
  private __delete;
123
122
  }
@@ -435,7 +435,7 @@ export class ThreadsClient {
435
435
  });
436
436
  }
437
437
  /**
438
- * Moves the thread to trash by adding a trash label to all messages. If the thread is already in trash, it will be permanently deleted. Use `permanent=true` to force permanent deletion.
438
+ * Permanently deletes a thread and all of its messages.
439
439
  *
440
440
  * **CLI:**
441
441
  * ```bash
@@ -443,7 +443,6 @@ export class ThreadsClient {
443
443
  * ```
444
444
  *
445
445
  * @param {AgentMail.ThreadId} thread_id
446
- * @param {AgentMail.DeleteThreadRequest} request
447
446
  * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
448
447
  *
449
448
  * @throws {@link AgentMail.NotFoundError}
@@ -451,16 +450,12 @@ export class ThreadsClient {
451
450
  * @example
452
451
  * await client.threads.delete("thread_id")
453
452
  */
454
- delete(thread_id, request = {}, requestOptions) {
455
- return core.HttpResponsePromise.fromPromise(this.__delete(thread_id, request, requestOptions));
453
+ delete(thread_id, requestOptions) {
454
+ return core.HttpResponsePromise.fromPromise(this.__delete(thread_id, requestOptions));
456
455
  }
457
- __delete(thread_id_1) {
458
- return __awaiter(this, arguments, void 0, function* (thread_id, request = {}, requestOptions) {
456
+ __delete(thread_id, requestOptions) {
457
+ return __awaiter(this, void 0, void 0, function* () {
459
458
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
460
- const { permanent } = request;
461
- const _queryParams = {
462
- permanent,
463
- };
464
459
  const _authRequest = yield this._options.authProvider.getAuthRequest();
465
460
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
466
461
  const _response = yield core.fetcher({
@@ -468,7 +463,7 @@ export class ThreadsClient {
468
463
  .http, `/v0/threads/${core.url.encodePathParam(serializers.ThreadId.jsonOrThrow(thread_id, { omitUndefined: true }))}`),
469
464
  method: "DELETE",
470
465
  headers: _headers,
471
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
466
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
472
467
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
473
468
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
474
469
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -1,3 +1,2 @@
1
- export type { DeleteThreadRequest } from "./DeleteThreadRequest.mjs";
2
1
  export type { ListThreadsRequest } from "./ListThreadsRequest.mjs";
3
2
  export type { SearchThreadsRequest } from "./SearchThreadsRequest.mjs";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.
3
+ */
4
+ export type ErrorCode = string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Link to the error reference entry for this code.
3
+ */
4
+ export type ErrorDocs = string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The concrete next action that resolves the error.
3
+ */
4
+ export type ErrorFix = string;
@@ -1,5 +1,8 @@
1
1
  import type * as AgentMail from "../index.mjs";
2
2
  export interface ErrorResponse {
3
3
  name: AgentMail.ErrorName;
4
+ code?: AgentMail.ErrorCode;
4
5
  message: AgentMail.ErrorMessage;
6
+ fix?: AgentMail.ErrorFix;
7
+ docs?: AgentMail.ErrorDocs;
5
8
  }
@@ -1,6 +1,10 @@
1
1
  import type * as AgentMail from "../index.mjs";
2
2
  export interface ValidationErrorResponse {
3
3
  name: AgentMail.ErrorName;
4
- /** Validation errors. */
4
+ code?: AgentMail.ErrorCode;
5
+ message?: AgentMail.ErrorMessage;
6
+ /** Validation errors. Each entry has a path and a message identifying the invalid field. */
5
7
  errors?: unknown;
8
+ fix?: AgentMail.ErrorFix;
9
+ docs?: AgentMail.ErrorDocs;
6
10
  }
@@ -2,6 +2,9 @@ export * from "./After.mjs";
2
2
  export * from "./Ascending.mjs";
3
3
  export * from "./Before.mjs";
4
4
  export * from "./Count.mjs";
5
+ export * from "./ErrorCode.mjs";
6
+ export * from "./ErrorDocs.mjs";
7
+ export * from "./ErrorFix.mjs";
5
8
  export * from "./ErrorMessage.mjs";
6
9
  export * from "./ErrorName.mjs";
7
10
  export * from "./ErrorResponse.mjs";
@@ -2,6 +2,9 @@ export * from "./After.mjs";
2
2
  export * from "./Ascending.mjs";
3
3
  export * from "./Before.mjs";
4
4
  export * from "./Count.mjs";
5
+ export * from "./ErrorCode.mjs";
6
+ export * from "./ErrorDocs.mjs";
7
+ export * from "./ErrorFix.mjs";
5
8
  export * from "./ErrorMessage.mjs";
6
9
  export * from "./ErrorName.mjs";
7
10
  export * from "./ErrorResponse.mjs";
@@ -5,9 +5,11 @@ import { SendAttachment } from "../../attachments/types/SendAttachment.mjs";
5
5
  import { DraftBcc } from "./DraftBcc.mjs";
6
6
  import { DraftCc } from "./DraftCc.mjs";
7
7
  import { DraftClientId } from "./DraftClientId.mjs";
8
+ import { DraftForwardOf } from "./DraftForwardOf.mjs";
8
9
  import { DraftHtml } from "./DraftHtml.mjs";
9
10
  import { DraftInReplyTo } from "./DraftInReplyTo.mjs";
10
11
  import { DraftLabels } from "./DraftLabels.mjs";
12
+ import { DraftReplyAll } from "./DraftReplyAll.mjs";
11
13
  import { DraftReplyTo } from "./DraftReplyTo.mjs";
12
14
  import { DraftSendAt } from "./DraftSendAt.mjs";
13
15
  import { DraftSubject } from "./DraftSubject.mjs";
@@ -26,6 +28,8 @@ export declare namespace CreateDraftRequest {
26
28
  html?: DraftHtml.Raw | null;
27
29
  attachments?: SendAttachment.Raw[] | null;
28
30
  in_reply_to?: DraftInReplyTo.Raw | null;
31
+ forward_of?: DraftForwardOf.Raw | null;
32
+ reply_all?: DraftReplyAll.Raw | null;
29
33
  send_at?: DraftSendAt.Raw | null;
30
34
  client_id?: DraftClientId.Raw | null;
31
35
  }
@@ -4,9 +4,11 @@ import { SendAttachment } from "../../attachments/types/SendAttachment.mjs";
4
4
  import { DraftBcc } from "./DraftBcc.mjs";
5
5
  import { DraftCc } from "./DraftCc.mjs";
6
6
  import { DraftClientId } from "./DraftClientId.mjs";
7
+ import { DraftForwardOf } from "./DraftForwardOf.mjs";
7
8
  import { DraftHtml } from "./DraftHtml.mjs";
8
9
  import { DraftInReplyTo } from "./DraftInReplyTo.mjs";
9
10
  import { DraftLabels } from "./DraftLabels.mjs";
11
+ import { DraftReplyAll } from "./DraftReplyAll.mjs";
10
12
  import { DraftReplyTo } from "./DraftReplyTo.mjs";
11
13
  import { DraftSendAt } from "./DraftSendAt.mjs";
12
14
  import { DraftSubject } from "./DraftSubject.mjs";
@@ -23,6 +25,8 @@ export const CreateDraftRequest = core.serialization.object({
23
25
  html: DraftHtml.optional(),
24
26
  attachments: core.serialization.list(SendAttachment).optional(),
25
27
  inReplyTo: core.serialization.property("in_reply_to", DraftInReplyTo.optional()),
28
+ forwardOf: core.serialization.property("forward_of", DraftForwardOf.optional()),
29
+ replyAll: core.serialization.property("reply_all", DraftReplyAll.optional()),
26
30
  sendAt: core.serialization.property("send_at", DraftSendAt.optional()),
27
31
  clientId: core.serialization.property("client_id", DraftClientId.optional()),
28
32
  });
@@ -1,9 +1,12 @@
1
1
  import type * as AgentMail from "../../../../api/index.mjs";
2
2
  import * as core from "../../../../core/index.mjs";
3
3
  import type * as serializers from "../../../index.mjs";
4
+ import { AttachmentId } from "../../attachments/types/AttachmentId.mjs";
5
+ import { SendAttachment } from "../../attachments/types/SendAttachment.mjs";
4
6
  import { DraftBcc } from "./DraftBcc.mjs";
5
7
  import { DraftCc } from "./DraftCc.mjs";
6
8
  import { DraftHtml } from "./DraftHtml.mjs";
9
+ import { DraftLabels } from "./DraftLabels.mjs";
7
10
  import { DraftReplyTo } from "./DraftReplyTo.mjs";
8
11
  import { DraftSendAt } from "./DraftSendAt.mjs";
9
12
  import { DraftSubject } from "./DraftSubject.mjs";
@@ -12,13 +15,17 @@ import { DraftTo } from "./DraftTo.mjs";
12
15
  export declare const UpdateDraftRequest: core.serialization.ObjectSchema<serializers.UpdateDraftRequest.Raw, AgentMail.UpdateDraftRequest>;
13
16
  export declare namespace UpdateDraftRequest {
14
17
  interface Raw {
15
- reply_to?: DraftReplyTo.Raw | null;
16
- to?: DraftTo.Raw | null;
17
- cc?: DraftCc.Raw | null;
18
- bcc?: DraftBcc.Raw | null;
19
- subject?: DraftSubject.Raw | null;
20
- text?: DraftText.Raw | null;
21
- html?: DraftHtml.Raw | null;
22
- send_at?: DraftSendAt.Raw | null;
18
+ reply_to?: (DraftReplyTo.Raw | null | undefined) | null;
19
+ to?: (DraftTo.Raw | null | undefined) | null;
20
+ cc?: (DraftCc.Raw | null | undefined) | null;
21
+ bcc?: (DraftBcc.Raw | null | undefined) | null;
22
+ subject?: (DraftSubject.Raw | null | undefined) | null;
23
+ text?: (DraftText.Raw | null | undefined) | null;
24
+ html?: (DraftHtml.Raw | null | undefined) | null;
25
+ add_attachments?: SendAttachment.Raw[] | null;
26
+ remove_attachments?: AttachmentId.Raw[] | null;
27
+ add_labels?: DraftLabels.Raw | null;
28
+ remove_labels?: DraftLabels.Raw | null;
29
+ send_at?: (DraftSendAt.Raw | null | undefined) | null;
23
30
  }
24
31
  }
@@ -1,20 +1,27 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import * as core from "../../../../core/index.mjs";
3
+ import { AttachmentId } from "../../attachments/types/AttachmentId.mjs";
4
+ import { SendAttachment } from "../../attachments/types/SendAttachment.mjs";
3
5
  import { DraftBcc } from "./DraftBcc.mjs";
4
6
  import { DraftCc } from "./DraftCc.mjs";
5
7
  import { DraftHtml } from "./DraftHtml.mjs";
8
+ import { DraftLabels } from "./DraftLabels.mjs";
6
9
  import { DraftReplyTo } from "./DraftReplyTo.mjs";
7
10
  import { DraftSendAt } from "./DraftSendAt.mjs";
8
11
  import { DraftSubject } from "./DraftSubject.mjs";
9
12
  import { DraftText } from "./DraftText.mjs";
10
13
  import { DraftTo } from "./DraftTo.mjs";
11
14
  export const UpdateDraftRequest = core.serialization.object({
12
- replyTo: core.serialization.property("reply_to", DraftReplyTo.optional()),
13
- to: DraftTo.optional(),
14
- cc: DraftCc.optional(),
15
- bcc: DraftBcc.optional(),
16
- subject: DraftSubject.optional(),
17
- text: DraftText.optional(),
18
- html: DraftHtml.optional(),
19
- sendAt: core.serialization.property("send_at", DraftSendAt.optional()),
15
+ replyTo: core.serialization.property("reply_to", DraftReplyTo.optionalNullable()),
16
+ to: DraftTo.optionalNullable(),
17
+ cc: DraftCc.optionalNullable(),
18
+ bcc: DraftBcc.optionalNullable(),
19
+ subject: DraftSubject.optionalNullable(),
20
+ text: DraftText.optionalNullable(),
21
+ html: DraftHtml.optionalNullable(),
22
+ addAttachments: core.serialization.property("add_attachments", core.serialization.list(SendAttachment).optional()),
23
+ removeAttachments: core.serialization.property("remove_attachments", core.serialization.list(AttachmentId).optional()),
24
+ addLabels: core.serialization.property("add_labels", DraftLabels.optional()),
25
+ removeLabels: core.serialization.property("remove_labels", DraftLabels.optional()),
26
+ sendAt: core.serialization.property("send_at", DraftSendAt.optionalNullable()),
20
27
  });
@@ -1,6 +1,3 @@
1
- export * from "./CreateDraftForwardRequest.mjs";
2
- export * from "./CreateDraftReplyAllRequest.mjs";
3
- export * from "./CreateDraftReplyRequest.mjs";
4
1
  export * from "./CreateDraftRequest.mjs";
5
2
  export * from "./Draft.mjs";
6
3
  export * from "./DraftAttachments.mjs";
@@ -1,6 +1,3 @@
1
- export * from "./CreateDraftForwardRequest.mjs";
2
- export * from "./CreateDraftReplyAllRequest.mjs";
3
- export * from "./CreateDraftReplyRequest.mjs";
4
1
  export * from "./CreateDraftRequest.mjs";
5
2
  export * from "./Draft.mjs";
6
3
  export * from "./DraftAttachments.mjs";
@@ -0,0 +1,7 @@
1
+ import type * as AgentMail from "../../api/index.mjs";
2
+ import * as core from "../../core/index.mjs";
3
+ import type * as serializers from "../index.mjs";
4
+ export declare const ErrorCode: core.serialization.Schema<serializers.ErrorCode.Raw, AgentMail.ErrorCode>;
5
+ export declare namespace ErrorCode {
6
+ type Raw = string;
7
+ }
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../core/index.mjs";
3
+ export const ErrorCode = core.serialization.string();
@@ -0,0 +1,7 @@
1
+ import type * as AgentMail from "../../api/index.mjs";
2
+ import * as core from "../../core/index.mjs";
3
+ import type * as serializers from "../index.mjs";
4
+ export declare const ErrorDocs: core.serialization.Schema<serializers.ErrorDocs.Raw, AgentMail.ErrorDocs>;
5
+ export declare namespace ErrorDocs {
6
+ type Raw = string;
7
+ }
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../core/index.mjs";
3
+ export const ErrorDocs = core.serialization.string();
@@ -0,0 +1,7 @@
1
+ import type * as AgentMail from "../../api/index.mjs";
2
+ import * as core from "../../core/index.mjs";
3
+ import type * as serializers from "../index.mjs";
4
+ export declare const ErrorFix: core.serialization.Schema<serializers.ErrorFix.Raw, AgentMail.ErrorFix>;
5
+ export declare namespace ErrorFix {
6
+ type Raw = string;
7
+ }
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../core/index.mjs";
3
+ export const ErrorFix = core.serialization.string();
@@ -1,12 +1,18 @@
1
1
  import type * as AgentMail from "../../api/index.mjs";
2
2
  import * as core from "../../core/index.mjs";
3
3
  import type * as serializers from "../index.mjs";
4
+ import { ErrorCode } from "./ErrorCode.mjs";
5
+ import { ErrorDocs } from "./ErrorDocs.mjs";
6
+ import { ErrorFix } from "./ErrorFix.mjs";
4
7
  import { ErrorMessage } from "./ErrorMessage.mjs";
5
8
  import { ErrorName } from "./ErrorName.mjs";
6
9
  export declare const ErrorResponse: core.serialization.ObjectSchema<serializers.ErrorResponse.Raw, AgentMail.ErrorResponse>;
7
10
  export declare namespace ErrorResponse {
8
11
  interface Raw {
9
12
  name: ErrorName.Raw;
13
+ code?: ErrorCode.Raw | null;
10
14
  message: ErrorMessage.Raw;
15
+ fix?: ErrorFix.Raw | null;
16
+ docs?: ErrorDocs.Raw | null;
11
17
  }
12
18
  }
@@ -1,8 +1,14 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import * as core from "../../core/index.mjs";
3
+ import { ErrorCode } from "./ErrorCode.mjs";
4
+ import { ErrorDocs } from "./ErrorDocs.mjs";
5
+ import { ErrorFix } from "./ErrorFix.mjs";
3
6
  import { ErrorMessage } from "./ErrorMessage.mjs";
4
7
  import { ErrorName } from "./ErrorName.mjs";
5
8
  export const ErrorResponse = core.serialization.object({
6
9
  name: ErrorName,
10
+ code: ErrorCode.optional(),
7
11
  message: ErrorMessage,
12
+ fix: ErrorFix.optional(),
13
+ docs: ErrorDocs.optional(),
8
14
  });
@@ -1,11 +1,19 @@
1
1
  import type * as AgentMail from "../../api/index.mjs";
2
2
  import * as core from "../../core/index.mjs";
3
3
  import type * as serializers from "../index.mjs";
4
+ import { ErrorCode } from "./ErrorCode.mjs";
5
+ import { ErrorDocs } from "./ErrorDocs.mjs";
6
+ import { ErrorFix } from "./ErrorFix.mjs";
7
+ import { ErrorMessage } from "./ErrorMessage.mjs";
4
8
  import { ErrorName } from "./ErrorName.mjs";
5
9
  export declare const ValidationErrorResponse: core.serialization.ObjectSchema<serializers.ValidationErrorResponse.Raw, AgentMail.ValidationErrorResponse>;
6
10
  export declare namespace ValidationErrorResponse {
7
11
  interface Raw {
8
12
  name: ErrorName.Raw;
13
+ code?: ErrorCode.Raw | null;
14
+ message?: ErrorMessage.Raw | null;
9
15
  errors?: unknown;
16
+ fix?: ErrorFix.Raw | null;
17
+ docs?: ErrorDocs.Raw | null;
10
18
  }
11
19
  }
@@ -1,7 +1,15 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import * as core from "../../core/index.mjs";
3
+ import { ErrorCode } from "./ErrorCode.mjs";
4
+ import { ErrorDocs } from "./ErrorDocs.mjs";
5
+ import { ErrorFix } from "./ErrorFix.mjs";
6
+ import { ErrorMessage } from "./ErrorMessage.mjs";
3
7
  import { ErrorName } from "./ErrorName.mjs";
4
8
  export const ValidationErrorResponse = core.serialization.object({
5
9
  name: ErrorName,
10
+ code: ErrorCode.optional(),
11
+ message: ErrorMessage.optional(),
6
12
  errors: core.serialization.unknown(),
13
+ fix: ErrorFix.optional(),
14
+ docs: ErrorDocs.optional(),
7
15
  });
@@ -2,6 +2,9 @@ export * from "./After.mjs";
2
2
  export * from "./Ascending.mjs";
3
3
  export * from "./Before.mjs";
4
4
  export * from "./Count.mjs";
5
+ export * from "./ErrorCode.mjs";
6
+ export * from "./ErrorDocs.mjs";
7
+ export * from "./ErrorFix.mjs";
5
8
  export * from "./ErrorMessage.mjs";
6
9
  export * from "./ErrorName.mjs";
7
10
  export * from "./ErrorResponse.mjs";
@@ -2,6 +2,9 @@ export * from "./After.mjs";
2
2
  export * from "./Ascending.mjs";
3
3
  export * from "./Before.mjs";
4
4
  export * from "./Count.mjs";
5
+ export * from "./ErrorCode.mjs";
6
+ export * from "./ErrorDocs.mjs";
7
+ export * from "./ErrorFix.mjs";
5
8
  export * from "./ErrorMessage.mjs";
6
9
  export * from "./ErrorName.mjs";
7
10
  export * from "./ErrorResponse.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.5.14";
1
+ export declare const SDK_VERSION = "0.5.16";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.5.14";
1
+ export const SDK_VERSION = "0.5.16";
package/dist/llms.txt CHANGED
@@ -46,13 +46,14 @@
46
46
  - [WebSockets](https://docs.agentmail.to/websockets.md): Learn how to use WebSockets for instant email notifications without webhooks or polling.
47
47
  - [WebSockets Quickstart](https://docs.agentmail.to/websockets/quickstart.md): Get started with real-time email event streaming
48
48
  - [Email Deliverability](https://docs.agentmail.to/email-deliverability.md): Learn the strategies and best practices for maximizing your email deliverability with AgentMail.
49
- - [Idempotent Requests](https://docs.agentmail.to/idempotency.md): A guide to using the client_id parameter in AgentMail to prevent duplicate resources and safely retry API requests.
49
+ - [Idempotent Requests](https://docs.agentmail.to/idempotency.md): A guide to preventing duplicate resources with client_id and preventing duplicate email sends with the Idempotency-Key header.
50
50
  - [Example: Event-Driven Agent](https://docs.agentmail.to/webhook-agent.md): A step-by-step guide to building a sophisticated agent that performs proactive outreach and uses webhooks for inbound message processing.
51
51
  - [Auto-Reply Email Agent](https://docs.agentmail.to/documentation/examples/auto-reply-agent.md): Build a simple agent that automatically responds to incoming emails with personalized messages
52
52
  - [Smart Email Labeling Agent](https://docs.agentmail.to/documentation/examples/smart-labeling-agent.md): Build an AI-powered agent that automatically classifies and labels incoming emails across multiple dimensions
53
53
  - [Sales Agent with WebSocket](https://docs.agentmail.to/sales-agent-websocket.md): A step-by-step guide to building an AI-powered sales agent that uses WebSocket for real-time email processing without polling or webhooks.
54
54
  - [Live AgentMail Examples](https://docs.agentmail.to/documentation/examples/live-agent-mail-examples.md)
55
55
  - [Frequently Asked Questions (FAQ)](https://docs.agentmail.to/faq.md): Find answers to common questions about AgentMail, from core concepts to best practices and security.
56
+ - [Error Reference](https://docs.agentmail.to/errors.md): Every AgentMail API error code, what it means, and how to fix it.
56
57
  - [Email Reply Extraction with Talon](https://docs.agentmail.to/talon-reply-extraction.md): Learn how to use Talon to extract new content from email replies, removing quoted text with 93.8% accuracy.
57
58
  - [Join the AgentMail Community](https://docs.agentmail.to/community.md): Connect with the AgentMail team and developers, share what you're building, and get support.
58
59
  - [Support](https://docs.agentmail.to/support.md): Get help with AgentMail through our support channels.
@@ -116,9 +117,6 @@
116
117
  - API Reference > Inboxes > Messages [Reply To Message](https://docs.agentmail.to/api-reference/inboxes/messages/reply.md)
117
118
  - API Reference > Inboxes > Messages [Reply All Message](https://docs.agentmail.to/api-reference/inboxes/messages/reply-all.md)
118
119
  - API Reference > Inboxes > Messages [Forward Message](https://docs.agentmail.to/api-reference/inboxes/messages/forward.md)
119
- - API Reference > Inboxes > Messages [Create Draft Reply](https://docs.agentmail.to/api-reference/inboxes/messages/draft-reply.md)
120
- - API Reference > Inboxes > Messages [Create Draft Reply All](https://docs.agentmail.to/api-reference/inboxes/messages/draft-reply-all.md)
121
- - API Reference > Inboxes > Messages [Create Draft Forward](https://docs.agentmail.to/api-reference/inboxes/messages/draft-forward.md)
122
120
  - API Reference > Inboxes > Drafts [List Drafts](https://docs.agentmail.to/api-reference/inboxes/drafts/list.md)
123
121
  - API Reference > Inboxes > Drafts [Get Draft](https://docs.agentmail.to/api-reference/inboxes/drafts/get.md)
124
122
  - API Reference > Inboxes > Drafts [Get Attachment](https://docs.agentmail.to/api-reference/inboxes/drafts/get-attachment.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentmail",
3
- "version": "0.5.14",
3
+ "version": "0.5.16",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",