agentmail 0.5.12 → 0.5.14
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.d.ts +3 -0
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/errors/ConflictError.d.ts +6 -0
- package/dist/cjs/api/errors/ConflictError.js +54 -0
- package/dist/cjs/api/errors/index.d.ts +1 -0
- package/dist/cjs/api/errors/index.js +1 -0
- package/dist/cjs/api/resources/drafts/types/CreateDraftForwardRequest.d.ts +21 -0
- package/dist/cjs/api/resources/drafts/types/CreateDraftForwardRequest.js +3 -0
- package/dist/cjs/api/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +17 -0
- package/dist/cjs/api/resources/drafts/types/CreateDraftReplyAllRequest.js +3 -0
- package/dist/cjs/api/resources/drafts/types/CreateDraftReplyRequest.d.ts +22 -0
- package/dist/cjs/api/resources/drafts/types/CreateDraftReplyRequest.js +3 -0
- package/dist/cjs/api/resources/drafts/types/Draft.d.ts +1 -0
- package/dist/cjs/api/resources/drafts/types/DraftForwardOf.d.ts +4 -0
- package/dist/cjs/api/resources/drafts/types/DraftForwardOf.js +3 -0
- package/dist/cjs/api/resources/drafts/types/DraftItem.d.ts +1 -0
- package/dist/cjs/api/resources/drafts/types/DraftReplyAll.d.ts +4 -0
- package/dist/cjs/api/resources/drafts/types/DraftReplyAll.js +3 -0
- package/dist/cjs/api/resources/drafts/types/index.d.ts +5 -0
- package/dist/cjs/api/resources/drafts/types/index.js +5 -0
- package/dist/cjs/api/resources/inboxes/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/inboxes/client/Client.js +5 -0
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +6 -3
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +11 -2
- package/dist/cjs/api/resources/inboxes/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/index.js +3 -1
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +84 -9
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +308 -8
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.d.ts +103 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.js +411 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/index.js +17 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.d.ts +10 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/exports.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/exports.js +21 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/index.js +17 -0
- package/dist/cjs/api/resources/pods/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/pods/client/Client.js +5 -0
- package/dist/cjs/api/resources/pods/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/pods/resources/index.js +3 -1
- package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.d.ts +103 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.js +411 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/index.js +17 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.d.ts +10 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.js +3 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/exports.d.ts +2 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/exports.js +21 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/types/CreateInboxWebhookRequest.d.ts +10 -0
- package/dist/cjs/api/resources/webhooks/types/CreateInboxWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/CreatePodWebhookRequest.d.ts +9 -0
- package/dist/cjs/api/resources/webhooks/types/CreatePodWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/CreateWebhookEventTypes.d.ts +7 -0
- package/dist/cjs/api/resources/webhooks/types/CreateWebhookEventTypes.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/CreateWebhookRequest.d.ts +1 -10
- package/dist/cjs/api/resources/webhooks/types/UpdateInboxWebhookRequest.d.ts +7 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateInboxWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/UpdatePodWebhookRequest.d.ts +11 -0
- package/dist/cjs/api/resources/webhooks/types/UpdatePodWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookEventTypes.d.ts +10 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookEventTypes.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequest.d.ts +1 -14
- package/dist/cjs/api/resources/webhooks/types/index.d.ts +6 -0
- package/dist/cjs/api/resources/webhooks/types/index.js +6 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftForwardRequest.d.ts +30 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftForwardRequest.js +62 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +24 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyAllRequest.js +56 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.d.ts +32 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.js +64 -0
- package/dist/cjs/serialization/resources/drafts/types/Draft.d.ts +2 -0
- package/dist/cjs/serialization/resources/drafts/types/Draft.js +2 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftForwardOf.d.ts +7 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftForwardOf.js +39 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftItem.d.ts +2 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftItem.js +2 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftReplyAll.d.ts +7 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftReplyAll.js +39 -0
- package/dist/cjs/serialization/resources/drafts/types/index.d.ts +5 -0
- package/dist/cjs/serialization/resources/drafts/types/index.js +5 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateInboxWebhookRequest.d.ts +14 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateInboxWebhookRequest.js +46 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreatePodWebhookRequest.d.ts +11 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreatePodWebhookRequest.js +45 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookEventTypes.d.ts +8 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookEventTypes.js +6 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookRequest.d.ts +2 -9
- package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookRequest.js +5 -10
- package/dist/cjs/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.d.ts +10 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.js +42 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdatePodWebhookRequest.d.ts +12 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdatePodWebhookRequest.js +46 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookEventTypes.d.ts +8 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookEventTypes.js +6 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookRequest.d.ts +2 -6
- package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookRequest.js +5 -7
- package/dist/cjs/serialization/resources/webhooks/types/index.d.ts +6 -0
- package/dist/cjs/serialization/resources/webhooks/types/index.js +6 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +3 -0
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/errors/ConflictError.d.mts +6 -0
- package/dist/esm/api/errors/ConflictError.mjs +17 -0
- package/dist/esm/api/errors/index.d.mts +1 -0
- package/dist/esm/api/errors/index.mjs +1 -0
- package/dist/esm/api/resources/drafts/types/CreateDraftForwardRequest.d.mts +21 -0
- package/dist/esm/api/resources/drafts/types/CreateDraftForwardRequest.mjs +2 -0
- package/dist/esm/api/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +17 -0
- package/dist/esm/api/resources/drafts/types/CreateDraftReplyAllRequest.mjs +2 -0
- package/dist/esm/api/resources/drafts/types/CreateDraftReplyRequest.d.mts +22 -0
- package/dist/esm/api/resources/drafts/types/CreateDraftReplyRequest.mjs +2 -0
- package/dist/esm/api/resources/drafts/types/Draft.d.mts +1 -0
- package/dist/esm/api/resources/drafts/types/DraftForwardOf.d.mts +4 -0
- package/dist/esm/api/resources/drafts/types/DraftForwardOf.mjs +2 -0
- package/dist/esm/api/resources/drafts/types/DraftItem.d.mts +1 -0
- package/dist/esm/api/resources/drafts/types/DraftReplyAll.d.mts +4 -0
- package/dist/esm/api/resources/drafts/types/DraftReplyAll.mjs +2 -0
- package/dist/esm/api/resources/drafts/types/index.d.mts +5 -0
- package/dist/esm/api/resources/drafts/types/index.mjs +5 -0
- package/dist/esm/api/resources/inboxes/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/inboxes/client/Client.mjs +5 -0
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +6 -3
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +12 -3
- package/dist/esm/api/resources/inboxes/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/index.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +84 -9
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +309 -9
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.d.mts +103 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.mjs +374 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.d.mts +10 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/exports.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/exports.mjs +3 -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/pods/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/pods/client/Client.mjs +5 -0
- package/dist/esm/api/resources/pods/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/pods/resources/index.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/Client.d.mts +103 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/Client.mjs +374 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.d.mts +10 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/exports.d.mts +2 -0
- package/dist/esm/api/resources/pods/resources/webhooks/exports.mjs +3 -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/webhooks/types/CreateInboxWebhookRequest.d.mts +10 -0
- package/dist/esm/api/resources/webhooks/types/CreateInboxWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/CreatePodWebhookRequest.d.mts +9 -0
- package/dist/esm/api/resources/webhooks/types/CreatePodWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/CreateWebhookEventTypes.d.mts +7 -0
- package/dist/esm/api/resources/webhooks/types/CreateWebhookEventTypes.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/CreateWebhookRequest.d.mts +1 -10
- package/dist/esm/api/resources/webhooks/types/UpdateInboxWebhookRequest.d.mts +7 -0
- package/dist/esm/api/resources/webhooks/types/UpdateInboxWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/UpdatePodWebhookRequest.d.mts +11 -0
- package/dist/esm/api/resources/webhooks/types/UpdatePodWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookEventTypes.d.mts +10 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookEventTypes.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequest.d.mts +1 -14
- package/dist/esm/api/resources/webhooks/types/index.d.mts +6 -0
- package/dist/esm/api/resources/webhooks/types/index.mjs +6 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.d.mts +30 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.mjs +26 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +24 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.mjs +20 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.d.mts +32 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.mjs +28 -0
- package/dist/esm/serialization/resources/drafts/types/Draft.d.mts +2 -0
- package/dist/esm/serialization/resources/drafts/types/Draft.mjs +2 -0
- package/dist/esm/serialization/resources/drafts/types/DraftForwardOf.d.mts +7 -0
- package/dist/esm/serialization/resources/drafts/types/DraftForwardOf.mjs +3 -0
- package/dist/esm/serialization/resources/drafts/types/DraftItem.d.mts +2 -0
- package/dist/esm/serialization/resources/drafts/types/DraftItem.mjs +2 -0
- package/dist/esm/serialization/resources/drafts/types/DraftReplyAll.d.mts +7 -0
- package/dist/esm/serialization/resources/drafts/types/DraftReplyAll.mjs +3 -0
- package/dist/esm/serialization/resources/drafts/types/index.d.mts +5 -0
- package/dist/esm/serialization/resources/drafts/types/index.mjs +5 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateInboxWebhookRequest.d.mts +14 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateInboxWebhookRequest.mjs +10 -0
- package/dist/esm/serialization/resources/webhooks/types/CreatePodWebhookRequest.d.mts +11 -0
- package/dist/esm/serialization/resources/webhooks/types/CreatePodWebhookRequest.mjs +9 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateWebhookEventTypes.d.mts +8 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateWebhookEventTypes.mjs +3 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateWebhookRequest.d.mts +2 -9
- package/dist/esm/serialization/resources/webhooks/types/CreateWebhookRequest.mjs +5 -10
- package/dist/esm/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.d.mts +10 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.mjs +6 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdatePodWebhookRequest.d.mts +12 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdatePodWebhookRequest.mjs +10 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookEventTypes.d.mts +8 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookEventTypes.mjs +3 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookRequest.d.mts +2 -6
- package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookRequest.mjs +5 -7
- package/dist/esm/serialization/resources/webhooks/types/index.d.mts +6 -0
- package/dist/esm/serialization/resources/webhooks/types/index.mjs +6 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms.txt +21 -4
- package/package.json +23 -1
- package/reference.md +1466 -440
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
17
|
+
import * as serializers from "../../../../../../serialization/index.mjs";
|
|
18
|
+
import * as AgentMail from "../../../../../index.mjs";
|
|
19
|
+
export class WebhooksClient {
|
|
20
|
+
constructor(options = {}) {
|
|
21
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* **CLI:**
|
|
25
|
+
* ```bash
|
|
26
|
+
* agentmail pods:webhooks list --pod-id <pod_id>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
30
|
+
* @param {AgentMail.pods.PodListWebhooksRequest} request
|
|
31
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.pods.webhooks.list("pod_id")
|
|
35
|
+
*/
|
|
36
|
+
list(pod_id, request = {}, requestOptions) {
|
|
37
|
+
return core.HttpResponsePromise.fromPromise(this.__list(pod_id, request, requestOptions));
|
|
38
|
+
}
|
|
39
|
+
__list(pod_id_1) {
|
|
40
|
+
return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
|
|
41
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
42
|
+
const { limit, pageToken, ascending } = request;
|
|
43
|
+
const _queryParams = {
|
|
44
|
+
limit,
|
|
45
|
+
page_token: pageToken,
|
|
46
|
+
ascending,
|
|
47
|
+
};
|
|
48
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
49
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
50
|
+
const _response = yield core.fetcher({
|
|
51
|
+
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)
|
|
52
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/webhooks`),
|
|
53
|
+
method: "GET",
|
|
54
|
+
headers: _headers,
|
|
55
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
56
|
+
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,
|
|
57
|
+
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,
|
|
58
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
59
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
60
|
+
logging: this._options.logging,
|
|
61
|
+
});
|
|
62
|
+
if (_response.ok) {
|
|
63
|
+
return {
|
|
64
|
+
data: serializers.webhooks.ListWebhooksResponse.parseOrThrow(_response.body, {
|
|
65
|
+
unrecognizedObjectKeys: "passthrough",
|
|
66
|
+
allowUnrecognizedUnionMembers: true,
|
|
67
|
+
allowUnrecognizedEnumValues: true,
|
|
68
|
+
skipValidation: true,
|
|
69
|
+
breadcrumbsPrefix: ["response"],
|
|
70
|
+
}),
|
|
71
|
+
rawResponse: _response.rawResponse,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (_response.error.reason === "status-code") {
|
|
75
|
+
throw new errors.AgentMailError({
|
|
76
|
+
statusCode: _response.error.statusCode,
|
|
77
|
+
body: _response.error.body,
|
|
78
|
+
rawResponse: _response.rawResponse,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/webhooks");
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* **CLI:**
|
|
86
|
+
* ```bash
|
|
87
|
+
* agentmail pods:webhooks get --pod-id <pod_id> --webhook-id <webhook_id>
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
91
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
92
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
93
|
+
*
|
|
94
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* await client.pods.webhooks.get("pod_id", "webhook_id")
|
|
98
|
+
*/
|
|
99
|
+
get(pod_id, webhook_id, requestOptions) {
|
|
100
|
+
return core.HttpResponsePromise.fromPromise(this.__get(pod_id, webhook_id, requestOptions));
|
|
101
|
+
}
|
|
102
|
+
__get(pod_id, webhook_id, requestOptions) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
105
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
106
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
107
|
+
const _response = yield core.fetcher({
|
|
108
|
+
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)
|
|
109
|
+
.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 }))}`),
|
|
110
|
+
method: "GET",
|
|
111
|
+
headers: _headers,
|
|
112
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
113
|
+
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,
|
|
114
|
+
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,
|
|
115
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
116
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
117
|
+
logging: this._options.logging,
|
|
118
|
+
});
|
|
119
|
+
if (_response.ok) {
|
|
120
|
+
return {
|
|
121
|
+
data: serializers.webhooks.Webhook.parseOrThrow(_response.body, {
|
|
122
|
+
unrecognizedObjectKeys: "passthrough",
|
|
123
|
+
allowUnrecognizedUnionMembers: true,
|
|
124
|
+
allowUnrecognizedEnumValues: true,
|
|
125
|
+
skipValidation: true,
|
|
126
|
+
breadcrumbsPrefix: ["response"],
|
|
127
|
+
}),
|
|
128
|
+
rawResponse: _response.rawResponse,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (_response.error.reason === "status-code") {
|
|
132
|
+
switch (_response.error.statusCode) {
|
|
133
|
+
case 404:
|
|
134
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
135
|
+
unrecognizedObjectKeys: "passthrough",
|
|
136
|
+
allowUnrecognizedUnionMembers: true,
|
|
137
|
+
allowUnrecognizedEnumValues: true,
|
|
138
|
+
skipValidation: true,
|
|
139
|
+
breadcrumbsPrefix: ["response"],
|
|
140
|
+
}), _response.rawResponse);
|
|
141
|
+
default:
|
|
142
|
+
throw new errors.AgentMailError({
|
|
143
|
+
statusCode: _response.error.statusCode,
|
|
144
|
+
body: _response.error.body,
|
|
145
|
+
rawResponse: _response.rawResponse,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/webhooks/{webhook_id}");
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Create a webhook scoped to this pod.
|
|
154
|
+
*
|
|
155
|
+
* **CLI:**
|
|
156
|
+
* ```bash
|
|
157
|
+
* agentmail pods:webhooks create --pod-id <pod_id> --url https://example.com/webhook --event-type message.received
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
160
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
161
|
+
* @param {AgentMail.webhooks.CreatePodWebhookRequest} request
|
|
162
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
163
|
+
*
|
|
164
|
+
* @throws {@link AgentMail.ValidationError}
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* await client.pods.webhooks.create("pod_id", {
|
|
168
|
+
* url: "url",
|
|
169
|
+
* eventTypes: ["message.received", "message.received"]
|
|
170
|
+
* })
|
|
171
|
+
*/
|
|
172
|
+
create(pod_id, request, requestOptions) {
|
|
173
|
+
return core.HttpResponsePromise.fromPromise(this.__create(pod_id, request, requestOptions));
|
|
174
|
+
}
|
|
175
|
+
__create(pod_id, request, requestOptions) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
178
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
179
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
180
|
+
const _response = yield core.fetcher({
|
|
181
|
+
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)
|
|
182
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/webhooks`),
|
|
183
|
+
method: "POST",
|
|
184
|
+
headers: _headers,
|
|
185
|
+
contentType: "application/json",
|
|
186
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
187
|
+
requestType: "json",
|
|
188
|
+
body: serializers.webhooks.CreatePodWebhookRequest.jsonOrThrow(request, {
|
|
189
|
+
unrecognizedObjectKeys: "strip",
|
|
190
|
+
omitUndefined: true,
|
|
191
|
+
}),
|
|
192
|
+
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,
|
|
193
|
+
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,
|
|
194
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
195
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
196
|
+
logging: this._options.logging,
|
|
197
|
+
});
|
|
198
|
+
if (_response.ok) {
|
|
199
|
+
return {
|
|
200
|
+
data: serializers.webhooks.Webhook.parseOrThrow(_response.body, {
|
|
201
|
+
unrecognizedObjectKeys: "passthrough",
|
|
202
|
+
allowUnrecognizedUnionMembers: true,
|
|
203
|
+
allowUnrecognizedEnumValues: true,
|
|
204
|
+
skipValidation: true,
|
|
205
|
+
breadcrumbsPrefix: ["response"],
|
|
206
|
+
}),
|
|
207
|
+
rawResponse: _response.rawResponse,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
if (_response.error.reason === "status-code") {
|
|
211
|
+
switch (_response.error.statusCode) {
|
|
212
|
+
case 400:
|
|
213
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
214
|
+
unrecognizedObjectKeys: "passthrough",
|
|
215
|
+
allowUnrecognizedUnionMembers: true,
|
|
216
|
+
allowUnrecognizedEnumValues: true,
|
|
217
|
+
skipValidation: true,
|
|
218
|
+
breadcrumbsPrefix: ["response"],
|
|
219
|
+
}), _response.rawResponse);
|
|
220
|
+
default:
|
|
221
|
+
throw new errors.AgentMailError({
|
|
222
|
+
statusCode: _response.error.statusCode,
|
|
223
|
+
body: _response.error.body,
|
|
224
|
+
rawResponse: _response.rawResponse,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/pods/{pod_id}/webhooks");
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* **CLI:**
|
|
233
|
+
* ```bash
|
|
234
|
+
* agentmail pods:webhooks update --pod-id <pod_id> --webhook-id <webhook_id> --add-inbox-id <inbox_id>
|
|
235
|
+
* ```
|
|
236
|
+
*
|
|
237
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
238
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
239
|
+
* @param {AgentMail.webhooks.UpdatePodWebhookRequest} request
|
|
240
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
241
|
+
*
|
|
242
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
243
|
+
* @throws {@link AgentMail.ValidationError}
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* await client.pods.webhooks.update("pod_id", "webhook_id", {})
|
|
247
|
+
*/
|
|
248
|
+
update(pod_id, webhook_id, request, requestOptions) {
|
|
249
|
+
return core.HttpResponsePromise.fromPromise(this.__update(pod_id, webhook_id, request, requestOptions));
|
|
250
|
+
}
|
|
251
|
+
__update(pod_id, webhook_id, request, requestOptions) {
|
|
252
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
253
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
254
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
255
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
256
|
+
const _response = yield core.fetcher({
|
|
257
|
+
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)
|
|
258
|
+
.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 }))}`),
|
|
259
|
+
method: "PATCH",
|
|
260
|
+
headers: _headers,
|
|
261
|
+
contentType: "application/json",
|
|
262
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
263
|
+
requestType: "json",
|
|
264
|
+
body: serializers.webhooks.UpdatePodWebhookRequest.jsonOrThrow(request, {
|
|
265
|
+
unrecognizedObjectKeys: "strip",
|
|
266
|
+
omitUndefined: true,
|
|
267
|
+
}),
|
|
268
|
+
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,
|
|
269
|
+
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,
|
|
270
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
271
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
272
|
+
logging: this._options.logging,
|
|
273
|
+
});
|
|
274
|
+
if (_response.ok) {
|
|
275
|
+
return {
|
|
276
|
+
data: serializers.webhooks.Webhook.parseOrThrow(_response.body, {
|
|
277
|
+
unrecognizedObjectKeys: "passthrough",
|
|
278
|
+
allowUnrecognizedUnionMembers: true,
|
|
279
|
+
allowUnrecognizedEnumValues: true,
|
|
280
|
+
skipValidation: true,
|
|
281
|
+
breadcrumbsPrefix: ["response"],
|
|
282
|
+
}),
|
|
283
|
+
rawResponse: _response.rawResponse,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
if (_response.error.reason === "status-code") {
|
|
287
|
+
switch (_response.error.statusCode) {
|
|
288
|
+
case 404:
|
|
289
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
290
|
+
unrecognizedObjectKeys: "passthrough",
|
|
291
|
+
allowUnrecognizedUnionMembers: true,
|
|
292
|
+
allowUnrecognizedEnumValues: true,
|
|
293
|
+
skipValidation: true,
|
|
294
|
+
breadcrumbsPrefix: ["response"],
|
|
295
|
+
}), _response.rawResponse);
|
|
296
|
+
case 400:
|
|
297
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
298
|
+
unrecognizedObjectKeys: "passthrough",
|
|
299
|
+
allowUnrecognizedUnionMembers: true,
|
|
300
|
+
allowUnrecognizedEnumValues: true,
|
|
301
|
+
skipValidation: true,
|
|
302
|
+
breadcrumbsPrefix: ["response"],
|
|
303
|
+
}), _response.rawResponse);
|
|
304
|
+
default:
|
|
305
|
+
throw new errors.AgentMailError({
|
|
306
|
+
statusCode: _response.error.statusCode,
|
|
307
|
+
body: _response.error.body,
|
|
308
|
+
rawResponse: _response.rawResponse,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/pods/{pod_id}/webhooks/{webhook_id}");
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* **CLI:**
|
|
317
|
+
* ```bash
|
|
318
|
+
* agentmail pods:webhooks delete --pod-id <pod_id> --webhook-id <webhook_id>
|
|
319
|
+
* ```
|
|
320
|
+
*
|
|
321
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
322
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
323
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
324
|
+
*
|
|
325
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* await client.pods.webhooks.delete("pod_id", "webhook_id")
|
|
329
|
+
*/
|
|
330
|
+
delete(pod_id, webhook_id, requestOptions) {
|
|
331
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(pod_id, webhook_id, requestOptions));
|
|
332
|
+
}
|
|
333
|
+
__delete(pod_id, webhook_id, requestOptions) {
|
|
334
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
335
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
336
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
337
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
338
|
+
const _response = yield core.fetcher({
|
|
339
|
+
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)
|
|
340
|
+
.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 }))}`),
|
|
341
|
+
method: "DELETE",
|
|
342
|
+
headers: _headers,
|
|
343
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
344
|
+
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,
|
|
345
|
+
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,
|
|
346
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
347
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
348
|
+
logging: this._options.logging,
|
|
349
|
+
});
|
|
350
|
+
if (_response.ok) {
|
|
351
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
352
|
+
}
|
|
353
|
+
if (_response.error.reason === "status-code") {
|
|
354
|
+
switch (_response.error.statusCode) {
|
|
355
|
+
case 404:
|
|
356
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
357
|
+
unrecognizedObjectKeys: "passthrough",
|
|
358
|
+
allowUnrecognizedUnionMembers: true,
|
|
359
|
+
allowUnrecognizedEnumValues: true,
|
|
360
|
+
skipValidation: true,
|
|
361
|
+
breadcrumbsPrefix: ["response"],
|
|
362
|
+
}), _response.rawResponse);
|
|
363
|
+
default:
|
|
364
|
+
throw new errors.AgentMailError({
|
|
365
|
+
statusCode: _response.error.statusCode,
|
|
366
|
+
body: _response.error.body,
|
|
367
|
+
rawResponse: _response.rawResponse,
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/pods/{pod_id}/webhooks/{webhook_id}");
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { PodListWebhooksRequest } from "./PodListWebhooksRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Create a webhook scoped to an inbox. The inbox comes from the path, so `inbox_ids` and `pod_ids`
|
|
4
|
+
* are not accepted.
|
|
5
|
+
*/
|
|
6
|
+
export interface CreateInboxWebhookRequest {
|
|
7
|
+
url: AgentMail.webhooks.Url;
|
|
8
|
+
eventTypes: AgentMail.webhooks.CreateWebhookEventTypes;
|
|
9
|
+
clientId?: AgentMail.webhooks.ClientId;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Create a 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 webhook to specific inboxes within the pod; omit to
|
|
5
|
+
* receive events for the whole pod.
|
|
6
|
+
*/
|
|
7
|
+
export interface CreatePodWebhookRequest extends AgentMail.webhooks.CreateInboxWebhookRequest {
|
|
8
|
+
inboxIds?: AgentMail.InboxIds;
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Full list of event types this webhook should receive. At least one type is required. Send every type you
|
|
4
|
+
* want in this array (not incremental). See [Webhooks overview](https://docs.agentmail.to/webhooks-overview)
|
|
5
|
+
* for spam, blocked, and unauthenticated events and required permissions.
|
|
6
|
+
*/
|
|
7
|
+
export type CreateWebhookEventTypes = AgentMail.EventTypes;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
-
export interface CreateWebhookRequest {
|
|
3
|
-
url: AgentMail.webhooks.Url;
|
|
4
|
-
/**
|
|
5
|
-
* Full list of event types this webhook should receive. At least one type is required. Send every type you
|
|
6
|
-
* want in this array (not incremental). See [Webhooks overview](https://docs.agentmail.to/webhooks-overview)
|
|
7
|
-
* for spam, blocked, and unauthenticated events and required permissions.
|
|
8
|
-
*/
|
|
9
|
-
eventTypes: AgentMail.EventTypes;
|
|
2
|
+
export interface CreateWebhookRequest extends AgentMail.webhooks.CreatePodWebhookRequest {
|
|
10
3
|
podIds?: AgentMail.PodIds;
|
|
11
|
-
inboxIds?: AgentMail.InboxIds;
|
|
12
|
-
clientId?: AgentMail.webhooks.ClientId;
|
|
13
4
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Update an inbox-scoped webhook. It is fixed to its inbox, so only `event_types` can change.
|
|
4
|
+
*/
|
|
5
|
+
export interface UpdateInboxWebhookRequest {
|
|
6
|
+
eventTypes?: AgentMail.webhooks.UpdateWebhookEventTypes;
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Update a pod-scoped webhook. You can adjust which inboxes within the pod it listens to and replace
|
|
4
|
+
* its `event_types`, but not the pod scope itself.
|
|
5
|
+
*/
|
|
6
|
+
export interface UpdatePodWebhookRequest extends AgentMail.webhooks.UpdateInboxWebhookRequest {
|
|
7
|
+
/** Inbox IDs to subscribe to the webhook. */
|
|
8
|
+
addInboxIds?: AgentMail.InboxIds;
|
|
9
|
+
/** Inbox IDs to unsubscribe from the webhook. */
|
|
10
|
+
removeInboxIds?: AgentMail.InboxIds;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* When you send a non-empty list, it replaces the webhook's subscribed event types in full (the same
|
|
4
|
+
* "set the list" behavior as create). It is not a merge or diff: include every event type you want after
|
|
5
|
+
* the update. Sending a one-element array means the webhook will only receive that one type afterward.
|
|
6
|
+
* Omit this field or send an empty array to leave event types unchanged. Clearing all types with an empty
|
|
7
|
+
* list is not supported. Subscribing to `message.received.spam`, `message.received.blocked`, or
|
|
8
|
+
* `message.received.unauthenticated` requires the matching label permission on the API key.
|
|
9
|
+
*/
|
|
10
|
+
export type UpdateWebhookEventTypes = AgentMail.EventTypes;
|
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
-
export interface UpdateWebhookRequest {
|
|
3
|
-
/** Inbox IDs to subscribe to the webhook. */
|
|
4
|
-
addInboxIds?: AgentMail.InboxIds;
|
|
5
|
-
/** Inbox IDs to unsubscribe from the webhook. */
|
|
6
|
-
removeInboxIds?: AgentMail.InboxIds;
|
|
2
|
+
export interface UpdateWebhookRequest extends AgentMail.webhooks.UpdatePodWebhookRequest {
|
|
7
3
|
/** Pod IDs to subscribe to the webhook. */
|
|
8
4
|
addPodIds?: AgentMail.PodIds;
|
|
9
5
|
/** Pod IDs to unsubscribe from the webhook. */
|
|
10
6
|
removePodIds?: AgentMail.PodIds;
|
|
11
|
-
/**
|
|
12
|
-
* When you send a non-empty list, it replaces the webhook's subscribed event types in full (the same
|
|
13
|
-
* "set the list" behavior as create). It is not a merge or diff: include every event type you want after
|
|
14
|
-
* the update. Sending a one-element array means the webhook will only receive that one type afterward.
|
|
15
|
-
* Omit this field or send an empty array to leave event types unchanged. Clearing all types with an empty
|
|
16
|
-
* list is not supported. Subscribing to `message.received.spam`, `message.received.blocked`, or
|
|
17
|
-
* `message.received.unauthenticated` requires the matching label permission on the API key.
|
|
18
|
-
*/
|
|
19
|
-
eventTypes?: AgentMail.EventTypes;
|
|
20
7
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export * from "./ClientId.mjs";
|
|
2
|
+
export * from "./CreateInboxWebhookRequest.mjs";
|
|
3
|
+
export * from "./CreatePodWebhookRequest.mjs";
|
|
4
|
+
export * from "./CreateWebhookEventTypes.mjs";
|
|
2
5
|
export * from "./CreateWebhookRequest.mjs";
|
|
3
6
|
export * from "./ListWebhooksResponse.mjs";
|
|
7
|
+
export * from "./UpdateInboxWebhookRequest.mjs";
|
|
8
|
+
export * from "./UpdatePodWebhookRequest.mjs";
|
|
9
|
+
export * from "./UpdateWebhookEventTypes.mjs";
|
|
4
10
|
export * from "./UpdateWebhookRequest.mjs";
|
|
5
11
|
export * from "./Url.mjs";
|
|
6
12
|
export * from "./Webhook.mjs";
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export * from "./ClientId.mjs";
|
|
2
|
+
export * from "./CreateInboxWebhookRequest.mjs";
|
|
3
|
+
export * from "./CreatePodWebhookRequest.mjs";
|
|
4
|
+
export * from "./CreateWebhookEventTypes.mjs";
|
|
2
5
|
export * from "./CreateWebhookRequest.mjs";
|
|
3
6
|
export * from "./ListWebhooksResponse.mjs";
|
|
7
|
+
export * from "./UpdateInboxWebhookRequest.mjs";
|
|
8
|
+
export * from "./UpdatePodWebhookRequest.mjs";
|
|
9
|
+
export * from "./UpdateWebhookEventTypes.mjs";
|
|
4
10
|
export * from "./UpdateWebhookRequest.mjs";
|
|
5
11
|
export * from "./Url.mjs";
|
|
6
12
|
export * from "./Webhook.mjs";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.mjs";
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../../../index.mjs";
|
|
4
|
+
import { SendAttachment } from "../../attachments/types/SendAttachment.mjs";
|
|
5
|
+
import { DraftBcc } from "./DraftBcc.mjs";
|
|
6
|
+
import { DraftCc } from "./DraftCc.mjs";
|
|
7
|
+
import { DraftClientId } from "./DraftClientId.mjs";
|
|
8
|
+
import { DraftHtml } from "./DraftHtml.mjs";
|
|
9
|
+
import { DraftLabels } from "./DraftLabels.mjs";
|
|
10
|
+
import { DraftReplyTo } from "./DraftReplyTo.mjs";
|
|
11
|
+
import { DraftSendAt } from "./DraftSendAt.mjs";
|
|
12
|
+
import { DraftSubject } from "./DraftSubject.mjs";
|
|
13
|
+
import { DraftText } from "./DraftText.mjs";
|
|
14
|
+
import { DraftTo } from "./DraftTo.mjs";
|
|
15
|
+
export declare const CreateDraftForwardRequest: core.serialization.ObjectSchema<serializers.CreateDraftForwardRequest.Raw, AgentMail.CreateDraftForwardRequest>;
|
|
16
|
+
export declare namespace CreateDraftForwardRequest {
|
|
17
|
+
interface Raw {
|
|
18
|
+
labels?: DraftLabels.Raw | null;
|
|
19
|
+
reply_to?: DraftReplyTo.Raw | null;
|
|
20
|
+
to?: DraftTo.Raw | null;
|
|
21
|
+
cc?: DraftCc.Raw | null;
|
|
22
|
+
bcc?: DraftBcc.Raw | null;
|
|
23
|
+
subject?: DraftSubject.Raw | null;
|
|
24
|
+
text?: DraftText.Raw | null;
|
|
25
|
+
html?: DraftHtml.Raw | null;
|
|
26
|
+
attachments?: SendAttachment.Raw[] | null;
|
|
27
|
+
send_at?: DraftSendAt.Raw | null;
|
|
28
|
+
client_id?: DraftClientId.Raw | null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import { SendAttachment } from "../../attachments/types/SendAttachment.mjs";
|
|
4
|
+
import { DraftBcc } from "./DraftBcc.mjs";
|
|
5
|
+
import { DraftCc } from "./DraftCc.mjs";
|
|
6
|
+
import { DraftClientId } from "./DraftClientId.mjs";
|
|
7
|
+
import { DraftHtml } from "./DraftHtml.mjs";
|
|
8
|
+
import { DraftLabels } from "./DraftLabels.mjs";
|
|
9
|
+
import { DraftReplyTo } from "./DraftReplyTo.mjs";
|
|
10
|
+
import { DraftSendAt } from "./DraftSendAt.mjs";
|
|
11
|
+
import { DraftSubject } from "./DraftSubject.mjs";
|
|
12
|
+
import { DraftText } from "./DraftText.mjs";
|
|
13
|
+
import { DraftTo } from "./DraftTo.mjs";
|
|
14
|
+
export const CreateDraftForwardRequest = core.serialization.object({
|
|
15
|
+
labels: DraftLabels.optional(),
|
|
16
|
+
replyTo: core.serialization.property("reply_to", DraftReplyTo.optional()),
|
|
17
|
+
to: DraftTo.optional(),
|
|
18
|
+
cc: DraftCc.optional(),
|
|
19
|
+
bcc: DraftBcc.optional(),
|
|
20
|
+
subject: DraftSubject.optional(),
|
|
21
|
+
text: DraftText.optional(),
|
|
22
|
+
html: DraftHtml.optional(),
|
|
23
|
+
attachments: core.serialization.list(SendAttachment).optional(),
|
|
24
|
+
sendAt: core.serialization.property("send_at", DraftSendAt.optional()),
|
|
25
|
+
clientId: core.serialization.property("client_id", DraftClientId.optional()),
|
|
26
|
+
});
|