agentmail 0.5.9 → 0.5.11

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 (104) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/domains/client/Client.d.ts +1 -2
  3. package/dist/cjs/api/resources/domains/client/Client.js +1 -2
  4. package/dist/cjs/api/resources/domains/types/CreateDomainRequest.d.ts +2 -1
  5. package/dist/cjs/api/resources/domains/types/Domain.d.ts +5 -1
  6. package/dist/cjs/api/resources/domains/types/DomainItem.d.ts +1 -0
  7. package/dist/cjs/api/resources/domains/types/SubdomainsEnabled.d.ts +5 -0
  8. package/dist/cjs/api/resources/domains/types/SubdomainsEnabled.js +3 -0
  9. package/dist/cjs/api/resources/domains/types/UpdateDomainRequest.d.ts +7 -0
  10. package/dist/cjs/api/resources/domains/types/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/domains/types/index.js +1 -0
  12. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +1 -0
  13. package/dist/cjs/api/resources/inboxes/client/Client.js +9 -0
  14. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +26 -0
  15. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +83 -0
  16. package/dist/cjs/api/resources/inboxes/types/CreateInboxRequest.d.ts +5 -1
  17. package/dist/cjs/api/resources/messages/types/BatchUpdateMessagesMessageIds.d.ts +8 -0
  18. package/dist/cjs/api/resources/messages/types/BatchUpdateMessagesMessageIds.js +3 -0
  19. package/dist/cjs/api/resources/messages/types/BatchUpdateMessagesRequest.d.ts +8 -0
  20. package/dist/cjs/api/resources/messages/types/BatchUpdateMessagesRequest.js +3 -0
  21. package/dist/cjs/api/resources/messages/types/BatchUpdateMessagesResponse.d.ts +11 -0
  22. package/dist/cjs/api/resources/messages/types/BatchUpdateMessagesResponse.js +3 -0
  23. package/dist/cjs/api/resources/messages/types/index.d.ts +3 -0
  24. package/dist/cjs/api/resources/messages/types/index.js +3 -0
  25. package/dist/cjs/api/resources/pods/resources/domains/client/Client.d.ts +1 -2
  26. package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +1 -2
  27. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.d.ts +1 -0
  28. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +9 -0
  29. package/dist/cjs/serialization/resources/domains/types/CreateDomainRequest.d.ts +3 -1
  30. package/dist/cjs/serialization/resources/domains/types/CreateDomainRequest.js +3 -1
  31. package/dist/cjs/serialization/resources/domains/types/Domain.d.ts +2 -0
  32. package/dist/cjs/serialization/resources/domains/types/Domain.js +2 -0
  33. package/dist/cjs/serialization/resources/domains/types/DomainItem.d.ts +2 -0
  34. package/dist/cjs/serialization/resources/domains/types/DomainItem.js +2 -0
  35. package/dist/cjs/serialization/resources/domains/types/SubdomainsEnabled.d.ts +7 -0
  36. package/dist/cjs/serialization/resources/domains/types/SubdomainsEnabled.js +39 -0
  37. package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.d.ts +2 -0
  38. package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.js +2 -0
  39. package/dist/cjs/serialization/resources/domains/types/index.d.ts +1 -0
  40. package/dist/cjs/serialization/resources/domains/types/index.js +1 -0
  41. package/dist/cjs/serialization/resources/messages/types/BatchUpdateMessagesMessageIds.d.ts +8 -0
  42. package/dist/cjs/serialization/resources/messages/types/BatchUpdateMessagesMessageIds.js +40 -0
  43. package/dist/cjs/serialization/resources/messages/types/BatchUpdateMessagesRequest.d.ts +13 -0
  44. package/dist/cjs/serialization/resources/messages/types/BatchUpdateMessagesRequest.js +45 -0
  45. package/dist/cjs/serialization/resources/messages/types/BatchUpdateMessagesResponse.d.ts +14 -0
  46. package/dist/cjs/serialization/resources/messages/types/BatchUpdateMessagesResponse.js +46 -0
  47. package/dist/cjs/serialization/resources/messages/types/index.d.ts +3 -0
  48. package/dist/cjs/serialization/resources/messages/types/index.js +3 -0
  49. package/dist/cjs/version.d.ts +1 -1
  50. package/dist/cjs/version.js +1 -1
  51. package/dist/esm/BaseClient.mjs +2 -2
  52. package/dist/esm/api/resources/domains/client/Client.d.mts +1 -2
  53. package/dist/esm/api/resources/domains/client/Client.mjs +1 -2
  54. package/dist/esm/api/resources/domains/types/CreateDomainRequest.d.mts +2 -1
  55. package/dist/esm/api/resources/domains/types/Domain.d.mts +5 -1
  56. package/dist/esm/api/resources/domains/types/DomainItem.d.mts +1 -0
  57. package/dist/esm/api/resources/domains/types/SubdomainsEnabled.d.mts +5 -0
  58. package/dist/esm/api/resources/domains/types/SubdomainsEnabled.mjs +2 -0
  59. package/dist/esm/api/resources/domains/types/UpdateDomainRequest.d.mts +7 -0
  60. package/dist/esm/api/resources/domains/types/index.d.mts +1 -0
  61. package/dist/esm/api/resources/domains/types/index.mjs +1 -0
  62. package/dist/esm/api/resources/inboxes/client/Client.d.mts +1 -0
  63. package/dist/esm/api/resources/inboxes/client/Client.mjs +9 -0
  64. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +26 -0
  65. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +83 -0
  66. package/dist/esm/api/resources/inboxes/types/CreateInboxRequest.d.mts +5 -1
  67. package/dist/esm/api/resources/messages/types/BatchUpdateMessagesMessageIds.d.mts +8 -0
  68. package/dist/esm/api/resources/messages/types/BatchUpdateMessagesMessageIds.mjs +2 -0
  69. package/dist/esm/api/resources/messages/types/BatchUpdateMessagesRequest.d.mts +8 -0
  70. package/dist/esm/api/resources/messages/types/BatchUpdateMessagesRequest.mjs +2 -0
  71. package/dist/esm/api/resources/messages/types/BatchUpdateMessagesResponse.d.mts +11 -0
  72. package/dist/esm/api/resources/messages/types/BatchUpdateMessagesResponse.mjs +2 -0
  73. package/dist/esm/api/resources/messages/types/index.d.mts +3 -0
  74. package/dist/esm/api/resources/messages/types/index.mjs +3 -0
  75. package/dist/esm/api/resources/pods/resources/domains/client/Client.d.mts +1 -2
  76. package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +1 -2
  77. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.d.mts +1 -0
  78. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +9 -0
  79. package/dist/esm/serialization/resources/domains/types/CreateDomainRequest.d.mts +3 -1
  80. package/dist/esm/serialization/resources/domains/types/CreateDomainRequest.mjs +3 -1
  81. package/dist/esm/serialization/resources/domains/types/Domain.d.mts +2 -0
  82. package/dist/esm/serialization/resources/domains/types/Domain.mjs +2 -0
  83. package/dist/esm/serialization/resources/domains/types/DomainItem.d.mts +2 -0
  84. package/dist/esm/serialization/resources/domains/types/DomainItem.mjs +2 -0
  85. package/dist/esm/serialization/resources/domains/types/SubdomainsEnabled.d.mts +7 -0
  86. package/dist/esm/serialization/resources/domains/types/SubdomainsEnabled.mjs +3 -0
  87. package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.d.mts +2 -0
  88. package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.mjs +2 -0
  89. package/dist/esm/serialization/resources/domains/types/index.d.mts +1 -0
  90. package/dist/esm/serialization/resources/domains/types/index.mjs +1 -0
  91. package/dist/esm/serialization/resources/messages/types/BatchUpdateMessagesMessageIds.d.mts +8 -0
  92. package/dist/esm/serialization/resources/messages/types/BatchUpdateMessagesMessageIds.mjs +4 -0
  93. package/dist/esm/serialization/resources/messages/types/BatchUpdateMessagesRequest.d.mts +13 -0
  94. package/dist/esm/serialization/resources/messages/types/BatchUpdateMessagesRequest.mjs +9 -0
  95. package/dist/esm/serialization/resources/messages/types/BatchUpdateMessagesResponse.d.mts +14 -0
  96. package/dist/esm/serialization/resources/messages/types/BatchUpdateMessagesResponse.mjs +10 -0
  97. package/dist/esm/serialization/resources/messages/types/index.d.mts +3 -0
  98. package/dist/esm/serialization/resources/messages/types/index.mjs +3 -0
  99. package/dist/esm/version.d.mts +1 -1
  100. package/dist/esm/version.mjs +1 -1
  101. package/dist/llms-full.txt +1 -49636
  102. package/dist/llms.txt +5 -1
  103. package/package.json +1 -1
  104. package/reference.md +85 -4
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "agentmail",
46
- "X-Fern-SDK-Version": "0.5.9",
47
- "User-Agent": "agentmail/0.5.9",
46
+ "X-Fern-SDK-Version": "0.5.11",
47
+ "User-Agent": "agentmail/0.5.11",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -63,8 +63,7 @@ export declare class DomainsClient {
63
63
  *
64
64
  * @example
65
65
  * await client.domains.create({
66
- * domain: "domain",
67
- * feedbackEnabled: true
66
+ * domain: "domain"
68
67
  * })
69
68
  */
70
69
  create(request: AgentMail.CreateDomainRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
@@ -249,8 +249,7 @@ class DomainsClient {
249
249
  *
250
250
  * @example
251
251
  * await client.domains.create({
252
- * domain: "domain",
253
- * feedbackEnabled: true
252
+ * domain: "domain"
254
253
  * })
255
254
  */
256
255
  create(request, requestOptions) {
@@ -1,5 +1,6 @@
1
1
  import type * as AgentMail from "../../../index.js";
2
2
  export interface CreateDomainRequest {
3
3
  domain: AgentMail.DomainName;
4
- feedbackEnabled: AgentMail.FeedbackEnabled;
4
+ feedbackEnabled?: AgentMail.FeedbackEnabled;
5
+ subdomainsEnabled?: AgentMail.SubdomainsEnabled;
5
6
  }
@@ -5,7 +5,11 @@ export interface Domain {
5
5
  domain: AgentMail.DomainName;
6
6
  status: AgentMail.Status;
7
7
  feedbackEnabled: AgentMail.FeedbackEnabled;
8
- /** A list of DNS records required to verify the domain. */
8
+ subdomainsEnabled: AgentMail.SubdomainsEnabled;
9
+ /**
10
+ * A list of DNS records required to verify the domain. Includes a
11
+ * wildcard MX record (`*.<domain>`) when `subdomains_enabled` is true.
12
+ */
9
13
  records: AgentMail.VerificationRecord[];
10
14
  clientId?: AgentMail.ClientId;
11
15
  /** Time at which the domain was last updated. */
@@ -4,6 +4,7 @@ export interface DomainItem {
4
4
  domainId: AgentMail.DomainId;
5
5
  domain: AgentMail.DomainName;
6
6
  feedbackEnabled: AgentMail.FeedbackEnabled;
7
+ subdomainsEnabled: AgentMail.SubdomainsEnabled;
7
8
  clientId?: AgentMail.ClientId;
8
9
  /** Time at which the domain was last updated. */
9
10
  updatedAt: Date;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Allow inboxes on any subdomain of this domain. Adds a required wildcard MX
3
+ * record (`*.<domain>`) to `records`.
4
+ */
5
+ export type SubdomainsEnabled = boolean;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,11 @@
1
1
  import type * as AgentMail from "../../../index.js";
2
+ /**
3
+ * Provide at least one of `feedback_enabled` or `subdomains_enabled`. Omitted
4
+ * fields are left unchanged; an empty body is rejected. Enabling
5
+ * `subdomains_enabled` on a verified domain returns it to `PENDING` until the
6
+ * newly-required wildcard MX record (`*.<domain>`) is published and verified.
7
+ */
2
8
  export interface UpdateDomainRequest {
3
9
  feedbackEnabled?: AgentMail.FeedbackEnabled;
10
+ subdomainsEnabled?: AgentMail.SubdomainsEnabled;
4
11
  }
@@ -9,6 +9,7 @@ export * from "./ListDomainsResponse.js";
9
9
  export * from "./RecordStatus.js";
10
10
  export * from "./RecordType.js";
11
11
  export * from "./Status.js";
12
+ export * from "./SubdomainsEnabled.js";
12
13
  export * from "./UpdateDomainRequest.js";
13
14
  export * from "./VerificationRecord.js";
14
15
  export * from "./VerificationStatus.js";
@@ -25,6 +25,7 @@ __exportStar(require("./ListDomainsResponse.js"), exports);
25
25
  __exportStar(require("./RecordStatus.js"), exports);
26
26
  __exportStar(require("./RecordType.js"), exports);
27
27
  __exportStar(require("./Status.js"), exports);
28
+ __exportStar(require("./SubdomainsEnabled.js"), exports);
28
29
  __exportStar(require("./UpdateDomainRequest.js"), exports);
29
30
  __exportStar(require("./VerificationRecord.js"), exports);
30
31
  __exportStar(require("./VerificationStatus.js"), exports);
@@ -71,6 +71,7 @@ export declare class InboxesClient {
71
71
  * @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
72
72
  *
73
73
  * @throws {@link AgentMail.ValidationError}
74
+ * @throws {@link AgentMail.UnprocessableError}
74
75
  *
75
76
  * @example
76
77
  * await client.inboxes.create(undefined)
@@ -228,6 +228,7 @@ class InboxesClient {
228
228
  * @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
229
229
  *
230
230
  * @throws {@link AgentMail.ValidationError}
231
+ * @throws {@link AgentMail.UnprocessableError}
231
232
  *
232
233
  * @example
233
234
  * await client.inboxes.create(undefined)
@@ -280,6 +281,14 @@ class InboxesClient {
280
281
  skipValidation: true,
281
282
  breadcrumbsPrefix: ["response"],
282
283
  }), _response.rawResponse);
284
+ case 422:
285
+ throw new AgentMail.UnprocessableError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
286
+ unrecognizedObjectKeys: "passthrough",
287
+ allowUnrecognizedUnionMembers: true,
288
+ allowUnrecognizedEnumValues: true,
289
+ skipValidation: true,
290
+ breadcrumbsPrefix: ["response"],
291
+ }), _response.rawResponse);
283
292
  default:
284
293
  throw new errors.AgentMailError({
285
294
  statusCode: _response.error.statusCode,
@@ -93,6 +93,32 @@ export declare class MessagesClient {
93
93
  */
94
94
  batchGet(inbox_id: AgentMail.inboxes.InboxId, request: AgentMail.BatchGetMessagesRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.BatchGetMessagesResponse>;
95
95
  private __batchGet;
96
+ /**
97
+ * Apply one label change to up to 50 messages in a single request. The
98
+ * same add_labels and remove_labels apply to every message id, and at
99
+ * least one of them must be provided. The update is atomic: either all
100
+ * resolved messages are updated or none are. Missing or restricted ids
101
+ * are silently excluded; compare `count` against `limit` to detect
102
+ * exclusions.
103
+ *
104
+ * **CLI:**
105
+ * ```bash
106
+ * agentmail inboxes:messages batch-update --inbox-id <inbox_id> --message-id <id1> --message-id <id2> --add-label read --remove-label unread
107
+ * ```
108
+ *
109
+ * @param {AgentMail.inboxes.InboxId} inbox_id
110
+ * @param {AgentMail.BatchUpdateMessagesRequest} request
111
+ * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
112
+ *
113
+ * @throws {@link AgentMail.ValidationError}
114
+ *
115
+ * @example
116
+ * await client.inboxes.messages.batchUpdate("inbox_id", {
117
+ * messageIds: ["message_ids", "message_ids"]
118
+ * })
119
+ */
120
+ batchUpdate(inbox_id: AgentMail.inboxes.InboxId, request: AgentMail.BatchUpdateMessagesRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.BatchUpdateMessagesResponse>;
121
+ private __batchUpdate;
96
122
  /**
97
123
  * **CLI:**
98
124
  * ```bash
@@ -395,6 +395,89 @@ class MessagesClient {
395
395
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/batch-get");
396
396
  });
397
397
  }
398
+ /**
399
+ * Apply one label change to up to 50 messages in a single request. The
400
+ * same add_labels and remove_labels apply to every message id, and at
401
+ * least one of them must be provided. The update is atomic: either all
402
+ * resolved messages are updated or none are. Missing or restricted ids
403
+ * are silently excluded; compare `count` against `limit` to detect
404
+ * exclusions.
405
+ *
406
+ * **CLI:**
407
+ * ```bash
408
+ * agentmail inboxes:messages batch-update --inbox-id <inbox_id> --message-id <id1> --message-id <id2> --add-label read --remove-label unread
409
+ * ```
410
+ *
411
+ * @param {AgentMail.inboxes.InboxId} inbox_id
412
+ * @param {AgentMail.BatchUpdateMessagesRequest} request
413
+ * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
414
+ *
415
+ * @throws {@link AgentMail.ValidationError}
416
+ *
417
+ * @example
418
+ * await client.inboxes.messages.batchUpdate("inbox_id", {
419
+ * messageIds: ["message_ids", "message_ids"]
420
+ * })
421
+ */
422
+ batchUpdate(inbox_id, request, requestOptions) {
423
+ return core.HttpResponsePromise.fromPromise(this.__batchUpdate(inbox_id, request, requestOptions));
424
+ }
425
+ __batchUpdate(inbox_id, request, requestOptions) {
426
+ return __awaiter(this, void 0, void 0, function* () {
427
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
428
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
429
+ 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);
430
+ const _response = yield core.fetcher({
431
+ 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)
432
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/batch-update`),
433
+ method: "POST",
434
+ headers: _headers,
435
+ contentType: "application/json",
436
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
437
+ requestType: "json",
438
+ body: serializers.BatchUpdateMessagesRequest.jsonOrThrow(request, {
439
+ unrecognizedObjectKeys: "strip",
440
+ omitUndefined: true,
441
+ }),
442
+ 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,
443
+ 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,
444
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
445
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
446
+ logging: this._options.logging,
447
+ });
448
+ if (_response.ok) {
449
+ return {
450
+ data: serializers.BatchUpdateMessagesResponse.parseOrThrow(_response.body, {
451
+ unrecognizedObjectKeys: "passthrough",
452
+ allowUnrecognizedUnionMembers: true,
453
+ allowUnrecognizedEnumValues: true,
454
+ skipValidation: true,
455
+ breadcrumbsPrefix: ["response"],
456
+ }),
457
+ rawResponse: _response.rawResponse,
458
+ };
459
+ }
460
+ if (_response.error.reason === "status-code") {
461
+ switch (_response.error.statusCode) {
462
+ case 400:
463
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
464
+ unrecognizedObjectKeys: "passthrough",
465
+ allowUnrecognizedUnionMembers: true,
466
+ allowUnrecognizedEnumValues: true,
467
+ skipValidation: true,
468
+ breadcrumbsPrefix: ["response"],
469
+ }), _response.rawResponse);
470
+ default:
471
+ throw new errors.AgentMailError({
472
+ statusCode: _response.error.statusCode,
473
+ body: _response.error.body,
474
+ rawResponse: _response.rawResponse,
475
+ });
476
+ }
477
+ }
478
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/messages/batch-update");
479
+ });
480
+ }
398
481
  /**
399
482
  * **CLI:**
400
483
  * ```bash
@@ -2,7 +2,11 @@ import type * as AgentMail from "../../../index.js";
2
2
  export interface CreateInboxRequest {
3
3
  /** Username of address. Randomly generated if not specified. */
4
4
  username?: string;
5
- /** Domain of address. Must be verified domain. Defaults to `agentmail.to`. */
5
+ /**
6
+ * Domain of address. Must be a verified domain, or any subdomain of a
7
+ * verified domain that has subdomains enabled (e.g., `bot.example.com`).
8
+ * Defaults to `agentmail.to`.
9
+ */
6
10
  domain?: string;
7
11
  displayName?: AgentMail.inboxes.DisplayName;
8
12
  clientId?: AgentMail.inboxes.ClientId;
@@ -0,0 +1,8 @@
1
+ import type * as AgentMail from "../../../index.js";
2
+ /**
3
+ * IDs of messages to update. Maximum 50 ids per request. Duplicates are
4
+ * rejected with a validation error. IDs not found in the inbox (including
5
+ * cross-inbox or permission-restricted) are silently excluded from the
6
+ * update; callers detect exclusions by comparing `count` against `limit`.
7
+ */
8
+ export type BatchUpdateMessagesMessageIds = AgentMail.MessageId[];
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import type * as AgentMail from "../../../index.js";
2
+ export interface BatchUpdateMessagesRequest {
3
+ messageIds: AgentMail.BatchUpdateMessagesMessageIds;
4
+ /** Label or labels to add to every message. */
5
+ addLabels?: AgentMail.UpdateMessageLabels;
6
+ /** Label or labels to remove from every message. */
7
+ removeLabels?: AgentMail.UpdateMessageLabels;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import type * as AgentMail from "../../../index.js";
2
+ export interface BatchUpdateMessagesResponse {
3
+ limit: AgentMail.Limit;
4
+ count: AgentMail.Count;
5
+ /**
6
+ * Updated messages with their new labels. Order matches `message_ids`
7
+ * in the request. Excluded ids are omitted, so `count` may be less than
8
+ * `limit`.
9
+ */
10
+ updates: AgentMail.UpdateMessageResponse[];
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,6 +2,9 @@ export * from "./Addresses.js";
2
2
  export * from "./BatchGetMessagesMessageIds.js";
3
3
  export * from "./BatchGetMessagesRequest.js";
4
4
  export * from "./BatchGetMessagesResponse.js";
5
+ export * from "./BatchUpdateMessagesMessageIds.js";
6
+ export * from "./BatchUpdateMessagesRequest.js";
7
+ export * from "./BatchUpdateMessagesResponse.js";
5
8
  export * from "./ListMessagesResponse.js";
6
9
  export * from "./Message.js";
7
10
  export * from "./MessageAttachments.js";
@@ -18,6 +18,9 @@ __exportStar(require("./Addresses.js"), exports);
18
18
  __exportStar(require("./BatchGetMessagesMessageIds.js"), exports);
19
19
  __exportStar(require("./BatchGetMessagesRequest.js"), exports);
20
20
  __exportStar(require("./BatchGetMessagesResponse.js"), exports);
21
+ __exportStar(require("./BatchUpdateMessagesMessageIds.js"), exports);
22
+ __exportStar(require("./BatchUpdateMessagesRequest.js"), exports);
23
+ __exportStar(require("./BatchUpdateMessagesResponse.js"), exports);
21
24
  __exportStar(require("./ListMessagesResponse.js"), exports);
22
25
  __exportStar(require("./Message.js"), exports);
23
26
  __exportStar(require("./MessageAttachments.js"), exports);
@@ -68,8 +68,7 @@ export declare class DomainsClient {
68
68
  *
69
69
  * @example
70
70
  * await client.pods.domains.create("pod_id", {
71
- * domain: "domain",
72
- * feedbackEnabled: true
71
+ * domain: "domain"
73
72
  * })
74
73
  */
75
74
  create(pod_id: AgentMail.pods.PodId, request: AgentMail.CreateDomainRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
@@ -265,8 +265,7 @@ class DomainsClient {
265
265
  *
266
266
  * @example
267
267
  * await client.pods.domains.create("pod_id", {
268
- * domain: "domain",
269
- * feedbackEnabled: true
268
+ * domain: "domain"
270
269
  * })
271
270
  */
272
271
  create(pod_id, request, requestOptions) {
@@ -55,6 +55,7 @@ export declare class InboxesClient {
55
55
  * @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
56
56
  *
57
57
  * @throws {@link AgentMail.ValidationError}
58
+ * @throws {@link AgentMail.UnprocessableError}
58
59
  *
59
60
  * @example
60
61
  * await client.pods.inboxes.create("pod_id", {})
@@ -209,6 +209,7 @@ class InboxesClient {
209
209
  * @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
210
210
  *
211
211
  * @throws {@link AgentMail.ValidationError}
212
+ * @throws {@link AgentMail.UnprocessableError}
212
213
  *
213
214
  * @example
214
215
  * await client.pods.inboxes.create("pod_id", {})
@@ -261,6 +262,14 @@ class InboxesClient {
261
262
  skipValidation: true,
262
263
  breadcrumbsPrefix: ["response"],
263
264
  }), _response.rawResponse);
265
+ case 422:
266
+ throw new AgentMail.UnprocessableError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
267
+ unrecognizedObjectKeys: "passthrough",
268
+ allowUnrecognizedUnionMembers: true,
269
+ allowUnrecognizedEnumValues: true,
270
+ skipValidation: true,
271
+ breadcrumbsPrefix: ["response"],
272
+ }), _response.rawResponse);
264
273
  default:
265
274
  throw new errors.AgentMailError({
266
275
  statusCode: _response.error.statusCode,
@@ -3,10 +3,12 @@ import * as core from "../../../../core/index.js";
3
3
  import type * as serializers from "../../../index.js";
4
4
  import { DomainName } from "./DomainName.js";
5
5
  import { FeedbackEnabled } from "./FeedbackEnabled.js";
6
+ import { SubdomainsEnabled } from "./SubdomainsEnabled.js";
6
7
  export declare const CreateDomainRequest: core.serialization.ObjectSchema<serializers.CreateDomainRequest.Raw, AgentMail.CreateDomainRequest>;
7
8
  export declare namespace CreateDomainRequest {
8
9
  interface Raw {
9
10
  domain: DomainName.Raw;
10
- feedback_enabled: FeedbackEnabled.Raw;
11
+ feedback_enabled?: FeedbackEnabled.Raw | null;
12
+ subdomains_enabled?: SubdomainsEnabled.Raw | null;
11
13
  }
12
14
  }
@@ -38,7 +38,9 @@ exports.CreateDomainRequest = void 0;
38
38
  const core = __importStar(require("../../../../core/index.js"));
39
39
  const DomainName_js_1 = require("./DomainName.js");
40
40
  const FeedbackEnabled_js_1 = require("./FeedbackEnabled.js");
41
+ const SubdomainsEnabled_js_1 = require("./SubdomainsEnabled.js");
41
42
  exports.CreateDomainRequest = core.serialization.object({
42
43
  domain: DomainName_js_1.DomainName,
43
- feedbackEnabled: core.serialization.property("feedback_enabled", FeedbackEnabled_js_1.FeedbackEnabled),
44
+ feedbackEnabled: core.serialization.property("feedback_enabled", FeedbackEnabled_js_1.FeedbackEnabled.optional()),
45
+ subdomainsEnabled: core.serialization.property("subdomains_enabled", SubdomainsEnabled_js_1.SubdomainsEnabled.optional()),
44
46
  });
@@ -7,6 +7,7 @@ import { DomainId } from "./DomainId.js";
7
7
  import { DomainName } from "./DomainName.js";
8
8
  import { FeedbackEnabled } from "./FeedbackEnabled.js";
9
9
  import { Status } from "./Status.js";
10
+ import { SubdomainsEnabled } from "./SubdomainsEnabled.js";
10
11
  import { VerificationRecord } from "./VerificationRecord.js";
11
12
  export declare const Domain: core.serialization.ObjectSchema<serializers.Domain.Raw, AgentMail.Domain>;
12
13
  export declare namespace Domain {
@@ -16,6 +17,7 @@ export declare namespace Domain {
16
17
  domain: DomainName.Raw;
17
18
  status: Status.Raw;
18
19
  feedback_enabled: FeedbackEnabled.Raw;
20
+ subdomains_enabled: SubdomainsEnabled.Raw;
19
21
  records: VerificationRecord.Raw[];
20
22
  client_id?: ClientId.Raw | null;
21
23
  updated_at: string;
@@ -42,6 +42,7 @@ const DomainId_js_1 = require("./DomainId.js");
42
42
  const DomainName_js_1 = require("./DomainName.js");
43
43
  const FeedbackEnabled_js_1 = require("./FeedbackEnabled.js");
44
44
  const Status_js_1 = require("./Status.js");
45
+ const SubdomainsEnabled_js_1 = require("./SubdomainsEnabled.js");
45
46
  const VerificationRecord_js_1 = require("./VerificationRecord.js");
46
47
  exports.Domain = core.serialization.object({
47
48
  podId: core.serialization.property("pod_id", PodId_js_1.PodId.optional()),
@@ -49,6 +50,7 @@ exports.Domain = core.serialization.object({
49
50
  domain: DomainName_js_1.DomainName,
50
51
  status: Status_js_1.Status,
51
52
  feedbackEnabled: core.serialization.property("feedback_enabled", FeedbackEnabled_js_1.FeedbackEnabled),
53
+ subdomainsEnabled: core.serialization.property("subdomains_enabled", SubdomainsEnabled_js_1.SubdomainsEnabled),
52
54
  records: core.serialization.list(VerificationRecord_js_1.VerificationRecord),
53
55
  clientId: core.serialization.property("client_id", ClientId_js_1.ClientId.optional()),
54
56
  updatedAt: core.serialization.property("updated_at", core.serialization.date()),
@@ -6,6 +6,7 @@ import { ClientId } from "./ClientId.js";
6
6
  import { DomainId } from "./DomainId.js";
7
7
  import { DomainName } from "./DomainName.js";
8
8
  import { FeedbackEnabled } from "./FeedbackEnabled.js";
9
+ import { SubdomainsEnabled } from "./SubdomainsEnabled.js";
9
10
  export declare const DomainItem: core.serialization.ObjectSchema<serializers.DomainItem.Raw, AgentMail.DomainItem>;
10
11
  export declare namespace DomainItem {
11
12
  interface Raw {
@@ -13,6 +14,7 @@ export declare namespace DomainItem {
13
14
  domain_id: DomainId.Raw;
14
15
  domain: DomainName.Raw;
15
16
  feedback_enabled: FeedbackEnabled.Raw;
17
+ subdomains_enabled: SubdomainsEnabled.Raw;
16
18
  client_id?: ClientId.Raw | null;
17
19
  updated_at: string;
18
20
  created_at: string;
@@ -41,11 +41,13 @@ const ClientId_js_1 = require("./ClientId.js");
41
41
  const DomainId_js_1 = require("./DomainId.js");
42
42
  const DomainName_js_1 = require("./DomainName.js");
43
43
  const FeedbackEnabled_js_1 = require("./FeedbackEnabled.js");
44
+ const SubdomainsEnabled_js_1 = require("./SubdomainsEnabled.js");
44
45
  exports.DomainItem = core.serialization.object({
45
46
  podId: core.serialization.property("pod_id", PodId_js_1.PodId.optional()),
46
47
  domainId: core.serialization.property("domain_id", DomainId_js_1.DomainId),
47
48
  domain: DomainName_js_1.DomainName,
48
49
  feedbackEnabled: core.serialization.property("feedback_enabled", FeedbackEnabled_js_1.FeedbackEnabled),
50
+ subdomainsEnabled: core.serialization.property("subdomains_enabled", SubdomainsEnabled_js_1.SubdomainsEnabled),
49
51
  clientId: core.serialization.property("client_id", ClientId_js_1.ClientId.optional()),
50
52
  updatedAt: core.serialization.property("updated_at", core.serialization.date()),
51
53
  createdAt: core.serialization.property("created_at", core.serialization.date()),
@@ -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 SubdomainsEnabled: core.serialization.Schema<serializers.SubdomainsEnabled.Raw, AgentMail.SubdomainsEnabled>;
5
+ export declare namespace SubdomainsEnabled {
6
+ type Raw = boolean;
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.SubdomainsEnabled = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ exports.SubdomainsEnabled = core.serialization.boolean();
@@ -2,9 +2,11 @@ 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
4
  import { FeedbackEnabled } from "./FeedbackEnabled.js";
5
+ import { SubdomainsEnabled } from "./SubdomainsEnabled.js";
5
6
  export declare const UpdateDomainRequest: core.serialization.ObjectSchema<serializers.UpdateDomainRequest.Raw, AgentMail.UpdateDomainRequest>;
6
7
  export declare namespace UpdateDomainRequest {
7
8
  interface Raw {
8
9
  feedback_enabled?: FeedbackEnabled.Raw | null;
10
+ subdomains_enabled?: SubdomainsEnabled.Raw | null;
9
11
  }
10
12
  }
@@ -37,6 +37,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.UpdateDomainRequest = void 0;
38
38
  const core = __importStar(require("../../../../core/index.js"));
39
39
  const FeedbackEnabled_js_1 = require("./FeedbackEnabled.js");
40
+ const SubdomainsEnabled_js_1 = require("./SubdomainsEnabled.js");
40
41
  exports.UpdateDomainRequest = core.serialization.object({
41
42
  feedbackEnabled: core.serialization.property("feedback_enabled", FeedbackEnabled_js_1.FeedbackEnabled.optional()),
43
+ subdomainsEnabled: core.serialization.property("subdomains_enabled", SubdomainsEnabled_js_1.SubdomainsEnabled.optional()),
42
44
  });
@@ -9,6 +9,7 @@ export * from "./ListDomainsResponse.js";
9
9
  export * from "./RecordStatus.js";
10
10
  export * from "./RecordType.js";
11
11
  export * from "./Status.js";
12
+ export * from "./SubdomainsEnabled.js";
12
13
  export * from "./UpdateDomainRequest.js";
13
14
  export * from "./VerificationRecord.js";
14
15
  export * from "./VerificationStatus.js";
@@ -25,6 +25,7 @@ __exportStar(require("./ListDomainsResponse.js"), exports);
25
25
  __exportStar(require("./RecordStatus.js"), exports);
26
26
  __exportStar(require("./RecordType.js"), exports);
27
27
  __exportStar(require("./Status.js"), exports);
28
+ __exportStar(require("./SubdomainsEnabled.js"), exports);
28
29
  __exportStar(require("./UpdateDomainRequest.js"), exports);
29
30
  __exportStar(require("./VerificationRecord.js"), exports);
30
31
  __exportStar(require("./VerificationStatus.js"), exports);
@@ -0,0 +1,8 @@
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
+ import { MessageId } from "./MessageId.js";
5
+ export declare const BatchUpdateMessagesMessageIds: core.serialization.Schema<serializers.BatchUpdateMessagesMessageIds.Raw, AgentMail.BatchUpdateMessagesMessageIds>;
6
+ export declare namespace BatchUpdateMessagesMessageIds {
7
+ type Raw = MessageId.Raw[];
8
+ }