agentmail 0.5.49 → 0.5.51
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/Client.d.ts +3 -0
- package/dist/cjs/Client.js +21 -16
- package/dist/cjs/api/resources/forwarding/client/Client.d.ts +127 -0
- package/dist/cjs/api/resources/forwarding/client/Client.js +503 -0
- package/dist/cjs/api/resources/forwarding/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/forwarding/client/index.js +2 -0
- package/dist/cjs/api/resources/forwarding/errors/ForwardingForbiddenError.d.ts +6 -0
- package/dist/cjs/api/resources/forwarding/errors/ForwardingForbiddenError.js +54 -0
- package/dist/cjs/api/resources/forwarding/errors/ForwardingRateLimitError.d.ts +6 -0
- package/dist/cjs/api/resources/forwarding/errors/ForwardingRateLimitError.js +54 -0
- package/dist/cjs/api/resources/forwarding/errors/index.d.ts +2 -0
- package/dist/cjs/api/resources/forwarding/errors/index.js +18 -0
- package/dist/cjs/api/resources/forwarding/exports.d.ts +2 -0
- package/dist/cjs/api/resources/forwarding/exports.js +21 -0
- package/dist/cjs/api/resources/forwarding/index.d.ts +3 -0
- package/dist/cjs/api/resources/forwarding/index.js +19 -0
- package/dist/cjs/api/resources/forwarding/types/ConfirmForwardingVerificationRequest.d.ts +10 -0
- package/dist/cjs/api/resources/forwarding/types/ConfirmForwardingVerificationRequest.js +3 -0
- package/dist/cjs/api/resources/forwarding/types/Forwarding.d.ts +15 -0
- package/dist/cjs/api/resources/forwarding/types/Forwarding.js +3 -0
- package/dist/cjs/api/resources/forwarding/types/ForwardingDestination.d.ts +5 -0
- package/dist/cjs/api/resources/forwarding/types/ForwardingDestination.js +3 -0
- package/dist/cjs/api/resources/forwarding/types/ForwardingVerificationConfirmed.d.ts +4 -0
- package/dist/cjs/api/resources/forwarding/types/ForwardingVerificationConfirmed.js +3 -0
- package/dist/cjs/api/resources/forwarding/types/ForwardingVerificationStarted.d.ts +4 -0
- package/dist/cjs/api/resources/forwarding/types/ForwardingVerificationStarted.js +3 -0
- package/dist/cjs/api/resources/forwarding/types/StartForwardingVerificationRequest.d.ts +5 -0
- package/dist/cjs/api/resources/forwarding/types/StartForwardingVerificationRequest.js +3 -0
- package/dist/cjs/api/resources/forwarding/types/UpdateForwardingRequest.d.ts +9 -0
- package/dist/cjs/api/resources/forwarding/types/UpdateForwardingRequest.js +3 -0
- package/dist/cjs/api/resources/forwarding/types/UpdateForwardingResponse.d.ts +8 -0
- package/dist/cjs/api/resources/forwarding/types/UpdateForwardingResponse.js +3 -0
- package/dist/cjs/api/resources/forwarding/types/index.d.ts +8 -0
- package/dist/cjs/api/resources/forwarding/types/index.js +24 -0
- package/dist/cjs/api/resources/inboxes/client/Client.d.ts +7 -1
- package/dist/cjs/api/resources/inboxes/client/Client.js +27 -11
- package/dist/cjs/api/resources/inboxes/resources/forwarding/client/Client.d.ts +79 -0
- package/dist/cjs/api/resources/inboxes/resources/forwarding/client/Client.js +317 -0
- package/dist/cjs/api/resources/inboxes/resources/forwarding/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/forwarding/client/index.js +2 -0
- package/dist/cjs/api/resources/inboxes/resources/forwarding/exports.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/forwarding/exports.js +21 -0
- package/dist/cjs/api/resources/inboxes/resources/forwarding/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/forwarding/index.js +17 -0
- package/dist/cjs/api/resources/inboxes/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/index.js +2 -1
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -1
- package/dist/cjs/api/resources/messages/types/Message.d.ts +2 -0
- package/dist/cjs/api/resources/messages/types/MessageItem.d.ts +2 -0
- package/dist/cjs/api/resources/messages/types/MessageOpenedAt.d.ts +6 -0
- package/dist/cjs/api/resources/messages/types/MessageOpenedAt.js +3 -0
- package/dist/cjs/api/resources/messages/types/MessageTrackOpens.d.ts +5 -0
- package/dist/cjs/api/resources/messages/types/MessageTrackOpens.js +3 -0
- package/dist/cjs/api/resources/messages/types/TrackOpens.d.ts +4 -3
- package/dist/cjs/api/resources/messages/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/messages/types/index.js +2 -0
- package/dist/cjs/api/resources/pods/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/pods/client/Client.js +15 -10
- package/dist/cjs/api/resources/pods/resources/forwarding/client/Client.d.ts +80 -0
- package/dist/cjs/api/resources/pods/resources/forwarding/client/Client.js +318 -0
- package/dist/cjs/api/resources/pods/resources/forwarding/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/forwarding/client/index.js +2 -0
- package/dist/cjs/api/resources/pods/resources/forwarding/exports.d.ts +2 -0
- package/dist/cjs/api/resources/pods/resources/forwarding/exports.js +21 -0
- package/dist/cjs/api/resources/pods/resources/forwarding/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/forwarding/index.js +17 -0
- package/dist/cjs/api/resources/pods/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/index.js +2 -1
- package/dist/cjs/serialization/resources/forwarding/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/forwarding/index.js +17 -0
- package/dist/cjs/serialization/resources/forwarding/types/ConfirmForwardingVerificationRequest.d.ts +11 -0
- package/dist/cjs/serialization/resources/forwarding/types/ConfirmForwardingVerificationRequest.js +43 -0
- package/dist/cjs/serialization/resources/forwarding/types/Forwarding.d.ts +11 -0
- package/dist/cjs/serialization/resources/forwarding/types/Forwarding.js +43 -0
- package/dist/cjs/serialization/resources/forwarding/types/ForwardingDestination.d.ts +7 -0
- package/dist/cjs/serialization/resources/forwarding/types/ForwardingDestination.js +39 -0
- package/dist/cjs/serialization/resources/forwarding/types/ForwardingVerificationConfirmed.d.ts +9 -0
- package/dist/cjs/serialization/resources/forwarding/types/ForwardingVerificationConfirmed.js +41 -0
- package/dist/cjs/serialization/resources/forwarding/types/ForwardingVerificationStarted.d.ts +9 -0
- package/dist/cjs/serialization/resources/forwarding/types/ForwardingVerificationStarted.js +41 -0
- package/dist/cjs/serialization/resources/forwarding/types/StartForwardingVerificationRequest.d.ts +10 -0
- package/dist/cjs/serialization/resources/forwarding/types/StartForwardingVerificationRequest.js +42 -0
- package/dist/cjs/serialization/resources/forwarding/types/UpdateForwardingRequest.d.ts +10 -0
- package/dist/cjs/serialization/resources/forwarding/types/UpdateForwardingRequest.js +42 -0
- package/dist/cjs/serialization/resources/forwarding/types/UpdateForwardingResponse.d.ts +10 -0
- package/dist/cjs/serialization/resources/forwarding/types/UpdateForwardingResponse.js +42 -0
- package/dist/cjs/serialization/resources/forwarding/types/index.d.ts +8 -0
- package/dist/cjs/serialization/resources/forwarding/types/index.js +24 -0
- package/dist/cjs/serialization/resources/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/index.js +3 -1
- package/dist/cjs/serialization/resources/messages/types/Message.d.ts +4 -0
- package/dist/cjs/serialization/resources/messages/types/Message.js +4 -0
- package/dist/cjs/serialization/resources/messages/types/MessageItem.d.ts +4 -0
- package/dist/cjs/serialization/resources/messages/types/MessageItem.js +4 -0
- package/dist/cjs/serialization/resources/messages/types/MessageOpenedAt.d.ts +7 -0
- package/dist/cjs/serialization/resources/messages/types/MessageOpenedAt.js +39 -0
- package/dist/cjs/serialization/resources/messages/types/MessageTrackOpens.d.ts +7 -0
- package/dist/cjs/serialization/resources/messages/types/MessageTrackOpens.js +39 -0
- package/dist/cjs/serialization/resources/messages/types/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/messages/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/resources/forwarding/client/Client.d.mts +127 -0
- package/dist/esm/api/resources/forwarding/client/Client.mjs +466 -0
- package/dist/esm/api/resources/forwarding/client/index.d.mts +1 -0
- package/dist/esm/api/resources/forwarding/client/index.mjs +1 -0
- package/dist/esm/api/resources/forwarding/errors/ForwardingForbiddenError.d.mts +6 -0
- package/dist/esm/api/resources/forwarding/errors/ForwardingForbiddenError.mjs +17 -0
- package/dist/esm/api/resources/forwarding/errors/ForwardingRateLimitError.d.mts +6 -0
- package/dist/esm/api/resources/forwarding/errors/ForwardingRateLimitError.mjs +17 -0
- package/dist/esm/api/resources/forwarding/errors/index.d.mts +2 -0
- package/dist/esm/api/resources/forwarding/errors/index.mjs +2 -0
- package/dist/esm/api/resources/forwarding/exports.d.mts +2 -0
- package/dist/esm/api/resources/forwarding/exports.mjs +3 -0
- package/dist/esm/api/resources/forwarding/index.d.mts +3 -0
- package/dist/esm/api/resources/forwarding/index.mjs +3 -0
- package/dist/esm/api/resources/forwarding/types/ConfirmForwardingVerificationRequest.d.mts +10 -0
- package/dist/esm/api/resources/forwarding/types/ConfirmForwardingVerificationRequest.mjs +2 -0
- package/dist/esm/api/resources/forwarding/types/Forwarding.d.mts +15 -0
- package/dist/esm/api/resources/forwarding/types/Forwarding.mjs +2 -0
- package/dist/esm/api/resources/forwarding/types/ForwardingDestination.d.mts +5 -0
- package/dist/esm/api/resources/forwarding/types/ForwardingDestination.mjs +2 -0
- package/dist/esm/api/resources/forwarding/types/ForwardingVerificationConfirmed.d.mts +4 -0
- package/dist/esm/api/resources/forwarding/types/ForwardingVerificationConfirmed.mjs +2 -0
- package/dist/esm/api/resources/forwarding/types/ForwardingVerificationStarted.d.mts +4 -0
- package/dist/esm/api/resources/forwarding/types/ForwardingVerificationStarted.mjs +2 -0
- package/dist/esm/api/resources/forwarding/types/StartForwardingVerificationRequest.d.mts +5 -0
- package/dist/esm/api/resources/forwarding/types/StartForwardingVerificationRequest.mjs +2 -0
- package/dist/esm/api/resources/forwarding/types/UpdateForwardingRequest.d.mts +9 -0
- package/dist/esm/api/resources/forwarding/types/UpdateForwardingRequest.mjs +2 -0
- package/dist/esm/api/resources/forwarding/types/UpdateForwardingResponse.d.mts +8 -0
- package/dist/esm/api/resources/forwarding/types/UpdateForwardingResponse.mjs +2 -0
- package/dist/esm/api/resources/forwarding/types/index.d.mts +8 -0
- package/dist/esm/api/resources/forwarding/types/index.mjs +8 -0
- package/dist/esm/api/resources/inboxes/client/Client.d.mts +7 -1
- package/dist/esm/api/resources/inboxes/client/Client.mjs +17 -1
- package/dist/esm/api/resources/inboxes/resources/forwarding/client/Client.d.mts +79 -0
- package/dist/esm/api/resources/inboxes/resources/forwarding/client/Client.mjs +280 -0
- package/dist/esm/api/resources/inboxes/resources/forwarding/client/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/forwarding/client/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/forwarding/exports.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/forwarding/exports.mjs +3 -0
- package/dist/esm/api/resources/inboxes/resources/forwarding/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/forwarding/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/index.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -0
- package/dist/esm/api/resources/messages/types/Message.d.mts +2 -0
- package/dist/esm/api/resources/messages/types/MessageItem.d.mts +2 -0
- package/dist/esm/api/resources/messages/types/MessageOpenedAt.d.mts +6 -0
- package/dist/esm/api/resources/messages/types/MessageOpenedAt.mjs +2 -0
- package/dist/esm/api/resources/messages/types/MessageTrackOpens.d.mts +5 -0
- package/dist/esm/api/resources/messages/types/MessageTrackOpens.mjs +2 -0
- package/dist/esm/api/resources/messages/types/TrackOpens.d.mts +4 -3
- package/dist/esm/api/resources/messages/types/index.d.mts +2 -0
- package/dist/esm/api/resources/messages/types/index.mjs +2 -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/forwarding/client/Client.d.mts +80 -0
- package/dist/esm/api/resources/pods/resources/forwarding/client/Client.mjs +281 -0
- package/dist/esm/api/resources/pods/resources/forwarding/client/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/forwarding/client/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/forwarding/exports.d.mts +2 -0
- package/dist/esm/api/resources/pods/resources/forwarding/exports.mjs +3 -0
- package/dist/esm/api/resources/pods/resources/forwarding/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/forwarding/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/index.mjs +1 -0
- package/dist/esm/serialization/resources/forwarding/index.d.mts +1 -0
- package/dist/esm/serialization/resources/forwarding/index.mjs +1 -0
- package/dist/esm/serialization/resources/forwarding/types/ConfirmForwardingVerificationRequest.d.mts +11 -0
- package/dist/esm/serialization/resources/forwarding/types/ConfirmForwardingVerificationRequest.mjs +7 -0
- package/dist/esm/serialization/resources/forwarding/types/Forwarding.d.mts +11 -0
- package/dist/esm/serialization/resources/forwarding/types/Forwarding.mjs +7 -0
- package/dist/esm/serialization/resources/forwarding/types/ForwardingDestination.d.mts +7 -0
- package/dist/esm/serialization/resources/forwarding/types/ForwardingDestination.mjs +3 -0
- package/dist/esm/serialization/resources/forwarding/types/ForwardingVerificationConfirmed.d.mts +9 -0
- package/dist/esm/serialization/resources/forwarding/types/ForwardingVerificationConfirmed.mjs +5 -0
- package/dist/esm/serialization/resources/forwarding/types/ForwardingVerificationStarted.d.mts +9 -0
- package/dist/esm/serialization/resources/forwarding/types/ForwardingVerificationStarted.mjs +5 -0
- package/dist/esm/serialization/resources/forwarding/types/StartForwardingVerificationRequest.d.mts +10 -0
- package/dist/esm/serialization/resources/forwarding/types/StartForwardingVerificationRequest.mjs +6 -0
- package/dist/esm/serialization/resources/forwarding/types/UpdateForwardingRequest.d.mts +10 -0
- package/dist/esm/serialization/resources/forwarding/types/UpdateForwardingRequest.mjs +6 -0
- package/dist/esm/serialization/resources/forwarding/types/UpdateForwardingResponse.d.mts +10 -0
- package/dist/esm/serialization/resources/forwarding/types/UpdateForwardingResponse.mjs +6 -0
- package/dist/esm/serialization/resources/forwarding/types/index.d.mts +8 -0
- package/dist/esm/serialization/resources/forwarding/types/index.mjs +8 -0
- package/dist/esm/serialization/resources/index.d.mts +2 -0
- package/dist/esm/serialization/resources/index.mjs +2 -0
- package/dist/esm/serialization/resources/messages/types/Message.d.mts +4 -0
- package/dist/esm/serialization/resources/messages/types/Message.mjs +4 -0
- package/dist/esm/serialization/resources/messages/types/MessageItem.d.mts +4 -0
- package/dist/esm/serialization/resources/messages/types/MessageItem.mjs +4 -0
- package/dist/esm/serialization/resources/messages/types/MessageOpenedAt.d.mts +7 -0
- package/dist/esm/serialization/resources/messages/types/MessageOpenedAt.mjs +3 -0
- package/dist/esm/serialization/resources/messages/types/MessageTrackOpens.d.mts +7 -0
- package/dist/esm/serialization/resources/messages/types/MessageTrackOpens.mjs +3 -0
- package/dist/esm/serialization/resources/messages/types/index.d.mts +2 -0
- package/dist/esm/serialization/resources/messages/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms.txt +3 -1
- package/package.json +34 -1
- package/reference.md +1026 -239
|
@@ -0,0 +1,280 @@
|
|
|
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 ForwardingClient {
|
|
20
|
+
constructor(options = {}) {
|
|
21
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get the forwarding this inbox sets. When the inbox sets nothing, `destinations` is `null` and
|
|
25
|
+
* the inbox uses its pod's forwarding, or the organization's when the pod sets none.
|
|
26
|
+
*
|
|
27
|
+
* **CLI:**
|
|
28
|
+
* ```bash
|
|
29
|
+
* agentmail inboxes forwarding get --inbox-id <inbox_id>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
33
|
+
* @param {ForwardingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
|
+
*
|
|
35
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
36
|
+
* @throws {@link AgentMail.ForwardingForbiddenError}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.inboxes.forwarding.get("inbox_id")
|
|
40
|
+
*/
|
|
41
|
+
get(inbox_id, requestOptions) {
|
|
42
|
+
return core.HttpResponsePromise.fromPromise(this.__get(inbox_id, requestOptions));
|
|
43
|
+
}
|
|
44
|
+
__get(inbox_id, requestOptions) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
47
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
48
|
+
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);
|
|
49
|
+
const _response = yield core.fetcher({
|
|
50
|
+
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)
|
|
51
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/forwarding`),
|
|
52
|
+
method: "GET",
|
|
53
|
+
headers: _headers,
|
|
54
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
55
|
+
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,
|
|
56
|
+
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,
|
|
57
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
58
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
59
|
+
logging: this._options.logging,
|
|
60
|
+
});
|
|
61
|
+
if (_response.ok) {
|
|
62
|
+
return {
|
|
63
|
+
data: serializers.Forwarding.parseOrThrow(_response.body, {
|
|
64
|
+
unrecognizedObjectKeys: "passthrough",
|
|
65
|
+
allowUnrecognizedUnionMembers: true,
|
|
66
|
+
allowUnrecognizedEnumValues: true,
|
|
67
|
+
skipValidation: true,
|
|
68
|
+
breadcrumbsPrefix: ["response"],
|
|
69
|
+
}),
|
|
70
|
+
rawResponse: _response.rawResponse,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (_response.error.reason === "status-code") {
|
|
74
|
+
switch (_response.error.statusCode) {
|
|
75
|
+
case 404:
|
|
76
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
77
|
+
unrecognizedObjectKeys: "passthrough",
|
|
78
|
+
allowUnrecognizedUnionMembers: true,
|
|
79
|
+
allowUnrecognizedEnumValues: true,
|
|
80
|
+
skipValidation: true,
|
|
81
|
+
breadcrumbsPrefix: ["response"],
|
|
82
|
+
}), _response.rawResponse);
|
|
83
|
+
case 403:
|
|
84
|
+
throw new AgentMail.ForwardingForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
85
|
+
unrecognizedObjectKeys: "passthrough",
|
|
86
|
+
allowUnrecognizedUnionMembers: true,
|
|
87
|
+
allowUnrecognizedEnumValues: true,
|
|
88
|
+
skipValidation: true,
|
|
89
|
+
breadcrumbsPrefix: ["response"],
|
|
90
|
+
}), _response.rawResponse);
|
|
91
|
+
default:
|
|
92
|
+
throw new errors.AgentMailError({
|
|
93
|
+
statusCode: _response.error.statusCode,
|
|
94
|
+
body: _response.error.body,
|
|
95
|
+
rawResponse: _response.rawResponse,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/forwarding");
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Set the addresses this inbox forwards to. The list replaces the inbox's current one and any pod
|
|
104
|
+
* or organization list for this inbox; lists are never combined. Send an empty list to stop this
|
|
105
|
+
* inbox forwarding even when its pod or the organization forwards. An address that is not
|
|
106
|
+
* verified is saved but receives nothing until it is verified.
|
|
107
|
+
*
|
|
108
|
+
* **CLI:**
|
|
109
|
+
* ```bash
|
|
110
|
+
* agentmail inboxes forwarding update --inbox-id <inbox_id> --destinations ops@example.com
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
114
|
+
* @param {AgentMail.UpdateForwardingRequest} request
|
|
115
|
+
* @param {ForwardingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
116
|
+
*
|
|
117
|
+
* @throws {@link AgentMail.ValidationError}
|
|
118
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
119
|
+
* @throws {@link AgentMail.ForwardingForbiddenError}
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* await client.inboxes.forwarding.update("inbox_id", {
|
|
123
|
+
* destinations: ["destinations", "destinations"]
|
|
124
|
+
* })
|
|
125
|
+
*/
|
|
126
|
+
update(inbox_id, request, requestOptions) {
|
|
127
|
+
return core.HttpResponsePromise.fromPromise(this.__update(inbox_id, request, requestOptions));
|
|
128
|
+
}
|
|
129
|
+
__update(inbox_id, request, requestOptions) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
132
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
133
|
+
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);
|
|
134
|
+
const _response = yield core.fetcher({
|
|
135
|
+
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)
|
|
136
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/forwarding`),
|
|
137
|
+
method: "PUT",
|
|
138
|
+
headers: _headers,
|
|
139
|
+
contentType: "application/json",
|
|
140
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
141
|
+
requestType: "json",
|
|
142
|
+
body: serializers.UpdateForwardingRequest.jsonOrThrow(request, {
|
|
143
|
+
unrecognizedObjectKeys: "strip",
|
|
144
|
+
omitUndefined: true,
|
|
145
|
+
}),
|
|
146
|
+
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,
|
|
147
|
+
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,
|
|
148
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
149
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
150
|
+
logging: this._options.logging,
|
|
151
|
+
});
|
|
152
|
+
if (_response.ok) {
|
|
153
|
+
return {
|
|
154
|
+
data: serializers.UpdateForwardingResponse.parseOrThrow(_response.body, {
|
|
155
|
+
unrecognizedObjectKeys: "passthrough",
|
|
156
|
+
allowUnrecognizedUnionMembers: true,
|
|
157
|
+
allowUnrecognizedEnumValues: true,
|
|
158
|
+
skipValidation: true,
|
|
159
|
+
breadcrumbsPrefix: ["response"],
|
|
160
|
+
}),
|
|
161
|
+
rawResponse: _response.rawResponse,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
if (_response.error.reason === "status-code") {
|
|
165
|
+
switch (_response.error.statusCode) {
|
|
166
|
+
case 400:
|
|
167
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
168
|
+
unrecognizedObjectKeys: "passthrough",
|
|
169
|
+
allowUnrecognizedUnionMembers: true,
|
|
170
|
+
allowUnrecognizedEnumValues: true,
|
|
171
|
+
skipValidation: true,
|
|
172
|
+
breadcrumbsPrefix: ["response"],
|
|
173
|
+
}), _response.rawResponse);
|
|
174
|
+
case 404:
|
|
175
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
176
|
+
unrecognizedObjectKeys: "passthrough",
|
|
177
|
+
allowUnrecognizedUnionMembers: true,
|
|
178
|
+
allowUnrecognizedEnumValues: true,
|
|
179
|
+
skipValidation: true,
|
|
180
|
+
breadcrumbsPrefix: ["response"],
|
|
181
|
+
}), _response.rawResponse);
|
|
182
|
+
case 403:
|
|
183
|
+
throw new AgentMail.ForwardingForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
184
|
+
unrecognizedObjectKeys: "passthrough",
|
|
185
|
+
allowUnrecognizedUnionMembers: true,
|
|
186
|
+
allowUnrecognizedEnumValues: true,
|
|
187
|
+
skipValidation: true,
|
|
188
|
+
breadcrumbsPrefix: ["response"],
|
|
189
|
+
}), _response.rawResponse);
|
|
190
|
+
default:
|
|
191
|
+
throw new errors.AgentMailError({
|
|
192
|
+
statusCode: _response.error.statusCode,
|
|
193
|
+
body: _response.error.body,
|
|
194
|
+
rawResponse: _response.rawResponse,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v0/inboxes/{inbox_id}/forwarding");
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Remove this inbox's own forwarding, so the inbox uses its pod's or the organization's forwarding
|
|
203
|
+
* again. Verified addresses stay verified. Returns `not_found` when the inbox sets no forwarding.
|
|
204
|
+
*
|
|
205
|
+
* **CLI:**
|
|
206
|
+
* ```bash
|
|
207
|
+
* agentmail inboxes forwarding delete --inbox-id <inbox_id>
|
|
208
|
+
* ```
|
|
209
|
+
*
|
|
210
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
211
|
+
* @param {ForwardingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
212
|
+
*
|
|
213
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
214
|
+
* @throws {@link AgentMail.ForwardingForbiddenError}
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* await client.inboxes.forwarding.delete("inbox_id")
|
|
218
|
+
*/
|
|
219
|
+
delete(inbox_id, requestOptions) {
|
|
220
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, requestOptions));
|
|
221
|
+
}
|
|
222
|
+
__delete(inbox_id, requestOptions) {
|
|
223
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
225
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
226
|
+
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);
|
|
227
|
+
const _response = yield core.fetcher({
|
|
228
|
+
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)
|
|
229
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/forwarding`),
|
|
230
|
+
method: "DELETE",
|
|
231
|
+
headers: _headers,
|
|
232
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
233
|
+
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,
|
|
234
|
+
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,
|
|
235
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
236
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
237
|
+
logging: this._options.logging,
|
|
238
|
+
});
|
|
239
|
+
if (_response.ok) {
|
|
240
|
+
return {
|
|
241
|
+
data: serializers.Forwarding.parseOrThrow(_response.body, {
|
|
242
|
+
unrecognizedObjectKeys: "passthrough",
|
|
243
|
+
allowUnrecognizedUnionMembers: true,
|
|
244
|
+
allowUnrecognizedEnumValues: true,
|
|
245
|
+
skipValidation: true,
|
|
246
|
+
breadcrumbsPrefix: ["response"],
|
|
247
|
+
}),
|
|
248
|
+
rawResponse: _response.rawResponse,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
if (_response.error.reason === "status-code") {
|
|
252
|
+
switch (_response.error.statusCode) {
|
|
253
|
+
case 404:
|
|
254
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
255
|
+
unrecognizedObjectKeys: "passthrough",
|
|
256
|
+
allowUnrecognizedUnionMembers: true,
|
|
257
|
+
allowUnrecognizedEnumValues: true,
|
|
258
|
+
skipValidation: true,
|
|
259
|
+
breadcrumbsPrefix: ["response"],
|
|
260
|
+
}), _response.rawResponse);
|
|
261
|
+
case 403:
|
|
262
|
+
throw new AgentMail.ForwardingForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
263
|
+
unrecognizedObjectKeys: "passthrough",
|
|
264
|
+
allowUnrecognizedUnionMembers: true,
|
|
265
|
+
allowUnrecognizedEnumValues: true,
|
|
266
|
+
skipValidation: true,
|
|
267
|
+
breadcrumbsPrefix: ["response"],
|
|
268
|
+
}), _response.rawResponse);
|
|
269
|
+
default:
|
|
270
|
+
throw new errors.AgentMailError({
|
|
271
|
+
statusCode: _response.error.statusCode,
|
|
272
|
+
body: _response.error.body,
|
|
273
|
+
rawResponse: _response.rawResponse,
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/inboxes/{inbox_id}/forwarding");
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -10,6 +10,7 @@ export * from "./events/client/requests/index.mjs";
|
|
|
10
10
|
export * as events from "./events/index.mjs";
|
|
11
11
|
export * from "./files/client/requests/index.mjs";
|
|
12
12
|
export * as files from "./files/index.mjs";
|
|
13
|
+
export * as forwarding from "./forwarding/index.mjs";
|
|
13
14
|
export * from "./lists/client/requests/index.mjs";
|
|
14
15
|
export * as lists from "./lists/index.mjs";
|
|
15
16
|
export * from "./messages/client/requests/index.mjs";
|
|
@@ -10,6 +10,7 @@ export * from "./events/client/requests/index.mjs";
|
|
|
10
10
|
export * as events from "./events/index.mjs";
|
|
11
11
|
export * from "./files/client/requests/index.mjs";
|
|
12
12
|
export * as files from "./files/index.mjs";
|
|
13
|
+
export * as forwarding from "./forwarding/index.mjs";
|
|
13
14
|
export * from "./lists/client/requests/index.mjs";
|
|
14
15
|
export * as lists from "./lists/index.mjs";
|
|
15
16
|
export * from "./messages/client/requests/index.mjs";
|
|
@@ -30,6 +30,9 @@ export * from "./events/types/index.mjs";
|
|
|
30
30
|
export * from "./files/errors/index.mjs";
|
|
31
31
|
export * as files from "./files/index.mjs";
|
|
32
32
|
export * from "./files/types/index.mjs";
|
|
33
|
+
export * from "./forwarding/errors/index.mjs";
|
|
34
|
+
export * as forwarding from "./forwarding/index.mjs";
|
|
35
|
+
export * from "./forwarding/types/index.mjs";
|
|
33
36
|
export * as inboxEvents from "./inboxEvents/index.mjs";
|
|
34
37
|
export * from "./inboxEvents/types/index.mjs";
|
|
35
38
|
export * as inboxes from "./inboxes/index.mjs";
|
|
@@ -30,6 +30,9 @@ export * from "./events/types/index.mjs";
|
|
|
30
30
|
export * from "./files/errors/index.mjs";
|
|
31
31
|
export * as files from "./files/index.mjs";
|
|
32
32
|
export * from "./files/types/index.mjs";
|
|
33
|
+
export * from "./forwarding/errors/index.mjs";
|
|
34
|
+
export * as forwarding from "./forwarding/index.mjs";
|
|
35
|
+
export * from "./forwarding/types/index.mjs";
|
|
33
36
|
export * as inboxEvents from "./inboxEvents/index.mjs";
|
|
34
37
|
export * from "./inboxEvents/types/index.mjs";
|
|
35
38
|
export * as inboxes from "./inboxes/index.mjs";
|
|
@@ -22,6 +22,8 @@ export interface Message {
|
|
|
22
22
|
attachments?: AgentMail.MessageAttachments;
|
|
23
23
|
inReplyTo?: AgentMail.MessageInReplyTo;
|
|
24
24
|
calendarEventId?: AgentMail.MessageCalendarEventId;
|
|
25
|
+
trackOpens?: AgentMail.MessageTrackOpens;
|
|
26
|
+
openedAt?: AgentMail.MessageOpenedAt;
|
|
25
27
|
references?: AgentMail.MessageReferences;
|
|
26
28
|
headers?: AgentMail.MessageHeaders;
|
|
27
29
|
authenticationResults?: AgentMail.MessageAuthenticationResults;
|
|
@@ -14,6 +14,8 @@ export interface MessageItem {
|
|
|
14
14
|
attachments?: AgentMail.MessageAttachments;
|
|
15
15
|
inReplyTo?: AgentMail.MessageInReplyTo;
|
|
16
16
|
calendarEventId?: AgentMail.MessageCalendarEventId;
|
|
17
|
+
trackOpens?: AgentMail.MessageTrackOpens;
|
|
18
|
+
openedAt?: AgentMail.MessageOpenedAt;
|
|
17
19
|
references?: AgentMail.MessageReferences;
|
|
18
20
|
headers?: AgentMail.MessageHeaders;
|
|
19
21
|
authenticationResults?: AgentMail.MessageAuthenticationResults;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time at which this message was first opened, the same time the `message.opened` event reports
|
|
3
|
+
* as `open.timestamp`. Set together with the `opened` label, and absent until the first open.
|
|
4
|
+
* Present only on messages with `track_opens`.
|
|
5
|
+
*/
|
|
6
|
+
export type MessageOpenedAt = Date;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Track when this message is first opened. Requires a custom domain with tracking enabled and
|
|
3
|
-
* an HTML body. Opens surface as the `opened` label on the message and as a
|
|
4
|
-
* event. One pixel is injected per message, not per recipient, so a message
|
|
5
|
-
* recipients fires once when any of them opens it, and the event does not identify
|
|
3
|
+
* an HTML body. Opens surface as the `opened` label and `opened_at` on the message and as a
|
|
4
|
+
* `message.opened` event. One pixel is injected per message, not per recipient, so a message
|
|
5
|
+
* with several recipients fires once when any of them opens it, and the event does not identify
|
|
6
|
+
* which one.
|
|
6
7
|
*/
|
|
7
8
|
export type TrackOpens = boolean;
|
|
@@ -22,6 +22,7 @@ export * from "./MessageId.mjs";
|
|
|
22
22
|
export * from "./MessageInReplyTo.mjs";
|
|
23
23
|
export * from "./MessageItem.mjs";
|
|
24
24
|
export * from "./MessageLabels.mjs";
|
|
25
|
+
export * from "./MessageOpenedAt.mjs";
|
|
25
26
|
export * from "./MessagePreview.mjs";
|
|
26
27
|
export * from "./MessageReferences.mjs";
|
|
27
28
|
export * from "./MessageReplyTo.mjs";
|
|
@@ -30,6 +31,7 @@ export * from "./MessageSubject.mjs";
|
|
|
30
31
|
export * from "./MessageText.mjs";
|
|
31
32
|
export * from "./MessageTimestamp.mjs";
|
|
32
33
|
export * from "./MessageTo.mjs";
|
|
34
|
+
export * from "./MessageTrackOpens.mjs";
|
|
33
35
|
export * from "./MessageUpdatedAt.mjs";
|
|
34
36
|
export * from "./RawMessageResponse.mjs";
|
|
35
37
|
export * from "./ReplyAll.mjs";
|
|
@@ -22,6 +22,7 @@ export * from "./MessageId.mjs";
|
|
|
22
22
|
export * from "./MessageInReplyTo.mjs";
|
|
23
23
|
export * from "./MessageItem.mjs";
|
|
24
24
|
export * from "./MessageLabels.mjs";
|
|
25
|
+
export * from "./MessageOpenedAt.mjs";
|
|
25
26
|
export * from "./MessagePreview.mjs";
|
|
26
27
|
export * from "./MessageReferences.mjs";
|
|
27
28
|
export * from "./MessageReplyTo.mjs";
|
|
@@ -30,6 +31,7 @@ export * from "./MessageSubject.mjs";
|
|
|
30
31
|
export * from "./MessageText.mjs";
|
|
31
32
|
export * from "./MessageTimestamp.mjs";
|
|
32
33
|
export * from "./MessageTo.mjs";
|
|
34
|
+
export * from "./MessageTrackOpens.mjs";
|
|
33
35
|
export * from "./MessageUpdatedAt.mjs";
|
|
34
36
|
export * from "./RawMessageResponse.mjs";
|
|
35
37
|
export * from "./ReplyAll.mjs";
|
|
@@ -6,6 +6,7 @@ import { AccountsClient } from "../resources/accounts/client/Client.mjs";
|
|
|
6
6
|
import { ApiKeysClient } from "../resources/apiKeys/client/Client.mjs";
|
|
7
7
|
import { DomainsClient } from "../resources/domains/client/Client.mjs";
|
|
8
8
|
import { DraftsClient } from "../resources/drafts/client/Client.mjs";
|
|
9
|
+
import { ForwardingClient } from "../resources/forwarding/client/Client.mjs";
|
|
9
10
|
import { InboxesClient } from "../resources/inboxes/client/Client.mjs";
|
|
10
11
|
import { ListsClient } from "../resources/lists/client/Client.mjs";
|
|
11
12
|
import { MetricsClient } from "../resources/metrics/client/Client.mjs";
|
|
@@ -24,6 +25,7 @@ export declare class PodsClient {
|
|
|
24
25
|
protected _webhooks: WebhooksClient | undefined;
|
|
25
26
|
protected _domains: DomainsClient | undefined;
|
|
26
27
|
protected _lists: ListsClient | undefined;
|
|
28
|
+
protected _forwarding: ForwardingClient | undefined;
|
|
27
29
|
protected _metrics: MetricsClient | undefined;
|
|
28
30
|
protected _apiKeys: ApiKeysClient | undefined;
|
|
29
31
|
protected _accounts: AccountsClient | undefined;
|
|
@@ -34,6 +36,7 @@ export declare class PodsClient {
|
|
|
34
36
|
get webhooks(): WebhooksClient;
|
|
35
37
|
get domains(): DomainsClient;
|
|
36
38
|
get lists(): ListsClient;
|
|
39
|
+
get forwarding(): ForwardingClient;
|
|
37
40
|
get metrics(): MetricsClient;
|
|
38
41
|
get apiKeys(): ApiKeysClient;
|
|
39
42
|
get accounts(): AccountsClient;
|
|
@@ -20,6 +20,7 @@ import { AccountsClient } from "../resources/accounts/client/Client.mjs";
|
|
|
20
20
|
import { ApiKeysClient } from "../resources/apiKeys/client/Client.mjs";
|
|
21
21
|
import { DomainsClient } from "../resources/domains/client/Client.mjs";
|
|
22
22
|
import { DraftsClient } from "../resources/drafts/client/Client.mjs";
|
|
23
|
+
import { ForwardingClient } from "../resources/forwarding/client/Client.mjs";
|
|
23
24
|
import { InboxesClient } from "../resources/inboxes/client/Client.mjs";
|
|
24
25
|
import { ListsClient } from "../resources/lists/client/Client.mjs";
|
|
25
26
|
import { MetricsClient } from "../resources/metrics/client/Client.mjs";
|
|
@@ -53,6 +54,10 @@ export class PodsClient {
|
|
|
53
54
|
var _a;
|
|
54
55
|
return ((_a = this._lists) !== null && _a !== void 0 ? _a : (this._lists = new ListsClient(this._options)));
|
|
55
56
|
}
|
|
57
|
+
get forwarding() {
|
|
58
|
+
var _a;
|
|
59
|
+
return ((_a = this._forwarding) !== null && _a !== void 0 ? _a : (this._forwarding = new ForwardingClient(this._options)));
|
|
60
|
+
}
|
|
56
61
|
get metrics() {
|
|
57
62
|
var _a;
|
|
58
63
|
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new MetricsClient(this._options)));
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
4
|
+
import * as AgentMail from "../../../../../index.mjs";
|
|
5
|
+
export declare namespace ForwardingClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ForwardingClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ForwardingClient.Options>;
|
|
12
|
+
constructor(options?: ForwardingClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Get the forwarding this pod sets. Its inboxes that set no forwarding of their own use this
|
|
15
|
+
* list. When the pod sets nothing, `destinations` is `null` and the pod uses the organization's
|
|
16
|
+
* forwarding.
|
|
17
|
+
*
|
|
18
|
+
* **CLI:**
|
|
19
|
+
* ```bash
|
|
20
|
+
* agentmail pods forwarding get --pod-id <pod_id>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
24
|
+
* @param {ForwardingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
|
+
*
|
|
26
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
27
|
+
* @throws {@link AgentMail.ForwardingForbiddenError}
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* await client.pods.forwarding.get("pod_id")
|
|
31
|
+
*/
|
|
32
|
+
get(pod_id: AgentMail.pods.PodId, requestOptions?: ForwardingClient.RequestOptions): core.HttpResponsePromise<AgentMail.Forwarding>;
|
|
33
|
+
private __get;
|
|
34
|
+
/**
|
|
35
|
+
* Set the addresses this pod forwards to. The list replaces the pod's current one and the
|
|
36
|
+
* organization's list for this pod; lists are never combined. Send an empty list to stop
|
|
37
|
+
* forwarding in this pod even when the organization forwards. An address that is not verified is
|
|
38
|
+
* saved but receives nothing until it is verified.
|
|
39
|
+
*
|
|
40
|
+
* **CLI:**
|
|
41
|
+
* ```bash
|
|
42
|
+
* agentmail pods forwarding update --pod-id <pod_id> --destinations ops@example.com
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
46
|
+
* @param {AgentMail.UpdateForwardingRequest} request
|
|
47
|
+
* @param {ForwardingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
|
+
*
|
|
49
|
+
* @throws {@link AgentMail.ValidationError}
|
|
50
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
51
|
+
* @throws {@link AgentMail.ForwardingForbiddenError}
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* await client.pods.forwarding.update("pod_id", {
|
|
55
|
+
* destinations: ["destinations", "destinations"]
|
|
56
|
+
* })
|
|
57
|
+
*/
|
|
58
|
+
update(pod_id: AgentMail.pods.PodId, request: AgentMail.UpdateForwardingRequest, requestOptions?: ForwardingClient.RequestOptions): core.HttpResponsePromise<AgentMail.UpdateForwardingResponse>;
|
|
59
|
+
private __update;
|
|
60
|
+
/**
|
|
61
|
+
* Remove this pod's own forwarding, so the pod uses the organization's forwarding again. Verified
|
|
62
|
+
* addresses stay verified. Returns `not_found` when the pod sets no forwarding.
|
|
63
|
+
*
|
|
64
|
+
* **CLI:**
|
|
65
|
+
* ```bash
|
|
66
|
+
* agentmail pods forwarding delete --pod-id <pod_id>
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
70
|
+
* @param {ForwardingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
71
|
+
*
|
|
72
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
73
|
+
* @throws {@link AgentMail.ForwardingForbiddenError}
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* await client.pods.forwarding.delete("pod_id")
|
|
77
|
+
*/
|
|
78
|
+
delete(pod_id: AgentMail.pods.PodId, requestOptions?: ForwardingClient.RequestOptions): core.HttpResponsePromise<AgentMail.Forwarding>;
|
|
79
|
+
private __delete;
|
|
80
|
+
}
|