agentmail 0.2.15 → 0.2.17

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 (57) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/websockets/client/Socket.d.ts +1 -1
  3. package/dist/cjs/api/resources/websockets/types/Error_.d.ts +6 -0
  4. package/dist/cjs/api/resources/websockets/types/Error_.js +3 -0
  5. package/dist/cjs/api/resources/websockets/types/index.d.ts +1 -0
  6. package/dist/cjs/api/resources/websockets/types/index.js +1 -0
  7. package/dist/cjs/api/types/ErrorMessage.d.ts +4 -0
  8. package/dist/cjs/api/types/ErrorMessage.js +3 -0
  9. package/dist/cjs/api/types/ErrorResponse.d.ts +1 -2
  10. package/dist/cjs/api/types/index.d.ts +1 -0
  11. package/dist/cjs/api/types/index.js +1 -0
  12. package/dist/cjs/environments.d.ts +5 -1
  13. package/dist/cjs/environments.js +4 -0
  14. package/dist/cjs/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.ts +3 -2
  15. package/dist/cjs/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.js +2 -0
  16. package/dist/cjs/serialization/resources/websockets/types/Error_.d.ts +13 -0
  17. package/dist/cjs/serialization/resources/websockets/types/Error_.js +45 -0
  18. package/dist/cjs/serialization/resources/websockets/types/index.d.ts +1 -0
  19. package/dist/cjs/serialization/resources/websockets/types/index.js +1 -0
  20. package/dist/cjs/serialization/types/ErrorMessage.d.ts +7 -0
  21. package/dist/cjs/serialization/types/ErrorMessage.js +39 -0
  22. package/dist/cjs/serialization/types/ErrorResponse.d.ts +2 -1
  23. package/dist/cjs/serialization/types/ErrorResponse.js +2 -1
  24. package/dist/cjs/serialization/types/index.d.ts +1 -0
  25. package/dist/cjs/serialization/types/index.js +1 -0
  26. package/dist/cjs/version.d.ts +1 -1
  27. package/dist/cjs/version.js +1 -1
  28. package/dist/esm/BaseClient.mjs +2 -2
  29. package/dist/esm/api/resources/websockets/client/Socket.d.mts +1 -1
  30. package/dist/esm/api/resources/websockets/types/Error_.d.mts +6 -0
  31. package/dist/esm/api/resources/websockets/types/Error_.mjs +2 -0
  32. package/dist/esm/api/resources/websockets/types/index.d.mts +1 -0
  33. package/dist/esm/api/resources/websockets/types/index.mjs +1 -0
  34. package/dist/esm/api/types/ErrorMessage.d.mts +4 -0
  35. package/dist/esm/api/types/ErrorMessage.mjs +2 -0
  36. package/dist/esm/api/types/ErrorResponse.d.mts +1 -2
  37. package/dist/esm/api/types/index.d.mts +1 -0
  38. package/dist/esm/api/types/index.mjs +1 -0
  39. package/dist/esm/environments.d.mts +5 -1
  40. package/dist/esm/environments.mjs +4 -0
  41. package/dist/esm/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.mts +3 -2
  42. package/dist/esm/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.mjs +2 -0
  43. package/dist/esm/serialization/resources/websockets/types/Error_.d.mts +13 -0
  44. package/dist/esm/serialization/resources/websockets/types/Error_.mjs +9 -0
  45. package/dist/esm/serialization/resources/websockets/types/index.d.mts +1 -0
  46. package/dist/esm/serialization/resources/websockets/types/index.mjs +1 -0
  47. package/dist/esm/serialization/types/ErrorMessage.d.mts +7 -0
  48. package/dist/esm/serialization/types/ErrorMessage.mjs +3 -0
  49. package/dist/esm/serialization/types/ErrorResponse.d.mts +2 -1
  50. package/dist/esm/serialization/types/ErrorResponse.mjs +2 -1
  51. package/dist/esm/serialization/types/index.d.mts +1 -0
  52. package/dist/esm/serialization/types/index.mjs +1 -0
  53. package/dist/esm/version.d.mts +1 -1
  54. package/dist/esm/version.mjs +1 -1
  55. package/dist/llms-full.txt +56 -0
  56. package/dist/llms.txt +1 -0
  57. package/package.json +1 -1
