agentmail 0.5.29 → 0.5.31

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 (143) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/agent/client/Client.d.ts +32 -2
  3. package/dist/cjs/api/resources/agent/client/Client.js +97 -2
  4. package/dist/cjs/api/resources/agent/types/AgentAttachHumanRequest.d.ts +7 -0
  5. package/dist/cjs/api/resources/agent/types/AgentAttachHumanRequest.js +3 -0
  6. package/dist/cjs/api/resources/agent/types/AgentAttachHumanResponse.d.ts +9 -0
  7. package/dist/cjs/api/resources/agent/types/AgentAttachHumanResponse.js +3 -0
  8. package/dist/cjs/api/resources/agent/types/AgentSignupRequest.d.ts +5 -2
  9. package/dist/cjs/api/resources/agent/types/index.d.ts +2 -0
  10. package/dist/cjs/api/resources/agent/types/index.js +2 -0
  11. package/dist/cjs/api/resources/apiKeys/types/ApiKeyPermissions.d.ts +2 -0
  12. package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.d.ts +28 -0
  13. package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.js +98 -0
  14. package/dist/cjs/api/resources/inboxes/resources/metrics/client/requests/QueryRatesRequest.d.ts +14 -0
  15. package/dist/cjs/api/resources/inboxes/resources/metrics/client/requests/QueryRatesRequest.js +3 -0
  16. package/dist/cjs/api/resources/inboxes/resources/metrics/client/requests/index.d.ts +1 -0
  17. package/dist/cjs/api/resources/metrics/client/Client.d.ts +28 -0
  18. package/dist/cjs/api/resources/metrics/client/Client.js +98 -0
  19. package/dist/cjs/api/resources/metrics/client/requests/QueryRatesRequest.d.ts +14 -0
  20. package/dist/cjs/api/resources/metrics/client/requests/QueryRatesRequest.js +3 -0
  21. package/dist/cjs/api/resources/metrics/client/requests/index.d.ts +1 -0
  22. package/dist/cjs/api/resources/metrics/types/QueryRatesResponse.d.ts +5 -0
  23. package/dist/cjs/api/resources/metrics/types/QueryRatesResponse.js +3 -0
  24. package/dist/cjs/api/resources/metrics/types/RatePeriod.d.ts +5 -0
  25. package/dist/cjs/api/resources/metrics/types/RatePeriod.js +3 -0
  26. package/dist/cjs/api/resources/metrics/types/RatePoint.d.ts +12 -0
  27. package/dist/cjs/api/resources/metrics/types/RatePoint.js +3 -0
  28. package/dist/cjs/api/resources/metrics/types/RateType.d.ts +10 -0
  29. package/dist/cjs/api/resources/metrics/types/RateType.js +13 -0
  30. package/dist/cjs/api/resources/metrics/types/RateTypes.d.ts +5 -0
  31. package/dist/cjs/api/resources/metrics/types/RateTypes.js +3 -0
  32. package/dist/cjs/api/resources/metrics/types/Window.d.ts +6 -0
  33. package/dist/cjs/api/resources/metrics/types/Window.js +3 -0
  34. package/dist/cjs/api/resources/metrics/types/index.d.ts +6 -0
  35. package/dist/cjs/api/resources/metrics/types/index.js +6 -0
  36. package/dist/cjs/api/resources/pods/resources/metrics/client/Client.d.ts +28 -0
  37. package/dist/cjs/api/resources/pods/resources/metrics/client/Client.js +98 -0
  38. package/dist/cjs/api/resources/pods/resources/metrics/client/requests/QueryRatesRequest.d.ts +14 -0
  39. package/dist/cjs/api/resources/pods/resources/metrics/client/requests/QueryRatesRequest.js +3 -0
  40. package/dist/cjs/api/resources/pods/resources/metrics/client/requests/index.d.ts +1 -0
  41. package/dist/cjs/api/resources/webhooks/types/UpdateInboxWebhookRequest.d.ts +10 -1
  42. package/dist/cjs/api/resources/webhooks/types/UpdatePodWebhookRequest.d.ts +2 -2
  43. package/dist/cjs/serialization/resources/agent/types/AgentAttachHumanRequest.d.ts +9 -0
  44. package/dist/cjs/serialization/resources/agent/types/AgentAttachHumanRequest.js +41 -0
  45. package/dist/cjs/serialization/resources/agent/types/AgentAttachHumanResponse.d.ts +10 -0
  46. package/dist/cjs/serialization/resources/agent/types/AgentAttachHumanResponse.js +42 -0
  47. package/dist/cjs/serialization/resources/agent/types/AgentSignupRequest.d.ts +1 -1
  48. package/dist/cjs/serialization/resources/agent/types/AgentSignupRequest.js +1 -1
  49. package/dist/cjs/serialization/resources/agent/types/index.d.ts +2 -0
  50. package/dist/cjs/serialization/resources/agent/types/index.js +2 -0
  51. package/dist/cjs/serialization/resources/apiKeys/types/ApiKeyPermissions.d.ts +1 -0
  52. package/dist/cjs/serialization/resources/apiKeys/types/ApiKeyPermissions.js +1 -0
  53. package/dist/cjs/serialization/resources/metrics/types/QueryRatesResponse.d.ts +9 -0
  54. package/dist/cjs/serialization/resources/metrics/types/QueryRatesResponse.js +41 -0
  55. package/dist/cjs/serialization/resources/metrics/types/RatePeriod.d.ts +7 -0
  56. package/dist/cjs/serialization/resources/metrics/types/RatePeriod.js +39 -0
  57. package/dist/cjs/serialization/resources/metrics/types/RatePoint.d.ts +11 -0
  58. package/dist/cjs/serialization/resources/metrics/types/RatePoint.js +43 -0
  59. package/dist/cjs/serialization/resources/metrics/types/RateType.d.ts +7 -0
  60. package/dist/cjs/serialization/resources/metrics/types/RateType.js +39 -0
  61. package/dist/cjs/serialization/resources/metrics/types/RateTypes.d.ts +8 -0
  62. package/dist/cjs/serialization/resources/metrics/types/RateTypes.js +40 -0
  63. package/dist/cjs/serialization/resources/metrics/types/Window.d.ts +7 -0
  64. package/dist/cjs/serialization/resources/metrics/types/Window.js +39 -0
  65. package/dist/cjs/serialization/resources/metrics/types/index.d.ts +6 -0
  66. package/dist/cjs/serialization/resources/metrics/types/index.js +6 -0
  67. package/dist/cjs/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.d.ts +1 -0
  68. package/dist/cjs/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.js +1 -0
  69. package/dist/cjs/version.d.ts +1 -1
  70. package/dist/cjs/version.js +1 -1
  71. package/dist/esm/BaseClient.mjs +2 -2
  72. package/dist/esm/api/resources/agent/client/Client.d.mts +32 -2
  73. package/dist/esm/api/resources/agent/client/Client.mjs +97 -2
  74. package/dist/esm/api/resources/agent/types/AgentAttachHumanRequest.d.mts +7 -0
  75. package/dist/esm/api/resources/agent/types/AgentAttachHumanRequest.mjs +2 -0
  76. package/dist/esm/api/resources/agent/types/AgentAttachHumanResponse.d.mts +9 -0
  77. package/dist/esm/api/resources/agent/types/AgentAttachHumanResponse.mjs +2 -0
  78. package/dist/esm/api/resources/agent/types/AgentSignupRequest.d.mts +5 -2
  79. package/dist/esm/api/resources/agent/types/index.d.mts +2 -0
  80. package/dist/esm/api/resources/agent/types/index.mjs +2 -0
  81. package/dist/esm/api/resources/apiKeys/types/ApiKeyPermissions.d.mts +2 -0
  82. package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.d.mts +28 -0
  83. package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.mjs +98 -0
  84. package/dist/esm/api/resources/inboxes/resources/metrics/client/requests/QueryRatesRequest.d.mts +14 -0
  85. package/dist/esm/api/resources/inboxes/resources/metrics/client/requests/QueryRatesRequest.mjs +2 -0
  86. package/dist/esm/api/resources/inboxes/resources/metrics/client/requests/index.d.mts +1 -0
  87. package/dist/esm/api/resources/metrics/client/Client.d.mts +28 -0
  88. package/dist/esm/api/resources/metrics/client/Client.mjs +98 -0
  89. package/dist/esm/api/resources/metrics/client/requests/QueryRatesRequest.d.mts +14 -0
  90. package/dist/esm/api/resources/metrics/client/requests/QueryRatesRequest.mjs +2 -0
  91. package/dist/esm/api/resources/metrics/client/requests/index.d.mts +1 -0
  92. package/dist/esm/api/resources/metrics/types/QueryRatesResponse.d.mts +5 -0
  93. package/dist/esm/api/resources/metrics/types/QueryRatesResponse.mjs +2 -0
  94. package/dist/esm/api/resources/metrics/types/RatePeriod.d.mts +5 -0
  95. package/dist/esm/api/resources/metrics/types/RatePeriod.mjs +2 -0
  96. package/dist/esm/api/resources/metrics/types/RatePoint.d.mts +12 -0
  97. package/dist/esm/api/resources/metrics/types/RatePoint.mjs +2 -0
  98. package/dist/esm/api/resources/metrics/types/RateType.d.mts +10 -0
  99. package/dist/esm/api/resources/metrics/types/RateType.mjs +10 -0
  100. package/dist/esm/api/resources/metrics/types/RateTypes.d.mts +5 -0
  101. package/dist/esm/api/resources/metrics/types/RateTypes.mjs +2 -0
  102. package/dist/esm/api/resources/metrics/types/Window.d.mts +6 -0
  103. package/dist/esm/api/resources/metrics/types/Window.mjs +2 -0
  104. package/dist/esm/api/resources/metrics/types/index.d.mts +6 -0
  105. package/dist/esm/api/resources/metrics/types/index.mjs +6 -0
  106. package/dist/esm/api/resources/pods/resources/metrics/client/Client.d.mts +28 -0
  107. package/dist/esm/api/resources/pods/resources/metrics/client/Client.mjs +98 -0
  108. package/dist/esm/api/resources/pods/resources/metrics/client/requests/QueryRatesRequest.d.mts +14 -0
  109. package/dist/esm/api/resources/pods/resources/metrics/client/requests/QueryRatesRequest.mjs +2 -0
  110. package/dist/esm/api/resources/pods/resources/metrics/client/requests/index.d.mts +1 -0
  111. package/dist/esm/api/resources/webhooks/types/UpdateInboxWebhookRequest.d.mts +10 -1
  112. package/dist/esm/api/resources/webhooks/types/UpdatePodWebhookRequest.d.mts +2 -2
  113. package/dist/esm/serialization/resources/agent/types/AgentAttachHumanRequest.d.mts +9 -0
  114. package/dist/esm/serialization/resources/agent/types/AgentAttachHumanRequest.mjs +5 -0
  115. package/dist/esm/serialization/resources/agent/types/AgentAttachHumanResponse.d.mts +10 -0
  116. package/dist/esm/serialization/resources/agent/types/AgentAttachHumanResponse.mjs +6 -0
  117. package/dist/esm/serialization/resources/agent/types/AgentSignupRequest.d.mts +1 -1
  118. package/dist/esm/serialization/resources/agent/types/AgentSignupRequest.mjs +1 -1
  119. package/dist/esm/serialization/resources/agent/types/index.d.mts +2 -0
  120. package/dist/esm/serialization/resources/agent/types/index.mjs +2 -0
  121. package/dist/esm/serialization/resources/apiKeys/types/ApiKeyPermissions.d.mts +1 -0
  122. package/dist/esm/serialization/resources/apiKeys/types/ApiKeyPermissions.mjs +1 -0
  123. package/dist/esm/serialization/resources/metrics/types/QueryRatesResponse.d.mts +9 -0
  124. package/dist/esm/serialization/resources/metrics/types/QueryRatesResponse.mjs +5 -0
  125. package/dist/esm/serialization/resources/metrics/types/RatePeriod.d.mts +7 -0
  126. package/dist/esm/serialization/resources/metrics/types/RatePeriod.mjs +3 -0
  127. package/dist/esm/serialization/resources/metrics/types/RatePoint.d.mts +11 -0
  128. package/dist/esm/serialization/resources/metrics/types/RatePoint.mjs +7 -0
  129. package/dist/esm/serialization/resources/metrics/types/RateType.d.mts +7 -0
  130. package/dist/esm/serialization/resources/metrics/types/RateType.mjs +3 -0
  131. package/dist/esm/serialization/resources/metrics/types/RateTypes.d.mts +8 -0
  132. package/dist/esm/serialization/resources/metrics/types/RateTypes.mjs +4 -0
  133. package/dist/esm/serialization/resources/metrics/types/Window.d.mts +7 -0
  134. package/dist/esm/serialization/resources/metrics/types/Window.mjs +3 -0
  135. package/dist/esm/serialization/resources/metrics/types/index.d.mts +6 -0
  136. package/dist/esm/serialization/resources/metrics/types/index.mjs +6 -0
  137. package/dist/esm/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.d.mts +1 -0
  138. package/dist/esm/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.mjs +1 -0
  139. package/dist/esm/version.d.mts +1 -1
  140. package/dist/esm/version.mjs +1 -1
  141. package/dist/llms.txt +6 -1
  142. package/package.json +1 -1
  143. package/reference.md +329 -2
