agentmail 0.5.18 → 0.5.20
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/LICENSE +21 -0
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/domains/types/CreateDomainRequest.d.ts +1 -0
- package/dist/cjs/api/resources/domains/types/Domain.d.ts +1 -0
- package/dist/cjs/api/resources/domains/types/DomainItem.d.ts +1 -0
- package/dist/cjs/api/resources/domains/types/TrackingEnabled.d.ts +6 -0
- package/dist/cjs/api/resources/domains/types/TrackingEnabled.js +3 -0
- package/dist/cjs/api/resources/domains/types/UpdateDomainRequest.d.ts +3 -1
- package/dist/cjs/api/resources/domains/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/domains/types/index.js +1 -0
- package/dist/cjs/api/resources/events/types/EventType.d.ts +1 -0
- package/dist/cjs/api/resources/events/types/EventType.js +1 -0
- package/dist/cjs/api/resources/events/types/MessageOpenedEvent.d.ts +11 -0
- package/dist/cjs/api/resources/events/types/MessageOpenedEvent.js +3 -0
- package/dist/cjs/api/resources/events/types/Open.d.ts +7 -0
- package/dist/cjs/api/resources/events/types/Open.js +3 -0
- package/dist/cjs/api/resources/events/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/events/types/index.js +2 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.d.ts +32 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.js +139 -0
- package/dist/cjs/api/resources/messages/types/ReplyAllMessageRequest.d.ts +1 -0
- package/dist/cjs/api/resources/messages/types/ReplyToMessageRequest.d.ts +1 -0
- package/dist/cjs/api/resources/messages/types/SendMessageRequest.d.ts +1 -0
- package/dist/cjs/api/resources/messages/types/TrackOpens.d.ts +7 -0
- package/dist/cjs/api/resources/messages/types/TrackOpens.js +3 -0
- package/dist/cjs/api/resources/messages/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/types/index.js +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.d.ts +32 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.js +139 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +30 -0
- package/dist/cjs/api/resources/webhooks/client/Client.js +137 -0
- package/dist/cjs/api/resources/webhooks/types/CreateInboxWebhookRequest.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookHeadersRequest.d.ts +10 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookHeadersRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/WebhookHeaderNamesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/webhooks/types/WebhookHeaderNamesResponse.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/WebhookHeaders.d.ts +6 -0
- package/dist/cjs/api/resources/webhooks/types/WebhookHeaders.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/webhooks/types/index.js +3 -0
- package/dist/cjs/api/resources/websockets/client/Socket.d.ts +1 -1
- package/dist/cjs/serialization/resources/domains/types/CreateDomainRequest.d.ts +2 -0
- package/dist/cjs/serialization/resources/domains/types/CreateDomainRequest.js +2 -0
- package/dist/cjs/serialization/resources/domains/types/Domain.d.ts +2 -0
- package/dist/cjs/serialization/resources/domains/types/Domain.js +2 -0
- package/dist/cjs/serialization/resources/domains/types/DomainItem.d.ts +2 -0
- package/dist/cjs/serialization/resources/domains/types/DomainItem.js +2 -0
- package/dist/cjs/serialization/resources/domains/types/TrackingEnabled.d.ts +7 -0
- package/dist/cjs/serialization/resources/domains/types/TrackingEnabled.js +39 -0
- package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.d.ts +2 -0
- package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.js +2 -0
- package/dist/cjs/serialization/resources/domains/types/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/domains/types/index.js +1 -0
- package/dist/cjs/serialization/resources/events/types/EventType.d.ts +1 -1
- package/dist/cjs/serialization/resources/events/types/EventType.js +1 -0
- package/dist/cjs/serialization/resources/events/types/MessageOpenedEvent.d.ts +14 -0
- package/dist/cjs/serialization/resources/events/types/MessageOpenedEvent.js +46 -0
- package/dist/cjs/serialization/resources/events/types/Open.d.ts +16 -0
- package/dist/cjs/serialization/resources/events/types/Open.js +48 -0
- package/dist/cjs/serialization/resources/events/types/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/events/types/index.js +2 -0
- package/dist/cjs/serialization/resources/messages/types/ReplyAllMessageRequest.d.ts +2 -0
- package/dist/cjs/serialization/resources/messages/types/ReplyAllMessageRequest.js +2 -0
- package/dist/cjs/serialization/resources/messages/types/ReplyToMessageRequest.d.ts +2 -0
- package/dist/cjs/serialization/resources/messages/types/ReplyToMessageRequest.js +2 -0
- package/dist/cjs/serialization/resources/messages/types/SendMessageRequest.d.ts +2 -0
- package/dist/cjs/serialization/resources/messages/types/SendMessageRequest.js +2 -0
- package/dist/cjs/serialization/resources/messages/types/TrackOpens.d.ts +7 -0
- package/dist/cjs/serialization/resources/messages/types/TrackOpens.js +39 -0
- package/dist/cjs/serialization/resources/messages/types/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/messages/types/index.js +1 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateInboxWebhookRequest.d.ts +2 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateInboxWebhookRequest.js +2 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookHeadersRequest.d.ts +11 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookHeadersRequest.js +43 -0
- package/dist/cjs/serialization/resources/webhooks/types/WebhookHeaderNamesResponse.d.ts +9 -0
- package/dist/cjs/serialization/resources/webhooks/types/WebhookHeaderNamesResponse.js +41 -0
- package/dist/cjs/serialization/resources/webhooks/types/WebhookHeaders.d.ts +7 -0
- package/dist/cjs/serialization/resources/webhooks/types/WebhookHeaders.js +39 -0
- package/dist/cjs/serialization/resources/webhooks/types/index.d.ts +3 -0
- package/dist/cjs/serialization/resources/webhooks/types/index.js +3 -0
- package/dist/cjs/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.ts +3 -2
- package/dist/cjs/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/domains/types/CreateDomainRequest.d.mts +1 -0
- package/dist/esm/api/resources/domains/types/Domain.d.mts +1 -0
- package/dist/esm/api/resources/domains/types/DomainItem.d.mts +1 -0
- package/dist/esm/api/resources/domains/types/TrackingEnabled.d.mts +6 -0
- package/dist/esm/api/resources/domains/types/TrackingEnabled.mjs +2 -0
- package/dist/esm/api/resources/domains/types/UpdateDomainRequest.d.mts +3 -1
- package/dist/esm/api/resources/domains/types/index.d.mts +1 -0
- package/dist/esm/api/resources/domains/types/index.mjs +1 -0
- package/dist/esm/api/resources/events/types/EventType.d.mts +1 -0
- package/dist/esm/api/resources/events/types/EventType.mjs +1 -0
- package/dist/esm/api/resources/events/types/MessageOpenedEvent.d.mts +11 -0
- package/dist/esm/api/resources/events/types/MessageOpenedEvent.mjs +2 -0
- package/dist/esm/api/resources/events/types/Open.d.mts +7 -0
- package/dist/esm/api/resources/events/types/Open.mjs +2 -0
- package/dist/esm/api/resources/events/types/index.d.mts +2 -0
- package/dist/esm/api/resources/events/types/index.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.d.mts +32 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.mjs +139 -0
- package/dist/esm/api/resources/messages/types/ReplyAllMessageRequest.d.mts +1 -0
- package/dist/esm/api/resources/messages/types/ReplyToMessageRequest.d.mts +1 -0
- package/dist/esm/api/resources/messages/types/SendMessageRequest.d.mts +1 -0
- package/dist/esm/api/resources/messages/types/TrackOpens.d.mts +7 -0
- package/dist/esm/api/resources/messages/types/TrackOpens.mjs +2 -0
- package/dist/esm/api/resources/messages/types/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/types/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/Client.d.mts +32 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/Client.mjs +139 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +30 -0
- package/dist/esm/api/resources/webhooks/client/Client.mjs +137 -0
- package/dist/esm/api/resources/webhooks/types/CreateInboxWebhookRequest.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookHeadersRequest.d.mts +10 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookHeadersRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/WebhookHeaderNamesResponse.d.mts +4 -0
- package/dist/esm/api/resources/webhooks/types/WebhookHeaderNamesResponse.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/WebhookHeaders.d.mts +6 -0
- package/dist/esm/api/resources/webhooks/types/WebhookHeaders.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/index.d.mts +3 -0
- package/dist/esm/api/resources/webhooks/types/index.mjs +3 -0
- package/dist/esm/api/resources/websockets/client/Socket.d.mts +1 -1
- package/dist/esm/serialization/resources/domains/types/CreateDomainRequest.d.mts +2 -0
- package/dist/esm/serialization/resources/domains/types/CreateDomainRequest.mjs +2 -0
- package/dist/esm/serialization/resources/domains/types/Domain.d.mts +2 -0
- package/dist/esm/serialization/resources/domains/types/Domain.mjs +2 -0
- package/dist/esm/serialization/resources/domains/types/DomainItem.d.mts +2 -0
- package/dist/esm/serialization/resources/domains/types/DomainItem.mjs +2 -0
- package/dist/esm/serialization/resources/domains/types/TrackingEnabled.d.mts +7 -0
- package/dist/esm/serialization/resources/domains/types/TrackingEnabled.mjs +3 -0
- package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.d.mts +2 -0
- package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.mjs +2 -0
- package/dist/esm/serialization/resources/domains/types/index.d.mts +1 -0
- package/dist/esm/serialization/resources/domains/types/index.mjs +1 -0
- package/dist/esm/serialization/resources/events/types/EventType.d.mts +1 -1
- package/dist/esm/serialization/resources/events/types/EventType.mjs +1 -0
- package/dist/esm/serialization/resources/events/types/MessageOpenedEvent.d.mts +14 -0
- package/dist/esm/serialization/resources/events/types/MessageOpenedEvent.mjs +10 -0
- package/dist/esm/serialization/resources/events/types/Open.d.mts +16 -0
- package/dist/esm/serialization/resources/events/types/Open.mjs +12 -0
- package/dist/esm/serialization/resources/events/types/index.d.mts +2 -0
- package/dist/esm/serialization/resources/events/types/index.mjs +2 -0
- package/dist/esm/serialization/resources/messages/types/ReplyAllMessageRequest.d.mts +2 -0
- package/dist/esm/serialization/resources/messages/types/ReplyAllMessageRequest.mjs +2 -0
- package/dist/esm/serialization/resources/messages/types/ReplyToMessageRequest.d.mts +2 -0
- package/dist/esm/serialization/resources/messages/types/ReplyToMessageRequest.mjs +2 -0
- package/dist/esm/serialization/resources/messages/types/SendMessageRequest.d.mts +2 -0
- package/dist/esm/serialization/resources/messages/types/SendMessageRequest.mjs +2 -0
- package/dist/esm/serialization/resources/messages/types/TrackOpens.d.mts +7 -0
- package/dist/esm/serialization/resources/messages/types/TrackOpens.mjs +3 -0
- package/dist/esm/serialization/resources/messages/types/index.d.mts +1 -0
- package/dist/esm/serialization/resources/messages/types/index.mjs +1 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateInboxWebhookRequest.d.mts +2 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateInboxWebhookRequest.mjs +2 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookHeadersRequest.d.mts +11 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookHeadersRequest.mjs +7 -0
- package/dist/esm/serialization/resources/webhooks/types/WebhookHeaderNamesResponse.d.mts +9 -0
- package/dist/esm/serialization/resources/webhooks/types/WebhookHeaderNamesResponse.mjs +5 -0
- package/dist/esm/serialization/resources/webhooks/types/WebhookHeaders.d.mts +7 -0
- package/dist/esm/serialization/resources/webhooks/types/WebhookHeaders.mjs +3 -0
- package/dist/esm/serialization/resources/webhooks/types/index.d.mts +3 -0
- package/dist/esm/serialization/resources/webhooks/types/index.mjs +3 -0
- package/dist/esm/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.mts +3 -2
- package/dist/esm/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms.txt +13 -0
- package/package.json +10 -2
- package/reference.md +440 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agentmail.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "agentmail",
|
|
46
|
-
"X-Fern-SDK-Version": "0.5.
|
|
47
|
-
"User-Agent": "agentmail/0.5.
|
|
46
|
+
"X-Fern-SDK-Version": "0.5.20",
|
|
47
|
+
"User-Agent": "agentmail/0.5.20",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -6,6 +6,7 @@ export interface Domain {
|
|
|
6
6
|
status: AgentMail.Status;
|
|
7
7
|
feedbackEnabled: AgentMail.FeedbackEnabled;
|
|
8
8
|
subdomainsEnabled: AgentMail.SubdomainsEnabled;
|
|
9
|
+
trackingEnabled: AgentMail.TrackingEnabled;
|
|
9
10
|
/**
|
|
10
11
|
* A list of DNS records required to verify the domain. Includes a
|
|
11
12
|
* wildcard MX record (`*.<domain>`) when `subdomains_enabled` is true.
|
|
@@ -5,6 +5,7 @@ export interface DomainItem {
|
|
|
5
5
|
domain: AgentMail.DomainName;
|
|
6
6
|
feedbackEnabled: AgentMail.FeedbackEnabled;
|
|
7
7
|
subdomainsEnabled: AgentMail.SubdomainsEnabled;
|
|
8
|
+
trackingEnabled: AgentMail.TrackingEnabled;
|
|
8
9
|
clientId?: AgentMail.ClientId;
|
|
9
10
|
/** Time at which the domain was last updated. */
|
|
10
11
|
updatedAt: Date;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as AgentMail from "../../../index.js";
|
|
2
2
|
/**
|
|
3
|
-
* Provide at least one of `feedback_enabled
|
|
3
|
+
* Provide at least one of `feedback_enabled`, `subdomains_enabled`, or
|
|
4
|
+
* `tracking_enabled`. Omitted
|
|
4
5
|
* fields are left unchanged; an empty body is rejected. Enabling
|
|
5
6
|
* `subdomains_enabled` on a verified domain returns it to `PENDING` until the
|
|
6
7
|
* newly-required wildcard MX record (`*.<domain>`) is published and verified.
|
|
@@ -8,4 +9,5 @@ import type * as AgentMail from "../../../index.js";
|
|
|
8
9
|
export interface UpdateDomainRequest {
|
|
9
10
|
feedbackEnabled?: AgentMail.FeedbackEnabled;
|
|
10
11
|
subdomainsEnabled?: AgentMail.SubdomainsEnabled;
|
|
12
|
+
trackingEnabled?: AgentMail.TrackingEnabled;
|
|
11
13
|
}
|
|
@@ -10,6 +10,7 @@ export * from "./RecordStatus.js";
|
|
|
10
10
|
export * from "./RecordType.js";
|
|
11
11
|
export * from "./Status.js";
|
|
12
12
|
export * from "./SubdomainsEnabled.js";
|
|
13
|
+
export * from "./TrackingEnabled.js";
|
|
13
14
|
export * from "./UpdateDomainRequest.js";
|
|
14
15
|
export * from "./VerificationRecord.js";
|
|
15
16
|
export * from "./VerificationStatus.js";
|
|
@@ -26,6 +26,7 @@ __exportStar(require("./RecordStatus.js"), exports);
|
|
|
26
26
|
__exportStar(require("./RecordType.js"), exports);
|
|
27
27
|
__exportStar(require("./Status.js"), exports);
|
|
28
28
|
__exportStar(require("./SubdomainsEnabled.js"), exports);
|
|
29
|
+
__exportStar(require("./TrackingEnabled.js"), exports);
|
|
29
30
|
__exportStar(require("./UpdateDomainRequest.js"), exports);
|
|
30
31
|
__exportStar(require("./VerificationRecord.js"), exports);
|
|
31
32
|
__exportStar(require("./VerificationStatus.js"), exports);
|
|
@@ -8,6 +8,7 @@ export declare const EventType: {
|
|
|
8
8
|
readonly MessageBounced: "message.bounced";
|
|
9
9
|
readonly MessageComplained: "message.complained";
|
|
10
10
|
readonly MessageRejected: "message.rejected";
|
|
11
|
+
readonly MessageOpened: "message.opened";
|
|
11
12
|
readonly DomainVerified: "domain.verified";
|
|
12
13
|
};
|
|
13
14
|
export type EventType = (typeof EventType)[keyof typeof EventType];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* A tracked message was opened for the first time. Sent once per message: repeat opens do not
|
|
4
|
+
* resend it.
|
|
5
|
+
*/
|
|
6
|
+
export interface MessageOpenedEvent {
|
|
7
|
+
type: "event";
|
|
8
|
+
eventType: "message.opened";
|
|
9
|
+
eventId: AgentMail.EventId;
|
|
10
|
+
open: AgentMail.Open;
|
|
11
|
+
}
|
|
@@ -9,10 +9,12 @@ export * from "./InboxIds.js";
|
|
|
9
9
|
export * from "./MessageBouncedEvent.js";
|
|
10
10
|
export * from "./MessageComplainedEvent.js";
|
|
11
11
|
export * from "./MessageDeliveredEvent.js";
|
|
12
|
+
export * from "./MessageOpenedEvent.js";
|
|
12
13
|
export * from "./MessageReceivedEvent.js";
|
|
13
14
|
export * from "./MessageReceivedEventType.js";
|
|
14
15
|
export * from "./MessageRejectedEvent.js";
|
|
15
16
|
export * from "./MessageSentEvent.js";
|
|
17
|
+
export * from "./Open.js";
|
|
16
18
|
export * from "./PodIds.js";
|
|
17
19
|
export * from "./Recipient.js";
|
|
18
20
|
export * from "./Reject.js";
|
|
@@ -25,10 +25,12 @@ __exportStar(require("./InboxIds.js"), exports);
|
|
|
25
25
|
__exportStar(require("./MessageBouncedEvent.js"), exports);
|
|
26
26
|
__exportStar(require("./MessageComplainedEvent.js"), exports);
|
|
27
27
|
__exportStar(require("./MessageDeliveredEvent.js"), exports);
|
|
28
|
+
__exportStar(require("./MessageOpenedEvent.js"), exports);
|
|
28
29
|
__exportStar(require("./MessageReceivedEvent.js"), exports);
|
|
29
30
|
__exportStar(require("./MessageReceivedEventType.js"), exports);
|
|
30
31
|
__exportStar(require("./MessageRejectedEvent.js"), exports);
|
|
31
32
|
__exportStar(require("./MessageSentEvent.js"), exports);
|
|
33
|
+
__exportStar(require("./Open.js"), exports);
|
|
32
34
|
__exportStar(require("./PodIds.js"), exports);
|
|
33
35
|
__exportStar(require("./Recipient.js"), exports);
|
|
34
36
|
__exportStar(require("./Reject.js"), exports);
|
|
@@ -42,6 +42,21 @@ export declare class WebhooksClient {
|
|
|
42
42
|
*/
|
|
43
43
|
get(inbox_id: AgentMail.inboxes.InboxId, webhook_id: AgentMail.webhooks.WebhookId, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.Webhook>;
|
|
44
44
|
private __get;
|
|
45
|
+
/**
|
|
46
|
+
* List the names of custom HTTP headers included with deliveries to this inbox-scoped webhook.
|
|
47
|
+
* Header values are write-only and are never returned.
|
|
48
|
+
*
|
|
49
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
50
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
51
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
52
|
+
*
|
|
53
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* await client.inboxes.webhooks.getHeaders("inbox_id", "webhook_id")
|
|
57
|
+
*/
|
|
58
|
+
getHeaders(inbox_id: AgentMail.inboxes.InboxId, webhook_id: AgentMail.webhooks.WebhookId, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.WebhookHeaderNamesResponse>;
|
|
59
|
+
private __getHeaders;
|
|
45
60
|
/**
|
|
46
61
|
* Create a webhook scoped to this inbox.
|
|
47
62
|
*
|
|
@@ -83,6 +98,23 @@ export declare class WebhooksClient {
|
|
|
83
98
|
*/
|
|
84
99
|
update(inbox_id: AgentMail.inboxes.InboxId, webhook_id: AgentMail.webhooks.WebhookId, request: AgentMail.webhooks.UpdateInboxWebhookRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.Webhook>;
|
|
85
100
|
private __update;
|
|
101
|
+
/**
|
|
102
|
+
* Atomically set, replace, or remove custom HTTP headers included with deliveries to this
|
|
103
|
+
* inbox-scoped webhook. Header values remain write-only.
|
|
104
|
+
*
|
|
105
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
106
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
107
|
+
* @param {AgentMail.webhooks.UpdateWebhookHeadersRequest} request
|
|
108
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
109
|
+
*
|
|
110
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
111
|
+
* @throws {@link AgentMail.ValidationError}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await client.inboxes.webhooks.updateHeaders("inbox_id", "webhook_id", {})
|
|
115
|
+
*/
|
|
116
|
+
updateHeaders(inbox_id: AgentMail.inboxes.InboxId, webhook_id: AgentMail.webhooks.WebhookId, request: AgentMail.webhooks.UpdateWebhookHeadersRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
117
|
+
private __updateHeaders;
|
|
86
118
|
/**
|
|
87
119
|
* **CLI:**
|
|
88
120
|
* ```bash
|
|
@@ -185,6 +185,72 @@ class WebhooksClient {
|
|
|
185
185
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/webhooks/{webhook_id}");
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* List the names of custom HTTP headers included with deliveries to this inbox-scoped webhook.
|
|
190
|
+
* Header values are write-only and are never returned.
|
|
191
|
+
*
|
|
192
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
193
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
194
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
195
|
+
*
|
|
196
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* await client.inboxes.webhooks.getHeaders("inbox_id", "webhook_id")
|
|
200
|
+
*/
|
|
201
|
+
getHeaders(inbox_id, webhook_id, requestOptions) {
|
|
202
|
+
return core.HttpResponsePromise.fromPromise(this.__getHeaders(inbox_id, webhook_id, requestOptions));
|
|
203
|
+
}
|
|
204
|
+
__getHeaders(inbox_id, webhook_id, requestOptions) {
|
|
205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
207
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
208
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
209
|
+
const _response = yield core.fetcher({
|
|
210
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
211
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/webhooks/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}/headers`),
|
|
212
|
+
method: "GET",
|
|
213
|
+
headers: _headers,
|
|
214
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
215
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
216
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
217
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
218
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
219
|
+
logging: this._options.logging,
|
|
220
|
+
});
|
|
221
|
+
if (_response.ok) {
|
|
222
|
+
return {
|
|
223
|
+
data: serializers.webhooks.WebhookHeaderNamesResponse.parseOrThrow(_response.body, {
|
|
224
|
+
unrecognizedObjectKeys: "passthrough",
|
|
225
|
+
allowUnrecognizedUnionMembers: true,
|
|
226
|
+
allowUnrecognizedEnumValues: true,
|
|
227
|
+
skipValidation: true,
|
|
228
|
+
breadcrumbsPrefix: ["response"],
|
|
229
|
+
}),
|
|
230
|
+
rawResponse: _response.rawResponse,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
if (_response.error.reason === "status-code") {
|
|
234
|
+
switch (_response.error.statusCode) {
|
|
235
|
+
case 404:
|
|
236
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
237
|
+
unrecognizedObjectKeys: "passthrough",
|
|
238
|
+
allowUnrecognizedUnionMembers: true,
|
|
239
|
+
allowUnrecognizedEnumValues: true,
|
|
240
|
+
skipValidation: true,
|
|
241
|
+
breadcrumbsPrefix: ["response"],
|
|
242
|
+
}), _response.rawResponse);
|
|
243
|
+
default:
|
|
244
|
+
throw new errors.AgentMailError({
|
|
245
|
+
statusCode: _response.error.statusCode,
|
|
246
|
+
body: _response.error.body,
|
|
247
|
+
rawResponse: _response.rawResponse,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/webhooks/{webhook_id}/headers");
|
|
252
|
+
});
|
|
253
|
+
}
|
|
188
254
|
/**
|
|
189
255
|
* Create a webhook scoped to this inbox.
|
|
190
256
|
*
|
|
@@ -348,6 +414,79 @@ class WebhooksClient {
|
|
|
348
414
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/inboxes/{inbox_id}/webhooks/{webhook_id}");
|
|
349
415
|
});
|
|
350
416
|
}
|
|
417
|
+
/**
|
|
418
|
+
* Atomically set, replace, or remove custom HTTP headers included with deliveries to this
|
|
419
|
+
* inbox-scoped webhook. Header values remain write-only.
|
|
420
|
+
*
|
|
421
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
422
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
423
|
+
* @param {AgentMail.webhooks.UpdateWebhookHeadersRequest} request
|
|
424
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
425
|
+
*
|
|
426
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
427
|
+
* @throws {@link AgentMail.ValidationError}
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* await client.inboxes.webhooks.updateHeaders("inbox_id", "webhook_id", {})
|
|
431
|
+
*/
|
|
432
|
+
updateHeaders(inbox_id, webhook_id, request, requestOptions) {
|
|
433
|
+
return core.HttpResponsePromise.fromPromise(this.__updateHeaders(inbox_id, webhook_id, request, requestOptions));
|
|
434
|
+
}
|
|
435
|
+
__updateHeaders(inbox_id, webhook_id, request, requestOptions) {
|
|
436
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
437
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
438
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
439
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
440
|
+
const _response = yield core.fetcher({
|
|
441
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
442
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/webhooks/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}/headers`),
|
|
443
|
+
method: "PATCH",
|
|
444
|
+
headers: _headers,
|
|
445
|
+
contentType: "application/json",
|
|
446
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
447
|
+
requestType: "json",
|
|
448
|
+
body: serializers.webhooks.UpdateWebhookHeadersRequest.jsonOrThrow(request, {
|
|
449
|
+
unrecognizedObjectKeys: "strip",
|
|
450
|
+
omitUndefined: true,
|
|
451
|
+
}),
|
|
452
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
453
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
454
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
455
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
456
|
+
logging: this._options.logging,
|
|
457
|
+
});
|
|
458
|
+
if (_response.ok) {
|
|
459
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
460
|
+
}
|
|
461
|
+
if (_response.error.reason === "status-code") {
|
|
462
|
+
switch (_response.error.statusCode) {
|
|
463
|
+
case 404:
|
|
464
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
465
|
+
unrecognizedObjectKeys: "passthrough",
|
|
466
|
+
allowUnrecognizedUnionMembers: true,
|
|
467
|
+
allowUnrecognizedEnumValues: true,
|
|
468
|
+
skipValidation: true,
|
|
469
|
+
breadcrumbsPrefix: ["response"],
|
|
470
|
+
}), _response.rawResponse);
|
|
471
|
+
case 400:
|
|
472
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
473
|
+
unrecognizedObjectKeys: "passthrough",
|
|
474
|
+
allowUnrecognizedUnionMembers: true,
|
|
475
|
+
allowUnrecognizedEnumValues: true,
|
|
476
|
+
skipValidation: true,
|
|
477
|
+
breadcrumbsPrefix: ["response"],
|
|
478
|
+
}), _response.rawResponse);
|
|
479
|
+
default:
|
|
480
|
+
throw new errors.AgentMailError({
|
|
481
|
+
statusCode: _response.error.statusCode,
|
|
482
|
+
body: _response.error.body,
|
|
483
|
+
rawResponse: _response.rawResponse,
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/inboxes/{inbox_id}/webhooks/{webhook_id}/headers");
|
|
488
|
+
});
|
|
489
|
+
}
|
|
351
490
|
/**
|
|
352
491
|
* **CLI:**
|
|
353
492
|
* ```bash
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Track when this message is first opened. Requires a custom domain with tracking enabled and
|
|
3
|
+
* an HTML body. Opens surface as the `opened` label on the message and as a `message.opened`
|
|
4
|
+
* event. One pixel is injected per message, not per recipient, so a message with several
|
|
5
|
+
* recipients fires once when any of them opens it, and the event does not identify which one.
|
|
6
|
+
*/
|
|
7
|
+
export type TrackOpens = boolean;
|
|
@@ -42,6 +42,7 @@ export * from "./SendMessageReplyTo.js";
|
|
|
42
42
|
export * from "./SendMessageRequest.js";
|
|
43
43
|
export * from "./SendMessageResponse.js";
|
|
44
44
|
export * from "./SendMessageTo.js";
|
|
45
|
+
export * from "./TrackOpens.js";
|
|
45
46
|
export * from "./UpdateMessageLabels.js";
|
|
46
47
|
export * from "./UpdateMessageRequest.js";
|
|
47
48
|
export * from "./UpdateMessageResponse.js";
|
|
@@ -58,6 +58,7 @@ __exportStar(require("./SendMessageReplyTo.js"), exports);
|
|
|
58
58
|
__exportStar(require("./SendMessageRequest.js"), exports);
|
|
59
59
|
__exportStar(require("./SendMessageResponse.js"), exports);
|
|
60
60
|
__exportStar(require("./SendMessageTo.js"), exports);
|
|
61
|
+
__exportStar(require("./TrackOpens.js"), exports);
|
|
61
62
|
__exportStar(require("./UpdateMessageLabels.js"), exports);
|
|
62
63
|
__exportStar(require("./UpdateMessageRequest.js"), exports);
|
|
63
64
|
__exportStar(require("./UpdateMessageResponse.js"), exports);
|
|
@@ -42,6 +42,21 @@ export declare class WebhooksClient {
|
|
|
42
42
|
*/
|
|
43
43
|
get(pod_id: AgentMail.pods.PodId, webhook_id: AgentMail.webhooks.WebhookId, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.Webhook>;
|
|
44
44
|
private __get;
|
|
45
|
+
/**
|
|
46
|
+
* List the names of custom HTTP headers included with deliveries to this pod-scoped webhook.
|
|
47
|
+
* Header values are write-only and are never returned.
|
|
48
|
+
*
|
|
49
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
50
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
51
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
52
|
+
*
|
|
53
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* await client.pods.webhooks.getHeaders("pod_id", "webhook_id")
|
|
57
|
+
*/
|
|
58
|
+
getHeaders(pod_id: AgentMail.pods.PodId, webhook_id: AgentMail.webhooks.WebhookId, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.WebhookHeaderNamesResponse>;
|
|
59
|
+
private __getHeaders;
|
|
45
60
|
/**
|
|
46
61
|
* Create a webhook scoped to this pod.
|
|
47
62
|
*
|
|
@@ -83,6 +98,23 @@ export declare class WebhooksClient {
|
|
|
83
98
|
*/
|
|
84
99
|
update(pod_id: AgentMail.pods.PodId, webhook_id: AgentMail.webhooks.WebhookId, request: AgentMail.webhooks.UpdatePodWebhookRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.Webhook>;
|
|
85
100
|
private __update;
|
|
101
|
+
/**
|
|
102
|
+
* Atomically set, replace, or remove custom HTTP headers included with deliveries to this
|
|
103
|
+
* pod-scoped webhook. Header values remain write-only.
|
|
104
|
+
*
|
|
105
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
106
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
107
|
+
* @param {AgentMail.webhooks.UpdateWebhookHeadersRequest} request
|
|
108
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
109
|
+
*
|
|
110
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
111
|
+
* @throws {@link AgentMail.ValidationError}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await client.pods.webhooks.updateHeaders("pod_id", "webhook_id", {})
|
|
115
|
+
*/
|
|
116
|
+
updateHeaders(pod_id: AgentMail.pods.PodId, webhook_id: AgentMail.webhooks.WebhookId, request: AgentMail.webhooks.UpdateWebhookHeadersRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
117
|
+
private __updateHeaders;
|
|
86
118
|
/**
|
|
87
119
|
* **CLI:**
|
|
88
120
|
* ```bash
|
|
@@ -185,6 +185,72 @@ class WebhooksClient {
|
|
|
185
185
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/webhooks/{webhook_id}");
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* List the names of custom HTTP headers included with deliveries to this pod-scoped webhook.
|
|
190
|
+
* Header values are write-only and are never returned.
|
|
191
|
+
*
|
|
192
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
193
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
194
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
195
|
+
*
|
|
196
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* await client.pods.webhooks.getHeaders("pod_id", "webhook_id")
|
|
200
|
+
*/
|
|
201
|
+
getHeaders(pod_id, webhook_id, requestOptions) {
|
|
202
|
+
return core.HttpResponsePromise.fromPromise(this.__getHeaders(pod_id, webhook_id, requestOptions));
|
|
203
|
+
}
|
|
204
|
+
__getHeaders(pod_id, webhook_id, requestOptions) {
|
|
205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
207
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
208
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
209
|
+
const _response = yield core.fetcher({
|
|
210
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
211
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/webhooks/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}/headers`),
|
|
212
|
+
method: "GET",
|
|
213
|
+
headers: _headers,
|
|
214
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
215
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
216
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
217
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
218
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
219
|
+
logging: this._options.logging,
|
|
220
|
+
});
|
|
221
|
+
if (_response.ok) {
|
|
222
|
+
return {
|
|
223
|
+
data: serializers.webhooks.WebhookHeaderNamesResponse.parseOrThrow(_response.body, {
|
|
224
|
+
unrecognizedObjectKeys: "passthrough",
|
|
225
|
+
allowUnrecognizedUnionMembers: true,
|
|
226
|
+
allowUnrecognizedEnumValues: true,
|
|
227
|
+
skipValidation: true,
|
|
228
|
+
breadcrumbsPrefix: ["response"],
|
|
229
|
+
}),
|
|
230
|
+
rawResponse: _response.rawResponse,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
if (_response.error.reason === "status-code") {
|
|
234
|
+
switch (_response.error.statusCode) {
|
|
235
|
+
case 404:
|
|
236
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
237
|
+
unrecognizedObjectKeys: "passthrough",
|
|
238
|
+
allowUnrecognizedUnionMembers: true,
|
|
239
|
+
allowUnrecognizedEnumValues: true,
|
|
240
|
+
skipValidation: true,
|
|
241
|
+
breadcrumbsPrefix: ["response"],
|
|
242
|
+
}), _response.rawResponse);
|
|
243
|
+
default:
|
|
244
|
+
throw new errors.AgentMailError({
|
|
245
|
+
statusCode: _response.error.statusCode,
|
|
246
|
+
body: _response.error.body,
|
|
247
|
+
rawResponse: _response.rawResponse,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/webhooks/{webhook_id}/headers");
|
|
252
|
+
});
|
|
253
|
+
}
|
|
188
254
|
/**
|
|
189
255
|
* Create a webhook scoped to this pod.
|
|
190
256
|
*
|
|
@@ -348,6 +414,79 @@ class WebhooksClient {
|
|
|
348
414
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/pods/{pod_id}/webhooks/{webhook_id}");
|
|
349
415
|
});
|
|
350
416
|
}
|
|
417
|
+
/**
|
|
418
|
+
* Atomically set, replace, or remove custom HTTP headers included with deliveries to this
|
|
419
|
+
* pod-scoped webhook. Header values remain write-only.
|
|
420
|
+
*
|
|
421
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
422
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
423
|
+
* @param {AgentMail.webhooks.UpdateWebhookHeadersRequest} request
|
|
424
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
425
|
+
*
|
|
426
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
427
|
+
* @throws {@link AgentMail.ValidationError}
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* await client.pods.webhooks.updateHeaders("pod_id", "webhook_id", {})
|
|
431
|
+
*/
|
|
432
|
+
updateHeaders(pod_id, webhook_id, request, requestOptions) {
|
|
433
|
+
return core.HttpResponsePromise.fromPromise(this.__updateHeaders(pod_id, webhook_id, request, requestOptions));
|
|
434
|
+
}
|
|
435
|
+
__updateHeaders(pod_id, webhook_id, request, requestOptions) {
|
|
436
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
437
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
438
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
439
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
440
|
+
const _response = yield core.fetcher({
|
|
441
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
442
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/webhooks/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}/headers`),
|
|
443
|
+
method: "PATCH",
|
|
444
|
+
headers: _headers,
|
|
445
|
+
contentType: "application/json",
|
|
446
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
447
|
+
requestType: "json",
|
|
448
|
+
body: serializers.webhooks.UpdateWebhookHeadersRequest.jsonOrThrow(request, {
|
|
449
|
+
unrecognizedObjectKeys: "strip",
|
|
450
|
+
omitUndefined: true,
|
|
451
|
+
}),
|
|
452
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
453
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
454
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
455
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
456
|
+
logging: this._options.logging,
|
|
457
|
+
});
|
|
458
|
+
if (_response.ok) {
|
|
459
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
460
|
+
}
|
|
461
|
+
if (_response.error.reason === "status-code") {
|
|
462
|
+
switch (_response.error.statusCode) {
|
|
463
|
+
case 404:
|
|
464
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
465
|
+
unrecognizedObjectKeys: "passthrough",
|
|
466
|
+
allowUnrecognizedUnionMembers: true,
|
|
467
|
+
allowUnrecognizedEnumValues: true,
|
|
468
|
+
skipValidation: true,
|
|
469
|
+
breadcrumbsPrefix: ["response"],
|
|
470
|
+
}), _response.rawResponse);
|
|
471
|
+
case 400:
|
|
472
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
473
|
+
unrecognizedObjectKeys: "passthrough",
|
|
474
|
+
allowUnrecognizedUnionMembers: true,
|
|
475
|
+
allowUnrecognizedEnumValues: true,
|
|
476
|
+
skipValidation: true,
|
|
477
|
+
breadcrumbsPrefix: ["response"],
|
|
478
|
+
}), _response.rawResponse);
|
|
479
|
+
default:
|
|
480
|
+
throw new errors.AgentMailError({
|
|
481
|
+
statusCode: _response.error.statusCode,
|
|
482
|
+
body: _response.error.body,
|
|
483
|
+
rawResponse: _response.rawResponse,
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/pods/{pod_id}/webhooks/{webhook_id}/headers");
|
|
488
|
+
});
|
|
489
|
+
}
|
|
351
490
|
/**
|
|
352
491
|
* **CLI:**
|
|
353
492
|
* ```bash
|