@@ -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.2.15",
47
- "User-Agent": "agentmail/0.2.15",
46
+ "X-Fern-SDK-Version": "0.2.17",
47
+ "User-Agent": "agentmail/0.2.17",
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);
@@ -4,7 +4,7 @@ export declare namespace WebsocketsSocket {
4
4
  interface Args {
5
5
  socket: core.ReconnectingWebSocket;
6
6
  }
7
- type Response = AgentMail.Subscribed | AgentMail.MessageReceivedEvent | AgentMail.MessageSentEvent | AgentMail.MessageDeliveredEvent | AgentMail.MessageBouncedEvent | AgentMail.MessageComplainedEvent | AgentMail.MessageRejectedEvent | AgentMail.DomainVerifiedEvent;
7
+ type Response = AgentMail.Subscribed | AgentMail.MessageReceivedEvent | AgentMail.MessageSentEvent | AgentMail.MessageDeliveredEvent | AgentMail.MessageBouncedEvent | AgentMail.MessageComplainedEvent | AgentMail.MessageRejectedEvent | AgentMail.DomainVerifiedEvent | AgentMail.Error_;
8
8
  type EventHandlers = {
9
9
  open?: () => void;
10
10
  message?: (message: Response) => void;
@@ -0,0 +1,6 @@
1
+ import type * as AgentMail from "../../../index.js";
2
+ export interface Error_ {
3
+ type: "error";
4
+ name: AgentMail.ErrorName;
5
+ message: AgentMail.ErrorMessage;
6
+ }
@@ -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,2 +1,3 @@
1
+ export * from "./Error_.js";
1
2
  export * from "./Subscribe.js";
2
3
  export * from "./Subscribed.js";
@@ -14,5 +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("./Error_.js"), exports);
17
18
  __exportStar(require("./Subscribe.js"), exports);
18
19
  __exportStar(require("./Subscribed.js"), exports);
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Error message.
3
+ */
4
+ export type ErrorMessage = string;
@@ -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,6 +1,5 @@
1
1
  import type * as AgentMail from "../index.js";
2
2
  export interface ErrorResponse {
3
3
  name: AgentMail.ErrorName;
4
- /** Error message. */
5
- message: string;
4
+ message: AgentMail.ErrorMessage;
6
5
  }
@@ -2,6 +2,7 @@ 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 "./ErrorMessage.js";
5
6
  export * from "./ErrorName.js";
6
7
  export * from "./ErrorResponse.js";
7
8
  export * from "./IncludeSpam.js";
@@ -18,6 +18,7 @@ __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("./ErrorMessage.js"), exports);
21
22
  __exportStar(require("./ErrorName.js"), exports);
22
23
  __exportStar(require("./ErrorResponse.js"), exports);
23
24
  __exportStar(require("./IncludeSpam.js"), exports);
@@ -11,5 +11,9 @@ export declare const AgentMailEnvironment: {
11
11
  readonly http: "https://x402.api.agentmail.to";
12
12
  readonly websockets: "wss://x402.ws.agentmail.to";
13
13
  };
14
+ readonly EuProd: {
15
+ readonly http: "https://api.agentmail.eu";
16
+ readonly websockets: "wss://ws.agentmail.eu";
17
+ };
14
18
  };
15
- export type AgentMailEnvironment = typeof AgentMailEnvironment.Prod | typeof AgentMailEnvironment.ProdX402;
19
+ export type AgentMailEnvironment = typeof AgentMailEnvironment.Prod | typeof AgentMailEnvironment.ProdX402 | typeof AgentMailEnvironment.EuProd;
@@ -11,4 +11,8 @@ exports.AgentMailEnvironment = {
11
11
  http: "https://x402.api.agentmail.to",
12
12
  websockets: "wss://x402.ws.agentmail.to",
13
13
  },
14
+ EuProd: {
15
+ http: "https://api.agentmail.eu",
16
+ websockets: "wss://ws.agentmail.eu",
17
+ },
14
18
  };
@@ -8,8 +8,9 @@ import { MessageDeliveredEvent } from "../../../events/types/MessageDeliveredEve
8
8
  import { MessageReceivedEvent } from "../../../events/types/MessageReceivedEvent.js";
9
9
  import { MessageRejectedEvent } from "../../../events/types/MessageRejectedEvent.js";
10
10
  import { MessageSentEvent } from "../../../events/types/MessageSentEvent.js";
11
+ import { Error_ } from "../../types/Error_.js";
11
12
  import { Subscribed } from "../../types/Subscribed.js";
