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.
- package/Client.d.ts +3 -0
- package/Client.js +5 -0
- package/api/resources/inboxes/client/Client.js +3 -3
- package/api/resources/inboxes/types/Inbox.d.ts +1 -1
- 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/MessageInReplyTo.d.ts +1 -1
- package/api/resources/messages/types/MessageReferences.d.ts +1 -1
- package/api/resources/messages/types/MessageReplyTo.d.ts +1 -1
- package/api/resources/threads/client/Client.js +2 -2
- package/api/resources/webhooks/client/Client.d.ts +71 -0
- package/api/resources/webhooks/client/Client.js +316 -0
- package/api/resources/webhooks/client/index.d.ts +1 -0
- package/api/resources/webhooks/client/index.js +17 -0
- package/api/resources/webhooks/client/requests/ListWebhooksRequest.d.ts +12 -0
- package/api/resources/webhooks/client/requests/ListWebhooksRequest.js +5 -0
- package/api/resources/webhooks/client/requests/index.d.ts +1 -0
- package/api/resources/webhooks/client/requests/index.js +2 -0
- package/api/resources/webhooks/index.d.ts +2 -0
- package/api/resources/webhooks/index.js +18 -0
- package/api/resources/webhooks/types/CreateWebhookRequest.d.ts +9 -0
- package/api/resources/webhooks/types/CreateWebhookRequest.js +5 -0
- package/api/resources/webhooks/types/EventId.d.ts +7 -0
- package/api/resources/webhooks/types/EventId.js +5 -0
- package/api/resources/webhooks/types/EventType.d.ts +7 -0
- package/api/resources/webhooks/types/EventType.js +9 -0
- package/api/resources/webhooks/types/Events.d.ts +8 -0
- package/api/resources/webhooks/types/Events.js +5 -0
- package/api/resources/webhooks/types/Inboxes.d.ts +7 -0
- package/api/resources/webhooks/types/Inboxes.js +5 -0
- package/api/resources/webhooks/types/ListWebhooksResponse.d.ts +11 -0
- package/api/resources/webhooks/types/ListWebhooksResponse.js +5 -0
- package/api/resources/webhooks/types/MessageReceivedPayload.d.ts +7 -0
- package/api/resources/webhooks/types/MessageReceivedPayload.js +5 -0
- package/api/resources/webhooks/types/Payload.d.ts +8 -0
- package/api/resources/webhooks/types/Payload.js +5 -0
- package/api/resources/webhooks/types/SvixId.d.ts +7 -0
- package/api/resources/webhooks/types/SvixId.js +5 -0
- package/api/resources/webhooks/types/SvixSignature.d.ts +7 -0
- package/api/resources/webhooks/types/SvixSignature.js +5 -0
- package/api/resources/webhooks/types/SvixTimestamp.d.ts +7 -0
- package/api/resources/webhooks/types/SvixTimestamp.js +5 -0
- package/api/resources/webhooks/types/Url.d.ts +7 -0
- package/api/resources/webhooks/types/Url.js +5 -0
- package/api/resources/webhooks/types/Webhook.d.ts +14 -0
- package/api/resources/webhooks/types/Webhook.js +5 -0
- package/api/resources/webhooks/types/WebhookId.d.ts +7 -0
- package/api/resources/webhooks/types/WebhookId.js +5 -0
- package/api/resources/webhooks/types/index.d.ts +14 -0
- package/api/resources/webhooks/types/index.js +30 -0
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +5 -0
- package/dist/api/resources/inboxes/client/Client.js +3 -3
- package/dist/api/resources/inboxes/types/Inbox.d.ts +1 -1
- 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/MessageInReplyTo.d.ts +1 -1
- package/dist/api/resources/messages/types/MessageReferences.d.ts +1 -1
- package/dist/api/resources/messages/types/MessageReplyTo.d.ts +1 -1
- package/dist/api/resources/threads/client/Client.js +2 -2
- package/dist/api/resources/webhooks/client/Client.d.ts +71 -0
- package/dist/api/resources/webhooks/client/Client.js +316 -0
- package/dist/api/resources/webhooks/client/index.d.ts +1 -0
- package/dist/api/resources/webhooks/client/index.js +17 -0
- package/dist/api/resources/webhooks/client/requests/ListWebhooksRequest.d.ts +12 -0
- package/dist/api/resources/webhooks/client/requests/ListWebhooksRequest.js +5 -0
- package/dist/api/resources/webhooks/client/requests/index.d.ts +1 -0
- package/dist/api/resources/webhooks/client/requests/index.js +2 -0
- package/dist/api/resources/webhooks/index.d.ts +2 -0
- package/dist/api/resources/webhooks/index.js +18 -0
- package/dist/api/resources/webhooks/types/CreateWebhookRequest.d.ts +9 -0
- package/dist/api/resources/webhooks/types/CreateWebhookRequest.js +5 -0
- package/dist/api/resources/webhooks/types/EventId.d.ts +7 -0
- package/dist/api/resources/webhooks/types/EventId.js +5 -0
- package/dist/api/resources/webhooks/types/EventType.d.ts +7 -0
- package/dist/api/resources/webhooks/types/EventType.js +9 -0
- package/dist/api/resources/webhooks/types/Events.d.ts +8 -0
- package/dist/api/resources/webhooks/types/Events.js +5 -0
- package/dist/api/resources/webhooks/types/Inboxes.d.ts +7 -0
- package/dist/api/resources/webhooks/types/Inboxes.js +5 -0
- package/dist/api/resources/webhooks/types/ListWebhooksResponse.d.ts +11 -0
- package/dist/api/resources/webhooks/types/ListWebhooksResponse.js +5 -0
- package/dist/api/resources/webhooks/types/MessageReceivedPayload.d.ts +7 -0
- package/dist/api/resources/webhooks/types/MessageReceivedPayload.js +5 -0
- package/dist/api/resources/webhooks/types/Payload.d.ts +8 -0
- package/dist/api/resources/webhooks/types/Payload.js +5 -0
- package/dist/api/resources/webhooks/types/SvixId.d.ts +7 -0
- package/dist/api/resources/webhooks/types/SvixId.js +5 -0
- package/dist/api/resources/webhooks/types/SvixSignature.d.ts +7 -0
- package/dist/api/resources/webhooks/types/SvixSignature.js +5 -0
- package/dist/api/resources/webhooks/types/SvixTimestamp.d.ts +7 -0
- package/dist/api/resources/webhooks/types/SvixTimestamp.js +5 -0
- package/dist/api/resources/webhooks/types/Url.d.ts +7 -0
- package/dist/api/resources/webhooks/types/Url.js +5 -0
- package/dist/api/resources/webhooks/types/Webhook.d.ts +14 -0
- package/dist/api/resources/webhooks/types/Webhook.js +5 -0
- package/dist/api/resources/webhooks/types/WebhookId.d.ts +7 -0
- package/dist/api/resources/webhooks/types/WebhookId.js +5 -0
- package/dist/api/resources/webhooks/types/index.d.ts +14 -0
- package/dist/api/resources/webhooks/types/index.js +30 -0
- package/dist/serialization/resources/inboxes/types/Inbox.d.ts +1 -1
- package/dist/serialization/resources/inboxes/types/Inbox.js +1 -1
- package/dist/serialization/resources/index.d.ts +2 -0
- package/dist/serialization/resources/index.js +3 -1
- package/dist/serialization/resources/messages/types/Message.d.ts +3 -3
- package/dist/serialization/resources/messages/types/Message.js +3 -3
- package/dist/serialization/resources/messages/types/MessageInReplyTo.d.ts +1 -1
- package/dist/serialization/resources/messages/types/MessageInReplyTo.js +1 -1
- package/dist/serialization/resources/messages/types/MessageReferences.d.ts +1 -1
- package/dist/serialization/resources/messages/types/MessageReferences.js +1 -1
- package/dist/serialization/resources/messages/types/MessageReplyTo.d.ts +1 -1
- package/dist/serialization/resources/messages/types/MessageReplyTo.js +1 -1
- package/dist/serialization/resources/webhooks/index.d.ts +1 -0
- package/dist/serialization/resources/webhooks/index.js +17 -0
- package/dist/serialization/resources/webhooks/types/CreateWebhookRequest.d.ts +17 -0
- package/dist/serialization/resources/webhooks/types/CreateWebhookRequest.js +48 -0
- package/dist/serialization/resources/webhooks/types/EventId.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/EventId.js +41 -0
- package/dist/serialization/resources/webhooks/types/EventType.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/EventType.js +41 -0
- package/dist/serialization/resources/webhooks/types/Events.d.ts +11 -0
- package/dist/serialization/resources/webhooks/types/Events.js +42 -0
- package/dist/serialization/resources/webhooks/types/Inboxes.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/Inboxes.js +41 -0
- package/dist/serialization/resources/webhooks/types/ListWebhooksResponse.d.ts +19 -0
- package/dist/serialization/resources/webhooks/types/ListWebhooksResponse.js +50 -0
- package/dist/serialization/resources/webhooks/types/MessageReceivedPayload.d.ts +14 -0
- package/dist/serialization/resources/webhooks/types/MessageReceivedPayload.js +47 -0
- package/dist/serialization/resources/webhooks/types/Payload.d.ts +15 -0
- package/dist/serialization/resources/webhooks/types/Payload.js +46 -0
- package/dist/serialization/resources/webhooks/types/SvixId.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/SvixId.js +41 -0
- package/dist/serialization/resources/webhooks/types/SvixSignature.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/SvixSignature.js +41 -0
- package/dist/serialization/resources/webhooks/types/SvixTimestamp.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/SvixTimestamp.js +41 -0
- package/dist/serialization/resources/webhooks/types/Url.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/Url.js +41 -0
- package/dist/serialization/resources/webhooks/types/Webhook.d.ts +21 -0
- package/dist/serialization/resources/webhooks/types/Webhook.js +52 -0
- package/dist/serialization/resources/webhooks/types/WebhookId.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/WebhookId.js +41 -0
- package/dist/serialization/resources/webhooks/types/index.d.ts +14 -0
- package/dist/serialization/resources/webhooks/types/index.js +30 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +198 -0
- package/serialization/resources/inboxes/types/Inbox.d.ts +1 -1
- package/serialization/resources/inboxes/types/Inbox.js +1 -1
- package/serialization/resources/index.d.ts +2 -0
- package/serialization/resources/index.js +3 -1
- package/serialization/resources/messages/types/Message.d.ts +3 -3
- package/serialization/resources/messages/types/Message.js +3 -3
- package/serialization/resources/messages/types/MessageInReplyTo.d.ts +1 -1
- package/serialization/resources/messages/types/MessageInReplyTo.js +1 -1
- package/serialization/resources/messages/types/MessageReferences.d.ts +1 -1
- package/serialization/resources/messages/types/MessageReferences.js +1 -1
- package/serialization/resources/messages/types/MessageReplyTo.d.ts +1 -1
- package/serialization/resources/messages/types/MessageReplyTo.js +1 -1
- package/serialization/resources/webhooks/index.d.ts +1 -0
- package/serialization/resources/webhooks/index.js +17 -0
- package/serialization/resources/webhooks/types/CreateWebhookRequest.d.ts +17 -0
- package/serialization/resources/webhooks/types/CreateWebhookRequest.js +48 -0
- package/serialization/resources/webhooks/types/EventId.d.ts +10 -0
- package/serialization/resources/webhooks/types/EventId.js +41 -0
- package/serialization/resources/webhooks/types/EventType.d.ts +10 -0
- package/serialization/resources/webhooks/types/EventType.js +41 -0
- package/serialization/resources/webhooks/types/Events.d.ts +11 -0
- package/serialization/resources/webhooks/types/Events.js +42 -0
- package/serialization/resources/webhooks/types/Inboxes.d.ts +10 -0
- package/serialization/resources/webhooks/types/Inboxes.js +41 -0
- package/serialization/resources/webhooks/types/ListWebhooksResponse.d.ts +19 -0
- package/serialization/resources/webhooks/types/ListWebhooksResponse.js +50 -0
- package/serialization/resources/webhooks/types/MessageReceivedPayload.d.ts +14 -0
- package/serialization/resources/webhooks/types/MessageReceivedPayload.js +47 -0
- package/serialization/resources/webhooks/types/Payload.d.ts +15 -0
- package/serialization/resources/webhooks/types/Payload.js +46 -0
- package/serialization/resources/webhooks/types/SvixId.d.ts +10 -0
- package/serialization/resources/webhooks/types/SvixId.js +41 -0
- package/serialization/resources/webhooks/types/SvixSignature.d.ts +10 -0
- package/serialization/resources/webhooks/types/SvixSignature.js +41 -0
- package/serialization/resources/webhooks/types/SvixTimestamp.d.ts +10 -0
- package/serialization/resources/webhooks/types/SvixTimestamp.js +41 -0
- package/serialization/resources/webhooks/types/Url.d.ts +10 -0
- package/serialization/resources/webhooks/types/Url.js +41 -0
- package/serialization/resources/webhooks/types/Webhook.d.ts +21 -0
- package/serialization/resources/webhooks/types/Webhook.js +52 -0
- package/serialization/resources/webhooks/types/WebhookId.d.ts +10 -0
- package/serialization/resources/webhooks/types/WebhookId.js +41 -0
- package/serialization/resources/webhooks/types/index.d.ts +14 -0
- package/serialization/resources/webhooks/types/index.js +30 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -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,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,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,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.
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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" }),
|
|
@@ -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.
|
|
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.
|
|
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
|
+
}
|