agentmail 0.5.14 → 0.5.15

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 (96) 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/types/ErrorCode.d.ts +4 -0
  11. package/dist/cjs/api/types/ErrorDocs.d.ts +4 -0
  12. package/dist/cjs/api/types/ErrorFix.d.ts +4 -0
  13. package/dist/cjs/api/types/ErrorResponse.d.ts +3 -0
  14. package/dist/cjs/api/types/ValidationErrorResponse.d.ts +5 -1
  15. package/dist/cjs/api/types/index.d.ts +3 -0
  16. package/dist/cjs/api/types/index.js +3 -0
  17. package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.d.ts +4 -0
  18. package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.js +4 -0
  19. package/dist/cjs/serialization/resources/drafts/types/UpdateDraftRequest.d.ts +15 -8
  20. package/dist/cjs/serialization/resources/drafts/types/UpdateDraftRequest.js +15 -8
  21. package/dist/cjs/serialization/resources/drafts/types/index.d.ts +0 -3
  22. package/dist/cjs/serialization/resources/drafts/types/index.js +0 -3
  23. package/dist/cjs/serialization/types/ErrorCode.d.ts +7 -0
  24. package/dist/cjs/serialization/{resources/drafts/types/CreateDraftReplyAllRequest.js → types/ErrorCode.js} +3 -20
  25. package/dist/cjs/serialization/types/ErrorDocs.d.ts +7 -0
  26. package/dist/cjs/serialization/{resources/drafts/types/CreateDraftForwardRequest.js → types/ErrorDocs.js} +3 -26
  27. package/dist/cjs/serialization/types/ErrorFix.d.ts +7 -0
  28. package/dist/cjs/serialization/types/ErrorFix.js +39 -0
  29. package/dist/cjs/serialization/types/ErrorResponse.d.ts +6 -0
  30. package/dist/cjs/serialization/types/ErrorResponse.js +6 -0
  31. package/dist/cjs/serialization/types/ValidationErrorResponse.d.ts +8 -0
  32. package/dist/cjs/serialization/types/ValidationErrorResponse.js +8 -0
  33. package/dist/cjs/serialization/types/index.d.ts +3 -0
  34. package/dist/cjs/serialization/types/index.js +3 -0
  35. package/dist/cjs/version.d.ts +1 -1
  36. package/dist/cjs/version.js +1 -1
  37. package/dist/esm/BaseClient.mjs +2 -2
  38. package/dist/esm/api/resources/drafts/types/CreateDraftRequest.d.mts +17 -0
  39. package/dist/esm/api/resources/drafts/types/UpdateDraftRequest.d.mts +22 -8
  40. package/dist/esm/api/resources/drafts/types/index.d.mts +0 -3
  41. package/dist/esm/api/resources/drafts/types/index.mjs +0 -3
  42. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +13 -0
  43. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +37 -0
  44. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +0 -69
  45. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +0 -264
  46. package/dist/esm/api/types/ErrorCode.d.mts +4 -0
  47. package/dist/esm/api/types/ErrorDocs.d.mts +4 -0
  48. package/dist/esm/api/types/ErrorFix.d.mts +4 -0
  49. package/dist/esm/api/types/ErrorResponse.d.mts +3 -0
  50. package/dist/esm/api/types/ValidationErrorResponse.d.mts +5 -1
  51. package/dist/esm/api/types/index.d.mts +3 -0
  52. package/dist/esm/api/types/index.mjs +3 -0
  53. package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.d.mts +4 -0
  54. package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.mjs +4 -0
  55. package/dist/esm/serialization/resources/drafts/types/UpdateDraftRequest.d.mts +15 -8
  56. package/dist/esm/serialization/resources/drafts/types/UpdateDraftRequest.mjs +15 -8
  57. package/dist/esm/serialization/resources/drafts/types/index.d.mts +0 -3
  58. package/dist/esm/serialization/resources/drafts/types/index.mjs +0 -3
  59. package/dist/esm/serialization/types/ErrorCode.d.mts +7 -0
  60. package/dist/esm/serialization/types/ErrorCode.mjs +3 -0
  61. package/dist/esm/serialization/types/ErrorDocs.d.mts +7 -0
  62. package/dist/esm/serialization/types/ErrorDocs.mjs +3 -0
  63. package/dist/esm/serialization/types/ErrorFix.d.mts +7 -0
  64. package/dist/esm/serialization/types/ErrorFix.mjs +3 -0
  65. package/dist/esm/serialization/types/ErrorResponse.d.mts +6 -0
  66. package/dist/esm/serialization/types/ErrorResponse.mjs +6 -0
  67. package/dist/esm/serialization/types/ValidationErrorResponse.d.mts +8 -0
  68. package/dist/esm/serialization/types/ValidationErrorResponse.mjs +8 -0
  69. package/dist/esm/serialization/types/index.d.mts +3 -0
  70. package/dist/esm/serialization/types/index.mjs +3 -0
  71. package/dist/esm/version.d.mts +1 -1
  72. package/dist/esm/version.mjs +1 -1
  73. package/package.json +1 -1
  74. package/reference.md +10 -258
  75. package/dist/cjs/api/resources/drafts/types/CreateDraftForwardRequest.d.ts +0 -21
  76. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +0 -17
  77. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyRequest.d.ts +0 -22
  78. package/dist/cjs/serialization/resources/drafts/types/CreateDraftForwardRequest.d.ts +0 -30
  79. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +0 -24
  80. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.d.ts +0 -32
  81. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.js +0 -64
  82. package/dist/esm/api/resources/drafts/types/CreateDraftForwardRequest.d.mts +0 -21
  83. package/dist/esm/api/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +0 -17
  84. package/dist/esm/api/resources/drafts/types/CreateDraftReplyRequest.d.mts +0 -22
  85. package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.d.mts +0 -30
  86. package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.mjs +0 -26
  87. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +0 -24
  88. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.mjs +0 -20
  89. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.d.mts +0 -32
  90. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.mjs +0 -28
  91. /package/dist/cjs/api/{resources/drafts/types/CreateDraftForwardRequest.js → types/ErrorCode.js} +0 -0
  92. /package/dist/cjs/api/{resources/drafts/types/CreateDraftReplyAllRequest.js → types/ErrorDocs.js} +0 -0
  93. /package/dist/cjs/api/{resources/drafts/types/CreateDraftReplyRequest.js → types/ErrorFix.js} +0 -0
  94. /package/dist/esm/api/{resources/drafts/types/CreateDraftForwardRequest.mjs → types/ErrorCode.mjs} +0 -0
  95. /package/dist/esm/api/{resources/drafts/types/CreateDraftReplyAllRequest.mjs → types/ErrorDocs.mjs} +0 -0
  96. /package/dist/esm/api/{resources/drafts/types/CreateDraftReplyRequest.mjs → types/ErrorFix.mjs} +0 -0