12
- export declare const WebsocketsSocketResponse: core.serialization.Schema<serializers.WebsocketsSocketResponse.Raw, AgentMail.Subscribed | AgentMail.MessageReceivedEvent | AgentMail.MessageSentEvent | AgentMail.MessageDeliveredEvent | AgentMail.MessageBouncedEvent | AgentMail.MessageComplainedEvent | AgentMail.MessageRejectedEvent | AgentMail.DomainVerifiedEvent>;
13
+ export declare const WebsocketsSocketResponse: core.serialization.Schema<serializers.WebsocketsSocketResponse.Raw, AgentMail.Subscribed | AgentMail.MessageReceivedEvent | AgentMail.MessageSentEvent | AgentMail.MessageDeliveredEvent | AgentMail.MessageBouncedEvent | AgentMail.MessageComplainedEvent | AgentMail.MessageRejectedEvent | AgentMail.DomainVerifiedEvent | AgentMail.Error_>;
13
14
  export declare namespace WebsocketsSocketResponse {
14
- type Raw = Subscribed.Raw | MessageReceivedEvent.Raw | MessageSentEvent.Raw | MessageDeliveredEvent.Raw | MessageBouncedEvent.Raw | MessageComplainedEvent.Raw | MessageRejectedEvent.Raw | DomainVerifiedEvent.Raw;
15
+ type Raw = Subscribed.Raw | MessageReceivedEvent.Raw | MessageSentEvent.Raw | MessageDeliveredEvent.Raw | MessageBouncedEvent.Raw | MessageComplainedEvent.Raw | MessageRejectedEvent.Raw | DomainVerifiedEvent.Raw | Error_.Raw;
15
16
  }
