agentmail 0.5.41 → 0.5.43
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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/calendar/types/UpdateCalendarEventRequest.d.ts +2 -1
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/Client.d.ts +21 -21
- package/dist/cjs/api/resources/inboxes/resources/calendar/client/Client.js +21 -21
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.js +5 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/exports.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/exports.js +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/index.js +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/index.js +41 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/Client.d.ts +89 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/Client.js +351 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/index.js +17 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/InboxListPollingWebhooksRequest.d.ts +10 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/InboxListPollingWebhooksRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/exports.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/exports.js +21 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/resources/polling/index.js +17 -0
- package/dist/cjs/api/resources/messages/types/Message.d.ts +1 -0
- package/dist/cjs/api/resources/messages/types/MessageCalendarEventId.d.ts +8 -0
- package/dist/cjs/api/resources/messages/types/MessageCalendarEventId.js +3 -0
- package/dist/cjs/api/resources/messages/types/MessageItem.d.ts +1 -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 +3 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.js +5 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/exports.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/exports.js +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/index.js +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/index.js +41 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/Client.d.ts +89 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/Client.js +351 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/index.js +17 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/requests/PodListPollingWebhooksRequest.d.ts +10 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/requests/PodListPollingWebhooksRequest.js +3 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/exports.d.ts +2 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/exports.js +21 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/resources/polling/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/webhooks/client/Client.js +5 -0
- package/dist/cjs/api/resources/webhooks/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/webhooks/resources/index.js +4 -1
- package/dist/cjs/api/resources/webhooks/resources/polling/client/Client.d.ts +92 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/client/Client.js +354 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/client/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/client/requests/ListPollingWebhooksRequest.d.ts +10 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/client/requests/ListPollingWebhooksRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/exports.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/exports.js +21 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/index.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/index.js +18 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.d.ts +9 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.d.ts +9 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.d.ts +9 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.d.ts +7 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.js +3 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.d.ts +12 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.js +3 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/PollingClientId.d.ts +7 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/PollingClientId.js +3 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/PollingToken.d.ts +8 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/PollingToken.js +3 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/PollingWebhook.d.ts +27 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/PollingWebhook.js +3 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/index.d.ts +8 -0
- package/dist/cjs/api/resources/webhooks/resources/polling/types/index.js +24 -0
- package/dist/cjs/serialization/resources/messages/types/Message.d.ts +2 -0
- package/dist/cjs/serialization/resources/messages/types/Message.js +2 -0
- package/dist/cjs/serialization/resources/messages/types/MessageCalendarEventId.d.ts +7 -0
- package/dist/cjs/serialization/resources/messages/types/MessageCalendarEventId.js +39 -0
- package/dist/cjs/serialization/resources/messages/types/MessageItem.d.ts +2 -0
- package/dist/cjs/serialization/resources/messages/types/MessageItem.js +2 -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/resources/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/webhooks/resources/index.js +3 -1
- package/dist/cjs/serialization/resources/webhooks/resources/polling/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/index.js +17 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.d.ts +12 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.js +44 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.d.ts +11 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.js +45 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.d.ts +11 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.js +45 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.d.ts +11 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.js +45 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.d.ts +16 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.js +48 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/PollingClientId.d.ts +8 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/PollingClientId.js +6 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/PollingToken.d.ts +7 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/PollingToken.js +39 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/PollingWebhook.d.ts +22 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/PollingWebhook.js +54 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/index.d.ts +8 -0
- package/dist/cjs/serialization/resources/webhooks/resources/polling/types/index.js +24 -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/calendar/types/UpdateCalendarEventRequest.d.mts +2 -1
- package/dist/esm/api/resources/inboxes/resources/calendar/client/Client.d.mts +21 -21
- package/dist/esm/api/resources/inboxes/resources/calendar/client/Client.mjs +21 -21
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.mjs +5 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/exports.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/exports.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/index.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/Client.d.mts +89 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/Client.mjs +314 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/InboxListPollingWebhooksRequest.d.mts +10 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/InboxListPollingWebhooksRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/exports.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/exports.mjs +3 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/resources/polling/index.mjs +1 -0
- package/dist/esm/api/resources/messages/types/Message.d.mts +1 -0
- package/dist/esm/api/resources/messages/types/MessageCalendarEventId.d.mts +8 -0
- package/dist/esm/api/resources/messages/types/MessageCalendarEventId.mjs +2 -0
- package/dist/esm/api/resources/messages/types/MessageItem.d.mts +1 -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 +3 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/Client.mjs +5 -0
- package/dist/esm/api/resources/pods/resources/webhooks/exports.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/exports.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/index.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/Client.d.mts +89 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/Client.mjs +314 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/requests/PodListPollingWebhooksRequest.d.mts +10 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/requests/PodListPollingWebhooksRequest.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/exports.d.mts +2 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/exports.mjs +3 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/resources/polling/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/webhooks/client/Client.mjs +5 -0
- package/dist/esm/api/resources/webhooks/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/webhooks/resources/index.mjs +3 -0
- package/dist/esm/api/resources/webhooks/resources/polling/client/Client.d.mts +92 -0
- package/dist/esm/api/resources/webhooks/resources/polling/client/Client.mjs +317 -0
- package/dist/esm/api/resources/webhooks/resources/polling/client/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/resources/polling/client/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/resources/polling/client/requests/ListPollingWebhooksRequest.d.mts +10 -0
- package/dist/esm/api/resources/webhooks/resources/polling/client/requests/ListPollingWebhooksRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/resources/polling/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/resources/polling/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/resources/polling/exports.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/resources/polling/exports.mjs +3 -0
- package/dist/esm/api/resources/webhooks/resources/polling/index.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/resources/polling/index.mjs +2 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.d.mts +9 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.d.mts +9 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.d.mts +9 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.d.mts +7 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.mjs +2 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.d.mts +12 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.mjs +2 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/PollingClientId.d.mts +7 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/PollingClientId.mjs +2 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/PollingToken.d.mts +8 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/PollingToken.mjs +2 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/PollingWebhook.d.mts +27 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/PollingWebhook.mjs +2 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/index.d.mts +8 -0
- package/dist/esm/api/resources/webhooks/resources/polling/types/index.mjs +8 -0
- package/dist/esm/serialization/resources/messages/types/Message.d.mts +2 -0
- package/dist/esm/serialization/resources/messages/types/Message.mjs +2 -0
- package/dist/esm/serialization/resources/messages/types/MessageCalendarEventId.d.mts +7 -0
- package/dist/esm/serialization/resources/messages/types/MessageCalendarEventId.mjs +3 -0
- package/dist/esm/serialization/resources/messages/types/MessageItem.d.mts +2 -0
- package/dist/esm/serialization/resources/messages/types/MessageItem.mjs +2 -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/resources/index.d.mts +2 -0
- package/dist/esm/serialization/resources/webhooks/resources/index.mjs +2 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/index.d.mts +1 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/index.mjs +1 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.d.mts +12 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreateInboxPollingWebhookRequest.mjs +8 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.d.mts +11 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.mjs +9 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.d.mts +11 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.mjs +9 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.d.mts +11 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.mjs +9 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.d.mts +16 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.mjs +12 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/PollingClientId.d.mts +8 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/PollingClientId.mjs +3 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/PollingToken.d.mts +7 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/PollingToken.mjs +3 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/PollingWebhook.d.mts +22 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/PollingWebhook.mjs +18 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/index.d.mts +8 -0
- package/dist/esm/serialization/resources/webhooks/resources/polling/types/index.mjs +8 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +34 -1
- package/reference.md +1462 -575
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../../../core/index.js";
|
|
4
|
+
import * as AgentMail from "../../../../../index.js";
|
|
5
|
+
export declare namespace PollingClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class PollingClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<PollingClient.Options>;
|
|
12
|
+
constructor(options?: PollingClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Lists the polling webhooks created through this route. `page_token` must come from this
|
|
15
|
+
* endpoint; a token from another list endpoint is rejected.
|
|
16
|
+
*
|
|
17
|
+
* **CLI:**
|
|
18
|
+
* ```bash
|
|
19
|
+
* agentmail webhooks polling list
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param {AgentMail.webhooks.ListPollingWebhooksRequest} request
|
|
23
|
+
* @param {PollingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
24
|
+
*
|
|
25
|
+
* @throws {@link AgentMail.ValidationError}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* await client.webhooks.polling.list()
|
|
29
|
+
*/
|
|
30
|
+
list(request?: AgentMail.webhooks.ListPollingWebhooksRequest, requestOptions?: PollingClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.ListPollingWebhooksResponse>;
|
|
31
|
+
private __list;
|
|
32
|
+
/**
|
|
33
|
+
* The `token` is never returned here: create again with the same `client_id` to get a new one.
|
|
34
|
+
*
|
|
35
|
+
* **CLI:**
|
|
36
|
+
* ```bash
|
|
37
|
+
* agentmail webhooks polling get --webhook-id <webhook_id>
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
41
|
+
* @param {PollingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
42
|
+
*
|
|
43
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* await client.webhooks.polling.get("webhook_id")
|
|
47
|
+
*/
|
|
48
|
+
get(webhook_id: AgentMail.webhooks.WebhookId, requestOptions?: PollingClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.PollingWebhook>;
|
|
49
|
+
private __get;
|
|
50
|
+
/**
|
|
51
|
+
* Creates a subscription the agent polls for events, and returns the `token` that reads it. Each
|
|
52
|
+
* organization, pod, and inbox holds at most 10 polling webhooks; a repeat create with the same
|
|
53
|
+
* `client_id` re-issues the token of the existing one instead of counting against that limit.
|
|
54
|
+
*
|
|
55
|
+
* **CLI:**
|
|
56
|
+
* ```bash
|
|
57
|
+
* agentmail webhooks polling create --client-id my-agent --event-types message.received
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @param {AgentMail.webhooks.CreatePollingWebhookRequest} request
|
|
61
|
+
* @param {PollingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
|
+
*
|
|
63
|
+
* @throws {@link AgentMail.ValidationError}
|
|
64
|
+
* @throws {@link AgentMail.ConflictError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.webhooks.polling.create({
|
|
68
|
+
* clientId: "client_id",
|
|
69
|
+
* eventTypes: ["message.received", "message.received"]
|
|
70
|
+
* })
|
|
71
|
+
*/
|
|
72
|
+
create(request: AgentMail.webhooks.CreatePollingWebhookRequest, requestOptions?: PollingClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.CreatePollingWebhookResponse>;
|
|
73
|
+
private __create;
|
|
74
|
+
/**
|
|
75
|
+
* Stops delivery and invalidates the subscription's token.
|
|
76
|
+
*
|
|
77
|
+
* **CLI:**
|
|
78
|
+
* ```bash
|
|
79
|
+
* agentmail webhooks polling delete --webhook-id <webhook_id>
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
83
|
+
* @param {PollingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
84
|
+
*
|
|
85
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* await client.webhooks.polling.delete("webhook_id")
|
|
89
|
+
*/
|
|
90
|
+
delete(webhook_id: AgentMail.webhooks.WebhookId, requestOptions?: PollingClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
91
|
+
private __delete;
|
|
92
|
+
}
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.PollingClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../../../BaseClient.js");
|
|
48
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
49
|
+
const core = __importStar(require("../../../../../../core/index.js"));
|
|
50
|
+
const environments = __importStar(require("../../../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
52
|
+
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
53
|
+
const serializers = __importStar(require("../../../../../../serialization/index.js"));
|
|
54
|
+
const AgentMail = __importStar(require("../../../../../index.js"));
|
|
55
|
+
class PollingClient {
|
|
56
|
+
constructor(options = {}) {
|
|
57
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Lists the polling webhooks created through this route. `page_token` must come from this
|
|
61
|
+
* endpoint; a token from another list endpoint is rejected.
|
|
62
|
+
*
|
|
63
|
+
* **CLI:**
|
|
64
|
+
* ```bash
|
|
65
|
+
* agentmail webhooks polling list
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @param {AgentMail.webhooks.ListPollingWebhooksRequest} request
|
|
69
|
+
* @param {PollingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
70
|
+
*
|
|
71
|
+
* @throws {@link AgentMail.ValidationError}
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* await client.webhooks.polling.list()
|
|
75
|
+
*/
|
|
76
|
+
list(request = {}, requestOptions) {
|
|
77
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
78
|
+
}
|
|
79
|
+
__list() {
|
|
80
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
81
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
82
|
+
const { limit, pageToken, ascending } = request;
|
|
83
|
+
const _queryParams = {
|
|
84
|
+
limit,
|
|
85
|
+
page_token: pageToken,
|
|
86
|
+
ascending,
|
|
87
|
+
};
|
|
88
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
89
|
+
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);
|
|
90
|
+
const _response = yield core.fetcher({
|
|
91
|
+
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)
|
|
92
|
+
.http, "/v0/webhooks/polling"),
|
|
93
|
+
method: "GET",
|
|
94
|
+
headers: _headers,
|
|
95
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
96
|
+
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,
|
|
97
|
+
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,
|
|
98
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
99
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
100
|
+
logging: this._options.logging,
|
|
101
|
+
});
|
|
102
|
+
if (_response.ok) {
|
|
103
|
+
return {
|
|
104
|
+
data: serializers.webhooks.ListPollingWebhooksResponse.parseOrThrow(_response.body, {
|
|
105
|
+
unrecognizedObjectKeys: "passthrough",
|
|
106
|
+
allowUnrecognizedUnionMembers: true,
|
|
107
|
+
allowUnrecognizedEnumValues: true,
|
|
108
|
+
skipValidation: true,
|
|
109
|
+
breadcrumbsPrefix: ["response"],
|
|
110
|
+
}),
|
|
111
|
+
rawResponse: _response.rawResponse,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if (_response.error.reason === "status-code") {
|
|
115
|
+
switch (_response.error.statusCode) {
|
|
116
|
+
case 400:
|
|
117
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
118
|
+
unrecognizedObjectKeys: "passthrough",
|
|
119
|
+
allowUnrecognizedUnionMembers: true,
|
|
120
|
+
allowUnrecognizedEnumValues: true,
|
|
121
|
+
skipValidation: true,
|
|
122
|
+
breadcrumbsPrefix: ["response"],
|
|
123
|
+
}), _response.rawResponse);
|
|
124
|
+
default:
|
|
125
|
+
throw new errors.AgentMailError({
|
|
126
|
+
statusCode: _response.error.statusCode,
|
|
127
|
+
body: _response.error.body,
|
|
128
|
+
rawResponse: _response.rawResponse,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/webhooks/polling");
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The `token` is never returned here: create again with the same `client_id` to get a new one.
|
|
137
|
+
*
|
|
138
|
+
* **CLI:**
|
|
139
|
+
* ```bash
|
|
140
|
+
* agentmail webhooks polling get --webhook-id <webhook_id>
|
|
141
|
+
* ```
|
|
142
|
+
*
|
|
143
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
144
|
+
* @param {PollingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
145
|
+
*
|
|
146
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* await client.webhooks.polling.get("webhook_id")
|
|
150
|
+
*/
|
|
151
|
+
get(webhook_id, requestOptions) {
|
|
152
|
+
return core.HttpResponsePromise.fromPromise(this.__get(webhook_id, requestOptions));
|
|
153
|
+
}
|
|
154
|
+
__get(webhook_id, requestOptions) {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
156
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
157
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
158
|
+
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);
|
|
159
|
+
const _response = yield core.fetcher({
|
|
160
|
+
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)
|
|
161
|
+
.http, `/v0/webhooks/polling/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}`),
|
|
162
|
+
method: "GET",
|
|
163
|
+
headers: _headers,
|
|
164
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
165
|
+
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,
|
|
166
|
+
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,
|
|
167
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
168
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
169
|
+
logging: this._options.logging,
|
|
170
|
+
});
|
|
171
|
+
if (_response.ok) {
|
|
172
|
+
return {
|
|
173
|
+
data: serializers.webhooks.PollingWebhook.parseOrThrow(_response.body, {
|
|
174
|
+
unrecognizedObjectKeys: "passthrough",
|
|
175
|
+
allowUnrecognizedUnionMembers: true,
|
|
176
|
+
allowUnrecognizedEnumValues: true,
|
|
177
|
+
skipValidation: true,
|
|
178
|
+
breadcrumbsPrefix: ["response"],
|
|
179
|
+
}),
|
|
180
|
+
rawResponse: _response.rawResponse,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
if (_response.error.reason === "status-code") {
|
|
184
|
+
switch (_response.error.statusCode) {
|
|
185
|
+
case 404:
|
|
186
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
187
|
+
unrecognizedObjectKeys: "passthrough",
|
|
188
|
+
allowUnrecognizedUnionMembers: true,
|
|
189
|
+
allowUnrecognizedEnumValues: true,
|
|
190
|
+
skipValidation: true,
|
|
191
|
+
breadcrumbsPrefix: ["response"],
|
|
192
|
+
}), _response.rawResponse);
|
|
193
|
+
default:
|
|
194
|
+
throw new errors.AgentMailError({
|
|
195
|
+
statusCode: _response.error.statusCode,
|
|
196
|
+
body: _response.error.body,
|
|
197
|
+
rawResponse: _response.rawResponse,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/webhooks/polling/{webhook_id}");
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Creates a subscription the agent polls for events, and returns the `token` that reads it. Each
|
|
206
|
+
* organization, pod, and inbox holds at most 10 polling webhooks; a repeat create with the same
|
|
207
|
+
* `client_id` re-issues the token of the existing one instead of counting against that limit.
|
|
208
|
+
*
|
|
209
|
+
* **CLI:**
|
|
210
|
+
* ```bash
|
|
211
|
+
* agentmail webhooks polling create --client-id my-agent --event-types message.received
|
|
212
|
+
* ```
|
|
213
|
+
*
|
|
214
|
+
* @param {AgentMail.webhooks.CreatePollingWebhookRequest} request
|
|
215
|
+
* @param {PollingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
216
|
+
*
|
|
217
|
+
* @throws {@link AgentMail.ValidationError}
|
|
218
|
+
* @throws {@link AgentMail.ConflictError}
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* await client.webhooks.polling.create({
|
|
222
|
+
* clientId: "client_id",
|
|
223
|
+
* eventTypes: ["message.received", "message.received"]
|
|
224
|
+
* })
|
|
225
|
+
*/
|
|
226
|
+
create(request, requestOptions) {
|
|
227
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
228
|
+
}
|
|
229
|
+
__create(request, requestOptions) {
|
|
230
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
231
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
232
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
233
|
+
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);
|
|
234
|
+
const _response = yield core.fetcher({
|
|
235
|
+
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)
|
|
236
|
+
.http, "/v0/webhooks/polling"),
|
|
237
|
+
method: "POST",
|
|
238
|
+
headers: _headers,
|
|
239
|
+
contentType: "application/json",
|
|
240
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
241
|
+
requestType: "json",
|
|
242
|
+
body: serializers.webhooks.CreatePollingWebhookRequest.jsonOrThrow(request, {
|
|
243
|
+
unrecognizedObjectKeys: "strip",
|
|
244
|
+
omitUndefined: true,
|
|
245
|
+
}),
|
|
246
|
+
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,
|
|
247
|
+
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,
|
|
248
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
249
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
250
|
+
logging: this._options.logging,
|
|
251
|
+
});
|
|
252
|
+
if (_response.ok) {
|
|
253
|
+
return {
|
|
254
|
+
data: serializers.webhooks.CreatePollingWebhookResponse.parseOrThrow(_response.body, {
|
|
255
|
+
unrecognizedObjectKeys: "passthrough",
|
|
256
|
+
allowUnrecognizedUnionMembers: true,
|
|
257
|
+
allowUnrecognizedEnumValues: true,
|
|
258
|
+
skipValidation: true,
|
|
259
|
+
breadcrumbsPrefix: ["response"],
|
|
260
|
+
}),
|
|
261
|
+
rawResponse: _response.rawResponse,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
if (_response.error.reason === "status-code") {
|
|
265
|
+
switch (_response.error.statusCode) {
|
|
266
|
+
case 400:
|
|
267
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
268
|
+
unrecognizedObjectKeys: "passthrough",
|
|
269
|
+
allowUnrecognizedUnionMembers: true,
|
|
270
|
+
allowUnrecognizedEnumValues: true,
|
|
271
|
+
skipValidation: true,
|
|
272
|
+
breadcrumbsPrefix: ["response"],
|
|
273
|
+
}), _response.rawResponse);
|
|
274
|
+
case 409:
|
|
275
|
+
throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
276
|
+
unrecognizedObjectKeys: "passthrough",
|
|
277
|
+
allowUnrecognizedUnionMembers: true,
|
|
278
|
+
allowUnrecognizedEnumValues: true,
|
|
279
|
+
skipValidation: true,
|
|
280
|
+
breadcrumbsPrefix: ["response"],
|
|
281
|
+
}), _response.rawResponse);
|
|
282
|
+
default:
|
|
283
|
+
throw new errors.AgentMailError({
|
|
284
|
+
statusCode: _response.error.statusCode,
|
|
285
|
+
body: _response.error.body,
|
|
286
|
+
rawResponse: _response.rawResponse,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/webhooks/polling");
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Stops delivery and invalidates the subscription's token.
|
|
295
|
+
*
|
|
296
|
+
* **CLI:**
|
|
297
|
+
* ```bash
|
|
298
|
+
* agentmail webhooks polling delete --webhook-id <webhook_id>
|
|
299
|
+
* ```
|
|
300
|
+
*
|
|
301
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
302
|
+
* @param {PollingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
303
|
+
*
|
|
304
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
* await client.webhooks.polling.delete("webhook_id")
|
|
308
|
+
*/
|
|
309
|
+
delete(webhook_id, requestOptions) {
|
|
310
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(webhook_id, requestOptions));
|
|
311
|
+
}
|
|
312
|
+
__delete(webhook_id, requestOptions) {
|
|
313
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
314
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
315
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
316
|
+
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);
|
|
317
|
+
const _response = yield core.fetcher({
|
|
318
|
+
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)
|
|
319
|
+
.http, `/v0/webhooks/polling/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}`),
|
|
320
|
+
method: "DELETE",
|
|
321
|
+
headers: _headers,
|
|
322
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
323
|
+
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,
|
|
324
|
+
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,
|
|
325
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
326
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
327
|
+
logging: this._options.logging,
|
|
328
|
+
});
|
|
329
|
+
if (_response.ok) {
|
|
330
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
331
|
+
}
|
|
332
|
+
if (_response.error.reason === "status-code") {
|
|
333
|
+
switch (_response.error.statusCode) {
|
|
334
|
+
case 404:
|
|
335
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
336
|
+
unrecognizedObjectKeys: "passthrough",
|
|
337
|
+
allowUnrecognizedUnionMembers: true,
|
|
338
|
+
allowUnrecognizedEnumValues: true,
|
|
339
|
+
skipValidation: true,
|
|
340
|
+
breadcrumbsPrefix: ["response"],
|
|
341
|
+
}), _response.rawResponse);
|
|
342
|
+
default:
|
|
343
|
+
throw new errors.AgentMailError({
|
|
344
|
+
statusCode: _response.error.statusCode,
|
|
345
|
+
body: _response.error.body,
|
|
346
|
+
rawResponse: _response.rawResponse,
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v0/webhooks/polling/{webhook_id}");
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
exports.PollingClient = PollingClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ListPollingWebhooksRequest } from "./ListPollingWebhooksRequest.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PollingClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "PollingClient", { enumerable: true, get: function () { return Client_js_1.PollingClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -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("./client/index.js"), exports);
|
|
18
|
+
__exportStar(require("./types/index.js"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Create a polling webhook scoped to an inbox. The inbox comes from the path, so `inbox_ids` and
|
|
4
|
+
* `pod_ids` are not accepted.
|
|
5
|
+
*/
|
|
6
|
+
export interface CreateInboxPollingWebhookRequest {
|
|
7
|
+
clientId: AgentMail.webhooks.PollingClientId;
|
|
8
|
+
eventTypes: AgentMail.webhooks.CreateWebhookEventTypes;
|
|
9
|
+
}
|
package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePodPollingWebhookRequest.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Create a polling webhook scoped to a pod. The pod comes from the path, so `pod_ids` is not accepted.
|
|
4
|
+
* Optionally pass `inbox_ids` to narrow the subscription to specific inboxes within the pod; omit to
|
|
5
|
+
* receive events for the whole pod.
|
|
6
|
+
*/
|
|
7
|
+
export interface CreatePodPollingWebhookRequest extends AgentMail.webhooks.CreateInboxPollingWebhookRequest {
|
|
8
|
+
inboxIds?: AgentMail.InboxIds;
|
|
9
|
+
}
|
package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePollingWebhookRequest.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../../index.js";
|
|
2
|
+
export interface CreatePollingWebhookRequest extends AgentMail.webhooks.CreatePodPollingWebhookRequest {
|
|
3
|
+
/**
|
|
4
|
+
* Pods for which to receive events. Maximum 10 channels (pods plus inboxes) per subscription. The
|
|
5
|
+
* subscription receives an event that matches any listed pod or inbox, so a listed pod already
|
|
6
|
+
* covers every inbox in it.
|
|
7
|
+
*/
|
|
8
|
+
podIds?: AgentMail.PodIds;
|
|
9
|
+
}
|
package/dist/cjs/api/resources/webhooks/resources/polling/types/CreatePollingWebhookResponse.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The subscription plus the one-time `token` that reads it.
|
|
4
|
+
*/
|
|
5
|
+
export interface CreatePollingWebhookResponse extends AgentMail.webhooks.PollingWebhook {
|
|
6
|
+
token: AgentMail.webhooks.PollingToken;
|
|
7
|
+
}
|
package/dist/cjs/api/resources/webhooks/resources/polling/types/ListPollingWebhooksResponse.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../../index.js";
|
|
2
|
+
export interface ListPollingWebhooksResponse {
|
|
3
|
+
count: AgentMail.Count;
|
|
4
|
+
limit?: AgentMail.Limit;
|
|
5
|
+
nextPageToken?: AgentMail.PageToken;
|
|
6
|
+
/**
|
|
7
|
+
* Ordered by `created_at` descending. Lists the subscriptions created through this route
|
|
8
|
+
* (organization, pod, or inbox); subscriptions created through a pod or inbox route are listed
|
|
9
|
+
* through that route.
|
|
10
|
+
*/
|
|
11
|
+
pollingWebhooks: AgentMail.webhooks.PollingWebhook[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Required. Idempotency key of the subscription: creating again with the same `client_id` through the
|
|
4
|
+
* same route returns the existing subscription with a fresh token instead of a second subscription, so a
|
|
5
|
+
* restarted agent resumes where it left off. Also accepted in place of `webhook_id` on get and delete.
|
|
6
|
+
*/
|
|
7
|
+
export type PollingClientId = AgentMail.webhooks.ClientId;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential for reading this subscription's events. Hand it to the Svix AutoConfig consumer
|
|
3
|
+
* (`AutoConfigConsumer` in the `svix` package for TypeScript and Python): `receive` returns the events
|
|
4
|
+
* queued since your last commit, `commit` marks them as processed. Returned by create only and never
|
|
5
|
+
* readable afterward. Create again with the same `client_id` to get a new token; the previous one stops
|
|
6
|
+
* working immediately.
|
|
7
|
+
*/
|
|
8
|
+
export type PollingToken = string;
|