@@ -40,9 +40,11 @@ const SendAttachment_js_1 = require("../../attachments/types/SendAttachment.js")
40
40
  const DraftBcc_js_1 = require("./DraftBcc.js");
41
41
  const DraftCc_js_1 = require("./DraftCc.js");
42
42
  const DraftClientId_js_1 = require("./DraftClientId.js");
43
+ const DraftForwardOf_js_1 = require("./DraftForwardOf.js");
43
44
  const DraftHtml_js_1 = require("./DraftHtml.js");
44
45
  const DraftInReplyTo_js_1 = require("./DraftInReplyTo.js");
45
46
  const DraftLabels_js_1 = require("./DraftLabels.js");
47
+ const DraftReplyAll_js_1 = require("./DraftReplyAll.js");
46
48
  const DraftReplyTo_js_1 = require("./DraftReplyTo.js");
47
49
  const DraftSendAt_js_1 = require("./DraftSendAt.js");
48
50
  const DraftSubject_js_1 = require("./DraftSubject.js");
@@ -59,6 +61,8 @@ exports.CreateDraftRequest = core.serialization.object({
59
61
  html: DraftHtml_js_1.DraftHtml.optional(),
60
62
  attachments: core.serialization.list(SendAttachment_js_1.SendAttachment).optional(),
61
63
  inReplyTo: core.serialization.property("in_reply_to", DraftInReplyTo_js_1.DraftInReplyTo.optional()),
64
+ forwardOf: core.serialization.property("forward_of", DraftForwardOf_js_1.DraftForwardOf.optional()),
65
+ replyAll: core.serialization.property("reply_all", DraftReplyAll_js_1.DraftReplyAll.optional()),
62
66
  sendAt: core.serialization.property("send_at", DraftSendAt_js_1.DraftSendAt.optional()),
63
67
  clientId: core.serialization.property("client_id", DraftClientId_js_1.DraftClientId.optional()),
64
68
  });
