agentmail 0.0.25 → 0.0.26
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.
- package/Client.d.ts +3 -0
- package/Client.js +7 -2
- package/README.md +1 -1
- package/api/resources/drafts/client/Client.d.ts +53 -0
- package/api/resources/drafts/client/Client.js +218 -0
- package/api/resources/drafts/client/index.d.ts +1 -0
- package/api/resources/drafts/client/index.js +17 -0
- package/api/resources/drafts/client/requests/ListDraftsRequest.d.ts +15 -0
- package/api/resources/drafts/client/requests/index.d.ts +1 -0
- package/api/resources/drafts/client/requests/index.js +2 -0
- package/api/resources/drafts/index.d.ts +2 -0
- package/api/resources/drafts/index.js +18 -0
- package/api/resources/drafts/types/Draft.d.ts +51 -0
- package/api/resources/drafts/types/DraftAttachments.d.ts +8 -0
- package/api/resources/drafts/types/DraftAttachments.js +5 -0
- package/api/resources/drafts/types/DraftBcc.d.ts +7 -0
- package/api/resources/drafts/types/DraftBcc.js +5 -0
- package/api/resources/drafts/types/DraftCc.d.ts +7 -0
- package/api/resources/drafts/types/DraftCc.js +5 -0
- package/api/resources/drafts/types/DraftCreatedAt.d.ts +7 -0
- package/api/resources/drafts/types/DraftCreatedAt.js +5 -0
- package/api/resources/drafts/types/DraftEventId.d.ts +7 -0
- package/api/resources/drafts/types/DraftEventId.js +5 -0
- package/api/resources/drafts/types/DraftHtml.d.ts +7 -0
- package/api/resources/drafts/types/DraftHtml.js +5 -0
- package/api/resources/drafts/types/DraftId.d.ts +7 -0
- package/api/resources/drafts/types/DraftId.js +5 -0
- package/api/resources/drafts/types/DraftInReplyTo.d.ts +7 -0
- package/api/resources/drafts/types/DraftInReplyTo.js +5 -0
- package/api/resources/drafts/types/DraftItem.d.ts +21 -0
- package/api/resources/drafts/types/DraftItem.js +5 -0
- package/api/resources/drafts/types/DraftLabels.d.ts +7 -0
- package/api/resources/drafts/types/DraftLabels.js +5 -0
- package/api/resources/drafts/types/DraftPreview.d.ts +7 -0
- package/api/resources/drafts/types/DraftPreview.js +5 -0
- package/api/resources/drafts/types/DraftReferences.d.ts +7 -0
- package/api/resources/drafts/types/DraftReferences.js +5 -0
- package/api/resources/drafts/types/DraftSubject.d.ts +7 -0
- package/api/resources/drafts/types/DraftSubject.js +5 -0
- package/api/resources/drafts/types/DraftText.d.ts +7 -0
- package/api/resources/drafts/types/DraftText.js +5 -0
- package/api/resources/drafts/types/DraftTo.d.ts +7 -0
- package/api/resources/drafts/types/DraftTo.js +5 -0
- package/api/resources/drafts/types/DraftUpdatedAt.d.ts +7 -0
- package/api/resources/drafts/types/DraftUpdatedAt.js +5 -0
- package/api/resources/drafts/types/ListDraftsResponse.d.ts +51 -0
- package/api/resources/drafts/types/ListDraftsResponse.js +5 -0
- package/api/resources/drafts/types/index.d.ts +18 -0
- package/api/resources/drafts/types/index.js +34 -0
- package/api/resources/inboxes/client/Client.js +3 -3
- package/api/resources/inboxes/types/ListInboxesResponse.d.ts +2 -2
- package/api/resources/index.d.ts +3 -0
- package/api/resources/index.js +4 -1
- package/api/resources/messages/client/Client.js +5 -5
- package/api/resources/messages/types/ListMessagesResponse.d.ts +2 -2
- package/api/resources/messages/types/Message.d.ts +2 -4
- package/api/resources/messages/types/MessageItem.d.ts +2 -0
- package/api/resources/messages/types/index.d.ts +4 -5
- package/api/resources/messages/types/index.js +4 -5
- package/api/resources/threads/client/Client.js +2 -2
- package/api/resources/threads/types/ListThreadsResponse.d.ts +2 -2
- package/api/resources/webhooks/client/Client.js +4 -4
- package/api/resources/webhooks/types/ListWebhooksResponse.d.ts +2 -2
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +7 -2
- package/dist/api/resources/drafts/client/Client.d.ts +53 -0
- package/dist/api/resources/drafts/client/Client.js +218 -0
- package/dist/api/resources/drafts/client/index.d.ts +1 -0
- package/dist/api/resources/drafts/client/index.js +17 -0
- package/dist/api/resources/drafts/client/requests/ListDraftsRequest.d.ts +15 -0
- package/dist/api/resources/drafts/client/requests/ListDraftsRequest.js +5 -0
- package/dist/api/resources/drafts/client/requests/index.d.ts +1 -0
- package/dist/api/resources/drafts/client/requests/index.js +2 -0
- package/dist/api/resources/drafts/index.d.ts +2 -0
- package/dist/api/resources/drafts/index.js +18 -0
- package/dist/api/resources/drafts/types/Draft.d.ts +51 -0
- package/dist/api/resources/drafts/types/Draft.js +5 -0
- package/dist/api/resources/drafts/types/DraftAttachments.d.ts +8 -0
- package/dist/api/resources/drafts/types/DraftAttachments.js +5 -0
- package/dist/api/resources/drafts/types/DraftBcc.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftBcc.js +5 -0
- package/dist/api/resources/drafts/types/DraftCc.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftCc.js +5 -0
- package/dist/api/resources/drafts/types/DraftCreatedAt.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftCreatedAt.js +5 -0
- package/dist/api/resources/drafts/types/DraftEventId.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftEventId.js +5 -0
- package/dist/api/resources/drafts/types/DraftHtml.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftHtml.js +5 -0
- package/dist/api/resources/drafts/types/DraftId.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftId.js +5 -0
- package/dist/api/resources/drafts/types/DraftInReplyTo.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftInReplyTo.js +5 -0
- package/dist/api/resources/drafts/types/DraftItem.d.ts +21 -0
- package/dist/api/resources/drafts/types/DraftItem.js +5 -0
- package/dist/api/resources/drafts/types/DraftLabels.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftLabels.js +5 -0
- package/dist/api/resources/drafts/types/DraftPreview.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftPreview.js +5 -0
- package/dist/api/resources/drafts/types/DraftReferences.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftReferences.js +5 -0
- package/dist/api/resources/drafts/types/DraftSubject.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftSubject.js +5 -0
- package/dist/api/resources/drafts/types/DraftText.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftText.js +5 -0
- package/dist/api/resources/drafts/types/DraftTo.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftTo.js +5 -0
- package/dist/api/resources/drafts/types/DraftUpdatedAt.d.ts +7 -0
- package/dist/api/resources/drafts/types/DraftUpdatedAt.js +5 -0
- package/dist/api/resources/drafts/types/ListDraftsResponse.d.ts +51 -0
- package/dist/api/resources/drafts/types/ListDraftsResponse.js +5 -0
- package/dist/api/resources/drafts/types/index.d.ts +18 -0
- package/dist/api/resources/drafts/types/index.js +34 -0
- package/dist/api/resources/inboxes/client/Client.js +3 -3
- package/dist/api/resources/inboxes/types/ListInboxesResponse.d.ts +2 -2
- package/dist/api/resources/index.d.ts +3 -0
- package/dist/api/resources/index.js +4 -1
- package/dist/api/resources/messages/client/Client.js +5 -5
- package/dist/api/resources/messages/types/ListMessagesResponse.d.ts +2 -2
- package/dist/api/resources/messages/types/Message.d.ts +2 -4
- package/dist/api/resources/messages/types/MessageItem.d.ts +2 -0
- package/dist/api/resources/messages/types/index.d.ts +4 -5
- package/dist/api/resources/messages/types/index.js +4 -5
- package/dist/api/resources/threads/client/Client.js +2 -2
- package/dist/api/resources/threads/types/ListThreadsResponse.d.ts +2 -2
- package/dist/api/resources/webhooks/client/Client.js +4 -4
- package/dist/api/resources/webhooks/types/ListWebhooksResponse.d.ts +2 -2
- package/dist/serialization/resources/drafts/index.d.ts +1 -0
- package/dist/serialization/resources/drafts/index.js +17 -0
- package/dist/serialization/resources/drafts/types/Draft.d.ts +45 -0
- package/dist/serialization/resources/drafts/types/Draft.js +76 -0
- package/dist/serialization/resources/drafts/types/DraftAttachments.d.ts +11 -0
- package/dist/serialization/resources/drafts/types/DraftAttachments.js +42 -0
- package/dist/serialization/resources/drafts/types/DraftBcc.d.ts +10 -0
- package/dist/serialization/resources/drafts/types/DraftBcc.js +41 -0
- package/dist/serialization/resources/drafts/types/DraftCc.d.ts +10 -0
- package/dist/serialization/resources/drafts/types/DraftCc.js +41 -0
- package/dist/serialization/resources/{messages/types/MessageReplyTo.d.ts → drafts/types/DraftCreatedAt.d.ts} +2 -2
- package/dist/serialization/resources/{messages/types/MessageReplyTo.js → drafts/types/DraftCreatedAt.js} +2 -2
- package/{serialization/resources/messages/types/MessageReplyTo.d.ts → dist/serialization/resources/drafts/types/DraftEventId.d.ts} +2 -2
- package/{serialization/resources/messages/types/MessageReplyTo.js → dist/serialization/resources/drafts/types/DraftEventId.js} +2 -2
- package/dist/serialization/resources/drafts/types/DraftHtml.d.ts +10 -0
- package/dist/serialization/resources/drafts/types/DraftHtml.js +41 -0
- package/dist/serialization/resources/drafts/types/DraftId.d.ts +10 -0
- package/dist/serialization/resources/drafts/types/DraftId.js +41 -0
- package/dist/serialization/resources/drafts/types/DraftInReplyTo.d.ts +10 -0
- package/dist/serialization/resources/drafts/types/DraftInReplyTo.js +41 -0
- package/dist/serialization/resources/drafts/types/DraftItem.d.ts +41 -0
- package/dist/serialization/resources/drafts/types/DraftItem.js +72 -0
- package/dist/serialization/resources/drafts/types/DraftLabels.d.ts +10 -0
- package/dist/serialization/resources/drafts/types/DraftLabels.js +41 -0
- package/dist/serialization/resources/drafts/types/DraftPreview.d.ts +10 -0
- package/dist/serialization/resources/drafts/types/DraftPreview.js +41 -0
- package/dist/serialization/resources/drafts/types/DraftReferences.d.ts +10 -0
- package/dist/serialization/resources/drafts/types/DraftReferences.js +41 -0
- package/dist/serialization/resources/drafts/types/DraftSubject.d.ts +10 -0
- package/dist/serialization/resources/drafts/types/DraftSubject.js +41 -0
- package/dist/serialization/resources/drafts/types/DraftText.d.ts +10 -0
- package/dist/serialization/resources/drafts/types/DraftText.js +41 -0
- package/dist/serialization/resources/drafts/types/DraftTo.d.ts +10 -0
- package/dist/serialization/resources/drafts/types/DraftTo.js +41 -0
- package/dist/serialization/resources/drafts/types/DraftUpdatedAt.d.ts +10 -0
- package/dist/serialization/resources/drafts/types/DraftUpdatedAt.js +41 -0
- package/dist/serialization/resources/drafts/types/ListDraftsResponse.d.ts +19 -0
- package/dist/serialization/resources/drafts/types/ListDraftsResponse.js +50 -0
- package/dist/serialization/resources/drafts/types/index.d.ts +18 -0
- package/dist/serialization/resources/drafts/types/index.js +34 -0
- package/dist/serialization/resources/inboxes/types/ListInboxesResponse.d.ts +2 -2
- package/dist/serialization/resources/inboxes/types/ListInboxesResponse.js +2 -2
- package/dist/serialization/resources/index.d.ts +2 -0
- package/dist/serialization/resources/index.js +3 -1
- package/dist/serialization/resources/messages/types/ListMessagesResponse.d.ts +2 -2
- package/dist/serialization/resources/messages/types/ListMessagesResponse.js +2 -2
- package/dist/serialization/resources/messages/types/Message.d.ts +4 -6
- package/dist/serialization/resources/messages/types/Message.js +4 -6
- package/dist/serialization/resources/messages/types/MessageItem.d.ts +4 -0
- package/dist/serialization/resources/messages/types/MessageItem.js +4 -0
- package/dist/serialization/resources/messages/types/index.d.ts +4 -5
- package/dist/serialization/resources/messages/types/index.js +4 -5
- package/dist/serialization/resources/threads/types/ListThreadsResponse.d.ts +2 -2
- package/dist/serialization/resources/threads/types/ListThreadsResponse.js +2 -2
- package/dist/serialization/resources/webhooks/types/ListWebhooksResponse.d.ts +2 -2
- package/dist/serialization/resources/webhooks/types/ListWebhooksResponse.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +116 -0
- package/serialization/resources/drafts/index.d.ts +1 -0
- package/serialization/resources/drafts/index.js +17 -0
- package/serialization/resources/drafts/types/Draft.d.ts +45 -0
- package/serialization/resources/drafts/types/Draft.js +76 -0
- package/serialization/resources/drafts/types/DraftAttachments.d.ts +11 -0
- package/serialization/resources/drafts/types/DraftAttachments.js +42 -0
- package/serialization/resources/drafts/types/DraftBcc.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftBcc.js +41 -0
- package/serialization/resources/drafts/types/DraftCc.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftCc.js +41 -0
- package/serialization/resources/drafts/types/DraftCreatedAt.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftCreatedAt.js +41 -0
- package/serialization/resources/drafts/types/DraftEventId.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftEventId.js +41 -0
- package/serialization/resources/drafts/types/DraftHtml.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftHtml.js +41 -0
- package/serialization/resources/drafts/types/DraftId.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftId.js +41 -0
- package/serialization/resources/drafts/types/DraftInReplyTo.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftInReplyTo.js +41 -0
- package/serialization/resources/drafts/types/DraftItem.d.ts +41 -0
- package/serialization/resources/drafts/types/DraftItem.js +72 -0
- package/serialization/resources/drafts/types/DraftLabels.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftLabels.js +41 -0
- package/serialization/resources/drafts/types/DraftPreview.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftPreview.js +41 -0
- package/serialization/resources/drafts/types/DraftReferences.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftReferences.js +41 -0
- package/serialization/resources/drafts/types/DraftSubject.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftSubject.js +41 -0
- package/serialization/resources/drafts/types/DraftText.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftText.js +41 -0
- package/serialization/resources/drafts/types/DraftTo.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftTo.js +41 -0
- package/serialization/resources/drafts/types/DraftUpdatedAt.d.ts +10 -0
- package/serialization/resources/drafts/types/DraftUpdatedAt.js +41 -0
- package/serialization/resources/drafts/types/ListDraftsResponse.d.ts +19 -0
- package/serialization/resources/drafts/types/ListDraftsResponse.js +50 -0
- package/serialization/resources/drafts/types/index.d.ts +18 -0
- package/serialization/resources/drafts/types/index.js +34 -0
- package/serialization/resources/inboxes/types/ListInboxesResponse.d.ts +2 -2
- package/serialization/resources/inboxes/types/ListInboxesResponse.js +2 -2
- package/serialization/resources/index.d.ts +2 -0
- package/serialization/resources/index.js +3 -1
- package/serialization/resources/messages/types/ListMessagesResponse.d.ts +2 -2
- package/serialization/resources/messages/types/ListMessagesResponse.js +2 -2
- package/serialization/resources/messages/types/Message.d.ts +4 -6
- package/serialization/resources/messages/types/Message.js +4 -6
- package/serialization/resources/messages/types/MessageItem.d.ts +4 -0
- package/serialization/resources/messages/types/MessageItem.js +4 -0
- package/serialization/resources/messages/types/index.d.ts +4 -5
- package/serialization/resources/messages/types/index.js +4 -5
- package/serialization/resources/threads/types/ListThreadsResponse.d.ts +2 -2
- package/serialization/resources/threads/types/ListThreadsResponse.js +2 -2
- package/serialization/resources/webhooks/types/ListWebhooksResponse.d.ts +2 -2
- package/serialization/resources/webhooks/types/ListWebhooksResponse.js +2 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/messages/types/MessageReplyTo.d.ts +0 -7
- package/dist/api/resources/messages/types/MessageReplyTo.d.ts +0 -7
- /package/api/resources/{messages/types/MessageReplyTo.js → drafts/client/requests/ListDraftsRequest.js} +0 -0
- /package/{dist/api/resources/messages/types/MessageReplyTo.js → api/resources/drafts/types/Draft.js} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as AgentMail from "../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* drafts: [{
|
|
9
|
+
* inboxId: "yourinbox@agentmail.to",
|
|
10
|
+
* threadId: "thread_123",
|
|
11
|
+
* draftId: "draft_123",
|
|
12
|
+
* eventId: "event_123",
|
|
13
|
+
* labels: ["RECEIVED", "UNREAD"],
|
|
14
|
+
* updatedAt: "2024-01-15T09:30:00Z",
|
|
15
|
+
* createdAt: "2024-01-15T09:30:00Z",
|
|
16
|
+
* to: ["bob@example.com"],
|
|
17
|
+
* subject: "Project Discussion",
|
|
18
|
+
* preview: "Let's review the timeline for the project.",
|
|
19
|
+
* cc: ["charlie@example.com"],
|
|
20
|
+
* bcc: ["david@example.com"],
|
|
21
|
+
* attachments: [{
|
|
22
|
+
* attachmentId: "att_123",
|
|
23
|
+
* filename: "proposal.pdf",
|
|
24
|
+
* contentType: "application/pdf",
|
|
25
|
+
* size: 1024,
|
|
26
|
+
* inline: false
|
|
27
|
+
* }]
|
|
28
|
+
* }, {
|
|
29
|
+
* inboxId: "yourinbox@agentmail.to",
|
|
30
|
+
* threadId: "thread_123",
|
|
31
|
+
* draftId: "draft_456",
|
|
32
|
+
* eventId: "event_456",
|
|
33
|
+
* labels: ["SENT"],
|
|
34
|
+
* updatedAt: "2024-01-15T10:15:00Z",
|
|
35
|
+
* createdAt: "2024-01-15T10:15:00Z",
|
|
36
|
+
* to: ["alice@example.com"],
|
|
37
|
+
* subject: "Re: Project Discussion",
|
|
38
|
+
* preview: "Sounds good, let's meet tomorrow."
|
|
39
|
+
* }],
|
|
40
|
+
* limit: 10,
|
|
41
|
+
* count: 2,
|
|
42
|
+
* lastKey: "draft_456#2024-01-15T10:15:00Z"
|
|
43
|
+
* }
|
|
44
|
+
*/
|
|
45
|
+
export interface ListDraftsResponse {
|
|
46
|
+
count: AgentMail.Count;
|
|
47
|
+
limit?: AgentMail.Limit;
|
|
48
|
+
lastKey?: AgentMail.LastKey;
|
|
49
|
+
/** Draft items. Ordered by `updated_at` descending. */
|
|
50
|
+
drafts: AgentMail.DraftItem[];
|
|
51
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from "./DraftId";
|
|
2
|
+
export * from "./DraftEventId";
|
|
3
|
+
export * from "./DraftLabels";
|
|
4
|
+
export * from "./DraftUpdatedAt";
|
|
5
|
+
export * from "./DraftCreatedAt";
|
|
6
|
+
export * from "./DraftTo";
|
|
7
|
+
export * from "./DraftCc";
|
|
8
|
+
export * from "./DraftBcc";
|
|
9
|
+
export * from "./DraftSubject";
|
|
10
|
+
export * from "./DraftPreview";
|
|
11
|
+
export * from "./DraftText";
|
|
12
|
+
export * from "./DraftHtml";
|
|
13
|
+
export * from "./DraftAttachments";
|
|
14
|
+
export * from "./DraftInReplyTo";
|
|
15
|
+
export * from "./DraftReferences";
|
|
16
|
+
export * from "./DraftItem";
|
|
17
|
+
export * from "./Draft";
|
|
18
|
+
export * from "./ListDraftsResponse";
|
|
@@ -0,0 +1,34 @@
|
|
|
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("./DraftId"), exports);
|
|
18
|
+
__exportStar(require("./DraftEventId"), exports);
|
|
19
|
+
__exportStar(require("./DraftLabels"), exports);
|
|
20
|
+
__exportStar(require("./DraftUpdatedAt"), exports);
|
|
21
|
+
__exportStar(require("./DraftCreatedAt"), exports);
|
|
22
|
+
__exportStar(require("./DraftTo"), exports);
|
|
23
|
+
__exportStar(require("./DraftCc"), exports);
|
|
24
|
+
__exportStar(require("./DraftBcc"), exports);
|
|
25
|
+
__exportStar(require("./DraftSubject"), exports);
|
|
26
|
+
__exportStar(require("./DraftPreview"), exports);
|
|
27
|
+
__exportStar(require("./DraftText"), exports);
|
|
28
|
+
__exportStar(require("./DraftHtml"), exports);
|
|
29
|
+
__exportStar(require("./DraftAttachments"), exports);
|
|
30
|
+
__exportStar(require("./DraftInReplyTo"), exports);
|
|
31
|
+
__exportStar(require("./DraftReferences"), exports);
|
|
32
|
+
__exportStar(require("./DraftItem"), exports);
|
|
33
|
+
__exportStar(require("./Draft"), exports);
|
|
34
|
+
__exportStar(require("./ListDraftsResponse"), exports);
|
|
@@ -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.
|
|
86
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "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",
|
|
@@ -136,7 +136,7 @@ class Inboxes {
|
|
|
136
136
|
const _response = yield core.fetcher({
|
|
137
137
|
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))}`),
|
|
138
138
|
method: "GET",
|
|
139
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.
|
|
139
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
140
140
|
contentType: "application/json",
|
|
141
141
|
requestType: "json",
|
|
142
142
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -207,7 +207,7 @@ class Inboxes {
|
|
|
207
207
|
const _response = yield core.fetcher({
|
|
208
208
|
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"),
|
|
209
209
|
method: "POST",
|
|
210
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.
|
|
210
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
211
211
|
contentType: "application/json",
|
|
212
212
|
requestType: "json",
|
|
213
213
|
body: serializers.CreateInboxRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -16,9 +16,9 @@ import * as AgentMail from "../../../index";
|
|
|
16
16
|
* }
|
|
17
17
|
*/
|
|
18
18
|
export interface ListInboxesResponse {
|
|
19
|
-
/** Inbox items. Ordered by `created_at` ascending. */
|
|
20
|
-
inboxes: AgentMail.Inbox[];
|
|
21
19
|
count: AgentMail.Count;
|
|
22
20
|
limit?: AgentMail.Limit;
|
|
23
21
|
lastKey?: AgentMail.LastKey;
|
|
22
|
+
/** Inbox items. Ordered by `created_at` ascending. */
|
|
23
|
+
inboxes: AgentMail.Inbox[];
|
|
24
24
|
}
|
package/api/resources/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * as drafts from "./drafts";
|
|
2
|
+
export * from "./drafts/types";
|
|
1
3
|
export * as inboxes from "./inboxes";
|
|
2
4
|
export * from "./inboxes/types";
|
|
3
5
|
export * as messages from "./messages";
|
|
@@ -7,6 +9,7 @@ export * from "./threads/types";
|
|
|
7
9
|
export * as webhooks from "./webhooks";
|
|
8
10
|
export * from "./webhooks/types";
|
|
9
11
|
export * from "./messages/errors";
|
|
12
|
+
export * from "./drafts/client/requests";
|
|
10
13
|
export * from "./inboxes/client/requests";
|
|
11
14
|
export * from "./messages/client/requests";
|
|
12
15
|
export * from "./threads/client/requests";
|
package/api/resources/index.js
CHANGED
|
@@ -36,7 +36,9 @@ 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.webhooks = exports.threads = exports.messages = exports.inboxes = void 0;
|
|
39
|
+
exports.webhooks = exports.threads = exports.messages = exports.inboxes = exports.drafts = void 0;
|
|
40
|
+
exports.drafts = __importStar(require("./drafts"));
|
|
41
|
+
__exportStar(require("./drafts/types"), exports);
|
|
40
42
|
exports.inboxes = __importStar(require("./inboxes"));
|
|
41
43
|
__exportStar(require("./inboxes/types"), exports);
|
|
42
44
|
exports.messages = __importStar(require("./messages"));
|
|
@@ -46,6 +48,7 @@ __exportStar(require("./threads/types"), exports);
|
|
|
46
48
|
exports.webhooks = __importStar(require("./webhooks"));
|
|
47
49
|
__exportStar(require("./webhooks/types"), exports);
|
|
48
50
|
__exportStar(require("./messages/errors"), exports);
|
|
51
|
+
__exportStar(require("./drafts/client/requests"), exports);
|
|
49
52
|
__exportStar(require("./inboxes/client/requests"), exports);
|
|
50
53
|
__exportStar(require("./messages/client/requests"), exports);
|
|
51
54
|
__exportStar(require("./threads/client/requests"), exports);
|
|
@@ -89,7 +89,7 @@ class Messages {
|
|
|
89
89
|
const _response = yield core.fetcher({
|
|
90
90
|
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`),
|
|
91
91
|
method: "GET",
|
|
92
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.
|
|
92
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
93
93
|
contentType: "application/json",
|
|
94
94
|
queryParameters: _queryParams,
|
|
95
95
|
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.
|
|
157
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "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,
|
|
@@ -211,7 +211,7 @@ class Messages {
|
|
|
211
211
|
const _response = yield core.fetcher({
|
|
212
212
|
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))}`),
|
|
213
213
|
method: "GET",
|
|
214
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.
|
|
214
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
215
215
|
contentType: "application/json",
|
|
216
216
|
requestType: "json",
|
|
217
217
|
responseType: "streaming",
|
|
@@ -279,7 +279,7 @@ class Messages {
|
|
|
279
279
|
const _response = yield core.fetcher({
|
|
280
280
|
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`),
|
|
281
281
|
method: "POST",
|
|
282
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.
|
|
282
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
283
283
|
contentType: "application/json",
|
|
284
284
|
requestType: "json",
|
|
285
285
|
body: serializers.SendMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -368,7 +368,7 @@ class Messages {
|
|
|
368
368
|
const _response = yield core.fetcher({
|
|
369
369
|
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`),
|
|
370
370
|
method: "POST",
|
|
371
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.
|
|
371
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
372
372
|
contentType: "application/json",
|
|
373
373
|
requestType: "json",
|
|
374
374
|
body: serializers.ReplyToMessageRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -43,9 +43,9 @@ import * as AgentMail from "../../../index";
|
|
|
43
43
|
* }
|
|
44
44
|
*/
|
|
45
45
|
export interface ListMessagesResponse {
|
|
46
|
-
/** Messages items. Ordered by `sent_at` descending. */
|
|
47
|
-
messages: AgentMail.MessageItem[];
|
|
48
46
|
count: AgentMail.Count;
|
|
49
47
|
limit?: AgentMail.Limit;
|
|
50
48
|
lastKey?: AgentMail.LastKey;
|
|
49
|
+
/** Message items. Ordered by `timestamp` descending. */
|
|
50
|
+
messages: AgentMail.MessageItem[];
|
|
51
51
|
}
|
|
@@ -11,7 +11,6 @@ import * as AgentMail from "../../../index";
|
|
|
11
11
|
* labels: ["RECEIVED", "UNREAD"],
|
|
12
12
|
* timestamp: "2024-01-15T09:30:00Z",
|
|
13
13
|
* from: "alice@example.com",
|
|
14
|
-
* replyTo: "alice.work@example.com",
|
|
15
14
|
* to: ["bob@example.com"],
|
|
16
15
|
* cc: ["charlie@example.com"],
|
|
17
16
|
* bcc: ["david@example.com"],
|
|
@@ -39,12 +38,11 @@ export interface Message {
|
|
|
39
38
|
labels: AgentMail.MessageLabels;
|
|
40
39
|
timestamp: AgentMail.MessageTimestamp;
|
|
41
40
|
from: AgentMail.MessageFrom;
|
|
42
|
-
replyTo?: AgentMail.MessageReplyTo;
|
|
43
|
-
subject?: AgentMail.MessageSubject;
|
|
44
|
-
preview?: AgentMail.MessagePreview;
|
|
45
41
|
to: AgentMail.MessageTo;
|
|
46
42
|
cc?: AgentMail.MessageCc;
|
|
47
43
|
bcc?: AgentMail.MessageBcc;
|
|
44
|
+
subject?: AgentMail.MessageSubject;
|
|
45
|
+
preview?: AgentMail.MessagePreview;
|
|
48
46
|
text?: AgentMail.MessageText;
|
|
49
47
|
html?: AgentMail.MessageHtml;
|
|
50
48
|
attachments?: AgentMail.MessageAttachments;
|
|
@@ -11,18 +11,17 @@ export * from "./MessageEventId";
|
|
|
11
11
|
export * from "./MessageLabels";
|
|
12
12
|
export * from "./MessageTimestamp";
|
|
13
13
|
export * from "./MessageFrom";
|
|
14
|
-
export * from "./MessageReplyTo";
|
|
15
|
-
export * from "./MessageSubject";
|
|
16
|
-
export * from "./MessagePreview";
|
|
17
14
|
export * from "./MessageTo";
|
|
18
15
|
export * from "./MessageCc";
|
|
19
16
|
export * from "./MessageBcc";
|
|
17
|
+
export * from "./MessageSubject";
|
|
18
|
+
export * from "./MessagePreview";
|
|
19
|
+
export * from "./MessageText";
|
|
20
|
+
export * from "./MessageHtml";
|
|
20
21
|
export * from "./MessageAttachments";
|
|
21
22
|
export * from "./MessageInReplyTo";
|
|
22
23
|
export * from "./MessageReferences";
|
|
23
24
|
export * from "./MessageItem";
|
|
24
|
-
export * from "./MessageText";
|
|
25
|
-
export * from "./MessageHtml";
|
|
26
25
|
export * from "./Message";
|
|
27
26
|
export * from "./ListMessagesResponse";
|
|
28
27
|
export * from "./Addresses";
|
|
@@ -27,18 +27,17 @@ __exportStar(require("./MessageEventId"), exports);
|
|
|
27
27
|
__exportStar(require("./MessageLabels"), exports);
|
|
28
28
|
__exportStar(require("./MessageTimestamp"), exports);
|
|
29
29
|
__exportStar(require("./MessageFrom"), exports);
|
|
30
|
-
__exportStar(require("./MessageReplyTo"), exports);
|
|
31
|
-
__exportStar(require("./MessageSubject"), exports);
|
|
32
|
-
__exportStar(require("./MessagePreview"), exports);
|
|
33
30
|
__exportStar(require("./MessageTo"), exports);
|
|
34
31
|
__exportStar(require("./MessageCc"), exports);
|
|
35
32
|
__exportStar(require("./MessageBcc"), exports);
|
|
33
|
+
__exportStar(require("./MessageSubject"), exports);
|
|
34
|
+
__exportStar(require("./MessagePreview"), exports);
|
|
35
|
+
__exportStar(require("./MessageText"), exports);
|
|
36
|
+
__exportStar(require("./MessageHtml"), exports);
|
|
36
37
|
__exportStar(require("./MessageAttachments"), exports);
|
|
37
38
|
__exportStar(require("./MessageInReplyTo"), exports);
|
|
38
39
|
__exportStar(require("./MessageReferences"), exports);
|
|
39
40
|
__exportStar(require("./MessageItem"), exports);
|
|
40
|
-
__exportStar(require("./MessageText"), exports);
|
|
41
|
-
__exportStar(require("./MessageHtml"), exports);
|
|
42
41
|
__exportStar(require("./Message"), exports);
|
|
43
42
|
__exportStar(require("./ListMessagesResponse"), exports);
|
|
44
43
|
__exportStar(require("./Addresses"), exports);
|
|
@@ -89,7 +89,7 @@ class Threads {
|
|
|
89
89
|
const _response = yield core.fetcher({
|
|
90
90
|
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`),
|
|
91
91
|
method: "GET",
|
|
92
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.
|
|
92
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
93
93
|
contentType: "application/json",
|
|
94
94
|
queryParameters: _queryParams,
|
|
95
95
|
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.
|
|
157
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "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,
|
|
@@ -34,9 +34,9 @@ import * as AgentMail from "../../../index";
|
|
|
34
34
|
* }
|
|
35
35
|
*/
|
|
36
36
|
export interface ListThreadsResponse {
|
|
37
|
-
/** Thread items. Ordered by `updated_at` descending. */
|
|
38
|
-
threads: AgentMail.ThreadItem[];
|
|
39
37
|
count: AgentMail.Count;
|
|
40
38
|
limit?: AgentMail.Limit;
|
|
41
39
|
lastKey?: AgentMail.LastKey;
|
|
40
|
+
/** Thread items. Ordered by `timestamp` descending. */
|
|
41
|
+
threads: AgentMail.ThreadItem[];
|
|
42
42
|
}
|
|
@@ -80,7 +80,7 @@ class Webhooks {
|
|
|
80
80
|
const _response = yield core.fetcher({
|
|
81
81
|
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/webhooks"),
|
|
82
82
|
method: "GET",
|
|
83
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.
|
|
83
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
84
84
|
contentType: "application/json",
|
|
85
85
|
queryParameters: _queryParams,
|
|
86
86
|
requestType: "json",
|
|
@@ -133,7 +133,7 @@ class Webhooks {
|
|
|
133
133
|
const _response = yield core.fetcher({
|
|
134
134
|
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/webhooks/${encodeURIComponent(serializers.WebhookId.jsonOrThrow(webhookId))}`),
|
|
135
135
|
method: "GET",
|
|
136
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.
|
|
136
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
137
137
|
contentType: "application/json",
|
|
138
138
|
requestType: "json",
|
|
139
139
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -200,7 +200,7 @@ class Webhooks {
|
|
|
200
200
|
const _response = yield core.fetcher({
|
|
201
201
|
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/webhooks"),
|
|
202
202
|
method: "POST",
|
|
203
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.
|
|
203
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
204
204
|
contentType: "application/json",
|
|
205
205
|
requestType: "json",
|
|
206
206
|
body: serializers.CreateWebhookRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -264,7 +264,7 @@ class Webhooks {
|
|
|
264
264
|
const _response = yield core.fetcher({
|
|
265
265
|
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/webhooks/${encodeURIComponent(serializers.WebhookId.jsonOrThrow(webhookId))}`),
|
|
266
266
|
method: "DELETE",
|
|
267
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.
|
|
267
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "agentmail", "X-Fern-SDK-Version": "0.0.26", "User-Agent": "agentmail/0.0.26", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
268
268
|
contentType: "application/json",
|
|
269
269
|
requestType: "json",
|
|
270
270
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as AgentMail from "../../../index";
|
|
5
5
|
export interface ListWebhooksResponse {
|
|
6
|
-
/** Webhook items. Ordered by `created_at` ascending. */
|
|
7
|
-
webhooks: AgentMail.Webhook[];
|
|
8
6
|
count: AgentMail.Count;
|
|
9
7
|
limit?: AgentMail.Limit;
|
|
10
8
|
lastKey?: AgentMail.LastKey;
|
|
9
|
+
/** Webhook items. Ordered by `created_at` ascending. */
|
|
10
|
+
webhooks: AgentMail.Webhook[];
|
|
11
11
|
}
|
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 { Drafts } from "./api/resources/drafts/client/Client";
|
|
9
10
|
import { Webhooks } from "./api/resources/webhooks/client/Client";
|
|
10
11
|
export declare namespace AgentMailClient {
|
|
11
12
|
interface Options {
|
|
@@ -30,10 +31,12 @@ export declare class AgentMailClient {
|
|
|
30
31
|
protected _inboxes: Inboxes | undefined;
|
|
31
32
|
protected _threads: Threads | undefined;
|
|
32
33
|
protected _messages: Messages | undefined;
|
|
34
|
+
protected _drafts: Drafts | undefined;
|
|
33
35
|
protected _webhooks: Webhooks | undefined;
|
|
34
36
|
constructor(_options?: AgentMailClient.Options);
|
|
35
37
|
get inboxes(): Inboxes;
|
|
36
38
|
get threads(): Threads;
|
|
37
39
|
get messages(): Messages;
|
|
40
|
+
get drafts(): Drafts;
|
|
38
41
|
get webhooks(): Webhooks;
|
|
39
42
|
}
|
package/dist/Client.js
CHANGED
|
@@ -7,7 +7,8 @@ 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/
|
|
10
|
+
const Client_4 = require("./api/resources/drafts/client/Client");
|
|
11
|
+
const Client_5 = require("./api/resources/webhooks/client/Client");
|
|
11
12
|
class AgentMailClient {
|
|
12
13
|
constructor(_options = {}) {
|
|
13
14
|
this._options = _options;
|
|
@@ -24,9 +25,13 @@ class AgentMailClient {
|
|
|
24
25
|
var _a;
|
|
25
26
|
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_3.Messages(this._options)));
|
|
26
27
|
}
|
|
28
|
+
get drafts() {
|
|
29
|
+
var _a;
|
|
30
|
+
return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new Client_4.Drafts(this._options)));
|
|
31
|
+
}
|
|
27
32
|
get webhooks() {
|
|
28
33
|
var _a;
|
|
29
|
-
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new
|
|
34
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_5.Webhooks(this._options)));
|
|
30
35
|
}
|
|
31
36
|
}
|
|
32
37
|
exports.AgentMailClient = AgentMailClient;
|
|
@@ -0,0 +1,53 @@
|
|
|
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 Drafts {
|
|
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 Drafts {
|
|
26
|
+
protected readonly _options: Drafts.Options;
|
|
27
|
+
constructor(_options?: Drafts.Options);
|
|
28
|
+
/**
|
|
29
|
+
* @param {AgentMail.InboxId} inboxId
|
|
30
|
+
* @param {AgentMail.ListDraftsRequest} request
|
|
31
|
+
* @param {Drafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
+
*
|
|
33
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* await client.drafts.list("yourinbox@agentmail.to", {
|
|
37
|
+
* limit: 10
|
|
38
|
+
* })
|
|
39
|
+
*/
|
|
40
|
+
list(inboxId: AgentMail.InboxId, request?: AgentMail.ListDraftsRequest, requestOptions?: Drafts.RequestOptions): Promise<AgentMail.ListDraftsResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* @param {AgentMail.InboxId} inboxId
|
|
43
|
+
* @param {AgentMail.DraftId} draftId
|
|
44
|
+
* @param {Drafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
45
|
+
*
|
|
46
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* await client.drafts.get("yourinbox@agentmail.to", "draft_123")
|
|
50
|
+
*/
|
|
51
|
+
get(inboxId: AgentMail.InboxId, draftId: AgentMail.DraftId, requestOptions?: Drafts.RequestOptions): Promise<AgentMail.Draft>;
|
|
52
|
+
protected _getAuthorizationHeader(): Promise<string>;
|
|
53
|
+
}
|