agentmail 0.5.13 → 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 (107) hide show
  1. package/dist/cjs/BaseClient.d.ts +3 -0
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/api/errors/ConflictError.d.ts +6 -0
  4. package/dist/cjs/{serialization/resources/drafts/types/CreateDraftReplyAllRequest.js → api/errors/ConflictError.js} +18 -20
  5. package/dist/cjs/api/errors/index.d.ts +1 -0
  6. package/dist/cjs/api/errors/index.js +1 -0
  7. package/dist/cjs/api/resources/drafts/types/CreateDraftRequest.d.ts +17 -0
  8. package/dist/cjs/api/resources/drafts/types/UpdateDraftRequest.d.ts +22 -8
  9. package/dist/cjs/api/resources/drafts/types/index.d.ts +0 -3
  10. package/dist/cjs/api/resources/drafts/types/index.js +0 -3
  11. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +19 -3
  12. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +48 -2
  13. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +15 -78
  14. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +41 -269
  15. package/dist/cjs/api/types/ErrorCode.d.ts +4 -0
  16. package/dist/cjs/api/types/ErrorDocs.d.ts +4 -0
  17. package/dist/cjs/api/types/ErrorFix.d.ts +4 -0
  18. package/dist/cjs/api/types/ErrorResponse.d.ts +3 -0
  19. package/dist/cjs/api/types/ValidationErrorResponse.d.ts +5 -1
  20. package/dist/cjs/api/types/index.d.ts +3 -0
  21. package/dist/cjs/api/types/index.js +3 -0
  22. package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.d.ts +4 -0
  23. package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.js +4 -0
  24. package/dist/cjs/serialization/resources/drafts/types/UpdateDraftRequest.d.ts +15 -8
  25. package/dist/cjs/serialization/resources/drafts/types/UpdateDraftRequest.js +15 -8
  26. package/dist/cjs/serialization/resources/drafts/types/index.d.ts +0 -3
  27. package/dist/cjs/serialization/resources/drafts/types/index.js +0 -3
  28. package/dist/cjs/serialization/types/ErrorCode.d.ts +7 -0
  29. package/dist/cjs/serialization/{resources/drafts/types/CreateDraftForwardRequest.js → types/ErrorCode.js} +3 -26
  30. package/dist/cjs/serialization/types/ErrorDocs.d.ts +7 -0
  31. package/dist/cjs/serialization/types/ErrorDocs.js +39 -0
  32. package/dist/cjs/serialization/types/ErrorFix.d.ts +7 -0
  33. package/dist/cjs/serialization/types/ErrorFix.js +39 -0
  34. package/dist/cjs/serialization/types/ErrorResponse.d.ts +6 -0
  35. package/dist/cjs/serialization/types/ErrorResponse.js +6 -0
  36. package/dist/cjs/serialization/types/ValidationErrorResponse.d.ts +8 -0
  37. package/dist/cjs/serialization/types/ValidationErrorResponse.js +8 -0
  38. package/dist/cjs/serialization/types/index.d.ts +3 -0
  39. package/dist/cjs/serialization/types/index.js +3 -0
  40. package/dist/cjs/version.d.ts +1 -1
  41. package/dist/cjs/version.js +1 -1
  42. package/dist/esm/BaseClient.d.mts +3 -0
  43. package/dist/esm/BaseClient.mjs +2 -2
  44. package/dist/esm/api/errors/ConflictError.d.mts +6 -0
  45. package/dist/esm/api/errors/ConflictError.mjs +17 -0
  46. package/dist/esm/api/errors/index.d.mts +1 -0
  47. package/dist/esm/api/errors/index.mjs +1 -0
  48. package/dist/esm/api/resources/drafts/types/CreateDraftRequest.d.mts +17 -0
  49. package/dist/esm/api/resources/drafts/types/UpdateDraftRequest.d.mts +22 -8
  50. package/dist/esm/api/resources/drafts/types/index.d.mts +0 -3
  51. package/dist/esm/api/resources/drafts/types/index.mjs +0 -3
  52. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +19 -3
  53. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +49 -3
  54. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +15 -78
  55. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +42 -270
  56. package/dist/esm/api/types/ErrorCode.d.mts +4 -0
  57. package/dist/esm/api/types/ErrorDocs.d.mts +4 -0
  58. package/dist/esm/api/types/ErrorFix.d.mts +4 -0
  59. package/dist/esm/api/types/ErrorResponse.d.mts +3 -0
  60. package/dist/esm/api/types/ValidationErrorResponse.d.mts +5 -1
  61. package/dist/esm/api/types/index.d.mts +3 -0
  62. package/dist/esm/api/types/index.mjs +3 -0
  63. package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.d.mts +4 -0
  64. package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.mjs +4 -0
  65. package/dist/esm/serialization/resources/drafts/types/UpdateDraftRequest.d.mts +15 -8
  66. package/dist/esm/serialization/resources/drafts/types/UpdateDraftRequest.mjs +15 -8
  67. package/dist/esm/serialization/resources/drafts/types/index.d.mts +0 -3
  68. package/dist/esm/serialization/resources/drafts/types/index.mjs +0 -3
  69. package/dist/esm/serialization/types/ErrorCode.d.mts +7 -0
  70. package/dist/esm/serialization/types/ErrorCode.mjs +3 -0
  71. package/dist/esm/serialization/types/ErrorDocs.d.mts +7 -0
  72. package/dist/esm/serialization/types/ErrorDocs.mjs +3 -0
  73. package/dist/esm/serialization/types/ErrorFix.d.mts +7 -0
  74. package/dist/esm/serialization/types/ErrorFix.mjs +3 -0
  75. package/dist/esm/serialization/types/ErrorResponse.d.mts +6 -0
  76. package/dist/esm/serialization/types/ErrorResponse.mjs +6 -0
  77. package/dist/esm/serialization/types/ValidationErrorResponse.d.mts +8 -0
  78. package/dist/esm/serialization/types/ValidationErrorResponse.mjs +8 -0
  79. package/dist/esm/serialization/types/index.d.mts +3 -0
  80. package/dist/esm/serialization/types/index.mjs +3 -0
  81. package/dist/esm/version.d.mts +1 -1
  82. package/dist/esm/version.mjs +1 -1
  83. package/dist/llms.txt +13 -0
  84. package/package.json +1 -1
  85. package/reference.md +15 -263
  86. package/dist/cjs/api/resources/drafts/types/CreateDraftForwardRequest.d.ts +0 -21
  87. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +0 -17
  88. package/dist/cjs/api/resources/drafts/types/CreateDraftReplyRequest.d.ts +0 -22
  89. package/dist/cjs/serialization/resources/drafts/types/CreateDraftForwardRequest.d.ts +0 -30
  90. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +0 -24
  91. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.d.ts +0 -32
  92. package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.js +0 -64
  93. package/dist/esm/api/resources/drafts/types/CreateDraftForwardRequest.d.mts +0 -21
  94. package/dist/esm/api/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +0 -17
  95. package/dist/esm/api/resources/drafts/types/CreateDraftReplyRequest.d.mts +0 -22
  96. package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.d.mts +0 -30
  97. package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.mjs +0 -26
  98. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +0 -24
  99. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.mjs +0 -20
  100. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.d.mts +0 -32
  101. package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.mjs +0 -28
  102. /package/dist/cjs/api/{resources/drafts/types/CreateDraftForwardRequest.js → types/ErrorCode.js} +0 -0
  103. /package/dist/cjs/api/{resources/drafts/types/CreateDraftReplyAllRequest.js → types/ErrorDocs.js} +0 -0
  104. /package/dist/cjs/api/{resources/drafts/types/CreateDraftReplyRequest.js → types/ErrorFix.js} +0 -0
  105. /package/dist/esm/api/{resources/drafts/types/CreateDraftForwardRequest.mjs → types/ErrorCode.mjs} +0 -0
  106. /package/dist/esm/api/{resources/drafts/types/CreateDraftReplyAllRequest.mjs → types/ErrorDocs.mjs} +0 -0
  107. /package/dist/esm/api/{resources/drafts/types/CreateDraftReplyRequest.mjs → types/ErrorFix.mjs} +0 -0
