agentmail 0.0.20 → 0.0.22

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 (196) hide show
  1. package/Client.d.ts +3 -0
  2. package/Client.js +5 -0
  3. package/api/resources/inboxes/client/Client.js +3 -3
  4. package/api/resources/inboxes/types/Inbox.d.ts +1 -1
  5. package/api/resources/index.d.ts +3 -0
  6. package/api/resources/index.js +4 -1
  7. package/api/resources/messages/client/Client.js +5 -5
  8. package/api/resources/messages/types/MessageInReplyTo.d.ts +1 -1
  9. package/api/resources/messages/types/MessageReferences.d.ts +1 -1
  10. package/api/resources/messages/types/MessageReplyTo.d.ts +1 -1
  11. package/api/resources/threads/client/Client.js +2 -2
  12. package/api/resources/webhooks/client/Client.d.ts +71 -0
  13. package/api/resources/webhooks/client/Client.js +316 -0
  14. package/api/resources/webhooks/client/index.d.ts +1 -0
  15. package/api/resources/webhooks/client/index.js +17 -0
  16. package/api/resources/webhooks/client/requests/ListWebhooksRequest.d.ts +12 -0
  17. package/api/resources/webhooks/client/requests/ListWebhooksRequest.js +5 -0
  18. package/api/resources/webhooks/client/requests/index.d.ts +1 -0
  19. package/api/resources/webhooks/client/requests/index.js +2 -0
  20. package/api/resources/webhooks/index.d.ts +2 -0
  21. package/api/resources/webhooks/index.js +18 -0
  22. package/api/resources/webhooks/types/CreateWebhookRequest.d.ts +9 -0
  23. package/api/resources/webhooks/types/CreateWebhookRequest.js +5 -0
  24. package/api/resources/webhooks/types/EventId.d.ts +7 -0
  25. package/api/resources/webhooks/types/EventId.js +5 -0
  26. package/api/resources/webhooks/types/EventType.d.ts +7 -0
  27. package/api/resources/webhooks/types/EventType.js +9 -0
  28. package/api/resources/webhooks/types/Events.d.ts +8 -0
  29. package/api/resources/webhooks/types/Events.js +5 -0
  30. package/api/resources/webhooks/types/Inboxes.d.ts +7 -0
  31. package/api/resources/webhooks/types/Inboxes.js +5 -0
  32. package/api/resources/webhooks/types/ListWebhooksResponse.d.ts +11 -0
  33. package/api/resources/webhooks/types/ListWebhooksResponse.js +5 -0
  34. package/api/resources/webhooks/types/MessageReceivedPayload.d.ts +7 -0
  35. package/api/resources/webhooks/types/MessageReceivedPayload.js +5 -0
  36. package/api/resources/webhooks/types/Payload.d.ts +8 -0
  37. package/api/resources/webhooks/types/Payload.js +5 -0
  38. package/api/resources/webhooks/types/SvixId.d.ts +7 -0
  39. package/api/resources/webhooks/types/SvixId.js +5 -0
  40. package/api/resources/webhooks/types/SvixSignature.d.ts +7 -0
  41. package/api/resources/webhooks/types/SvixSignature.js +5 -0
  42. package/api/resources/webhooks/types/SvixTimestamp.d.ts +7 -0
  43. package/api/resources/webhooks/types/SvixTimestamp.js +5 -0
  44. package/api/resources/webhooks/types/Url.d.ts +7 -0
  45. package/api/resources/webhooks/types/Url.js +5 -0
  46. package/api/resources/webhooks/types/Webhook.d.ts +14 -0
  47. package/api/resources/webhooks/types/Webhook.js +5 -0
  48. package/api/resources/webhooks/types/WebhookId.d.ts +7 -0
  49. package/api/resources/webhooks/types/WebhookId.js +5 -0
  50. package/api/resources/webhooks/types/index.d.ts +14 -0
  51. package/api/resources/webhooks/types/index.js +30 -0
  52. package/dist/Client.d.ts +3 -0
  53. package/dist/Client.js +5 -0
  54. package/dist/api/resources/inboxes/client/Client.js +3 -3
  55. package/dist/api/resources/inboxes/types/Inbox.d.ts +1 -1
  56. package/dist/api/resources/index.d.ts +3 -0
  57. package/dist/api/resources/index.js +4 -1
  58. package/dist/api/resources/messages/client/Client.js +5 -5
  59. package/dist/api/resources/messages/types/MessageInReplyTo.d.ts +1 -1
  60. package/dist/api/resources/messages/types/MessageReferences.d.ts +1 -1
  61. package/dist/api/resources/messages/types/MessageReplyTo.d.ts +1 -1
  62. package/dist/api/resources/threads/client/Client.js +2 -2
  63. package/dist/api/resources/webhooks/client/Client.d.ts +71 -0
  64. package/dist/api/resources/webhooks/client/Client.js +316 -0
  65. package/dist/api/resources/webhooks/client/index.d.ts +1 -0
  66. package/dist/api/resources/webhooks/client/index.js +17 -0
  67. package/dist/api/resources/webhooks/client/requests/ListWebhooksRequest.d.ts +12 -0
  68. package/dist/api/resources/webhooks/client/requests/ListWebhooksRequest.js +5 -0
  69. package/dist/api/resources/webhooks/client/requests/index.d.ts +1 -0
  70. package/dist/api/resources/webhooks/client/requests/index.js +2 -0
  71. package/dist/api/resources/webhooks/index.d.ts +2 -0
  72. package/dist/api/resources/webhooks/index.js +18 -0
  73. package/dist/api/resources/webhooks/types/CreateWebhookRequest.d.ts +9 -0
  74. package/dist/api/resources/webhooks/types/CreateWebhookRequest.js +5 -0
  75. package/dist/api/resources/webhooks/types/EventId.d.ts +7 -0
  76. package/dist/api/resources/webhooks/types/EventId.js +5 -0
  77. package/dist/api/resources/webhooks/types/EventType.d.ts +7 -0
  78. package/dist/api/resources/webhooks/types/EventType.js +9 -0
  79. package/dist/api/resources/webhooks/types/Events.d.ts +8 -0
  80. package/dist/api/resources/webhooks/types/Events.js +5 -0
  81. package/dist/api/resources/webhooks/types/Inboxes.d.ts +7 -0
  82. package/dist/api/resources/webhooks/types/Inboxes.js +5 -0
  83. package/dist/api/resources/webhooks/types/ListWebhooksResponse.d.ts +11 -0
  84. package/dist/api/resources/webhooks/types/ListWebhooksResponse.js +5 -0
  85. package/dist/api/resources/webhooks/types/MessageReceivedPayload.d.ts +7 -0
  86. package/dist/api/resources/webhooks/types/MessageReceivedPayload.js +5 -0
  87. package/dist/api/resources/webhooks/types/Payload.d.ts +8 -0
  88. package/dist/api/resources/webhooks/types/Payload.js +5 -0
  89. package/dist/api/resources/webhooks/types/SvixId.d.ts +7 -0
  90. package/dist/api/resources/webhooks/types/SvixId.js +5 -0
  91. package/dist/api/resources/webhooks/types/SvixSignature.d.ts +7 -0
  92. package/dist/api/resources/webhooks/types/SvixSignature.js +5 -0
  93. package/dist/api/resources/webhooks/types/SvixTimestamp.d.ts +7 -0
  94. package/dist/api/resources/webhooks/types/SvixTimestamp.js +5 -0
  95. package/dist/api/resources/webhooks/types/Url.d.ts +7 -0
  96. package/dist/api/resources/webhooks/types/Url.js +5 -0
  97. package/dist/api/resources/webhooks/types/Webhook.d.ts +14 -0
  98. package/dist/api/resources/webhooks/types/Webhook.js +5 -0
  99. package/dist/api/resources/webhooks/types/WebhookId.d.ts +7 -0
  100. package/dist/api/resources/webhooks/types/WebhookId.js +5 -0
  101. package/dist/api/resources/webhooks/types/index.d.ts +14 -0
  102. package/dist/api/resources/webhooks/types/index.js +30 -0
  103. package/dist/serialization/resources/inboxes/types/Inbox.d.ts +1 -1
  104. package/dist/serialization/resources/inboxes/types/Inbox.js +1 -1
  105. package/dist/serialization/resources/index.d.ts +2 -0
  106. package/dist/serialization/resources/index.js +3 -1
  107. package/dist/serialization/resources/messages/types/Message.d.ts +3 -3
  108. package/dist/serialization/resources/messages/types/Message.js +3 -3
  109. package/dist/serialization/resources/messages/types/MessageInReplyTo.d.ts +1 -1
  110. package/dist/serialization/resources/messages/types/MessageInReplyTo.js +1 -1
  111. package/dist/serialization/resources/messages/types/MessageReferences.d.ts +1 -1
  112. package/dist/serialization/resources/messages/types/MessageReferences.js +1 -1
  113. package/dist/serialization/resources/messages/types/MessageReplyTo.d.ts +1 -1
  114. package/dist/serialization/resources/messages/types/MessageReplyTo.js +1 -1
  115. package/dist/serialization/resources/webhooks/index.d.ts +1 -0
  116. package/dist/serialization/resources/webhooks/index.js +17 -0
  117. package/dist/serialization/resources/webhooks/types/CreateWebhookRequest.d.ts +17 -0
  118. package/dist/serialization/resources/webhooks/types/CreateWebhookRequest.js +48 -0
  119. package/dist/serialization/resources/webhooks/types/EventId.d.ts +10 -0
  120. package/dist/serialization/resources/webhooks/types/EventId.js +41 -0
  121. package/dist/serialization/resources/webhooks/types/EventType.d.ts +10 -0
  122. package/dist/serialization/resources/webhooks/types/EventType.js +41 -0
  123. package/dist/serialization/resources/webhooks/types/Events.d.ts +11 -0
  124. package/dist/serialization/resources/webhooks/types/Events.js +42 -0
  125. package/dist/serialization/resources/webhooks/types/Inboxes.d.ts +10 -0
  126. package/dist/serialization/resources/webhooks/types/Inboxes.js +41 -0
  127. package/dist/serialization/resources/webhooks/types/ListWebhooksResponse.d.ts +19 -0
  128. package/dist/serialization/resources/webhooks/types/ListWebhooksResponse.js +50 -0
  129. package/dist/serialization/resources/webhooks/types/MessageReceivedPayload.d.ts +14 -0
  130. package/dist/serialization/resources/webhooks/types/MessageReceivedPayload.js +47 -0
  131. package/dist/serialization/resources/webhooks/types/Payload.d.ts +15 -0
  132. package/dist/serialization/resources/webhooks/types/Payload.js +46 -0
  133. package/dist/serialization/resources/webhooks/types/SvixId.d.ts +10 -0
  134. package/dist/serialization/resources/webhooks/types/SvixId.js +41 -0
  135. package/dist/serialization/resources/webhooks/types/SvixSignature.d.ts +10 -0
  136. package/dist/serialization/resources/webhooks/types/SvixSignature.js +41 -0
  137. package/dist/serialization/resources/webhooks/types/SvixTimestamp.d.ts +10 -0
  138. package/dist/serialization/resources/webhooks/types/SvixTimestamp.js +41 -0
  139. package/dist/serialization/resources/webhooks/types/Url.d.ts +10 -0
  140. package/dist/serialization/resources/webhooks/types/Url.js +41 -0
  141. package/dist/serialization/resources/webhooks/types/Webhook.d.ts +21 -0
  142. package/dist/serialization/resources/webhooks/types/Webhook.js +52 -0
  143. package/dist/serialization/resources/webhooks/types/WebhookId.d.ts +10 -0
  144. package/dist/serialization/resources/webhooks/types/WebhookId.js +41 -0
  145. package/dist/serialization/resources/webhooks/types/index.d.ts +14 -0
  146. package/dist/serialization/resources/webhooks/types/index.js +30 -0
  147. package/dist/version.d.ts +1 -1
  148. package/dist/version.js +1 -1
  149. package/package.json +1 -1
  150. package/reference.md +198 -0
  151. package/serialization/resources/inboxes/types/Inbox.d.ts +1 -1
  152. package/serialization/resources/inboxes/types/Inbox.js +1 -1
  153. package/serialization/resources/index.d.ts +2 -0
  154. package/serialization/resources/index.js +3 -1
  155. package/serialization/resources/messages/types/Message.d.ts +3 -3
  156. package/serialization/resources/messages/types/Message.js +3 -3
  157. package/serialization/resources/messages/types/MessageInReplyTo.d.ts +1 -1
  158. package/serialization/resources/messages/types/MessageInReplyTo.js +1 -1
  159. package/serialization/resources/messages/types/MessageReferences.d.ts +1 -1
  160. package/serialization/resources/messages/types/MessageReferences.js +1 -1
  161. package/serialization/resources/messages/types/MessageReplyTo.d.ts +1 -1
  162. package/serialization/resources/messages/types/MessageReplyTo.js +1 -1
  163. package/serialization/resources/webhooks/index.d.ts +1 -0
  164. package/serialization/resources/webhooks/index.js +17 -0
  165. package/serialization/resources/webhooks/types/CreateWebhookRequest.d.ts +17 -0
  166. package/serialization/resources/webhooks/types/CreateWebhookRequest.js +48 -0
  167. package/serialization/resources/webhooks/types/EventId.d.ts +10 -0
  168. package/serialization/resources/webhooks/types/EventId.js +41 -0
  169. package/serialization/resources/webhooks/types/EventType.d.ts +10 -0
  170. package/serialization/resources/webhooks/types/EventType.js +41 -0
  171. package/serialization/resources/webhooks/types/Events.d.ts +11 -0
  172. package/serialization/resources/webhooks/types/Events.js +42 -0
  173. package/serialization/resources/webhooks/types/Inboxes.d.ts +10 -0
  174. package/serialization/resources/webhooks/types/Inboxes.js +41 -0
  175. package/serialization/resources/webhooks/types/ListWebhooksResponse.d.ts +19 -0
  176. package/serialization/resources/webhooks/types/ListWebhooksResponse.js +50 -0
  177. package/serialization/resources/webhooks/types/MessageReceivedPayload.d.ts +14 -0
  178. package/serialization/resources/webhooks/types/MessageReceivedPayload.js +47 -0
  179. package/serialization/resources/webhooks/types/Payload.d.ts +15 -0
  180. package/serialization/resources/webhooks/types/Payload.js +46 -0
  181. package/serialization/resources/webhooks/types/SvixId.d.ts +10 -0
  182. package/serialization/resources/webhooks/types/SvixId.js +41 -0
  183. package/serialization/resources/webhooks/types/SvixSignature.d.ts +10 -0
  184. package/serialization/resources/webhooks/types/SvixSignature.js +41 -0
  185. package/serialization/resources/webhooks/types/SvixTimestamp.d.ts +10 -0
  186. package/serialization/resources/webhooks/types/SvixTimestamp.js +41 -0
  187. package/serialization/resources/webhooks/types/Url.d.ts +10 -0
  188. package/serialization/resources/webhooks/types/Url.js +41 -0
  189. package/serialization/resources/webhooks/types/Webhook.d.ts +21 -0
  190. package/serialization/resources/webhooks/types/Webhook.js +52 -0
  191. package/serialization/resources/webhooks/types/WebhookId.d.ts +10 -0
  192. package/serialization/resources/webhooks/types/WebhookId.js +41 -0
  193. package/serialization/resources/webhooks/types/index.d.ts +14 -0
  194. package/serialization/resources/webhooks/types/index.js +30 -0
  195. package/version.d.ts +1 -1
  196. package/version.js +1 -1
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./types";
2
+ export * from "./client";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
18
+ __exportStar(require("./client"), exports);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as AgentMail from "../../../index";
5
+ export interface CreateWebhookRequest {
6
+ url: AgentMail.Url;
7
+ events?: AgentMail.Events;
8
+ inboxes?: AgentMail.Inboxes;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * ID of event.
6
+ */
7
+ export type EventId = string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type EventType = "message.received";
5
+ export declare const EventType: {
6
+ readonly MessageReceived: "message.received";
7
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EventType = void 0;
7
+ exports.EventType = {
8
+ MessageReceived: "message.received",
9
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as AgentMail from "../../../index";
5
+ /**
6
+ * Event types to send. Omit to send all event types.
7
+ */
8
+ export type Events = AgentMail.EventType[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Inboxes for which to send events. Omit to send events for all inboxes.
6
+ */
7
+ export type Inboxes = string[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as AgentMail from "../../../index";
5
+ export interface ListWebhooksResponse {
6
+ /** Webhook items. Ordered by `created_at` ascending. */
7
+ webhooks: AgentMail.Webhook[];
8
+ count: AgentMail.Count;
9
+ limit?: AgentMail.Limit;
10
+ lastKey?: AgentMail.LastKey;
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as AgentMail from "../../../index";
5
+ export interface MessageReceivedPayload extends AgentMail.Payload {
6
+ message: AgentMail.Message;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as AgentMail from "../../../index";
5
+ export interface Payload {
6
+ eventType: AgentMail.EventType;
7
+ eventId: AgentMail.EventId;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * ID of webhook message.
6
+ */
7
+ export type SvixId = string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Signature of webhook message.
6
+ */
7
+ export type SvixSignature = string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Timestamp of webhook message.
6
+ */
7
+ export type SvixTimestamp = Date;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * URL of webhook endpoint.
6
+ */
7
+ export type Url = string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as AgentMail from "../../../index";
5
+ export interface Webhook {
6
+ webhookId: AgentMail.WebhookId;
7
+ url: AgentMail.Url;
8
+ events?: AgentMail.Events;
9
+ inboxes?: AgentMail.Inboxes;
10
+ /** Secret for webhook signature verification. */
11
+ secret: string;
12
+ /** Time at which webhook was created. */
13
+ createdAt: Date;
14
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * ID of webhook.
6
+ */
7
+ export type WebhookId = string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ export * from "./WebhookId";
2
+ export * from "./Url";
3
+ export * from "./EventType";
4
+ export * from "./Events";
5
+ export * from "./Inboxes";
6
+ export * from "./Webhook";
7
+ export * from "./ListWebhooksResponse";
8
+ export * from "./CreateWebhookRequest";
9
+ export * from "./EventId";
10
+ export * from "./Payload";
11
+ export * from "./MessageReceivedPayload";
12
+ export * from "./SvixId";
13
+ export * from "./SvixTimestamp";
14
+ export * from "./SvixSignature";
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./WebhookId"), exports);
18
+ __exportStar(require("./Url"), exports);
19
+ __exportStar(require("./EventType"), exports);
20
+ __exportStar(require("./Events"), exports);
21
+ __exportStar(require("./Inboxes"), exports);
22
+ __exportStar(require("./Webhook"), exports);
23
+ __exportStar(require("./ListWebhooksResponse"), exports);
24
+ __exportStar(require("./CreateWebhookRequest"), exports);
25
+ __exportStar(require("./EventId"), exports);
26
+ __exportStar(require("./Payload"), exports);
27
+ __exportStar(require("./MessageReceivedPayload"), exports);
28
+ __exportStar(require("./SvixId"), exports);
29
+ __exportStar(require("./SvixTimestamp"), exports);
30
+ __exportStar(require("./SvixSignature"), exports);
package/dist/Client.d.ts CHANGED
@@ -6,6 +6,7 @@ import * as core from "./core";
6
6
  import { Inboxes } from "./api/resources/inboxes/client/Client";
7
7
  import { Threads } from "./api/resources/threads/client/Client";
8
8
  import { Messages } from "./api/resources/messages/client/Client";
9
+ import { Webhooks } from "./api/resources/webhooks/client/Client";
9
10
  export declare namespace AgentMailClient {
10
11
  interface Options {
11
12
  environment?: core.Supplier<environments.AgentMailEnvironment | string>;
@@ -29,8 +30,10 @@ export declare class AgentMailClient {
29
30
  protected _inboxes: Inboxes | undefined;
30
31
  protected _threads: Threads | undefined;
31
32
  protected _messages: Messages | undefined;
33
+ protected _webhooks: Webhooks | undefined;
32
34
  constructor(_options?: AgentMailClient.Options);
33
35
  get inboxes(): Inboxes;
34
36
  get threads(): Threads;
35
37
  get messages(): Messages;
38
+ get webhooks(): Webhooks;
36
39
  }
package/dist/Client.js CHANGED
@@ -7,6 +7,7 @@ exports.AgentMailClient = void 0;
7
7
  const Client_1 = require("./api/resources/inboxes/client/Client");
8
8
  const Client_2 = require("./api/resources/threads/client/Client");
9
9
  const Client_3 = require("./api/resources/messages/client/Client");
10
+ const Client_4 = require("./api/resources/webhooks/client/Client");
10
11
  class AgentMailClient {
11
12
  constructor(_options = {}) {
12
13
  this._options = _options;
@@ -23,5 +24,9 @@ class AgentMailClient {
23
24
  var _a;
24
25
  return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_3.Messages(this._options)));
25
26
  }
27
+ get webhooks() {
28
+ var _a;
29
+ return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_4.Webhooks(this._options)));
30
+ }
26
31
  }
27
32
  exports.AgentMailClient = AgentMailClient;
@@ -83,7 +83,7 @@ class Inboxes {
83
83
  const _response = yield core.fetcher({
84
84
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, "/v0/inboxes"),
85
85
  method: "GET",
86
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.20", "User-Agent": "agentmail/0.0.20", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
86
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
87
  contentType: "application/json",
88
88
  queryParameters: _queryParams,
89
89
  requestType: "json",
@@ -135,7 +135,7 @@ class Inboxes {
135
135
  const _response = yield core.fetcher({
136
136
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}`),
137
137
  method: "GET",
138
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.20", "User-Agent": "agentmail/0.0.20", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
138
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
139
139
  contentType: "application/json",
140
140
  requestType: "json",
141
141
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -204,7 +204,7 @@ class Inboxes {
204
204
  const _response = yield core.fetcher({
205
205
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, "/v0/inboxes"),
206
206
  method: "POST",
207
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.20", "User-Agent": "agentmail/0.0.20", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
207
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
208
208
  contentType: "application/json",
209
209
  requestType: "json",
210
210
  body: serializers.CreateInboxRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -23,7 +23,7 @@ export interface Inbox {
23
23
  inboxId: AgentMail.InboxId;
24
24
  /** ID of organization that owns inbox. */
25
25
  organizationId: string;
26
- displayName: AgentMail.DisplayName;
26
+ displayName?: AgentMail.DisplayName;
27
27
  /** Time at which inbox was created. */
28
28
  createdAt: Date;
29
29
  }
@@ -4,6 +4,9 @@ export * as messages from "./messages";
4
4
  export * from "./messages/types";
5
5
  export * as threads from "./threads";
6
6
  export * from "./threads/types";
7
+ export * as webhooks from "./webhooks";
8
+ export * from "./webhooks/types";
7
9
  export * from "./inboxes/client/requests";
8
10
  export * from "./messages/client/requests";
9
11
  export * from "./threads/client/requests";
12
+ export * from "./webhooks/client/requests";
@@ -36,13 +36,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.threads = exports.messages = exports.inboxes = void 0;
39
+ exports.webhooks = exports.threads = exports.messages = exports.inboxes = void 0;
40
40
  exports.inboxes = __importStar(require("./inboxes"));
41
41
  __exportStar(require("./inboxes/types"), exports);
42
42
  exports.messages = __importStar(require("./messages"));
43
43
  __exportStar(require("./messages/types"), exports);
44
44
  exports.threads = __importStar(require("./threads"));
45
45
  __exportStar(require("./threads/types"), exports);
46
+ exports.webhooks = __importStar(require("./webhooks"));
47
+ __exportStar(require("./webhooks/types"), exports);
46
48
  __exportStar(require("./inboxes/client/requests"), exports);
47
49
  __exportStar(require("./messages/client/requests"), exports);
48
50
  __exportStar(require("./threads/client/requests"), exports);
51
+ __exportStar(require("./webhooks/client/requests"), exports);
@@ -91,7 +91,7 @@ class Messages {
91
91
  const _response = yield core.fetcher({
92
92
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/messages`),
93
93
  method: "GET",
94
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.20", "User-Agent": "agentmail/0.0.20", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
94
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
95
95
  contentType: "application/json",
96
96
  queryParameters: _queryParams,
97
97
  requestType: "json",
@@ -154,7 +154,7 @@ class Messages {
154
154
  const _response = yield core.fetcher({
155
155
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.MessageId.jsonOrThrow(messageId))}`),
156
156
  method: "GET",
157
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.20", "User-Agent": "agentmail/0.0.20", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
157
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
158
  contentType: "application/json",
159
159
  requestType: "json",
160
160
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -209,7 +209,7 @@ class Messages {
209
209
  const _response = yield core.fetcher({
210
210
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.MessageId.jsonOrThrow(messageId))}/attachments/${encodeURIComponent(serializers.AttachmentId.jsonOrThrow(attachmentId))}`),
211
211
  method: "GET",
212
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.20", "User-Agent": "agentmail/0.0.20", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
212
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
213
213
  contentType: "application/json",
214
214
  requestType: "json",
215
215
  responseType: "streaming",
@@ -275,7 +275,7 @@ class Messages {
275
275
  const _response = yield core.fetcher({
276
276
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/messages/send`),
277
277
  method: "POST",
278
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.20", "User-Agent": "agentmail/0.0.20", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
278
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
279
279
  contentType: "application/json",
280
280
  requestType: "json",
281
281
  body: serializers.SendMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -352,7 +352,7 @@ class Messages {
352
352
  const _response = yield core.fetcher({
353
353
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/messages/${encodeURIComponent(serializers.MessageId.jsonOrThrow(messageId))}/reply`),
354
354
  method: "POST",
355
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.20", "User-Agent": "agentmail/0.0.20", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
355
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
356
356
  contentType: "application/json",
357
357
  requestType: "json",
358
358
  body: serializers.ReplyToMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -4,4 +4,4 @@
4
4
  /**
5
5
  * ID of message being replied to.
6
6
  */
7
- export type MessageInReplyTo = string | undefined;
7
+ export type MessageInReplyTo = string;
@@ -4,4 +4,4 @@
4
4
  /**
5
5
  * IDs of previous messages in thread.
6
6
  */
7
- export type MessageReferences = string[] | undefined;
7
+ export type MessageReferences = string[];
@@ -4,4 +4,4 @@
4
4
  /**
5
5
  * Address to reply to. In format `username@domain.com` or `Display Name <username@domain.com>`.
6
6
  */
7
- export type MessageReplyTo = string | undefined;
7
+ export type MessageReplyTo = string;
@@ -91,7 +91,7 @@ class Threads {
91
91
  const _response = yield core.fetcher({
92
92
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/threads`),
93
93
  method: "GET",
94
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.20", "User-Agent": "agentmail/0.0.20", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
94
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
95
95
  contentType: "application/json",
96
96
  queryParameters: _queryParams,
97
97
  requestType: "json",
@@ -154,7 +154,7 @@ class Threads {
154
154
  const _response = yield core.fetcher({
155
155
  url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AgentMailEnvironment.Production, `/v0/inboxes/${encodeURIComponent(serializers.InboxId.jsonOrThrow(inboxId))}/threads/${encodeURIComponent(serializers.ThreadId.jsonOrThrow(threadId))}`),
156
156
  method: "GET",
157
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.20", "User-Agent": "agentmail/0.0.20", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
157
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.22", "User-Agent": "agentmail/0.0.22", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
158
  contentType: "application/json",
159
159
  requestType: "json",
160
160
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -0,0 +1,71 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments";
5
+ import * as core from "../../../../core";
6
+ import * as AgentMail from "../../../index";
7
+ export declare namespace Webhooks {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.AgentMailEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ apiKey?: core.Supplier<core.BearerToken | undefined>;
13
+ }
14
+ interface RequestOptions {
15
+ /** The maximum time to wait for a response in seconds. */
16
+ timeoutInSeconds?: number;
17
+ /** The number of times to retry the request. Defaults to 2. */
18
+ maxRetries?: number;
19
+ /** A hook to abort the request. */
20
+ abortSignal?: AbortSignal;
21
+ /** Additional headers to include in the request. */
22
+ headers?: Record<string, string>;
23
+ }
24
+ }
25
+ export declare class Webhooks {
26
+ protected readonly _options: Webhooks.Options;
27
+ constructor(_options?: Webhooks.Options);
28
+ /**
29
+ * @param {AgentMail.ListWebhooksRequest} request
30
+ * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
31
+ *
32
+ * @example
33
+ * await client.webhooks.list()
34
+ */
35
+ list(request?: AgentMail.ListWebhooksRequest, requestOptions?: Webhooks.RequestOptions): Promise<AgentMail.ListWebhooksResponse>;
36
+ /**
37
+ * @param {AgentMail.WebhookId} webhookId
38
+ * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
39
+ *
40
+ * @throws {@link AgentMail.NotFoundError}
41
+ *
42
+ * @example
43
+ * await client.webhooks.get("webhook_id")
44
+ */
45
+ get(webhookId: AgentMail.WebhookId, requestOptions?: Webhooks.RequestOptions): Promise<AgentMail.Webhook>;
46
+ /**
47
+ * @param {AgentMail.CreateWebhookRequest} request
48
+ * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
49
+ *
50
+ * @throws {@link AgentMail.ValidationError}
51
+ *
52
+ * @example
53
+ * await client.webhooks.create({
54
+ * url: "url",
55
+ * events: undefined,
56
+ * inboxes: undefined
57
+ * })
58
+ */
59
+ create(request: AgentMail.CreateWebhookRequest, requestOptions?: Webhooks.RequestOptions): Promise<AgentMail.Webhook>;
60
+ /**
61
+ * @param {AgentMail.WebhookId} webhookId
62
+ * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link AgentMail.NotFoundError}
65
+ *
66
+ * @example
67
+ * await client.webhooks.delete("webhook_id")
68
+ */
69
+ delete(webhookId: AgentMail.WebhookId, requestOptions?: Webhooks.RequestOptions): Promise<void>;
70
+ protected _getAuthorizationHeader(): Promise<string>;
71
+ }