@@ -1,9 +1,12 @@
1
1
  import type * as AgentMail from "../../../../api/index.js";
2
2
  import * as core from "../../../../core/index.js";
3
3
  import type * as serializers from "../../../index.js";
4
+ import { AttachmentId } from "../../attachments/types/AttachmentId.js";
5
+ import { SendAttachment } from "../../attachments/types/SendAttachment.js";
4
6
  import { DraftBcc } from "./DraftBcc.js";
5
7
  import { DraftCc } from "./DraftCc.js";
6
8
  import { DraftHtml } from "./DraftHtml.js";
9
+ import { DraftLabels } from "./DraftLabels.js";
7
10
  import { DraftReplyTo } from "./DraftReplyTo.js";
8
11
  import { DraftSendAt } from "./DraftSendAt.js";
9
12
  import { DraftSubject } from "./DraftSubject.js";
@@ -12,13 +15,17 @@ import { DraftTo } from "./DraftTo.js";
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
  }
@@ -36,21 +36,28 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.UpdateDraftRequest = void 0;
38
38
  const core = __importStar(require("../../../../core/index.js"));
39
+ const AttachmentId_js_1 = require("../../attachments/types/AttachmentId.js");
40
+ const SendAttachment_js_1 = require("../../attachments/types/SendAttachment.js");
39
41
  const DraftBcc_js_1 = require("./DraftBcc.js");
40
42
  const DraftCc_js_1 = require("./DraftCc.js");
41
43
  const DraftHtml_js_1 = require("./DraftHtml.js");
44
+ const DraftLabels_js_1 = require("./DraftLabels.js");
42
45
  const DraftReplyTo_js_1 = require("./DraftReplyTo.js");
43
46
  const DraftSendAt_js_1 = require("./DraftSendAt.js");
44
47
  const DraftSubject_js_1 = require("./DraftSubject.js");
45
48
  const DraftText_js_1 = require("./DraftText.js");
46
49
  const DraftTo_js_1 = require("./DraftTo.js");
47
50
  exports.UpdateDraftRequest = core.serialization.object({
48
- replyTo: core.serialization.property("reply_to", DraftReplyTo_js_1.DraftReplyTo.optional()),
49
- to: DraftTo_js_1.DraftTo.optional(),
50
- cc: DraftCc_js_1.DraftCc.optional(),
51
- bcc: DraftBcc_js_1.DraftBcc.optional(),
52
- subject: DraftSubject_js_1.DraftSubject.optional(),
53
- text: DraftText_js_1.DraftText.optional(),
54
- html: DraftHtml_js_1.DraftHtml.optional(),
55
- sendAt: core.serialization.property("send_at", DraftSendAt_js_1.DraftSendAt.optional()),
51
+ replyTo: core.serialization.property("reply_to", DraftReplyTo_js_1.DraftReplyTo.optionalNullable()),
52
+ to: DraftTo_js_1.DraftTo.optionalNullable(),
53
+ cc: DraftCc_js_1.DraftCc.optionalNullable(),
54
+ bcc: DraftBcc_js_1.DraftBcc.optionalNullable(),
55
+ subject: DraftSubject_js_1.DraftSubject.optionalNullable(),
56
+ text: DraftText_js_1.DraftText.optionalNullable(),
57
+ html: DraftHtml_js_1.DraftHtml.optionalNullable(),
58
+ addAttachments: core.serialization.property("add_attachments", core.serialization.list(SendAttachment_js_1.SendAttachment).optional()),
59
+ removeAttachments: core.serialization.property("remove_attachments", core.serialization.list(AttachmentId_js_1.AttachmentId).optional()),
60
+ addLabels: core.serialization.property("add_labels", DraftLabels_js_1.DraftLabels.optional()),
61
+ removeLabels: core.serialization.property("remove_labels", DraftLabels_js_1.DraftLabels.optional()),
62
+ sendAt: core.serialization.property("send_at", DraftSendAt_js_1.DraftSendAt.optionalNullable()),
56
63
  });
