agentmail 0.1.0 → 0.1.1

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 (127) hide show
  1. package/README.md +5 -2
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/apiKeys/client/Client.d.ts +1 -1
  4. package/dist/cjs/api/resources/apiKeys/client/Client.js +1 -1
  5. package/dist/cjs/api/resources/domains/client/Client.d.ts +1 -1
  6. package/dist/cjs/api/resources/domains/client/Client.js +1 -1
  7. package/dist/cjs/api/resources/drafts/client/Client.d.ts +1 -1
  8. package/dist/cjs/api/resources/drafts/client/Client.js +1 -1
  9. package/dist/cjs/api/resources/events/types/Bounce.d.ts +1 -0
  10. package/dist/cjs/api/resources/events/types/Complaint.d.ts +1 -0
  11. package/dist/cjs/api/resources/events/types/Delivery.d.ts +1 -0
  12. package/dist/cjs/api/resources/events/types/Reject.d.ts +1 -0
  13. package/dist/cjs/api/resources/events/types/Send.d.ts +1 -0
  14. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +1 -1
  15. package/dist/cjs/api/resources/inboxes/client/Client.js +1 -1
  16. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +1 -1
  17. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +1 -1
  18. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +1 -1
  19. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +1 -1
  20. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.d.ts +1 -1
  21. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +1 -1
  22. package/dist/cjs/api/resources/pods/client/Client.d.ts +1 -1
  23. package/dist/cjs/api/resources/pods/client/Client.js +1 -1
  24. package/dist/cjs/api/resources/pods/resources/domains/client/Client.d.ts +1 -1
  25. package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +1 -1
  26. package/dist/cjs/api/resources/pods/resources/drafts/client/Client.d.ts +1 -1
  27. package/dist/cjs/api/resources/pods/resources/drafts/client/Client.js +1 -1
  28. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.d.ts +1 -1
  29. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +1 -1
  30. package/dist/cjs/api/resources/pods/resources/threads/client/Client.d.ts +1 -1
  31. package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +1 -1
  32. package/dist/cjs/api/resources/threads/client/Client.d.ts +1 -1
  33. package/dist/cjs/api/resources/threads/client/Client.js +1 -1
  34. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +1 -1
  35. package/dist/cjs/api/resources/webhooks/client/Client.js +1 -1
  36. package/dist/cjs/core/exports.d.ts +2 -0
  37. package/dist/cjs/core/exports.js +18 -0
  38. package/dist/cjs/core/pagination/Page.d.ts +7 -6
  39. package/dist/cjs/core/pagination/Page.js +1 -0
  40. package/dist/cjs/core/pagination/exports.d.ts +1 -0
  41. package/dist/cjs/core/pagination/exports.js +2 -0
  42. package/dist/cjs/core/pagination/index.d.ts +0 -1
  43. package/dist/cjs/core/pagination/index.js +1 -3
  44. package/dist/cjs/core/websocket/exports.d.ts +8 -0
  45. package/dist/cjs/core/websocket/exports.js +2 -0
  46. package/dist/cjs/exports.d.ts +1 -0
  47. package/dist/cjs/exports.js +17 -0
  48. package/dist/cjs/index.d.ts +1 -0
  49. package/dist/cjs/index.js +4 -0
  50. package/dist/cjs/serialization/resources/events/types/Bounce.d.ts +2 -0
  51. package/dist/cjs/serialization/resources/events/types/Bounce.js +2 -0
  52. package/dist/cjs/serialization/resources/events/types/Complaint.d.ts +2 -0
  53. package/dist/cjs/serialization/resources/events/types/Complaint.js +2 -0
  54. package/dist/cjs/serialization/resources/events/types/Delivery.d.ts +2 -0
  55. package/dist/cjs/serialization/resources/events/types/Delivery.js +2 -0
  56. package/dist/cjs/serialization/resources/events/types/Reject.d.ts +2 -0
  57. package/dist/cjs/serialization/resources/events/types/Reject.js +2 -0
  58. package/dist/cjs/serialization/resources/events/types/Send.d.ts +2 -0
  59. package/dist/cjs/serialization/resources/events/types/Send.js +2 -0
  60. package/dist/cjs/version.d.ts +1 -1
  61. package/dist/cjs/version.js +1 -1
  62. package/dist/esm/Client.mjs +2 -2
  63. package/dist/esm/api/resources/apiKeys/client/Client.d.mts +1 -1
  64. package/dist/esm/api/resources/apiKeys/client/Client.mjs +1 -1
  65. package/dist/esm/api/resources/domains/client/Client.d.mts +1 -1
  66. package/dist/esm/api/resources/domains/client/Client.mjs +1 -1
  67. package/dist/esm/api/resources/drafts/client/Client.d.mts +1 -1
  68. package/dist/esm/api/resources/drafts/client/Client.mjs +1 -1
  69. package/dist/esm/api/resources/events/types/Bounce.d.mts +1 -0
  70. package/dist/esm/api/resources/events/types/Complaint.d.mts +1 -0
  71. package/dist/esm/api/resources/events/types/Delivery.d.mts +1 -0
  72. package/dist/esm/api/resources/events/types/Reject.d.mts +1 -0
  73. package/dist/esm/api/resources/events/types/Send.d.mts +1 -0
  74. package/dist/esm/api/resources/inboxes/client/Client.d.mts +1 -1
  75. package/dist/esm/api/resources/inboxes/client/Client.mjs +1 -1
  76. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +1 -1
  77. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +1 -1
  78. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +1 -1
  79. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +1 -1
  80. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.d.mts +1 -1
  81. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +1 -1
  82. package/dist/esm/api/resources/pods/client/Client.d.mts +1 -1
  83. package/dist/esm/api/resources/pods/client/Client.mjs +1 -1
  84. package/dist/esm/api/resources/pods/resources/domains/client/Client.d.mts +1 -1
  85. package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +1 -1
  86. package/dist/esm/api/resources/pods/resources/drafts/client/Client.d.mts +1 -1
  87. package/dist/esm/api/resources/pods/resources/drafts/client/Client.mjs +1 -1
  88. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.d.mts +1 -1
  89. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +1 -1
  90. package/dist/esm/api/resources/pods/resources/threads/client/Client.d.mts +1 -1
  91. package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +1 -1
  92. package/dist/esm/api/resources/threads/client/Client.d.mts +1 -1
  93. package/dist/esm/api/resources/threads/client/Client.mjs +1 -1
  94. package/dist/esm/api/resources/webhooks/client/Client.d.mts +1 -1
  95. package/dist/esm/api/resources/webhooks/client/Client.mjs +1 -1
  96. package/dist/esm/core/exports.d.mts +2 -0
  97. package/dist/esm/core/exports.mjs +2 -0
  98. package/dist/esm/core/pagination/Page.d.mts +7 -6
  99. package/dist/esm/core/pagination/Page.mjs +1 -0
  100. package/dist/esm/core/pagination/exports.d.mts +1 -0
  101. package/dist/esm/core/pagination/exports.mjs +1 -0
  102. package/dist/esm/core/pagination/index.d.mts +0 -1
  103. package/dist/esm/core/pagination/index.mjs +0 -1
  104. package/dist/esm/core/websocket/exports.d.mts +8 -0
  105. package/dist/esm/core/websocket/exports.mjs +1 -0
  106. package/dist/esm/exports.d.mts +1 -0
  107. package/dist/esm/exports.mjs +1 -0
  108. package/dist/esm/index.d.mts +1 -0
  109. package/dist/esm/index.mjs +1 -0
  110. package/dist/esm/serialization/resources/events/types/Bounce.d.mts +2 -0
  111. package/dist/esm/serialization/resources/events/types/Bounce.mjs +2 -0
  112. package/dist/esm/serialization/resources/events/types/Complaint.d.mts +2 -0
  113. package/dist/esm/serialization/resources/events/types/Complaint.mjs +2 -0
  114. package/dist/esm/serialization/resources/events/types/Delivery.d.mts +2 -0
  115. package/dist/esm/serialization/resources/events/types/Delivery.mjs +2 -0
  116. package/dist/esm/serialization/resources/events/types/Reject.d.mts +2 -0
  117. package/dist/esm/serialization/resources/events/types/Reject.mjs +2 -0
  118. package/dist/esm/serialization/resources/events/types/Send.d.mts +2 -0
  119. package/dist/esm/serialization/resources/events/types/Send.mjs +2 -0
  120. package/dist/esm/version.d.mts +1 -1
  121. package/dist/esm/version.mjs +1 -1
  122. package/package.json +1 -1
  123. package/reference.md +84 -42
  124. package/dist/cjs/core/pagination/Pageable.d.ts +0 -14
  125. package/dist/cjs/core/pagination/Pageable.js +0 -10
  126. package/dist/esm/core/pagination/Pageable.d.mts +0 -14
  127. package/dist/esm/core/pagination/Pageable.mjs +0 -6