@@ -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.RateType = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ exports.RateType = core.serialization.enum_(["bounce", "complaint"]);
@@ -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 { RateType } from "./RateType.js";
5
+ export declare const RateTypes: core.serialization.Schema<serializers.RateTypes.Raw, AgentMail.RateTypes>;
6
+ export declare namespace RateTypes {
7
+ type Raw = RateType.Raw[];
8
+ }
@@ -0,0 +1,40 @@
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.RateTypes = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ const RateType_js_1 = require("./RateType.js");
40
+ exports.RateTypes = core.serialization.list(RateType_js_1.RateType);
@@ -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 Window: core.serialization.Schema<serializers.Window.Raw, AgentMail.Window>;
5
+ export declare namespace Window {
6
+ type Raw = number;
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.Window = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ exports.Window = core.serialization.number();
@@ -6,8 +6,14 @@ export * from "./MetricEventTypes.js";
6
6
  export * from "./MetricLimit.js";
7
7
  export * from "./Period.js";
8
8
  export * from "./QueryMetricsResponse.js";
9
+ export * from "./QueryRatesResponse.js";
9
10
  export * from "./QueryUsageResponse.js";
11
+ export * from "./RatePeriod.js";
12
+ export * from "./RatePoint.js";
13
+ export * from "./RateType.js";
14
+ export * from "./RateTypes.js";
10
15
  export * from "./Start.js";
11
16
  export * from "./UsagePoint.js";
12
17
  export * from "./UsageType.js";
13
18
  export * from "./UsageTypes.js";
19
+ export * from "./Window.js";
@@ -22,8 +22,14 @@ __exportStar(require("./MetricEventTypes.js"), exports);
22
22
  __exportStar(require("./MetricLimit.js"), exports);
23
23
  __exportStar(require("./Period.js"), exports);
24
24
  __exportStar(require("./QueryMetricsResponse.js"), exports);
25
+ __exportStar(require("./QueryRatesResponse.js"), exports);
25
26
  __exportStar(require("./QueryUsageResponse.js"), exports);
27
+ __exportStar(require("./RatePeriod.js"), exports);
28
+ __exportStar(require("./RatePoint.js"), exports);
29
+ __exportStar(require("./RateType.js"), exports);
30
+ __exportStar(require("./RateTypes.js"), exports);
26
31
  __exportStar(require("./Start.js"), exports);
27
32
  __exportStar(require("./UsagePoint.js"), exports);
28
33
  __exportStar(require("./UsageType.js"), exports);
29
34
  __exportStar(require("./UsageTypes.js"), exports);
35
+ __exportStar(require("./Window.js"), exports);
@@ -6,5 +6,6 @@ export declare const UpdateInboxWebhookRequest: core.serialization.ObjectSchema<
6
6
  export declare namespace UpdateInboxWebhookRequest {
7
7
  interface Raw {
8
8
  event_types?: UpdateWebhookEventTypes.Raw | null;
9
+ enabled?: boolean | null;
9
10
  }
10
11
  }
@@ -39,4 +39,5 @@ const core = __importStar(require("../../../../core/index.js"));
39
39
  const UpdateWebhookEventTypes_js_1 = require("./UpdateWebhookEventTypes.js");
40
40
  exports.UpdateInboxWebhookRequest = core.serialization.object({
41
41
  eventTypes: core.serialization.property("event_types", UpdateWebhookEventTypes_js_1.UpdateWebhookEventTypes.optional()),
42
+ enabled: core.serialization.boolean().optional(),
42
43
  });
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.5.29";
1
+ export declare const SDK_VERSION = "0.5.31";
@@ -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.29";
4
+ exports.SDK_VERSION = "0.5.31";
@@ -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.29",
10
- "User-Agent": "agentmail/0.5.29",
9
+ "X-Fern-SDK-Version": "0.5.31",
10
+ "User-Agent": "agentmail/0.5.31",
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);
@@ -15,6 +15,8 @@ export declare class AgentClient {
15
15
  *
16
16
  * A 6-digit OTP is sent to the human's email for verification.
17
17
  *
18
+ * `human_email` is optional. Without it, the inbox can receive email but cannot send to anyone until a human is attached with the attach human endpoint. There is also no way to recover the API key, so store it durably. Calling sign-up again without `human_email` creates a new organization, which needs a different `username`: the original username stays with the lost organization's inbox.
19
+ *
18
20
  * This endpoint is idempotent. Calling it again with the same `human_email` will rotate the API key and resend the OTP if expired.
19
21
  *
20
22
  * The returned API key has limited permissions until the organization is verified via the verify endpoint.
@@ -31,18 +33,46 @@ export declare class AgentClient {
31
33
  *
32
34
  * @example
33
35
  * await client.agent.signUp({
34
- * humanEmail: "human_email",
35
36
  * username: "username"
36
37
  * })
37
38
  */
38
39
  signUp(request: AgentMail.AgentSignupRequest, requestOptions?: AgentClient.RequestOptions): core.HttpResponsePromise<AgentMail.AgentSignupResponse>;
39
40
  private __signUp;
41
+ /**
42
+ * Attach a human to an unverified agent organization. A 6-digit OTP is sent to the human's email, which you then submit to the verify endpoint.
43
+ *
44
+ * Use it after signing up without a `human_email`. Once the human is attached, the organization can send email to that human only, and verification lifts the remaining restrictions. For up to 5 minutes after attaching, sends to the human can still be rejected with a `429` daily send limit error while the API key's cached limits catch up. Wait and retry.
45
+ *
46
+ * Calling it again with the same `human_email` does not rotate the API key. It resends the OTP if it was never delivered, or issues a new one if it expired. While the current OTP is still valid, calling it again keeps that OTP and its attempt count. If all 10 attempts are used up, wait until the OTP expires, 24 hours after it was issued, then call it again for a new one.
47
+ *
48
+ * Calling it with a different `human_email` replaces the attached human and sends the new human an OTP. An organization can replace its human at most 2 times.
49
+ *
50
+ * Only available until the organization is verified.
51
+ *
52
+ * **CLI:**
53
+ * ```bash
54
+ * agentmail agent attach-human --human-email user@example.com
55
+ * ```
56
+ *
57
+ * @param {AgentMail.AgentAttachHumanRequest} request
58
+ * @param {AgentClient.RequestOptions} requestOptions - Request-specific configuration.
59
+ *
60
+ * @throws {@link AgentMail.ValidationError}
61
+ * @throws {@link AgentMail.ConflictError}
62
+ *
63
+ * @example
64
+ * await client.agent.attachHuman({
65
+ * humanEmail: "human_email"
66
+ * })
67
+ */
68
+ attachHuman(request: AgentMail.AgentAttachHumanRequest, requestOptions?: AgentClient.RequestOptions): core.HttpResponsePromise<AgentMail.AgentAttachHumanResponse>;
69
+ private __attachHuman;
40
70
  /**
41
71
  * Verify an agent organization using the 6-digit OTP sent to the human's email during sign-up.
42
72
  *
43
73
  * On success, the organization is upgraded from `agent_unverified` to `agent_verified`, the send allowlist is removed, and free plan entitlements are applied.
44
74
  *
45
- * The OTP expires after 24 hours and allows a maximum of 10 attempts. If you run into any difficulties receiving the OTP code, you can also create an account on [console.agentmail.to](https://console.agentmail.to) using the human email address you provided to verify your account.
75
+ * The OTP expires after 24 hours and allows a maximum of 10 attempts. If the OTP expired, call the attach human endpoint with the same `human_email` to get a new one without rotating the API key. Once all 10 attempts are used, even the correct OTP is rejected, and attach human keeps returning the same OTP until it expires, so wait for it to expire before asking for a new one. An organization that signed up without a `human_email` has no OTP until a human is attached. If you run into any difficulties receiving the OTP code, you can also create an account on [console.agentmail.to](https://console.agentmail.to) using the human email address you provided to verify your account.
46
76
  *
47
77
  * **CLI:**
48
78
  * ```bash
@@ -25,6 +25,8 @@ export class AgentClient {
25
25
  *
26
26
  * A 6-digit OTP is sent to the human's email for verification.
27
27
  *
28
+ * `human_email` is optional. Without it, the inbox can receive email but cannot send to anyone until a human is attached with the attach human endpoint. There is also no way to recover the API key, so store it durably. Calling sign-up again without `human_email` creates a new organization, which needs a different `username`: the original username stays with the lost organization's inbox.
29
+ *
28
30
  * This endpoint is idempotent. Calling it again with the same `human_email` will rotate the API key and resend the OTP if expired.
29
31
  *
30
32
  * The returned API key has limited permissions until the organization is verified via the verify endpoint.
@@ -41,7 +43,6 @@ export class AgentClient {
41
43
  *
42
44
  * @example
43
45
  * await client.agent.signUp({
44
- * humanEmail: "human_email",
45
46
  * username: "username"
46
47
  * })
47
48
  */
@@ -103,12 +104,106 @@ export class AgentClient {
103
104
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/agent/sign-up");
104
105
  });
105
106
  }