@@ -1,6 +1,3 @@
1
- export * from "./CreateDraftForwardRequest.js";
2
- export * from "./CreateDraftReplyAllRequest.js";
3
- export * from "./CreateDraftReplyRequest.js";
4
1
  export * from "./CreateDraftRequest.js";
5
2
  export * from "./Draft.js";
6
3
  export * from "./DraftAttachments.js";
@@ -14,9 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./CreateDraftForwardRequest.js"), exports);
18
- __exportStar(require("./CreateDraftReplyAllRequest.js"), exports);
19
- __exportStar(require("./CreateDraftReplyRequest.js"), exports);
20
17
  __exportStar(require("./CreateDraftRequest.js"), exports);
21
18
  __exportStar(require("./Draft.js"), exports);
22
19
  __exportStar(require("./DraftAttachments.js"), exports);
@@ -0,0 +1,7 @@
1
+ import type * as AgentMail from "../../api/index.js";
2
+ import * as core from "../../core/index.js";
3
+ import type * as serializers from "../index.js";
4
+ export declare const ErrorCode: core.serialization.Schema<serializers.ErrorCode.Raw, AgentMail.ErrorCode>;
5
+ export declare namespace ErrorCode {
6
+ type Raw = string;
7
+ }
@@ -34,23 +34,6 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.CreateDraftReplyAllRequest = void 0;
38
- const core = __importStar(require("../../../../core/index.js"));
39
- const SendAttachment_js_1 = require("../../attachments/types/SendAttachment.js");
40
- const DraftClientId_js_1 = require("./DraftClientId.js");
41
- const DraftHtml_js_1 = require("./DraftHtml.js");
42
- const DraftLabels_js_1 = require("./DraftLabels.js");
43
- const DraftReplyTo_js_1 = require("./DraftReplyTo.js");
44
- const DraftSendAt_js_1 = require("./DraftSendAt.js");
45
- const DraftSubject_js_1 = require("./DraftSubject.js");
46
- const DraftText_js_1 = require("./DraftText.js");
47
- exports.CreateDraftReplyAllRequest = core.serialization.object({
48
- labels: DraftLabels_js_1.DraftLabels.optional(),
49
- replyTo: core.serialization.property("reply_to", DraftReplyTo_js_1.DraftReplyTo.optional()),
50
- subject: DraftSubject_js_1.DraftSubject.optional(),
51
- text: DraftText_js_1.DraftText.optional(),
52
- html: DraftHtml_js_1.DraftHtml.optional(),
53
- attachments: core.serialization.list(SendAttachment_js_1.SendAttachment).optional(),
54
- sendAt: core.serialization.property("send_at", DraftSendAt_js_1.DraftSendAt.optional()),
55
- clientId: core.serialization.property("client_id", DraftClientId_js_1.DraftClientId.optional()),
56
- });
37
+ exports.ErrorCode = void 0;
38
+ const core = __importStar(require("../../core/index.js"));
39
+ exports.ErrorCode = core.serialization.string();
@@ -0,0 +1,7 @@
1
+ import type * as AgentMail from "../../api/index.js";
2
+ import * as core from "../../core/index.js";
3
+ import type * as serializers from "../index.js";
4
+ export declare const ErrorDocs: core.serialization.Schema<serializers.ErrorDocs.Raw, AgentMail.ErrorDocs>;
5
+ export declare namespace ErrorDocs {
6
+ type Raw = string;
7
+ }
@@ -34,29 +34,6 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.CreateDraftForwardRequest = void 0;
38
- const core = __importStar(require("../../../../core/index.js"));
39
- const SendAttachment_js_1 = require("../../attachments/types/SendAttachment.js");
40
- const DraftBcc_js_1 = require("./DraftBcc.js");
41
- const DraftCc_js_1 = require("./DraftCc.js");
42
- const DraftClientId_js_1 = require("./DraftClientId.js");
43
- const DraftHtml_js_1 = require("./DraftHtml.js");
44
- const DraftLabels_js_1 = require("./DraftLabels.js");
45
- const DraftReplyTo_js_1 = require("./DraftReplyTo.js");
46
- const DraftSendAt_js_1 = require("./DraftSendAt.js");
47
- const DraftSubject_js_1 = require("./DraftSubject.js");
48
- const DraftText_js_1 = require("./DraftText.js");
49
- const DraftTo_js_1 = require("./DraftTo.js");
50
- exports.CreateDraftForwardRequest = core.serialization.object({
51
- labels: DraftLabels_js_1.DraftLabels.optional(),
52
- replyTo: core.serialization.property("reply_to", DraftReplyTo_js_1.DraftReplyTo.optional()),
53
- to: DraftTo_js_1.DraftTo.optional(),
54
- cc: DraftCc_js_1.DraftCc.optional(),
55
- bcc: DraftBcc_js_1.DraftBcc.optional(),
56
- subject: DraftSubject_js_1.DraftSubject.optional(),
57
- text: DraftText_js_1.DraftText.optional(),
58
- html: DraftHtml_js_1.DraftHtml.optional(),
59
- attachments: core.serialization.list(SendAttachment_js_1.SendAttachment).optional(),
60
- sendAt: core.serialization.property("send_at", DraftSendAt_js_1.DraftSendAt.optional()),
61
- clientId: core.serialization.property("client_id", DraftClientId_js_1.DraftClientId.optional()),
62
- });
37
+ exports.ErrorDocs = void 0;
38
+ const core = __importStar(require("../../core/index.js"));
39
+ exports.ErrorDocs = core.serialization.string();
@@ -0,0 +1,7 @@
1
+ import type * as AgentMail from "../../api/index.js";
2
+ import * as core from "../../core/index.js";
3
+ import type * as serializers from "../index.js";
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,39 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.ErrorFix = void 0;
38
+ const core = __importStar(require("../../core/index.js"));
39
+ exports.ErrorFix = core.serialization.string();
@@ -1,12 +1,18 @@
1
1
  import type * as AgentMail from "../../api/index.js";