package/README.md CHANGED
@@ -67,8 +67,8 @@ List endpoints are paginated. The SDK provides an iterator so that you can simpl
67
67
  import { AgentMailClient } from "agentmail";
68
68
 
69
69
  const client = new AgentMailClient({ apiKey: "YOUR_API_KEY" });
70
- const response = await client.inboxes.list();
71
- for await (const item of response) {
70
+ const pageableResponse = await client.inboxes.list();
71
+ for await (const item of pageableResponse) {
72
72
  console.log(item);
73
73
  }
74
74
 
@@ -77,6 +77,9 @@ let page = await client.inboxes.list();
77
77
  while (page.hasNextPage()) {
78
78
  page = page.getNextPage();
79
79
  }
80
+
81
+ // You can also access the underlying response
82
+ const response = page.response;
80
83
  ```
81
84
 
82
85
  ## Advanced
@@ -51,8 +51,8 @@ class AgentMailClient {
51
51
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
52
52
  "X-Fern-Language": "JavaScript",
53
53
  "X-Fern-SDK-Name": "agentmail",
54
- "X-Fern-SDK-Version": "0.1.0",
55
- "User-Agent": "agentmail/0.1.0",
54
+ "X-Fern-SDK-Version": "0.1.1",
55
+ "User-Agent": "agentmail/0.1.1",
56
56
  "X-Fern-Runtime": core.RUNTIME.type,
57
57
  "X-Fern-Runtime-Version": core.RUNTIME.version,
58
58
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -17,7 +17,7 @@ export declare class ApiKeys {
17
17
  * @example
18
18
  * await client.apiKeys.list()
19
19
  */
20
- list(request?: AgentMail.ListApiKeysRequest, requestOptions?: ApiKeys.RequestOptions): Promise<core.Page<AgentMail.ApiKey>>;
20
+ list(request?: AgentMail.ListApiKeysRequest, requestOptions?: ApiKeys.RequestOptions): Promise<core.Page<AgentMail.ApiKey, AgentMail.ListApiKeysResponse>>;
21
21
  /**
22
22
  * @param {AgentMail.CreateApiKeyRequest} request
23
23
  * @param {ApiKeys.RequestOptions} requestOptions - Request-specific configuration.
@@ -119,7 +119,7 @@ class ApiKeys {
119
119
  }
120
120
  }));
121
121
  const dataWithRawResponse = yield list(request).withRawResponse();
122
- return new core.Pageable({
122
+ return new core.Page({
123
123
  response: dataWithRawResponse.data,
124
124
  rawResponse: dataWithRawResponse.rawResponse,
125
125
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -17,7 +17,7 @@ export declare class Domains {
17
17
  * @example
18
18
  * await client.domains.list()
19
19
  */
20
- list(request?: AgentMail.ListDomainsRequest, requestOptions?: Domains.RequestOptions): Promise<core.Page<AgentMail.DomainSummary>>;
20
+ list(request?: AgentMail.ListDomainsRequest, requestOptions?: Domains.RequestOptions): Promise<core.Page<AgentMail.DomainSummary, AgentMail.ListDomainsResponse>>;
21
21
  /**
22
22
  * @param {AgentMail.DomainId} domainId
23
23
  * @param {Domains.RequestOptions} requestOptions - Request-specific configuration.
@@ -119,7 +119,7 @@ class Domains {
119
119
  }
120
120
  }));
121
121
  const dataWithRawResponse = yield list(request).withRawResponse();
122
- return new core.Pageable({
122
+ return new core.Page({
123
123
  response: dataWithRawResponse.data,
124
124
  rawResponse: dataWithRawResponse.rawResponse,
125
125
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -19,7 +19,7 @@ export declare class Drafts {
19
19
  * @example
20
20
  * await client.drafts.list()
21
21
  */
22
- list(request?: AgentMail.ListDraftsRequest, requestOptions?: Drafts.RequestOptions): Promise<core.Page<AgentMail.DraftItem>>;
22
+ list(request?: AgentMail.ListDraftsRequest, requestOptions?: Drafts.RequestOptions): Promise<core.Page<AgentMail.DraftItem, AgentMail.ListDraftsResponse>>;
23
23
  /**
24
24
  * @param {AgentMail.DraftId} draftId
25
25
  * @param {Drafts.RequestOptions} requestOptions - Request-specific configuration.
@@ -148,7 +148,7 @@ class Drafts {
148
148
  }
149
149
  }));
150
150
  const dataWithRawResponse = yield list(request).withRawResponse();
151
- return new core.Pageable({
151
+ return new core.Page({
152
152
  response: dataWithRawResponse.data,
153
153
  rawResponse: dataWithRawResponse.rawResponse,
154
154
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -1,6 +1,7 @@
1
1
  import type * as AgentMail from "../../../index.js";
2
2
  export interface Bounce {
3
3
  inboxId: AgentMail.inboxes.InboxId;
4
+ threadId: AgentMail.ThreadId;
4
5
  messageId: AgentMail.MessageId;
5
6
  timestamp: AgentMail.Timestamp;
6
7
  /** Bounce type. */
@@ -1,6 +1,7 @@
1
1
  import type * as AgentMail from "../../../index.js";
2
2
  export interface Complaint {
3
3
  inboxId: AgentMail.inboxes.InboxId;
4
+ threadId: AgentMail.ThreadId;
4
5
  messageId: AgentMail.MessageId;
5
6
  timestamp: AgentMail.Timestamp;
6
7
  /** Complaint type. */
@@ -1,6 +1,7 @@
1
1
  import type * as AgentMail from "../../../index.js";
2
2
  export interface Delivery {
3
3
  inboxId: AgentMail.inboxes.InboxId;
4
+ threadId: AgentMail.ThreadId;
4
5
  messageId: AgentMail.MessageId;
5
6
  timestamp: AgentMail.Timestamp;
6
7
  /** Delivered recipients. */
@@ -1,6 +1,7 @@
1
1
  import type * as AgentMail from "../../../index.js";
2
2
  export interface Reject {
3
3
  inboxId: AgentMail.inboxes.InboxId;
4
+ threadId: AgentMail.ThreadId;
4
5
  messageId: AgentMail.MessageId;
5
6
  timestamp: AgentMail.Timestamp;
6
7
  /** Reject reason. */
@@ -1,6 +1,7 @@
1
1
  import type * as AgentMail from "../../../index.js";
2
2
  export interface Send {
3
3
  inboxId: AgentMail.inboxes.InboxId;
4
+ threadId: AgentMail.ThreadId;
4
5
  messageId: AgentMail.MessageId;
5
6
  timestamp: AgentMail.Timestamp;
6
7
  /** Sent recipients. */
@@ -29,7 +29,7 @@ export declare class Inboxes {
29
29
  * @example
30
30
  * await client.inboxes.list()
31
31
  */
32
- list(request?: AgentMail.inboxes.ListInboxesRequest, requestOptions?: Inboxes.RequestOptions): Promise<core.Page<AgentMail.inboxes.Inbox>>;
32
+ list(request?: AgentMail.inboxes.ListInboxesRequest, requestOptions?: Inboxes.RequestOptions): Promise<core.Page<AgentMail.inboxes.Inbox, AgentMail.inboxes.ListInboxesResponse>>;
33
33
  /**
34
34
  * @param {AgentMail.inboxes.InboxId} inboxId
35
35
  * @param {Inboxes.RequestOptions} requestOptions - Request-specific configuration.
@@ -139,7 +139,7 @@ class Inboxes {
139
139
  }
140
140
  }));
141
141
  const dataWithRawResponse = yield list(request).withRawResponse();
142
- return new core.Pageable({
142
+ return new core.Page({
143
143
  response: dataWithRawResponse.data,
144
144
  rawResponse: dataWithRawResponse.rawResponse,
145
145
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -20,7 +20,7 @@ export declare class Drafts {
20
20
  * @example
21
21
  * await client.inboxes.drafts.list("inbox_id")
22
22
  */
23
- list(inboxId: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListDraftsRequest, requestOptions?: Drafts.RequestOptions): Promise<core.Page<AgentMail.DraftItem>>;
23
+ list(inboxId: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListDraftsRequest, requestOptions?: Drafts.RequestOptions): Promise<core.Page<AgentMail.DraftItem, AgentMail.ListDraftsResponse>>;
24
24
  /**
25
25
  * @param {AgentMail.inboxes.InboxId} inboxId
26
26
  * @param {AgentMail.DraftId} draftId
@@ -149,7 +149,7 @@ class Drafts {
149
149
  }
150
150
  }));
151
151
  const dataWithRawResponse = yield list(request).withRawResponse();
152
- return new core.Pageable({
152
+ return new core.Page({
153
153
  response: dataWithRawResponse.data,
154
154
  rawResponse: dataWithRawResponse.rawResponse,
155
155
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -20,7 +20,7 @@ export declare class Messages {
20
20
  * @example
21
21
  * await client.inboxes.messages.list("inbox_id")
22
22
  */
23
- list(inboxId: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListMessagesRequest, requestOptions?: Messages.RequestOptions): Promise<core.Page<AgentMail.MessageItem>>;
23
+ list(inboxId: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListMessagesRequest, requestOptions?: Messages.RequestOptions): Promise<core.Page<AgentMail.MessageItem, AgentMail.ListMessagesResponse>>;
24
24
  /**
25
25
  * @param {AgentMail.inboxes.InboxId} inboxId
26
26
  * @param {AgentMail.MessageId} messageId
@@ -149,7 +149,7 @@ class Messages {
149
149
  }
150
150
  }));
151
151
  const dataWithRawResponse = yield list(request).withRawResponse();
152
- return new core.Pageable({
152
+ return new core.Page({
153
153
  response: dataWithRawResponse.data,
154
154
  rawResponse: dataWithRawResponse.rawResponse,
155
155
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -20,7 +20,7 @@ export declare class Threads {
20
20
  * @example
21
21
  * await client.inboxes.threads.list("inbox_id")
22
22
  */
23
- list(inboxId: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListThreadsRequest, requestOptions?: Threads.RequestOptions): Promise<core.Page<AgentMail.ThreadItem>>;
23
+ list(inboxId: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListThreadsRequest, requestOptions?: Threads.RequestOptions): Promise<core.Page<AgentMail.ThreadItem, AgentMail.ListThreadsResponse>>;
24
24
  /**
25
25
  * @param {AgentMail.inboxes.InboxId} inboxId
26
26
  * @param {AgentMail.ThreadId} threadId
@@ -149,7 +149,7 @@ class Threads {
149
149
  }
150
150
  }));
151
151
  const dataWithRawResponse = yield list(request).withRawResponse();
152
- return new core.Pageable({
152
+ return new core.Page({
153
153
  response: dataWithRawResponse.data,
154
154
  rawResponse: dataWithRawResponse.rawResponse,
155
155
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -29,7 +29,7 @@ export declare class Pods {
29
29
  * @example
30
30
  * await client.pods.list()
31
31
  */
32
- list(request?: AgentMail.pods.ListPodsRequest, requestOptions?: Pods.RequestOptions): Promise<core.Page<AgentMail.pods.Pod>>;
32
+ list(request?: AgentMail.pods.ListPodsRequest, requestOptions?: Pods.RequestOptions): Promise<core.Page<AgentMail.pods.Pod, AgentMail.pods.ListPodsResponse>>;
33
33
  /**
34
34
  * @param {AgentMail.pods.PodId} podId
35
35
  * @param {Pods.RequestOptions} requestOptions - Request-specific configuration.
@@ -139,7 +139,7 @@ class Pods {
139
139
  }
140
140
  }));
141
141
  const dataWithRawResponse = yield list(request).withRawResponse();
142
- return new core.Pageable({
142
+ return new core.Page({
143
143
  response: dataWithRawResponse.data,
144
144
  rawResponse: dataWithRawResponse.rawResponse,
145
145
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -20,7 +20,7 @@ export declare class Domains {
20
20
  * @example
21
21
  * await client.pods.domains.list("pod_id")
22
22
  */
23
- list(podId: AgentMail.pods.PodId, request?: AgentMail.pods.ListDomainsRequest, requestOptions?: Domains.RequestOptions): Promise<core.Page<AgentMail.DomainSummary>>;
23
+ list(podId: AgentMail.pods.PodId, request?: AgentMail.pods.ListDomainsRequest, requestOptions?: Domains.RequestOptions): Promise<core.Page<AgentMail.DomainSummary, AgentMail.ListDomainsResponse>>;
24
24
  /**
25
25
  * @param {AgentMail.pods.PodId} podId
26
26
  * @param {AgentMail.CreateDomainRequest} request
@@ -149,7 +149,7 @@ class Domains {
149
149
  }
150
150
  }));
151
151
  const dataWithRawResponse = yield list(request).withRawResponse();
152
- return new core.Pageable({
152
+ return new core.Page({
153
153
  response: dataWithRawResponse.data,
154
154
  rawResponse: dataWithRawResponse.rawResponse,
155
155
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -20,7 +20,7 @@ export declare class Drafts {
20
20
  * @example
21
21
  * await client.pods.drafts.list("pod_id")
22
22
  */
23
- list(podId: AgentMail.pods.PodId, request?: AgentMail.pods.ListDraftsRequest, requestOptions?: Drafts.RequestOptions): Promise<core.Page<AgentMail.DraftItem>>;
23
+ list(podId: AgentMail.pods.PodId, request?: AgentMail.pods.ListDraftsRequest, requestOptions?: Drafts.RequestOptions): Promise<core.Page<AgentMail.DraftItem, AgentMail.ListDraftsResponse>>;
24
24
  /**
25
25
  * @param {AgentMail.pods.PodId} podId
26
26
  * @param {AgentMail.DraftId} draftId
@@ -149,7 +149,7 @@ class Drafts {
149
149
  }
150
150
  }));
151
151
  const dataWithRawResponse = yield list(request).withRawResponse();
152
- return new core.Pageable({
152
+ return new core.Page({
153
153
  response: dataWithRawResponse.data,
154
154
  rawResponse: dataWithRawResponse.rawResponse,
155
155
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -20,7 +20,7 @@ export declare class Inboxes {
20
20
  * @example
21
21
  * await client.pods.inboxes.list("pod_id")
22
22
  */
23
- list(podId: AgentMail.pods.PodId, request?: AgentMail.pods.ListInboxesRequest, requestOptions?: Inboxes.RequestOptions): Promise<core.Page<AgentMail.inboxes.Inbox>>;
23
+ list(podId: AgentMail.pods.PodId, request?: AgentMail.pods.ListInboxesRequest, requestOptions?: Inboxes.RequestOptions): Promise<core.Page<AgentMail.inboxes.Inbox, AgentMail.inboxes.ListInboxesResponse>>;
24
24
  /**
25
25
  * @param {AgentMail.pods.PodId} podId
26
26
  * @param {AgentMail.inboxes.InboxId} inboxId
@@ -149,7 +149,7 @@ class Inboxes {
149
149
  }
150
150
  }));
151
151
  const dataWithRawResponse = yield list(request).withRawResponse();
152
- return new core.Pageable({
152
+ return new core.Page({
153
153
  response: dataWithRawResponse.data,
154
154
  rawResponse: dataWithRawResponse.rawResponse,
155
155
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -20,7 +20,7 @@ export declare class Threads {
20
20
  * @example
21
21
  * await client.pods.threads.list("pod_id")
22
22
  */
23
- list(podId: AgentMail.pods.PodId, request?: AgentMail.pods.ListThreadsRequest, requestOptions?: Threads.RequestOptions): Promise<core.Page<AgentMail.ThreadItem>>;
23
+ list(podId: AgentMail.pods.PodId, request?: AgentMail.pods.ListThreadsRequest, requestOptions?: Threads.RequestOptions): Promise<core.Page<AgentMail.ThreadItem, AgentMail.ListThreadsResponse>>;
24
24
  /**
25
25
  * @param {AgentMail.pods.PodId} podId
26
26
  * @param {AgentMail.ThreadId} threadId
@@ -149,7 +149,7 @@ class Threads {
149
149
  }
150
150
  }));
151
151
  const dataWithRawResponse = yield list(request).withRawResponse();
152
- return new core.Pageable({
152
+ return new core.Page({
153
153
  response: dataWithRawResponse.data,
154
154
  rawResponse: dataWithRawResponse.rawResponse,
155
155
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -19,7 +19,7 @@ export declare class Threads {
19
19
  * @example
20
20
  * await client.threads.list()
21
21
  */
22
- list(request?: AgentMail.ListThreadsRequest, requestOptions?: Threads.RequestOptions): Promise<core.Page<AgentMail.ThreadItem>>;
22
+ list(request?: AgentMail.ListThreadsRequest, requestOptions?: Threads.RequestOptions): Promise<core.Page<AgentMail.ThreadItem, AgentMail.ListThreadsResponse>>;
23
23
  /**
24
24
  * @param {AgentMail.ThreadId} threadId
25
25
  * @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
@@ -148,7 +148,7 @@ class Threads {
148
148
  }
149
149
  }));
150
150
  const dataWithRawResponse = yield list(request).withRawResponse();
151
- return new core.Pageable({
151
+ return new core.Page({
152
152
  response: dataWithRawResponse.data,
153
153
  rawResponse: dataWithRawResponse.rawResponse,
154
154
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -17,7 +17,7 @@ export declare class Webhooks {
17
17
  * @example
18
18
  * await client.webhooks.list()
19
19
  */
20
- list(request?: AgentMail.webhooks.ListWebhooksRequest, requestOptions?: Webhooks.RequestOptions): Promise<core.Page<AgentMail.webhooks.Webhook>>;
20
+ list(request?: AgentMail.webhooks.ListWebhooksRequest, requestOptions?: Webhooks.RequestOptions): Promise<core.Page<AgentMail.webhooks.Webhook, AgentMail.webhooks.ListWebhooksResponse>>;
21
21
  /**
22
22
  * @param {AgentMail.webhooks.WebhookId} webhookId
23
23
  * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
@@ -119,7 +119,7 @@ class Webhooks {
119
119
  }
120
120
  }));
121
121
  const dataWithRawResponse = yield list(request).withRawResponse();
122
- return new core.Pageable({
122
+ return new core.Page({
123
123
  response: dataWithRawResponse.data,
124
124
  rawResponse: dataWithRawResponse.rawResponse,
125
125
  hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
@@ -0,0 +1,2 @@
1
+ export * from "./pagination/exports.js";
2
+ export * from "./websocket/exports.js";
@@ -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("./pagination/exports.js"), exports);
18
+ __exportStar(require("./websocket/exports.js"), exports);
@@ -3,20 +3,21 @@ import type { HttpResponsePromise, RawResponse } from "../fetcher/index.js";
3
3
  * A page of results from a paginated API.
4
4
  *
5
5
  * @template T The type of the items in the page.
6
+ * @template R The type of the API response.
6
7
  */
7
- export declare class Page<T> implements AsyncIterable<T> {
8
+ export declare class Page<T, R = unknown> implements AsyncIterable<T> {
8
9
  data: T[];
9
10
  rawResponse: RawResponse;
10
- private response;
11
+ response: R;
11
12
  private _hasNextPage;
12
13
  private getItems;
13
14
  private loadNextPage;
14
15
  constructor({ response, rawResponse, hasNextPage, getItems, loadPage, }: {
15
- response: unknown;
16
+ response: R;
16
17
  rawResponse: RawResponse;
17
- hasNextPage: (response: unknown) => boolean;
18
- getItems: (response: unknown) => T[];
19
- loadPage: (response: unknown) => HttpResponsePromise<any>;
18
+ hasNextPage: (response: R) => boolean;
19
+ getItems: (response: R) => T[];
20
+ loadPage: (response: R) => HttpResponsePromise<R>;
20
21
  });
21
22
  /**
22
23
  * Retrieves the next page
@@ -34,6 +34,7 @@ exports.Page = void 0;
34
34
  * A page of results from a paginated API.
35
35
  *
36
36
  * @template T The type of the items in the page.
37
+ * @template R The type of the API response.
37
38
  */
38
39
  class Page {
39
40
  constructor({ response, rawResponse, hasNextPage, getItems, loadPage, }) {
@@ -0,0 +1 @@
1
+ export type { Page } from "./Page.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1 @@
1
1
  export { Page } from "./Page.js";
2
- export { Pageable } from "./Pageable.js";
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Pageable = exports.Page = void 0;
3
+ exports.Page = void 0;
4
4
  var Page_js_1 = require("./Page.js");
5
5
  Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return Page_js_1.Page; } });
6
- var Pageable_js_1 = require("./Pageable.js");
7
- Object.defineProperty(exports, "Pageable", { enumerable: true, get: function () { return Pageable_js_1.Pageable; } });
@@ -0,0 +1,8 @@
1
+ import type * as events from "./events.js";
2
+ import type * as ws from "./ws.js";
3
+ export type ReconnectingWebSocket = typeof ws.ReconnectingWebSocket;
4
+ export declare namespace ReconnectingWebSocket {
5
+ type Event = events.Event;
6
+ type CloseEvent = events.CloseEvent;
7
+ type ErrorEvent = events.ErrorEvent;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./core/exports.js";
@@ -0,0 +1,17 @@
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("./core/exports.js"), exports);
@@ -3,4 +3,5 @@ export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
3
3
  export { AgentMailClient } from "./Client.js";
4
4
  export { AgentMailEnvironment, type AgentMailEnvironmentUrls } from "./environments.js";
5
5
  export { AgentMailError, AgentMailTimeoutError } from "./errors/index.js";
6
+ export * from "./exports.js";
6
7
  export * as serialization from "./serialization/index.js";
package/dist/cjs/index.js CHANGED
@@ -32,6 +32,9 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
35
38
  Object.defineProperty(exports, "__esModule", { value: true });
36
39
  exports.serialization = exports.AgentMailTimeoutError = exports.AgentMailError = exports.AgentMailEnvironment = exports.AgentMailClient = exports.AgentMail = void 0;
37
40
  exports.AgentMail = __importStar(require("./api/index.js"));
@@ -42,4 +45,5 @@ Object.defineProperty(exports, "AgentMailEnvironment", { enumerable: true, get:
42
45
  var index_js_1 = require("./errors/index.js");
43
46
  Object.defineProperty(exports, "AgentMailError", { enumerable: true, get: function () { return index_js_1.AgentMailError; } });
44
47
  Object.defineProperty(exports, "AgentMailTimeoutError", { enumerable: true, get: function () { return index_js_1.AgentMailTimeoutError; } });
48
+ __exportStar(require("./exports.js"), exports);
45
49
  exports.serialization = __importStar(require("./serialization/index.js"));
@@ -3,12 +3,14 @@ import * as core from "../../../../core/index.js";
3
3
  import type * as serializers from "../../../index.js";
4
4
  import { InboxId } from "../../inboxes/types/InboxId.js";
5
5
  import { MessageId } from "../../messages/types/MessageId.js";
6
+ import { ThreadId } from "../../threads/types/ThreadId.js";
6
7
  import { Recipient } from "./Recipient.js";
7
8
  import { Timestamp } from "./Timestamp.js";
8
9
  export declare const Bounce: core.serialization.ObjectSchema<serializers.Bounce.Raw, AgentMail.Bounce>;
9
10
  export declare namespace Bounce {
10
11
  interface Raw {
11
12
  inbox_id: InboxId.Raw;
13
+ thread_id: ThreadId.Raw;
12
14
  message_id: MessageId.Raw;
13
15
  timestamp: Timestamp.Raw;
14
16
  type: string;
@@ -38,10 +38,12 @@ exports.Bounce = void 0;
38
38
  const core = __importStar(require("../../../../core/index.js"));
39
39
  const InboxId_js_1 = require("../../inboxes/types/InboxId.js");
40
40
  const MessageId_js_1 = require("../../messages/types/MessageId.js");
41
+ const ThreadId_js_1 = require("../../threads/types/ThreadId.js");
41
42
  const Recipient_js_1 = require("./Recipient.js");
42
43
  const Timestamp_js_1 = require("./Timestamp.js");
43
44
  exports.Bounce = core.serialization.object({
44
45
  inboxId: core.serialization.property("inbox_id", InboxId_js_1.InboxId),
46
+ threadId: core.serialization.property("thread_id", ThreadId_js_1.ThreadId),
45
47
  messageId: core.serialization.property("message_id", MessageId_js_1.MessageId),
46
48
  timestamp: Timestamp_js_1.Timestamp,
47
49
  type: core.serialization.string(),
@@ -3,11 +3,13 @@ import * as core from "../../../../core/index.js";
3
3
  import type * as serializers from "../../../index.js";
4
4
  import { InboxId } from "../../inboxes/types/InboxId.js";
5
5
  import { MessageId } from "../../messages/types/MessageId.js";
6
+ import { ThreadId } from "../../threads/types/ThreadId.js";
6
7
  import { Timestamp } from "./Timestamp.js";
7
8
  export declare const Complaint: core.serialization.ObjectSchema<serializers.Complaint.Raw, AgentMail.Complaint>;
8
9
  export declare namespace Complaint {
9
10
  interface Raw {
10
11
  inbox_id: InboxId.Raw;
12
+ thread_id: ThreadId.Raw;
11
13
  message_id: MessageId.Raw;
12
14
  timestamp: Timestamp.Raw;
13
15
  type: string;
@@ -38,9 +38,11 @@ exports.Complaint = void 0;
38
38
  const core = __importStar(require("../../../../core/index.js"));
39
39
  const InboxId_js_1 = require("../../inboxes/types/InboxId.js");
40
40
  const MessageId_js_1 = require("../../messages/types/MessageId.js");
41
+ const ThreadId_js_1 = require("../../threads/types/ThreadId.js");
41
42
  const Timestamp_js_1 = require("./Timestamp.js");
42
43
  exports.Complaint = core.serialization.object({
43
44
  inboxId: core.serialization.property("inbox_id", InboxId_js_1.InboxId),
45
+ threadId: core.serialization.property("thread_id", ThreadId_js_1.ThreadId),
44
46
  messageId: core.serialization.property("message_id", MessageId_js_1.MessageId),
45
47
  timestamp: Timestamp_js_1.Timestamp,
46
48
  type: core.serialization.string(),
@@ -3,11 +3,13 @@ import * as core from "../../../../core/index.js";
3
3
  import type * as serializers from "../../../index.js";
4
4
  import { InboxId } from "../../inboxes/types/InboxId.js";
5
5
  import { MessageId } from "../../messages/types/MessageId.js";
6
+ import { ThreadId } from "../../threads/types/ThreadId.js";
6
7
  import { Timestamp } from "./Timestamp.js";
7
8
  export declare const Delivery: core.serialization.ObjectSchema<serializers.Delivery.Raw, AgentMail.Delivery>;
8
9
  export declare namespace Delivery {
9
10
  interface Raw {
10
11
  inbox_id: InboxId.Raw;
12
+ thread_id: ThreadId.Raw;
11
13
  message_id: MessageId.Raw;
12
14
  timestamp: Timestamp.Raw;
13
15
  recipients: string[];
@@ -38,9 +38,11 @@ exports.Delivery = void 0;
38
38
  const core = __importStar(require("../../../../core/index.js"));
39
39
  const InboxId_js_1 = require("../../inboxes/types/InboxId.js");
40
40
  const MessageId_js_1 = require("../../messages/types/MessageId.js");
41
+ const ThreadId_js_1 = require("../../threads/types/ThreadId.js");
41
42
  const Timestamp_js_1 = require("./Timestamp.js");
42
43
  exports.Delivery = core.serialization.object({
43
44
  inboxId: core.serialization.property("inbox_id", InboxId_js_1.InboxId),
45
+ threadId: core.serialization.property("thread_id", ThreadId_js_1.ThreadId),
44
46
  messageId: core.serialization.property("message_id", MessageId_js_1.MessageId),
45
47
  timestamp: Timestamp_js_1.Timestamp,
46
48
  recipients: core.serialization.list(core.serialization.string()),
@@ -3,11 +3,13 @@ import * as core from "../../../../core/index.js";
3
3
  import type * as serializers from "../../../index.js";
4
4
  import { InboxId } from "../../inboxes/types/InboxId.js";
5
5
  import { MessageId } from "../../messages/types/MessageId.js";
6
+ import { ThreadId } from "../../threads/types/ThreadId.js";
6
7
  import { Timestamp } from "./Timestamp.js";
7
8
  export declare const Reject: core.serialization.ObjectSchema<serializers.Reject.Raw, AgentMail.Reject>;
8
9
  export declare namespace Reject {
9
10
  interface Raw {
10
11
  inbox_id: InboxId.Raw;
12
+ thread_id: ThreadId.Raw;
11
13
  message_id: MessageId.Raw;
12
14
  timestamp: Timestamp.Raw;
13
15
  reason: string;