@@ -768,10 +768,11 @@ class MessagesClient {
768
768
  *
769
769
  * @param {AgentMail.inboxes.InboxId} inbox_id
770
770
  * @param {AgentMail.SendMessageRequest} request
771
- * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
771
+ * @param {MessagesClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
772
772
  *
773
773
  * @throws {@link AgentMail.ValidationError}
774
774
  * @throws {@link AgentMail.NotFoundError}
775
+ * @throws {@link AgentMail.ConflictError}
775
776
  * @throws {@link AgentMail.MessageRejectedError}
776
777
  *
777
778
  * @example
@@ -784,7 +785,7 @@ class MessagesClient {
784
785
  return __awaiter(this, void 0, void 0, function* () {
785
786
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
786
787
  const _authRequest = yield this._options.authProvider.getAuthRequest();
787
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
788
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
788
789
  const _response = yield core.fetcher({
789
790
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
790
791
  .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/send`),
@@ -833,6 +834,14 @@ class MessagesClient {
833
834
  skipValidation: true,
834
835
  breadcrumbsPrefix: ["response"],
835
836
  }), _response.rawResponse);
837
+ case 409:
838
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
839
+ unrecognizedObjectKeys: "passthrough",
840
+ allowUnrecognizedUnionMembers: true,
841
+ allowUnrecognizedEnumValues: true,
842
+ skipValidation: true,
843
+ breadcrumbsPrefix: ["response"],
844
+ }), _response.rawResponse);
836
845
  case 403:
837
846
  throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
838
847
  unrecognizedObjectKeys: "passthrough",
@@ -861,10 +870,11 @@ class MessagesClient {
861
870
  * @param {AgentMail.inboxes.InboxId} inbox_id
862
871
  * @param {AgentMail.MessageId} message_id
863
872
  * @param {AgentMail.ReplyToMessageRequest} request
864
- * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
873
+ * @param {MessagesClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
865
874
  *
866
875
  * @throws {@link AgentMail.ValidationError}
867
876
  * @throws {@link AgentMail.NotFoundError}
877
+ * @throws {@link AgentMail.ConflictError}
868
878
  * @throws {@link AgentMail.MessageRejectedError}
869
879
  *
870
880
  * @example
@@ -877,7 +887,7 @@ class MessagesClient {
877
887
  return __awaiter(this, void 0, void 0, function* () {
878
888
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
879
889
  const _authRequest = yield this._options.authProvider.getAuthRequest();
880
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
890
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
881
891
  const _response = yield core.fetcher({
882
892
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
883
893
  .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/reply`),
@@ -926,6 +936,14 @@ class MessagesClient {
926
936
  skipValidation: true,
927
937
  breadcrumbsPrefix: ["response"],
928
938
  }), _response.rawResponse);
939
+ case 409:
940
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
941
+ unrecognizedObjectKeys: "passthrough",
942
+ allowUnrecognizedUnionMembers: true,
943
+ allowUnrecognizedEnumValues: true,
944
+ skipValidation: true,
945
+ breadcrumbsPrefix: ["response"],
946
+ }), _response.rawResponse);
929
947
  case 403:
930
948
  throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
931
949
  unrecognizedObjectKeys: "passthrough",
@@ -954,10 +972,11 @@ class MessagesClient {
954
972
  * @param {AgentMail.inboxes.InboxId} inbox_id
955
973
  * @param {AgentMail.MessageId} message_id
956
974
  * @param {AgentMail.ReplyAllMessageRequest} request
957
- * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
975
+ * @param {MessagesClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
958
976
  *
959
977
  * @throws {@link AgentMail.ValidationError}
960
978
  * @throws {@link AgentMail.NotFoundError}
979
+ * @throws {@link AgentMail.ConflictError}
961
980
  * @throws {@link AgentMail.MessageRejectedError}
962
981
  *
963
982
  * @example
@@ -970,7 +989,7 @@ class MessagesClient {
970
989
  return __awaiter(this, void 0, void 0, function* () {
971
990
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
972
991
  const _authRequest = yield this._options.authProvider.getAuthRequest();
973
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
992
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
974
993
  const _response = yield core.fetcher({
975
994
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
976
995
  .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/reply-all`),
@@ -1019,6 +1038,14 @@ class MessagesClient {
1019
1038
  skipValidation: true,
1020
1039
  breadcrumbsPrefix: ["response"],
1021
1040
  }), _response.rawResponse);
1041
+ case 409:
1042
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
1043
+ unrecognizedObjectKeys: "passthrough",
1044
+ allowUnrecognizedUnionMembers: true,
1045
+ allowUnrecognizedEnumValues: true,
1046
+ skipValidation: true,
1047
+ breadcrumbsPrefix: ["response"],
1048
+ }), _response.rawResponse);
1022
1049
  case 403:
1023
1050
  throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
1024
1051
  unrecognizedObjectKeys: "passthrough",
@@ -1047,10 +1074,11 @@ class MessagesClient {
1047
1074
  * @param {AgentMail.inboxes.InboxId} inbox_id
1048
1075
  * @param {AgentMail.MessageId} message_id
1049
1076
  * @param {AgentMail.SendMessageRequest} request
1050
- * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
1077
+ * @param {MessagesClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
1051
1078
  *
1052
1079
  * @throws {@link AgentMail.ValidationError}
1053
1080
  * @throws {@link AgentMail.NotFoundError}
1081
+ * @throws {@link AgentMail.ConflictError}
1054
1082
  * @throws {@link AgentMail.MessageRejectedError}
1055
1083
  *
1056
1084
  * @example
@@ -1063,7 +1091,7 @@ class MessagesClient {
1063
1091
  return __awaiter(this, void 0, void 0, function* () {
1064
1092
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1065
1093
  const _authRequest = yield this._options.authProvider.getAuthRequest();
1066
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1094
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1067
1095
  const _response = yield core.fetcher({
1068
1096
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
1069
1097
  .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/forward`),
@@ -1112,272 +1140,16 @@ class MessagesClient {
1112
1140
  skipValidation: true,
1113
1141
  breadcrumbsPrefix: ["response"],
1114
1142
  }), _response.rawResponse);
1115
- case 403:
1116
- throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
1117
- unrecognizedObjectKeys: "passthrough",
1118
- allowUnrecognizedUnionMembers: true,
1119
- allowUnrecognizedEnumValues: true,
1120
- skipValidation: true,
1121
- breadcrumbsPrefix: ["response"],
1122
- }), _response.rawResponse);
1123
- default:
1124
- throw new errors.AgentMailError({
1125
- statusCode: _response.error.statusCode,
1126
- body: _response.error.body,
1127
- rawResponse: _response.rawResponse,
1128
- });
1129
- }
1130
- }
1131
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/forward");
1132
- });
1133
- }
1134
- /**
1135
- * Create a draft that replies to a message instead of sending it. The
1136
- * recipients, subject, and threading are derived from the source message.
1137
- * Send it later with `Send Draft`.
1138
- *
1139
- * **CLI:**
1140
- * ```bash
1141
- * agentmail inboxes:messages draft-reply --inbox-id <inbox_id> --message-id <message_id> --text "Reply text"
1142
- * ```
1143
- *
1144
- * @param {AgentMail.inboxes.InboxId} inbox_id
1145
- * @param {AgentMail.MessageId} message_id
1146
- * @param {AgentMail.CreateDraftReplyRequest} request
1147
- * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
1148
- *
1149
- * @throws {@link AgentMail.ValidationError}
1150
- * @throws {@link AgentMail.NotFoundError}
1151
- *
1152
- * @example
1153
- * await client.inboxes.messages.draftReply("inbox_id", "message_id", {})
1154
- */
1155
- draftReply(inbox_id, message_id, request, requestOptions) {
1156
- return core.HttpResponsePromise.fromPromise(this.__draftReply(inbox_id, message_id, request, requestOptions));
1157
- }
1158
- __draftReply(inbox_id, message_id, request, requestOptions) {
1159
- return __awaiter(this, void 0, void 0, function* () {
1160
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1161
- const _authRequest = yield this._options.authProvider.getAuthRequest();
1162
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1163
- const _response = yield core.fetcher({
1164
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
1165
- .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/draft-reply`),
1166
- method: "POST",
1167
- headers: _headers,
1168
- contentType: "application/json",
1169
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1170
- requestType: "json",
1171
- body: serializers.CreateDraftReplyRequest.jsonOrThrow(request, {
1172
- unrecognizedObjectKeys: "strip",
1173
- omitUndefined: true,
1174
- }),
1175
- 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,
1176
- 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,
1177
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1178
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
1179
- logging: this._options.logging,
1180
- });
1181
- if (_response.ok) {
1182
- return {
1183
- data: serializers.Draft.parseOrThrow(_response.body, {
1184
- unrecognizedObjectKeys: "passthrough",
1185
- allowUnrecognizedUnionMembers: true,
1186
- allowUnrecognizedEnumValues: true,
1187
- skipValidation: true,
1188
- breadcrumbsPrefix: ["response"],
1189
- }),
1190
- rawResponse: _response.rawResponse,
1191
- };
1192
- }
1193
- if (_response.error.reason === "status-code") {
1194
- switch (_response.error.statusCode) {
1195
- case 400:
1196
- throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
1197
- unrecognizedObjectKeys: "passthrough",
1198
- allowUnrecognizedUnionMembers: true,
1199
- allowUnrecognizedEnumValues: true,
1200
- skipValidation: true,
1201
- breadcrumbsPrefix: ["response"],
1202
- }), _response.rawResponse);
1203
- case 404:
1204
- throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
1143
+ case 409:
1144
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
1205
1145
  unrecognizedObjectKeys: "passthrough",
1206
1146
  allowUnrecognizedUnionMembers: true,
1207
1147
  allowUnrecognizedEnumValues: true,
1208
1148
  skipValidation: true,
1209
1149
  breadcrumbsPrefix: ["response"],
1210
1150
  }), _response.rawResponse);
1211
- default:
1212
- throw new errors.AgentMailError({
1213
- statusCode: _response.error.statusCode,
1214
- body: _response.error.body,
1215
- rawResponse: _response.rawResponse,
1216
- });
1217
- }
1218
- }
1219
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/draft-reply");
1220
- });
1221
- }
1222
- /**
1223
- * Create a draft that replies to every recipient of a message instead of
1224
- * sending it. Recipients, subject, and threading are derived from the
1225
- * source message. Send it later with `Send Draft`.
1226
- *
1227
- * **CLI:**
1228
- * ```bash
1229
- * agentmail inboxes:messages draft-reply-all --inbox-id <inbox_id> --message-id <message_id> --text "Reply text"
1230
- * ```
1231
- *
1232
- * @param {AgentMail.inboxes.InboxId} inbox_id
1233
- * @param {AgentMail.MessageId} message_id
1234
- * @param {AgentMail.CreateDraftReplyAllRequest} request
1235
- * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
1236
- *
1237
- * @throws {@link AgentMail.ValidationError}
1238
- * @throws {@link AgentMail.NotFoundError}
1239
- *
1240
- * @example
1241
- * await client.inboxes.messages.draftReplyAll("inbox_id", "message_id", {})
1242
- */
1243
- draftReplyAll(inbox_id, message_id, request, requestOptions) {
1244
- return core.HttpResponsePromise.fromPromise(this.__draftReplyAll(inbox_id, message_id, request, requestOptions));
1245
- }
1246
- __draftReplyAll(inbox_id, message_id, request, requestOptions) {
1247
- return __awaiter(this, void 0, void 0, function* () {
1248
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1249
- const _authRequest = yield this._options.authProvider.getAuthRequest();
1250
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1251
- const _response = yield core.fetcher({
1252
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
1253
- .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/draft-reply-all`),
1254
- method: "POST",
1255
- headers: _headers,
1256
- contentType: "application/json",
1257
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1258
- requestType: "json",
1259
- body: serializers.CreateDraftReplyAllRequest.jsonOrThrow(request, {
1260
- unrecognizedObjectKeys: "strip",
1261
- omitUndefined: true,
1262
- }),
1263
- 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,
1264
- 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,
1265
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1266
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
1267
- logging: this._options.logging,
1268
- });
1269
- if (_response.ok) {
1270
- return {
1271
- data: serializers.Draft.parseOrThrow(_response.body, {
1272
- unrecognizedObjectKeys: "passthrough",
1273
- allowUnrecognizedUnionMembers: true,
1274
- allowUnrecognizedEnumValues: true,
1275
- skipValidation: true,
1276
- breadcrumbsPrefix: ["response"],
1277
- }),
1278
- rawResponse: _response.rawResponse,
1279
- };
1280
- }
1281
- if (_response.error.reason === "status-code") {
1282
- switch (_response.error.statusCode) {
1283
- case 400:
1284
- throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
1285
- unrecognizedObjectKeys: "passthrough",
1286
- allowUnrecognizedUnionMembers: true,
1287
- allowUnrecognizedEnumValues: true,
1288
- skipValidation: true,
1289
- breadcrumbsPrefix: ["response"],
1290
- }), _response.rawResponse);
1291
- case 404:
1292
- throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
1293
- unrecognizedObjectKeys: "passthrough",
1294
- allowUnrecognizedUnionMembers: true,
1295
- allowUnrecognizedEnumValues: true,
1296
- skipValidation: true,
1297
- breadcrumbsPrefix: ["response"],
1298
- }), _response.rawResponse);
1299
- default:
1300
- throw new errors.AgentMailError({
1301
- statusCode: _response.error.statusCode,
1302
- body: _response.error.body,
1303
- rawResponse: _response.rawResponse,
1304
- });
1305
- }
1306
- }
1307
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/draft-reply-all");
1308
- });
1309
- }
1310
- /**
1311
- * Create a draft that forwards a message instead of sending it. The subject
1312
- * and threading are derived from the source message, whose body and
1313
- * attachments are merged in at send time. Send it later with `Send Draft`.
1314
- *
1315
- * **CLI:**
1316
- * ```bash
1317
- * agentmail inboxes:messages draft-forward --inbox-id <inbox_id> --message-id <message_id> --to recipient@example.com
1318
- * ```
1319
- *
1320
- * @param {AgentMail.inboxes.InboxId} inbox_id
1321
- * @param {AgentMail.MessageId} message_id
1322
- * @param {AgentMail.CreateDraftForwardRequest} request
1323
- * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
1324
- *
1325
- * @throws {@link AgentMail.ValidationError}
1326
- * @throws {@link AgentMail.NotFoundError}
1327
- *
1328
- * @example
1329
- * await client.inboxes.messages.draftForward("inbox_id", "message_id", {})
1330
- */
1331
- draftForward(inbox_id, message_id, request, requestOptions) {
1332
- return core.HttpResponsePromise.fromPromise(this.__draftForward(inbox_id, message_id, request, requestOptions));
1333
- }
1334
- __draftForward(inbox_id, message_id, request, requestOptions) {
1335
- return __awaiter(this, void 0, void 0, function* () {
1336
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1337
- const _authRequest = yield this._options.authProvider.getAuthRequest();
1338
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1339
- const _response = yield core.fetcher({
1340
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
1341
- .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}/draft-forward`),
1342
- method: "POST",
1343
- headers: _headers,
1344
- contentType: "application/json",
1345
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1346
- requestType: "json",
1347
- body: serializers.CreateDraftForwardRequest.jsonOrThrow(request, {
1348
- unrecognizedObjectKeys: "strip",
1349
- omitUndefined: true,
1350
- }),
1351
- 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,
1352
- 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,
1353
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1354
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
1355
- logging: this._options.logging,
1356
- });
1357
- if (_response.ok) {
1358
- return {
1359
- data: serializers.Draft.parseOrThrow(_response.body, {
1360
- unrecognizedObjectKeys: "passthrough",
1361
- allowUnrecognizedUnionMembers: true,
1362
- allowUnrecognizedEnumValues: true,
1363
- skipValidation: true,
1364
- breadcrumbsPrefix: ["response"],
1365
- }),
1366
- rawResponse: _response.rawResponse,
1367
- };
1368
- }
1369
- if (_response.error.reason === "status-code") {
1370
- switch (_response.error.statusCode) {
1371
- case 400:
1372
- throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
1373
- unrecognizedObjectKeys: "passthrough",
1374
- allowUnrecognizedUnionMembers: true,
1375
- allowUnrecognizedEnumValues: true,
1376
- skipValidation: true,
1377
- breadcrumbsPrefix: ["response"],
1378
- }), _response.rawResponse);
1379
- case 404:
1380
- throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
1151
+ case 403:
1152
+ throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
1381
1153
  unrecognizedObjectKeys: "passthrough",
1382
1154
  allowUnrecognizedUnionMembers: true,
1383
1155
  allowUnrecognizedEnumValues: true,
@@ -1392,7 +1164,7 @@ class MessagesClient {
1392
1164
  });
1393
1165
  }
1394
1166
  }
1395
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/draft-forward");
1167
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/{message_id}/forward");
1396
1168
  });
1397
1169
  }
1398
1170
  }
@@ -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.js";
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.js";
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.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);
@@ -5,9 +5,11 @@ import { SendAttachment } from "../../attachments/types/SendAttachment.js";
5
5
  import { DraftBcc } from "./DraftBcc.js";
6
6
  import { DraftCc } from "./DraftCc.js";
7
7
  import { DraftClientId } from "./DraftClientId.js";
8
+ import { DraftForwardOf } from "./DraftForwardOf.js";
8
9
  import { DraftHtml } from "./DraftHtml.js";
9
10
  import { DraftInReplyTo } from "./DraftInReplyTo.js";
10
11
  import { DraftLabels } from "./DraftLabels.js";
12
+ import { DraftReplyAll } from "./DraftReplyAll.js";
11
13
  import { DraftReplyTo } from "./DraftReplyTo.js";
12
14
  import { DraftSendAt } from "./DraftSendAt.js";
13
15
  import { DraftSubject } from "./DraftSubject.js";
@@ -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
  }
@@ -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
+ }