2
2
  import * as core from "../../core/index.js";
3
3
  import type * as serializers from "../index.js";
4
+ import { ErrorCode } from "./ErrorCode.js";
5
+ import { ErrorDocs } from "./ErrorDocs.js";
6
+ import { ErrorFix } from "./ErrorFix.js";
4
7
  import { ErrorMessage } from "./ErrorMessage.js";
5
8
  import { ErrorName } from "./ErrorName.js";
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
  }
@@ -36,9 +36,15 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.ErrorResponse = void 0;
38
38
  const core = __importStar(require("../../core/index.js"));
39
+ const ErrorCode_js_1 = require("./ErrorCode.js");
40
+ const ErrorDocs_js_1 = require("./ErrorDocs.js");
41
+ const ErrorFix_js_1 = require("./ErrorFix.js");
39
42
  const ErrorMessage_js_1 = require("./ErrorMessage.js");
40
43
  const ErrorName_js_1 = require("./ErrorName.js");
41
44
  exports.ErrorResponse = core.serialization.object({
42
45
  name: ErrorName_js_1.ErrorName,
46
+ code: ErrorCode_js_1.ErrorCode.optional(),
43
47
  message: ErrorMessage_js_1.ErrorMessage,
48
+ fix: ErrorFix_js_1.ErrorFix.optional(),
49
+ docs: ErrorDocs_js_1.ErrorDocs.optional(),
44
50
  });
@@ -1,11 +1,19 @@
1
1
  import type * as AgentMail from "../../api/index.js";
2
2
  import * as core from "../../core/index.js";
3
3
  import type * as serializers from "../index.js";
4
+ import { ErrorCode } from "./ErrorCode.js";
5
+ import { ErrorDocs } from "./ErrorDocs.js";
6
+ import { ErrorFix } from "./ErrorFix.js";
7
+ import { ErrorMessage } from "./ErrorMessage.js";
4
8
  import { ErrorName } from "./ErrorName.js";
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
  }