107
+ /**
108
+ * Attach a human to an unverified agent organization. A 6-digit OTP is sent to the human's email, which you then submit to the verify endpoint.
109
+ *
110
+ * Use it after signing up without a `human_email`. Once the human is attached, the organization can send email to that human only, and verification lifts the remaining restrictions. For up to 5 minutes after attaching, sends to the human can still be rejected with a `429` daily send limit error while the API key's cached limits catch up. Wait and retry.
111
+ *
112
+ * Calling it again with the same `human_email` does not rotate the API key. It resends the OTP if it was never delivered, or issues a new one if it expired. While the current OTP is still valid, calling it again keeps that OTP and its attempt count. If all 10 attempts are used up, wait until the OTP expires, 24 hours after it was issued, then call it again for a new one.
113
+ *
114
+ * Calling it with a different `human_email` replaces the attached human and sends the new human an OTP. An organization can replace its human at most 2 times.
115
+ *
116
+ * Only available until the organization is verified.
117
+ *
118
+ * **CLI:**
119
+ * ```bash
120
+ * agentmail agent attach-human --human-email user@example.com
121
+ * ```
122
+ *
123
+ * @param {AgentMail.AgentAttachHumanRequest} request
124
+ * @param {AgentClient.RequestOptions} requestOptions - Request-specific configuration.
125
+ *
126
+ * @throws {@link AgentMail.ValidationError}
127
+ * @throws {@link AgentMail.ConflictError}
128
+ *
129
+ * @example
130
+ * await client.agent.attachHuman({
131
+ * humanEmail: "human_email"
132
+ * })
133
+ */
134
+ attachHuman(request, requestOptions) {
135
+ return core.HttpResponsePromise.fromPromise(this.__attachHuman(request, requestOptions));
136
+ }
137
+ __attachHuman(request, requestOptions) {
138
+ return __awaiter(this, void 0, void 0, function* () {
139
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
140
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
141
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
142
+ const _response = yield core.fetcher({
143
+ 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)
144
+ .http, "/v0/agent/human"),
145
+ method: "POST",
146
+ headers: _headers,
147
+ contentType: "application/json",
148
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
149
+ requestType: "json",
150
+ body: serializers.AgentAttachHumanRequest.jsonOrThrow(request, {
151
+ unrecognizedObjectKeys: "strip",
152
+ omitUndefined: true,
153
+ }),
154
+ 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,
155
+ 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,
156
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
157
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
158
+ logging: this._options.logging,
159
+ });
160
+ if (_response.ok) {
161
+ return {
162
+ data: serializers.AgentAttachHumanResponse.parseOrThrow(_response.body, {
163
+ unrecognizedObjectKeys: "passthrough",
164
+ allowUnrecognizedUnionMembers: true,
165
+ allowUnrecognizedEnumValues: true,
166
+ skipValidation: true,
167
+ breadcrumbsPrefix: ["response"],
168
+ }),
169
+ rawResponse: _response.rawResponse,
170
+ };
171
+ }
172
+ if (_response.error.reason === "status-code") {
173
+ switch (_response.error.statusCode) {
174
+ case 400:
175
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
176
+ unrecognizedObjectKeys: "passthrough",
177
+ allowUnrecognizedUnionMembers: true,
178
+ allowUnrecognizedEnumValues: true,
179
+ skipValidation: true,
180
+ breadcrumbsPrefix: ["response"],
181
+ }), _response.rawResponse);
182
+ case 409:
183
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
184
+ unrecognizedObjectKeys: "passthrough",
185
+ allowUnrecognizedUnionMembers: true,
186
+ allowUnrecognizedEnumValues: true,
187
+ skipValidation: true,
188
+ breadcrumbsPrefix: ["response"],
189
+ }), _response.rawResponse);
190
+ default:
191
+ throw new errors.AgentMailError({
192
+ statusCode: _response.error.statusCode,
193
+ body: _response.error.body,
194
+ rawResponse: _response.rawResponse,
195
+ });
196
+ }
197
+ }
198
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/agent/human");
199
+ });
200
+ }
106
201
  /**
107
202
  * Verify an agent organization using the 6-digit OTP sent to the human's email during sign-up.
108
203
  *
109
204
  * On success, the organization is upgraded from `agent_unverified` to `agent_verified`, the send allowlist is removed, and free plan entitlements are applied.
110
205
  *
111
- * The OTP expires after 24 hours and allows a maximum of 10 attempts. If you run into any difficulties receiving the OTP code, you can also create an account on [console.agentmail.to](https://console.agentmail.to) using the human email address you provided to verify your account.
206
+ * The OTP expires after 24 hours and allows a maximum of 10 attempts. If the OTP expired, call the attach human endpoint with the same `human_email` to get a new one without rotating the API key. Once all 10 attempts are used, even the correct OTP is rejected, and attach human keeps returning the same OTP until it expires, so wait for it to expire before asking for a new one. An organization that signed up without a `human_email` has no OTP until a human is attached. If you run into any difficulties receiving the OTP code, you can also create an account on [console.agentmail.to](https://console.agentmail.to) using the human email address you provided to verify your account.
112
207
  *
113
208
  * **CLI:**
114
209
  * ```bash
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Request body to attach a human to an agent organization.
3
+ */
4
+ export interface AgentAttachHumanRequest {
5
+ /** Email address of the human who owns the agent. A 6-digit OTP will be sent to this address. */
6
+ humanEmail: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Response after attaching a human to an agent organization.
3
+ */
4
+ export interface AgentAttachHumanResponse {
5
+ /** Email address of the attached human. */
6
+ humanEmail: string;
7
+ /** Next steps for the agent, in plain text. */
8
+ instructions: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -2,8 +2,11 @@
2
2
  * Request body to sign up an agent.
3
3
  */
4
4
  export interface AgentSignupRequest {
5
- /** Email address of the human who owns the agent. A 6-digit OTP will be sent to this address. */
6
- humanEmail: string;
5
+ /**
6
+ * Email address of the human who owns the agent. A 6-digit OTP will be sent to this address.
7
+ * Omit it to get a receive-only inbox: it can receive email but cannot send until a human is attached with the attach human endpoint.
8
+ */
9
+ humanEmail?: string;
7
10
  /** Username for the auto-created inbox (e.g. "my-agent" creates my-agent@agentmail.to). */
8
11
  username: string;
9
12
  /**
@@ -1,3 +1,5 @@
1
+ export * from "./AgentAttachHumanRequest.mjs";
2
+ export * from "./AgentAttachHumanResponse.mjs";
1
3
  export * from "./AgentSignupRequest.mjs";
2
4
  export * from "./AgentSignupResponse.mjs";
3
5
  export * from "./AgentVerifyRequest.mjs";
@@ -1,3 +1,5 @@
1
+ export * from "./AgentAttachHumanRequest.mjs";
2
+ export * from "./AgentAttachHumanResponse.mjs";
1
3
  export * from "./AgentSignupRequest.mjs";
2
4
  export * from "./AgentSignupResponse.mjs";
3
5
  export * from "./AgentVerifyRequest.mjs";
@@ -87,6 +87,8 @@ export interface ApiKeyPermissions {
87
87
  podRead?: boolean;
88
88
  /** Create pods. */
89
89
  podCreate?: boolean;
90
+ /** Update pods. */
91
+ podUpdate?: boolean;
90
92
  /** Delete pods. */
91
93
  podDelete?: boolean;
92
94
  }
@@ -53,4 +53,32 @@ export declare class MetricsClient {
53
53
  */
54
54
  queryUsage(inbox_id: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.QueryUsageRequest, requestOptions?: MetricsClient.RequestOptions): core.HttpResponsePromise<AgentMail.QueryUsageResponse>;
55
55
  private __queryUsage;
56
+ /**
57
+ * Rolling bounce and complaint rates for the inbox. At each `period`
58
+ * grid point, the bounced (or complained) messages over the preceding
59
+ * `window` divided by the messages sent over the same window, with the
60
+ * send count alongside. Account moderation evaluates the organization-wide
61
+ * rate, so use the organization endpoint to see the number it acts on;
62
+ * the inbox view shows which inboxes contribute. Defaults to the rolling
63
+ * 24-hour rate sampled hourly over the last day; `start` must be within
64
+ * the last 90 days, `window` must be a whole multiple of `period`, and
65
+ * the range plus window divided by `period` must not exceed 1000
66
+ * buckets.
67
+ *
68
+ * **CLI:**
69
+ * ```bash
70
+ * agentmail inboxes metrics query-rates --inbox-id <inbox_id>
71
+ * ```
72
+ *
73
+ * @param {AgentMail.inboxes.InboxId} inbox_id
74
+ * @param {AgentMail.inboxes.QueryRatesRequest} request
75
+ * @param {MetricsClient.RequestOptions} requestOptions - Request-specific configuration.
76
+ *
77
+ * @throws {@link AgentMail.ValidationError}
78
+ *
79
+ * @example
80
+ * await client.inboxes.metrics.queryRates("inbox_id")
81
+ */
82
+ queryRates(inbox_id: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.QueryRatesRequest, requestOptions?: MetricsClient.RequestOptions): core.HttpResponsePromise<AgentMail.QueryRatesResponse>;
83
+ private __queryRates;
56
84
  }
@@ -202,4 +202,102 @@ export class MetricsClient {
202
202
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/metrics/usage");
203
203
  });
204
204
  }