@@ -43,6 +43,7 @@ const MessageDeliveredEvent_js_1 = require("../../../events/types/MessageDeliver
43
43
  const MessageReceivedEvent_js_1 = require("../../../events/types/MessageReceivedEvent.js");
44
44
  const MessageRejectedEvent_js_1 = require("../../../events/types/MessageRejectedEvent.js");
45
45
  const MessageSentEvent_js_1 = require("../../../events/types/MessageSentEvent.js");
46
+ const Error__js_1 = require("../../types/Error_.js");
46
47
  const Subscribed_js_1 = require("../../types/Subscribed.js");
47
48
  exports.WebsocketsSocketResponse = core.serialization.undiscriminatedUnion([
48
49
  Subscribed_js_1.Subscribed,
@@ -53,4 +54,5 @@ exports.WebsocketsSocketResponse = core.serialization.undiscriminatedUnion([
53
54
  MessageComplainedEvent_js_1.MessageComplainedEvent,
54
55
  MessageRejectedEvent_js_1.MessageRejectedEvent,
55
56
  DomainVerifiedEvent_js_1.DomainVerifiedEvent,
57
+ Error__js_1.Error_,
56
58
  ]);
@@ -0,0 +1,13 @@
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 { ErrorMessage } from "../../../types/ErrorMessage.js";
5
+ import { ErrorName } from "../../../types/ErrorName.js";
6
+ export declare const Error_: core.serialization.ObjectSchema<serializers.Error_.Raw, AgentMail.Error_>;
7
+ export declare namespace Error_ {
8
+ interface Raw {
9
+ type: "error";
10
+ name: ErrorName.Raw;
11
+ message: ErrorMessage.Raw;
12
+ }
13
+ }
@@ -0,0 +1,45 @@
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.Error_ = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ const ErrorMessage_js_1 = require("../../../types/ErrorMessage.js");
40
+ const ErrorName_js_1 = require("../../../types/ErrorName.js");
41
+ exports.Error_ = core.serialization.object({
42
+ type: core.serialization.stringLiteral("error"),
43
+ name: ErrorName_js_1.ErrorName,
44
+ message: ErrorMessage_js_1.ErrorMessage,
45
+ });
@@ -1,2 +1,3 @@
1
+ export * from "./Error_.js";
1
2
  export * from "./Subscribe.js";
2
3
  export * from "./Subscribed.js";
@@ -14,5 +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("./Error_.js"), exports);
17
18
  __exportStar(require("./Subscribe.js"), exports);
18
19
  __exportStar(require("./Subscribed.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 ErrorMessage: core.serialization.Schema<serializers.ErrorMessage.Raw, AgentMail.ErrorMessage>;
5
+ export declare namespace ErrorMessage {
6
+ type Raw = string;
7
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.ErrorMessage = void 0;
38
+ const core = __importStar(require("../../core/index.js"));
39
+ exports.ErrorMessage = core.serialization.string();
@@ -1,11 +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 { ErrorMessage } from "./ErrorMessage.js";
4
5
  import { ErrorName } from "./ErrorName.js";
5
6
  export declare const ErrorResponse: core.serialization.ObjectSchema<serializers.ErrorResponse.Raw, AgentMail.ErrorResponse>;
6
7
  export declare namespace ErrorResponse {
7
8
  interface Raw {
8
9
  name: ErrorName.Raw;
9
- message: string;
10
+ message: ErrorMessage.Raw;
10
11
  }
11
12
  }
@@ -36,8 +36,9 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.ErrorResponse = void 0;
38
38
  const core = __importStar(require("../../core/index.js"));
39
+ const ErrorMessage_js_1 = require("./ErrorMessage.js");
39
40
  const ErrorName_js_1 = require("./ErrorName.js");
40
41
  exports.ErrorResponse = core.serialization.object({
41
42
  name: ErrorName_js_1.ErrorName,
42
- message: core.serialization.string(),
43
+ message: ErrorMessage_js_1.ErrorMessage,
43
44
  });
@@ -2,6 +2,7 @@ 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 "./ErrorMessage.js";
5
6
  export * from "./ErrorName.js";
6
7
  export * from "./ErrorResponse.js";
7
8
  export * from "./IncludeSpam.js";
@@ -18,6 +18,7 @@ __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("./ErrorMessage.js"), exports);
21
22
  __exportStar(require("./ErrorName.js"), exports);
22
23
  __exportStar(require("./ErrorResponse.js"), exports);
23
24
  __exportStar(require("./IncludeSpam.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.2.15";
1
+ export declare const SDK_VERSION = "0.2.17";
@@ -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.2.15";
4
+ exports.SDK_VERSION = "0.2.17";
@@ -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.2.15",
10
- "User-Agent": "agentmail/0.2.15",
9
+ "X-Fern-SDK-Version": "0.2.17",
10
+ "User-Agent": "agentmail/0.2.17",
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);
@@ -4,7 +4,7 @@ export declare namespace WebsocketsSocket {
4
4
  interface Args {
5
5
  socket: core.ReconnectingWebSocket;
6
6
  }
7
- type Response = AgentMail.Subscribed | AgentMail.MessageReceivedEvent | AgentMail.MessageSentEvent | AgentMail.MessageDeliveredEvent | AgentMail.MessageBouncedEvent | AgentMail.MessageComplainedEvent | AgentMail.MessageRejectedEvent | AgentMail.DomainVerifiedEvent;
7
+ type Response = AgentMail.Subscribed | AgentMail.MessageReceivedEvent | AgentMail.MessageSentEvent | AgentMail.MessageDeliveredEvent | AgentMail.MessageBouncedEvent | AgentMail.MessageComplainedEvent | AgentMail.MessageRejectedEvent | AgentMail.DomainVerifiedEvent | AgentMail.Error_;
8
8
  type EventHandlers = {
9
9
  open?: () => void;
10
10
  message?: (message: Response) => void;
@@ -0,0 +1,6 @@
1
+ import type * as AgentMail from "../../../index.mjs";
2
+ export interface Error_ {
3
+ type: "error";
4
+ name: AgentMail.ErrorName;
5
+ message: AgentMail.ErrorMessage;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,2 +1,3 @@
1
+ export * from "./Error_.mjs";
1
2
  export * from "./Subscribe.mjs";
2
3
  export * from "./Subscribed.mjs";
@@ -1,2 +1,3 @@
1
+ export * from "./Error_.mjs";
1
2
  export * from "./Subscribe.mjs";
2
3
  export * from "./Subscribed.mjs";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Error message.
3
+ */
4
+ export type ErrorMessage = string;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,6 +1,5 @@
1
1
  import type * as AgentMail from "../index.mjs";
2
2
  export interface ErrorResponse {
3
3
  name: AgentMail.ErrorName;
4
- /** Error message. */
5
- message: string;
4
+ message: AgentMail.ErrorMessage;
6
5
  }
@@ -2,6 +2,7 @@ export * from "./After.mjs";
2
2
  export * from "./Ascending.mjs";
3
3
  export * from "./Before.mjs";
4
4
  export * from "./Count.mjs";
5
+ export * from "./ErrorMessage.mjs";
5
6
  export * from "./ErrorName.mjs";
6
7
  export * from "./ErrorResponse.mjs";
7
8
  export * from "./IncludeSpam.mjs";
@@ -2,6 +2,7 @@ export * from "./After.mjs";
2
2
  export * from "./Ascending.mjs";
3
3
  export * from "./Before.mjs";
4
4
  export * from "./Count.mjs";
5
+ export * from "./ErrorMessage.mjs";
5
6
  export * from "./ErrorName.mjs";
6
7
  export * from "./ErrorResponse.mjs";
7
8
  export * from "./IncludeSpam.mjs";
@@ -11,5 +11,9 @@ export declare const AgentMailEnvironment: {
11
11
  readonly http: "https://x402.api.agentmail.to";
12
12
  readonly websockets: "wss://x402.ws.agentmail.to";
13
13
  };
14
+ readonly EuProd: {
15
+ readonly http: "https://api.agentmail.eu";
16
+ readonly websockets: "wss://ws.agentmail.eu";
17
+ };
14
18
  };
15
- export type AgentMailEnvironment = typeof AgentMailEnvironment.Prod | typeof AgentMailEnvironment.ProdX402;
19
+ export type AgentMailEnvironment = typeof AgentMailEnvironment.Prod | typeof AgentMailEnvironment.ProdX402 | typeof AgentMailEnvironment.EuProd;
@@ -8,4 +8,8 @@ export const AgentMailEnvironment = {
8
8
  http: "https://x402.api.agentmail.to",
9
9
  websockets: "wss://x402.ws.agentmail.to",
10
10
  },
11
+ EuProd: {
12
+ http: "https://api.agentmail.eu",
13
+ websockets: "wss://ws.agentmail.eu",
14
+ },
11
15
  };
@@ -8,8 +8,9 @@ import { MessageDeliveredEvent } from "../../../events/types/MessageDeliveredEve
8
8
  import { MessageReceivedEvent } from "../../../events/types/MessageReceivedEvent.mjs";
9
9
  import { MessageRejectedEvent } from "../../../events/types/MessageRejectedEvent.mjs";
10
10
  import { MessageSentEvent } from "../../../events/types/MessageSentEvent.mjs";
11
+ import { Error_ } from "../../types/Error_.mjs";
11
12
  import { Subscribed } from "../../types/Subscribed.mjs";
12
- export declare const WebsocketsSocketResponse: core.serialization.Schema<serializers.WebsocketsSocketResponse.Raw, AgentMail.Subscribed | AgentMail.MessageReceivedEvent | AgentMail.MessageSentEvent | AgentMail.MessageDeliveredEvent | AgentMail.MessageBouncedEvent | AgentMail.MessageComplainedEvent | AgentMail.MessageRejectedEvent | AgentMail.DomainVerifiedEvent>;
13
+ export declare const WebsocketsSocketResponse: core.serialization.Schema<serializers.WebsocketsSocketResponse.Raw, AgentMail.Subscribed | AgentMail.MessageReceivedEvent | AgentMail.MessageSentEvent | AgentMail.MessageDeliveredEvent | AgentMail.MessageBouncedEvent | AgentMail.MessageComplainedEvent | AgentMail.MessageRejectedEvent | AgentMail.DomainVerifiedEvent | AgentMail.Error_>;
13
14
  export declare namespace WebsocketsSocketResponse {
14
- type Raw = Subscribed.Raw | MessageReceivedEvent.Raw | MessageSentEvent.Raw | MessageDeliveredEvent.Raw | MessageBouncedEvent.Raw | MessageComplainedEvent.Raw | MessageRejectedEvent.Raw | DomainVerifiedEvent.Raw;
15
+ type Raw = Subscribed.Raw | MessageReceivedEvent.Raw | MessageSentEvent.Raw | MessageDeliveredEvent.Raw | MessageBouncedEvent.Raw | MessageComplainedEvent.Raw | MessageRejectedEvent.Raw | DomainVerifiedEvent.Raw | Error_.Raw;
15
16
  }
@@ -7,6 +7,7 @@ import { MessageDeliveredEvent } from "../../../events/types/MessageDeliveredEve
7
7
  import { MessageReceivedEvent } from "../../../events/types/MessageReceivedEvent.mjs";
8
8
  import { MessageRejectedEvent } from "../../../events/types/MessageRejectedEvent.mjs";
9
9
  import { MessageSentEvent } from "../../../events/types/MessageSentEvent.mjs";
10
+ import { Error_ } from "../../types/Error_.mjs";
10
11
  import { Subscribed } from "../../types/Subscribed.mjs";
11
12
  export const WebsocketsSocketResponse = core.serialization.undiscriminatedUnion([
12
13
  Subscribed,
@@ -17,4 +18,5 @@ export const WebsocketsSocketResponse = core.serialization.undiscriminatedUnion(
17
18
  MessageComplainedEvent,
18
19
  MessageRejectedEvent,
19
20
  DomainVerifiedEvent,
21
+ Error_,
20
22
  ]);
@@ -0,0 +1,13 @@
1
+ import type * as AgentMail from "../../../../api/index.mjs";
2
+ import * as core from "../../../../core/index.mjs";
3
+ import type * as serializers from "../../../index.mjs";
4
+ import { ErrorMessage } from "../../../types/ErrorMessage.mjs";
5
+ import { ErrorName } from "../../../types/ErrorName.mjs";
6
+ export declare const Error_: core.serialization.ObjectSchema<serializers.Error_.Raw, AgentMail.Error_>;
7
+ export declare namespace Error_ {
8
+ interface Raw {
9
+ type: "error";
10
+ name: ErrorName.Raw;
11
+ message: ErrorMessage.Raw;
12
+ }
13
+ }
@@ -0,0 +1,9 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../../../core/index.mjs";
3
+ import { ErrorMessage } from "../../../types/ErrorMessage.mjs";
4
+ import { ErrorName } from "../../../types/ErrorName.mjs";
5
+ export const Error_ = core.serialization.object({
6
+ type: core.serialization.stringLiteral("error"),
7
+ name: ErrorName,
8
+ message: ErrorMessage,
9
+ });
@@ -1,2 +1,3 @@
1
+ export * from "./Error_.mjs";
1
2
  export * from "./Subscribe.mjs";
2
3
  export * from "./Subscribed.mjs";
@@ -1,2 +1,3 @@
1
+ export * from "./Error_.mjs";
1
2
  export * from "./Subscribe.mjs";
2
3
  export * from "./Subscribed.mjs";
@@ -0,0 +1,7 @@
1
+ import type * as AgentMail from "../../api/index.mjs";
2
+ import * as core from "../../core/index.mjs";
3
+ import type * as serializers from "../index.mjs";
4
+ export declare const ErrorMessage: core.serialization.Schema<serializers.ErrorMessage.Raw, AgentMail.ErrorMessage>;
5
+ export declare namespace ErrorMessage {
6
+ type Raw = string;
7
+ }
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../core/index.mjs";
3
+ export const ErrorMessage = core.serialization.string();
@@ -1,11 +1,12 @@
1
1
  import type * as AgentMail from "../../api/index.mjs";
2
2
  import * as core from "../../core/index.mjs";
3
3
  import type * as serializers from "../index.mjs";
4
+ import { ErrorMessage } from "./ErrorMessage.mjs";
4
5
  import { ErrorName } from "./ErrorName.mjs";
5
6
  export declare const ErrorResponse: core.serialization.ObjectSchema<serializers.ErrorResponse.Raw, AgentMail.ErrorResponse>;
6
7
  export declare namespace ErrorResponse {
7
8
  interface Raw {
8
9
  name: ErrorName.Raw;
9
- message: string;
10
+ message: ErrorMessage.Raw;
10
11
  }
11
12
  }
@@ -1,7 +1,8 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import * as core from "../../core/index.mjs";
3
+ import { ErrorMessage } from "./ErrorMessage.mjs";
3
4
  import { ErrorName } from "./ErrorName.mjs";
4
5
  export const ErrorResponse = core.serialization.object({
5
6
  name: ErrorName,
6
- message: core.serialization.string(),
7
+ message: ErrorMessage,
7
8
  });
@@ -2,6 +2,7 @@ export * from "./After.mjs";
2
2
  export * from "./Ascending.mjs";
3
3
  export * from "./Before.mjs";
4
4
  export * from "./Count.mjs";
5
+ export * from "./ErrorMessage.mjs";
5
6
  export * from "./ErrorName.mjs";
6
7
  export * from "./ErrorResponse.mjs";
7
8
  export * from "./IncludeSpam.mjs";
@@ -2,6 +2,7 @@ export * from "./After.mjs";
2
2
  export * from "./Ascending.mjs";
3
3
  export * from "./Before.mjs";
4
4
  export * from "./Count.mjs";
5
+ export * from "./ErrorMessage.mjs";
5
6
  export * from "./ErrorName.mjs";
6
7
  export * from "./ErrorResponse.mjs";
7
8
  export * from "./IncludeSpam.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.2.15";
1
+ export declare const SDK_VERSION = "0.2.17";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.2.15";
1
+ export const SDK_VERSION = "0.2.17";
@@ -4593,6 +4593,59 @@ main();
4593
4593
  ***
4594
4594
 
4595
4595
 
4596
+ ***
4597
+
4598
+ title: WebSockets Quickstart
4599
+ subtitle: Get started with real-time email event streaming
4600
+ slug: websockets/quickstart
4601
+ ---------------------------
4602
+
4603
+ ```typescript title="TypeScript"
4604
+ import { AgentMailClient } from "agentmail";
4605
+
4606
+ const client = new AgentMailClient();
4607
+
4608
+ async function main() {
4609
+ const socket = await client.websockets.connect({
4610
+ apiKey: process.env.AGENTMAIL_API_KEY,
4611
+ });
4612
+
4613
+ socket.on("message", async (event) => {
4614
+ if (event.type === "subscribed") {
4615
+ console.log("Subscribed to", event.inboxIds);
4616
+ } else if (event.eventType === "message.received") {
4617
+ console.log(`Received message from: ${event.message.from}`);
4618
+ }
4619
+ });
4620
+
4621
+ await socket.waitForOpen();
4622
+
4623
+ socket.sendSubscribe({
4624
+ type: "subscribe",
4625
+ inboxIds: ["my-agent@agentmail.to"],
4626
+ });
4627
+ }
4628
+
4629
+ main();
4630
+ ```
4631
+
4632
+ ```python title="Python"
4633
+ from agentmail import AgentMail, MessageReceivedEvent, Subscribe, Subscribed
4634
+
4635
+ client = AgentMail()
4636
+
4637
+ with client.websockets.connect() as socket:
4638
+ socket.send_subscribe(Subscribe(inbox_ids=["my-agent@agentmail.to"]))
4639
+
4640
+ for event in socket:
4641
+ if isinstance(event, Subscribed):
4642
+ print(f"Subscribed to {event.inbox_ids}")
4643
+ elif isinstance(event, MessageReceivedEvent):
4644
+ msg = event.message
4645
+ print(f"Received message from: {msg.from_}")
4646
+ ```
4647
+
4648
+
4596
4649
  ***
4597
4650
 
4598
4651
  title: Email Deliverability
@@ -21864,6 +21917,9 @@ servers:
21864
21917
  prod-x402:
21865
21918
  url: wss://x402.ws.agentmail.to/
21866
21919
  protocol: wss
21920
+ eu-prod:
21921
+ url: wss://ws.agentmail.eu/
21922
+ protocol: wss
21867
21923
  components:
21868
21924
  messages:
21869
21925
  subpackage_websockets.websockets-server-0-subscribed:
package/dist/llms.txt CHANGED
@@ -26,6 +26,7 @@
26
26
  - [Webhook Setup Guide](https://docs.agentmail.to/webhook-setup.mdx): A comprehensive guide to setting up webhooks with ngrok and AgentMail, including account creation, inbox setup, and code examples.
27
27
  - [Verifying Webhooks](https://docs.agentmail.to/webhook-verification.mdx): Learn how to verify webhook signatures to secure your webhook endpoints and prevent spoofed requests.
28
28
  - [WebSockets](https://docs.agentmail.to/websockets.mdx): Learn how to use WebSockets for instant email notifications without webhooks or polling.
29
+ - [WebSockets Quickstart](https://docs.agentmail.to/websockets/quickstart.mdx): Get started with real-time email event streaming
29
30
  - [Email Deliverability](https://docs.agentmail.to/email-deliverability.mdx): Learn the strategies and best practices for maximizing your email deliverability with AgentMail.
30
31
  - [Idempotent Requests](https://docs.agentmail.to/idempotency.mdx): A guide to using the client_id parameter in AgentMail to prevent duplicate resources and safely retry API requests.
31
32
  - [Example: Event-Driven Agent](https://docs.agentmail.to/webhook-agent.mdx): A step-by-step guide to building a sophisticated agent that performs proactive outreach and uses webhooks for inbound message processing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentmail",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",