@@ -36,8 +36,16 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.ValidationErrorResponse = void 0;
38
38
  const core = __importStar(require("../../core/index.js"));
39
+ const ErrorCode_js_1 = require("./ErrorCode.js");
40
+ const ErrorDocs_js_1 = require("./ErrorDocs.js");
41
+ const ErrorFix_js_1 = require("./ErrorFix.js");
42
+ const ErrorMessage_js_1 = require("./ErrorMessage.js");
39
43
  const ErrorName_js_1 = require("./ErrorName.js");
40
44
  exports.ValidationErrorResponse = core.serialization.object({
41
45
  name: ErrorName_js_1.ErrorName,
46
+ code: ErrorCode_js_1.ErrorCode.optional(),
47
+ message: ErrorMessage_js_1.ErrorMessage.optional(),
42
48
  errors: core.serialization.unknown(),
49
+ fix: ErrorFix_js_1.ErrorFix.optional(),
50
+ docs: ErrorDocs_js_1.ErrorDocs.optional(),
43
51
  });
@@ -2,6 +2,9 @@ export * from "./After.js";
2
2
  export * from "./Ascending.js";
3
3
  export * from "./Before.js";
4
4
  export * from "./Count.js";
5
+ export * from "./ErrorCode.js";
6
+ export * from "./ErrorDocs.js";
7
+ export * from "./ErrorFix.js";
5
8
  export * from "./ErrorMessage.js";
6
9
  export * from "./ErrorName.js";
7
10
  export * from "./ErrorResponse.js";
@@ -18,6 +18,9 @@ __exportStar(require("./After.js"), exports);
18
18
  __exportStar(require("./Ascending.js"), exports);
19
19
  __exportStar(require("./Before.js"), exports);
20
20
  __exportStar(require("./Count.js"), exports);
21
+ __exportStar(require("./ErrorCode.js"), exports);
22
+ __exportStar(require("./ErrorDocs.js"), exports);
23
+ __exportStar(require("./ErrorFix.js"), exports);
21
24
  __exportStar(require("./ErrorMessage.js"), exports);
22
25
  __exportStar(require("./ErrorName.js"), exports);