205
+ /**
206
+ * Rolling bounce and complaint rates for the inbox. At each `period`
207
+ * grid point, the bounced (or complained) messages over the preceding
208
+ * `window` divided by the messages sent over the same window, with the
209
+ * send count alongside. Account moderation evaluates the organization-wide
210
+ * rate, so use the organization endpoint to see the number it acts on;
211
+ * the inbox view shows which inboxes contribute. Defaults to the rolling
212
+ * 24-hour rate sampled hourly over the last day; `start` must be within
213
+ * the last 90 days, `window` must be a whole multiple of `period`, and
214
+ * the range plus window divided by `period` must not exceed 1000
215
+ * buckets.
216
+ *
217
+ * **CLI:**
218
+ * ```bash
219
+ * agentmail inboxes metrics query-rates --inbox-id <inbox_id>
220
+ * ```
221
+ *
222
+ * @param {AgentMail.inboxes.InboxId} inbox_id
223
+ * @param {AgentMail.inboxes.QueryRatesRequest} request
224
+ * @param {MetricsClient.RequestOptions} requestOptions - Request-specific configuration.
225
+ *
226
+ * @throws {@link AgentMail.ValidationError}
227
+ *
228
+ * @example
229
+ * await client.inboxes.metrics.queryRates("inbox_id")
230
+ */
231
+ queryRates(inbox_id, request = {}, requestOptions) {
232
+ return core.HttpResponsePromise.fromPromise(this.__queryRates(inbox_id, request, requestOptions));
233
+ }
234
+ __queryRates(inbox_id_1) {
235
+ return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
236
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
237
+ const { rateTypes, start, end, period, window, limit, descending } = request;
238
+ const _queryParams = {
239
+ rate_types: rateTypes != null
240
+ ? toJson(serializers.RateTypes.jsonOrThrow(rateTypes, {
241
+ unrecognizedObjectKeys: "strip",
242
+ omitUndefined: true,
243
+ }))
244
+ : undefined,
245
+ start: start != null
246
+ ? serializers.Start.jsonOrThrow(start, { unrecognizedObjectKeys: "strip", omitUndefined: true })
247
+ : undefined,
248
+ end: end != null
249
+ ? serializers.End.jsonOrThrow(end, { unrecognizedObjectKeys: "strip", omitUndefined: true })
250
+ : undefined,
251
+ period,
252
+ window,
253
+ limit,
254
+ descending,
255
+ };
256
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
257
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
258
+ const _response = yield core.fetcher({
259
+ 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)
260
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/metrics/rates`),
261
+ method: "GET",
262
+ headers: _headers,
263
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
264
+ 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,
265
+ 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,
266
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
267
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
268
+ logging: this._options.logging,
269
+ });
270
+ if (_response.ok) {
271
+ return {
272
+ data: serializers.QueryRatesResponse.parseOrThrow(_response.body, {
273
+ unrecognizedObjectKeys: "passthrough",
274
+ allowUnrecognizedUnionMembers: true,
275
+ allowUnrecognizedEnumValues: true,
276
+ skipValidation: true,
277
+ breadcrumbsPrefix: ["response"],
278
+ }),
279
+ rawResponse: _response.rawResponse,
280
+ };
281
+ }
282
+ if (_response.error.reason === "status-code") {
283
+ switch (_response.error.statusCode) {
284
+ case 400:
285
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
286
+ unrecognizedObjectKeys: "passthrough",
287
+ allowUnrecognizedUnionMembers: true,
288
+ allowUnrecognizedEnumValues: true,
289
+ skipValidation: true,
290
+ breadcrumbsPrefix: ["response"],
291
+ }), _response.rawResponse);
292
+ default:
293
+ throw new errors.AgentMailError({
294
+ statusCode: _response.error.statusCode,
295
+ body: _response.error.body,
296
+ rawResponse: _response.rawResponse,
297
+ });
298
+ }
299
+ }
300
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/metrics/rates");
301
+ });
302
+ }
205
303
  }
@@ -0,0 +1,14 @@
1
+ import type * as AgentMail from "../../../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface QueryRatesRequest {
7
+ rateTypes?: AgentMail.RateTypes;
8
+ start?: AgentMail.Start;
9
+ end?: AgentMail.End;
10
+ period?: AgentMail.RatePeriod;
11
+ window?: AgentMail.Window;
12
+ limit?: AgentMail.MetricLimit;
13
+ descending?: AgentMail.Descending;
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,2 +1,3 @@
1
1
  export type { QueryEventsRequest } from "./QueryEventsRequest.mjs";
2
+ export type { QueryRatesRequest } from "./QueryRatesRequest.mjs";
2
3
  export type { QueryUsageRequest } from "./QueryUsageRequest.mjs";