23
26
  __exportStar(require("./ErrorResponse.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.5.14";
1
+ export declare const SDK_VERSION = "0.5.15";
@@ -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.5.14";
4
+ exports.SDK_VERSION = "0.5.15";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "agentmail",
9
- "X-Fern-SDK-Version": "0.5.14",
10
- "User-Agent": "agentmail/0.5.14",
9
+ "X-Fern-SDK-Version": "0.5.15",
10
+ "User-Agent": "agentmail/0.5.15",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,4 +1,19 @@
1
1
  import type * as AgentMail from "../../../index.mjs";
2
+ /**
3
+ * Body for creating a draft. Supports plain, reply, reply-all, and forward
4
+ * drafts:
5
+ *
6
+ * - **Plain draft:** supply `to`, `subject`, `text`, etc.
7
+ * - **Reply:** set `in_reply_to` to a message ID. Recipients, subject, and
8
+ * threading are derived from that message. Set `reply_all` to address the
9
+ * whole thread (you then cannot also pass `to`, `cc`, or `bcc`).
10
+ * - **Forward:** set `forward_of` to a message ID. The subject and threading
11
+ * are derived from the source message, whose body and attachments are
12
+ * merged in at send time.
13
+ *
14
+ * `in_reply_to` and `forward_of` are mutually exclusive, and reading the
15
+ * referenced message requires `message_read` permission.
16
+ */
2
17
  export interface CreateDraftRequest {
3
18
  labels?: AgentMail.DraftLabels;
4
19
  replyTo?: AgentMail.DraftReplyTo;
@@ -11,6 +26,8 @@ export interface CreateDraftRequest {
11
26
  /** Attachments to include in draft. */
12
27
  attachments?: AgentMail.SendAttachment[];
13
28
  inReplyTo?: AgentMail.DraftInReplyTo;
29
+ forwardOf?: AgentMail.DraftForwardOf;
30
+ replyAll?: AgentMail.DraftReplyAll;
14
31
  sendAt?: AgentMail.DraftSendAt;
15
32
  clientId?: AgentMail.DraftClientId;
16
33
  }
@@ -1,11 +1,25 @@
1
1
  import type * as AgentMail from "../../../index.mjs";
2
+ /**
3
+ * Edit fields on an existing draft. A draft's kind (plain, reply, or forward)
4
+ * is fixed at creation and cannot be changed here. Omitting a field leaves it
5
+ * unchanged; passing `null` (or `[]` for a recipient field) clears it. Pass
6
+ * `send_at` to schedule or reschedule the draft, or `null` to un-schedule it.
7
+ */
2
8
  export interface UpdateDraftRequest {
3
- replyTo?: AgentMail.DraftReplyTo;
4
- to?: AgentMail.DraftTo;
5
- cc?: AgentMail.DraftCc;
6
- bcc?: AgentMail.DraftBcc;
7
- subject?: AgentMail.DraftSubject;
8
- text?: AgentMail.DraftText;
9
- html?: AgentMail.DraftHtml;
10
- sendAt?: AgentMail.DraftSendAt;
9
+ replyTo?: AgentMail.DraftReplyTo | null;
10
+ to?: AgentMail.DraftTo | null;
11
+ cc?: AgentMail.DraftCc | null;
12
+ bcc?: AgentMail.DraftBcc | null;
13
+ subject?: AgentMail.DraftSubject | null;
14
+ text?: AgentMail.DraftText | null;
15
+ html?: AgentMail.DraftHtml | null;
16
+ /** Attachments to add to the draft. */
17
+ addAttachments?: AgentMail.SendAttachment[];
18
+ /** IDs of attachments to remove from the draft. */
19
+ removeAttachments?: AgentMail.AttachmentId[];
20
+ /** Label or labels to add to the draft. */
21
+ addLabels?: AgentMail.DraftLabels;
22
+ /** Label or labels to remove from the draft. */
23
+ removeLabels?: AgentMail.DraftLabels;
24
+ sendAt?: AgentMail.DraftSendAt | null;
11
25
  }
@@ -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";
@@ -65,6 +65,12 @@ export declare class DraftsClient {
65
65
  getAttachment(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, attachment_id: AgentMail.AttachmentId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
66
66
  private __getAttachment;
67
67
  /**
68
+ * Create a draft. Supply `in_reply_to` to create a reply draft (with
69
+ * `reply_all` to address the whole thread), whose recipients, subject, and
70
+ * threading are derived from the referenced message, or `forward_of` to
71
+ * create a forward draft, which derives the subject, threading, and
72
+ * forwarded content from the source but keeps recipients caller-supplied.
73
+ *
68
74
  * **CLI:**
69
75
  * ```bash
70
76
  * agentmail inboxes:drafts create --inbox-id <inbox_id> --to recipient@example.com --subject "Draft subject" --text "Draft body"
@@ -74,6 +80,7 @@ export declare class DraftsClient {
74
80
  * @param {AgentMail.CreateDraftRequest} request
75
81
  * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
76
82
  *
83
+ * @throws {@link AgentMail.ValidationError}
77
84
  * @throws {@link AgentMail.NotFoundError}
78
85
  *
79
86
  * @example
@@ -82,6 +89,10 @@ export declare class DraftsClient {
82
89
  create(inbox_id: AgentMail.inboxes.InboxId, request: AgentMail.CreateDraftRequest, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
83
90
  private __create;
84
91
  /**
92
+ * Edit fields on an existing draft. Passing `null` clears a field (or `[]`
93
+ * for a recipient field); `send_at: null` un-schedules a scheduled draft.
94
+ * A draft that is already being sent cannot be edited.
95
+ *
85
96
  * **CLI:**
86
97
  * ```bash
87
98
  * agentmail inboxes:drafts update --inbox-id <inbox_id> --draft-id <draft_id> --subject "Updated subject"
@@ -92,7 +103,9 @@ export declare class DraftsClient {
92
103
  * @param {AgentMail.UpdateDraftRequest} request
93
104
  * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
94
105
  *
106
+ * @throws {@link AgentMail.ValidationError}
95
107
  * @throws {@link AgentMail.NotFoundError}
108
+ * @throws {@link AgentMail.ConflictError}
96
109
  *
97
110
  * @example
98
111
  * await client.inboxes.drafts.update("inbox_id", "draft_id", {})
@@ -245,6 +245,12 @@ export class DraftsClient {
245
245
  });
246
246
  }
247
247
  /**
248
+ * Create a draft. Supply `in_reply_to` to create a reply draft (with
249
+ * `reply_all` to address the whole thread), whose recipients, subject, and
250
+ * threading are derived from the referenced message, or `forward_of` to
251
+ * create a forward draft, which derives the subject, threading, and
252
+ * forwarded content from the source but keeps recipients caller-supplied.
253
+ *
248
254
  * **CLI:**
249
255
  * ```bash
250
256
  * agentmail inboxes:drafts create --inbox-id <inbox_id> --to recipient@example.com --subject "Draft subject" --text "Draft body"
@@ -254,6 +260,7 @@ export class DraftsClient {
254
260
  * @param {AgentMail.CreateDraftRequest} request
255
261
  * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
256
262
  *
263
+ * @throws {@link AgentMail.ValidationError}
257
264
  * @throws {@link AgentMail.NotFoundError}
258
265
  *
259
266
  * @example
@@ -299,6 +306,14 @@ export class DraftsClient {
299
306
  }
300
307
  if (_response.error.reason === "status-code") {
301
308
  switch (_response.error.statusCode) {
309
+ case 400:
310
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
311
+ unrecognizedObjectKeys: "passthrough",
312
+ allowUnrecognizedUnionMembers: true,
313
+ allowUnrecognizedEnumValues: true,
314
+ skipValidation: true,
315
+ breadcrumbsPrefix: ["response"],
316
+ }), _response.rawResponse);
302
317
  case 404:
303
318
  throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
304
319
  unrecognizedObjectKeys: "passthrough",
@@ -319,6 +334,10 @@ export class DraftsClient {
319
334
  });
320
335
  }
321
336
  /**
337
+ * Edit fields on an existing draft. Passing `null` clears a field (or `[]`
338
+ * for a recipient field); `send_at: null` un-schedules a scheduled draft.
339
+ * A draft that is already being sent cannot be edited.
340
+ *
322
341
  * **CLI:**
323
342
  * ```bash
324
343
  * agentmail inboxes:drafts update --inbox-id <inbox_id> --draft-id <draft_id> --subject "Updated subject"
@@ -329,7 +348,9 @@ export class DraftsClient {
329
348
  * @param {AgentMail.UpdateDraftRequest} request
330
349
  * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
331
350
  *
351
+ * @throws {@link AgentMail.ValidationError}
332
352
  * @throws {@link AgentMail.NotFoundError}
353
+ * @throws {@link AgentMail.ConflictError}
333
354
  *
334
355
  * @example
335
356
  * await client.inboxes.drafts.update("inbox_id", "draft_id", {})
@@ -374,6 +395,14 @@ export class DraftsClient {
374
395
  }
375
396
  if (_response.error.reason === "status-code") {
376
397
  switch (_response.error.statusCode) {
398
+ case 400:
399
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
400
+ unrecognizedObjectKeys: "passthrough",
401
+ allowUnrecognizedUnionMembers: true,
402
+ allowUnrecognizedEnumValues: true,
403
+ skipValidation: true,
404
+ breadcrumbsPrefix: ["response"],
405
+ }), _response.rawResponse);
377
406
  case 404:
378
407
  throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
379
408
  unrecognizedObjectKeys: "passthrough",
@@ -382,6 +411,14 @@ export class DraftsClient {
382
411
  skipValidation: true,
383
412
  breadcrumbsPrefix: ["response"],
384
413
  }), _response.rawResponse);
414
+ case 409:
415
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
416
+ unrecognizedObjectKeys: "passthrough",
417
+ allowUnrecognizedUnionMembers: true,
418
+ allowUnrecognizedEnumValues: true,
419
+ skipValidation: true,
420
+ breadcrumbsPrefix: ["response"],
421
+ }), _response.rawResponse);
385
422
  default:
386
423
  throw new errors.AgentMailError({
387
424
  statusCode: _response.error.statusCode,