agentmail 0.3.2 → 0.3.3
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 +17 -12
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +2 -1
- package/dist/cjs/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +2 -1
- package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -1
- package/dist/cjs/api/resources/lists/client/Client.d.ts +65 -0
- package/dist/cjs/api/resources/lists/client/Client.js +307 -0
- package/dist/cjs/api/resources/lists/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/lists/client/index.js +17 -0
- package/dist/cjs/api/resources/lists/client/requests/ListListEntriesRequest.d.ts +9 -0
- package/dist/cjs/api/resources/lists/client/requests/ListListEntriesRequest.js +3 -0
- package/dist/cjs/api/resources/lists/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/lists/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/lists/index.d.ts +2 -0
- package/dist/cjs/api/resources/lists/index.js +18 -0
- package/dist/cjs/api/resources/lists/types/CreateListEntryRequest.d.ts +6 -0
- package/dist/cjs/api/resources/lists/types/CreateListEntryRequest.js +3 -0
- package/dist/cjs/api/resources/lists/types/Direction.d.ts +6 -0
- package/dist/cjs/api/resources/lists/types/Direction.js +9 -0
- package/dist/cjs/api/resources/lists/types/EntryType.d.ts +6 -0
- package/dist/cjs/api/resources/lists/types/EntryType.js +9 -0
- package/dist/cjs/api/resources/lists/types/ListEntry.d.ts +3 -0
- package/dist/cjs/api/resources/lists/types/ListEntry.js +3 -0
- package/dist/cjs/api/resources/lists/types/ListEntryBase.d.ts +13 -0
- package/dist/cjs/api/resources/lists/types/ListEntryBase.js +3 -0
- package/dist/cjs/api/resources/lists/types/ListListEntriesResponse.d.ts +8 -0
- package/dist/cjs/api/resources/lists/types/ListListEntriesResponse.js +3 -0
- package/dist/cjs/api/resources/lists/types/ListType.d.ts +6 -0
- package/dist/cjs/api/resources/lists/types/ListType.js +9 -0
- package/dist/cjs/api/resources/lists/types/PodListEntry.d.ts +7 -0
- package/dist/cjs/api/resources/lists/types/PodListEntry.js +3 -0
- package/dist/cjs/api/resources/lists/types/PodListListEntriesResponse.d.ts +8 -0
- package/dist/cjs/api/resources/lists/types/PodListListEntriesResponse.js +3 -0
- package/dist/cjs/api/resources/lists/types/index.d.ts +9 -0
- package/dist/cjs/api/resources/lists/types/index.js +25 -0
- package/dist/cjs/api/resources/pods/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/pods/client/Client.js +7 -2
- 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/lists/client/Client.d.ts +69 -0
- package/dist/cjs/api/resources/pods/resources/lists/client/Client.js +311 -0
- package/dist/cjs/api/resources/pods/resources/lists/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/lists/client/index.js +17 -0
- package/dist/cjs/api/resources/pods/resources/lists/client/requests/ListListEntriesRequest.d.ts +9 -0
- package/dist/cjs/api/resources/pods/resources/lists/client/requests/ListListEntriesRequest.js +3 -0
- package/dist/cjs/api/resources/pods/resources/lists/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/lists/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/pods/resources/lists/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/lists/index.js +17 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +2 -1
- package/dist/cjs/api/resources/pods/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
- package/dist/cjs/api/resources/threads/client/Client.js +2 -1
- package/dist/cjs/api/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
- package/dist/cjs/api/types/IncludeBlocked.d.ts +4 -0
- package/dist/cjs/api/types/IncludeBlocked.js +3 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -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/lists/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/lists/index.js +17 -0
- package/dist/cjs/serialization/resources/lists/types/CreateListEntryRequest.d.ts +10 -0
- package/dist/cjs/serialization/resources/lists/types/CreateListEntryRequest.js +42 -0
- package/dist/cjs/serialization/resources/lists/types/Direction.d.ts +7 -0
- package/dist/cjs/serialization/resources/lists/types/Direction.js +39 -0
- package/dist/cjs/serialization/resources/lists/types/EntryType.d.ts +7 -0
- package/dist/cjs/serialization/resources/lists/types/EntryType.js +39 -0
- package/dist/cjs/serialization/resources/lists/types/ListEntry.d.ts +9 -0
- package/dist/cjs/serialization/resources/lists/types/ListEntry.js +40 -0
- package/dist/cjs/serialization/resources/lists/types/ListEntryBase.d.ts +19 -0
- package/dist/cjs/serialization/resources/lists/types/ListEntryBase.js +51 -0
- package/dist/cjs/serialization/resources/lists/types/ListListEntriesResponse.d.ts +16 -0
- package/dist/cjs/serialization/resources/lists/types/ListListEntriesResponse.js +48 -0
- package/dist/cjs/serialization/resources/lists/types/ListType.d.ts +7 -0
- package/dist/cjs/serialization/resources/lists/types/ListType.js +39 -0
- package/dist/cjs/serialization/resources/lists/types/PodListEntry.d.ts +11 -0
- package/dist/cjs/serialization/resources/lists/types/PodListEntry.js +45 -0
- package/dist/cjs/serialization/resources/lists/types/PodListListEntriesResponse.d.ts +16 -0
- package/dist/cjs/serialization/resources/lists/types/PodListListEntriesResponse.js +48 -0
- package/dist/cjs/serialization/resources/lists/types/index.d.ts +9 -0
- package/dist/cjs/serialization/resources/lists/types/index.js +25 -0
- package/dist/cjs/serialization/types/IncludeBlocked.d.ts +7 -0
- package/dist/cjs/serialization/types/IncludeBlocked.js +39 -0
- package/dist/cjs/serialization/types/index.d.ts +1 -0
- package/dist/cjs/serialization/types/index.js +1 -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/inboxes/resources/messages/client/Client.mjs +2 -1
- package/dist/esm/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +2 -1
- package/dist/esm/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.mts +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/lists/client/Client.d.mts +65 -0
- package/dist/esm/api/resources/lists/client/Client.mjs +270 -0
- package/dist/esm/api/resources/lists/client/index.d.mts +1 -0
- package/dist/esm/api/resources/lists/client/index.mjs +1 -0
- package/dist/esm/api/resources/lists/client/requests/ListListEntriesRequest.d.mts +9 -0
- package/dist/esm/api/resources/lists/client/requests/ListListEntriesRequest.mjs +2 -0
- package/dist/esm/api/resources/lists/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/lists/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/lists/index.d.mts +2 -0
- package/dist/esm/api/resources/lists/index.mjs +2 -0
- package/dist/esm/api/resources/lists/types/CreateListEntryRequest.d.mts +6 -0
- package/dist/esm/api/resources/lists/types/CreateListEntryRequest.mjs +2 -0
- package/dist/esm/api/resources/lists/types/Direction.d.mts +6 -0
- package/dist/esm/api/resources/lists/types/Direction.mjs +6 -0
- package/dist/esm/api/resources/lists/types/EntryType.d.mts +6 -0
- package/dist/esm/api/resources/lists/types/EntryType.mjs +6 -0
- package/dist/esm/api/resources/lists/types/ListEntry.d.mts +3 -0
- package/dist/esm/api/resources/lists/types/ListEntry.mjs +2 -0
- package/dist/esm/api/resources/lists/types/ListEntryBase.d.mts +13 -0
- package/dist/esm/api/resources/lists/types/ListEntryBase.mjs +2 -0
- package/dist/esm/api/resources/lists/types/ListListEntriesResponse.d.mts +8 -0
- package/dist/esm/api/resources/lists/types/ListListEntriesResponse.mjs +2 -0
- package/dist/esm/api/resources/lists/types/ListType.d.mts +6 -0
- package/dist/esm/api/resources/lists/types/ListType.mjs +6 -0
- package/dist/esm/api/resources/lists/types/PodListEntry.d.mts +7 -0
- package/dist/esm/api/resources/lists/types/PodListEntry.mjs +2 -0
- package/dist/esm/api/resources/lists/types/PodListListEntriesResponse.d.mts +8 -0
- package/dist/esm/api/resources/lists/types/PodListListEntriesResponse.mjs +2 -0
- package/dist/esm/api/resources/lists/types/index.d.mts +9 -0
- package/dist/esm/api/resources/lists/types/index.mjs +9 -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/lists/client/Client.d.mts +69 -0
- package/dist/esm/api/resources/pods/resources/lists/client/Client.mjs +274 -0
- package/dist/esm/api/resources/pods/resources/lists/client/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/lists/client/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/lists/client/requests/ListListEntriesRequest.d.mts +9 -0
- package/dist/esm/api/resources/pods/resources/lists/client/requests/ListListEntriesRequest.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/lists/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/lists/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/lists/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/lists/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +2 -1
- package/dist/esm/api/resources/pods/resources/threads/client/requests/ListThreadsRequest.d.mts +1 -0
- package/dist/esm/api/resources/threads/client/Client.mjs +2 -1
- package/dist/esm/api/resources/threads/client/requests/ListThreadsRequest.d.mts +1 -0
- package/dist/esm/api/types/IncludeBlocked.d.mts +4 -0
- package/dist/esm/api/types/IncludeBlocked.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -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/lists/index.d.mts +1 -0
- package/dist/esm/serialization/resources/lists/index.mjs +1 -0
- package/dist/esm/serialization/resources/lists/types/CreateListEntryRequest.d.mts +10 -0
- package/dist/esm/serialization/resources/lists/types/CreateListEntryRequest.mjs +6 -0
- package/dist/esm/serialization/resources/lists/types/Direction.d.mts +7 -0
- package/dist/esm/serialization/resources/lists/types/Direction.mjs +3 -0
- package/dist/esm/serialization/resources/lists/types/EntryType.d.mts +7 -0
- package/dist/esm/serialization/resources/lists/types/EntryType.mjs +3 -0
- package/dist/esm/serialization/resources/lists/types/ListEntry.d.mts +9 -0
- package/dist/esm/serialization/resources/lists/types/ListEntry.mjs +4 -0
- package/dist/esm/serialization/resources/lists/types/ListEntryBase.d.mts +19 -0
- package/dist/esm/serialization/resources/lists/types/ListEntryBase.mjs +15 -0
- package/dist/esm/serialization/resources/lists/types/ListListEntriesResponse.d.mts +16 -0
- package/dist/esm/serialization/resources/lists/types/ListListEntriesResponse.mjs +12 -0
- package/dist/esm/serialization/resources/lists/types/ListType.d.mts +7 -0
- package/dist/esm/serialization/resources/lists/types/ListType.mjs +3 -0
- package/dist/esm/serialization/resources/lists/types/PodListEntry.d.mts +11 -0
- package/dist/esm/serialization/resources/lists/types/PodListEntry.mjs +9 -0
- package/dist/esm/serialization/resources/lists/types/PodListListEntriesResponse.d.mts +16 -0
- package/dist/esm/serialization/resources/lists/types/PodListListEntriesResponse.mjs +12 -0
- package/dist/esm/serialization/resources/lists/types/index.d.mts +9 -0
- package/dist/esm/serialization/resources/lists/types/index.mjs +9 -0
- package/dist/esm/serialization/types/IncludeBlocked.d.mts +7 -0
- package/dist/esm/serialization/types/IncludeBlocked.mjs +3 -0
- package/dist/esm/serialization/types/index.d.mts +1 -0
- package/dist/esm/serialization/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms.txt +7 -1
- package/package.json +1 -1
- package/reference.md +558 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Direction = void 0;
|
|
5
|
+
/** Direction of list entry. */
|
|
6
|
+
exports.Direction = {
|
|
7
|
+
Send: "send",
|
|
8
|
+
Receive: "receive",
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.EntryType = void 0;
|
|
5
|
+
/** Whether the entry is an email address or domain. */
|
|
6
|
+
exports.EntryType = {
|
|
7
|
+
Email: "email",
|
|
8
|
+
Domain: "domain",
|
|
9
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.js";
|
|
2
|
+
export interface ListEntryBase {
|
|
3
|
+
/** Email address or domain of list entry. */
|
|
4
|
+
entry: string;
|
|
5
|
+
organizationId: AgentMail.OrganizationId;
|
|
6
|
+
/** Reason for adding the entry. */
|
|
7
|
+
reason?: string;
|
|
8
|
+
direction: AgentMail.Direction;
|
|
9
|
+
listType: AgentMail.ListType;
|
|
10
|
+
entryType: AgentMail.EntryType;
|
|
11
|
+
/** Time at which entry was created. */
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ListType = void 0;
|
|
5
|
+
/** Type of list entry. */
|
|
6
|
+
exports.ListType = {
|
|
7
|
+
Allow: "allow",
|
|
8
|
+
Block: "block",
|
|
9
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.js";
|
|
2
|
+
export interface PodListListEntriesResponse {
|
|
3
|
+
count: AgentMail.Count;
|
|
4
|
+
limit?: AgentMail.Limit;
|
|
5
|
+
nextPageToken?: AgentMail.PageToken;
|
|
6
|
+
/** Ordered by entry ascending. */
|
|
7
|
+
entries: AgentMail.PodListEntry[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./CreateListEntryRequest.js";
|
|
2
|
+
export * from "./Direction.js";
|
|
3
|
+
export * from "./EntryType.js";
|
|
4
|
+
export * from "./ListEntry.js";
|
|
5
|
+
export * from "./ListEntryBase.js";
|
|
6
|
+
export * from "./ListListEntriesResponse.js";
|
|
7
|
+
export * from "./ListType.js";
|
|
8
|
+
export * from "./PodListEntry.js";
|
|
9
|
+
export * from "./PodListListEntriesResponse.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./CreateListEntryRequest.js"), exports);
|
|
18
|
+
__exportStar(require("./Direction.js"), exports);
|
|
19
|
+
__exportStar(require("./EntryType.js"), exports);
|
|
20
|
+
__exportStar(require("./ListEntry.js"), exports);
|
|
21
|
+
__exportStar(require("./ListEntryBase.js"), exports);
|
|
22
|
+
__exportStar(require("./ListListEntriesResponse.js"), exports);
|
|
23
|
+
__exportStar(require("./ListType.js"), exports);
|
|
24
|
+
__exportStar(require("./PodListEntry.js"), exports);
|
|
25
|
+
__exportStar(require("./PodListListEntriesResponse.js"), exports);
|
|
@@ -5,6 +5,7 @@ import * as AgentMail from "../../../index.js";
|
|
|
5
5
|
import { DomainsClient } from "../resources/domains/client/Client.js";
|
|
6
6
|
import { DraftsClient } from "../resources/drafts/client/Client.js";
|
|
7
7
|
import { InboxesClient } from "../resources/inboxes/client/Client.js";
|
|
8
|
+
import { ListsClient } from "../resources/lists/client/Client.js";
|
|
8
9
|
import { ThreadsClient } from "../resources/threads/client/Client.js";
|
|
9
10
|
export declare namespace PodsClient {
|
|
10
11
|
type Options = BaseClientOptions;
|
|
@@ -17,11 +18,13 @@ export declare class PodsClient {
|
|
|
17
18
|
protected _threads: ThreadsClient | undefined;
|
|
18
19
|
protected _drafts: DraftsClient | undefined;
|
|
19
20
|
protected _domains: DomainsClient | undefined;
|
|
21
|
+
protected _lists: ListsClient | undefined;
|
|
20
22
|
constructor(options?: PodsClient.Options);
|
|
21
23
|
get inboxes(): InboxesClient;
|
|
22
24
|
get threads(): ThreadsClient;
|
|
23
25
|
get drafts(): DraftsClient;
|
|
24
26
|
get domains(): DomainsClient;
|
|
27
|
+
get lists(): ListsClient;
|
|
25
28
|
/**
|
|
26
29
|
* @param {AgentMail.pods.ListPodsRequest} request
|
|
27
30
|
* @param {PodsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -55,7 +55,8 @@ const AgentMail = __importStar(require("../../../index.js"));
|
|
|
55
55
|
const Client_js_1 = require("../resources/domains/client/Client.js");
|
|
56
56
|
const Client_js_2 = require("../resources/drafts/client/Client.js");
|
|
57
57
|
const Client_js_3 = require("../resources/inboxes/client/Client.js");
|
|
58
|
-
const Client_js_4 = require("../resources/
|
|
58
|
+
const Client_js_4 = require("../resources/lists/client/Client.js");
|
|
59
|
+
const Client_js_5 = require("../resources/threads/client/Client.js");
|
|
59
60
|
class PodsClient {
|
|
60
61
|
constructor(options = {}) {
|
|
61
62
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
@@ -66,7 +67,7 @@ class PodsClient {
|
|
|
66
67
|
}
|
|
67
68
|
get threads() {
|
|
68
69
|
var _a;
|
|
69
|
-
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new
|
|
70
|
+
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new Client_js_5.ThreadsClient(this._options)));
|
|
70
71
|
}
|
|
71
72
|
get drafts() {
|
|
72
73
|
var _a;
|
|
@@ -76,6 +77,10 @@ class PodsClient {
|
|
|
76
77
|
var _a;
|
|
77
78
|
return ((_a = this._domains) !== null && _a !== void 0 ? _a : (this._domains = new Client_js_1.DomainsClient(this._options)));
|
|
78
79
|
}
|
|
80
|
+
get lists() {
|
|
81
|
+
var _a;
|
|
82
|
+
return ((_a = this._lists) !== null && _a !== void 0 ? _a : (this._lists = new Client_js_4.ListsClient(this._options)));
|
|
83
|
+
}
|
|
79
84
|
/**
|
|
80
85
|
* @param {AgentMail.pods.ListPodsRequest} request
|
|
81
86
|
* @param {PodsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4,5 +4,7 @@ export * from "./drafts/client/requests/index.js";
|
|
|
4
4
|
export * as drafts from "./drafts/index.js";
|
|
5
5
|
export * from "./inboxes/client/requests/index.js";
|
|
6
6
|
export * as inboxes from "./inboxes/index.js";
|
|
7
|
+
export * from "./lists/client/requests/index.js";
|
|
8
|
+
export * as lists from "./lists/index.js";
|
|
7
9
|
export * from "./threads/client/requests/index.js";
|
|
8
10
|
export * as threads from "./threads/index.js";
|
|
@@ -36,12 +36,14 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.threads = exports.inboxes = exports.drafts = exports.domains = void 0;
|
|
39
|
+
exports.threads = exports.lists = exports.inboxes = exports.drafts = exports.domains = void 0;
|
|
40
40
|
__exportStar(require("./domains/client/requests/index.js"), exports);
|
|
41
41
|
exports.domains = __importStar(require("./domains/index.js"));
|
|
42
42
|
__exportStar(require("./drafts/client/requests/index.js"), exports);
|
|
43
43
|
exports.drafts = __importStar(require("./drafts/index.js"));
|
|
44
44
|
__exportStar(require("./inboxes/client/requests/index.js"), exports);
|
|
45
45
|
exports.inboxes = __importStar(require("./inboxes/index.js"));
|
|
46
|
+
__exportStar(require("./lists/client/requests/index.js"), exports);
|
|
47
|
+
exports.lists = __importStar(require("./lists/index.js"));
|
|
46
48
|
__exportStar(require("./threads/client/requests/index.js"), exports);
|
|
47
49
|
exports.threads = __importStar(require("./threads/index.js"));
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../../../core/index.js";
|
|
4
|
+
import * as AgentMail from "../../../../../index.js";
|
|
5
|
+
export declare namespace ListsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ListsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ListsClient.Options>;
|
|
12
|
+
constructor(options?: ListsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
15
|
+
* @param {AgentMail.Direction} direction
|
|
16
|
+
* @param {AgentMail.ListType} type
|
|
17
|
+
* @param {AgentMail.CreateListEntryRequest} request
|
|
18
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
|
+
*
|
|
20
|
+
* @throws {@link AgentMail.ValidationError}
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* await client.pods.lists.create("pod_id", "send", "allow", {
|
|
24
|
+
* entry: "entry"
|
|
25
|
+
* })
|
|
26
|
+
*/
|
|
27
|
+
create(pod_id: AgentMail.pods.PodId, direction: AgentMail.Direction, type: AgentMail.ListType, request: AgentMail.CreateListEntryRequest, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.PodListEntry>;
|
|
28
|
+
private __create;
|
|
29
|
+
/**
|
|
30
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
31
|
+
* @param {AgentMail.Direction} direction
|
|
32
|
+
* @param {AgentMail.ListType} type
|
|
33
|
+
* @param {AgentMail.pods.ListListEntriesRequest} request
|
|
34
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* await client.pods.lists.list("pod_id", "send", "allow")
|
|
38
|
+
*/
|
|
39
|
+
list(pod_id: AgentMail.pods.PodId, direction: AgentMail.Direction, type: AgentMail.ListType, request?: AgentMail.pods.ListListEntriesRequest, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.PodListListEntriesResponse>;
|
|
40
|
+
private __list;
|
|
41
|
+
/**
|
|
42
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
43
|
+
* @param {AgentMail.Direction} direction
|
|
44
|
+
* @param {AgentMail.ListType} type
|
|
45
|
+
* @param {string} entry - Email address or domain.
|
|
46
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
|
+
*
|
|
48
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* await client.pods.lists.get("pod_id", "send", "allow", "entry")
|
|
52
|
+
*/
|
|
53
|
+
get(pod_id: AgentMail.pods.PodId, direction: AgentMail.Direction, type: AgentMail.ListType, entry: string, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.PodListEntry>;
|
|
54
|
+
private __get;
|
|
55
|
+
/**
|
|
56
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
57
|
+
* @param {AgentMail.Direction} direction
|
|
58
|
+
* @param {AgentMail.ListType} type
|
|
59
|
+
* @param {string} entry - Email address or domain.
|
|
60
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
|
+
*
|
|
62
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* await client.pods.lists.delete("pod_id", "send", "allow", "entry")
|
|
66
|
+
*/
|
|
67
|
+
delete(pod_id: AgentMail.pods.PodId, direction: AgentMail.Direction, type: AgentMail.ListType, entry: string, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
68
|
+
private __delete;
|
|
69
|
+
}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.ListsClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../../../BaseClient.js");
|
|
48
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
49
|
+
const core = __importStar(require("../../../../../../core/index.js"));
|
|
50
|
+
const environments = __importStar(require("../../../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
52
|
+
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
53
|
+
const serializers = __importStar(require("../../../../../../serialization/index.js"));
|
|
54
|
+
const AgentMail = __importStar(require("../../../../../index.js"));
|
|
55
|
+
class ListsClient {
|
|
56
|
+
constructor(options = {}) {
|
|
57
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
61
|
+
* @param {AgentMail.Direction} direction
|
|
62
|
+
* @param {AgentMail.ListType} type
|
|
63
|
+
* @param {AgentMail.CreateListEntryRequest} request
|
|
64
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
|
+
*
|
|
66
|
+
* @throws {@link AgentMail.ValidationError}
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* await client.pods.lists.create("pod_id", "send", "allow", {
|
|
70
|
+
* entry: "entry"
|
|
71
|
+
* })
|
|
72
|
+
*/
|
|
73
|
+
create(pod_id, direction, type, request, requestOptions) {
|
|
74
|
+
return core.HttpResponsePromise.fromPromise(this.__create(pod_id, direction, type, request, requestOptions));
|
|
75
|
+
}
|
|
76
|
+
__create(pod_id, direction, type, request, requestOptions) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
79
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
80
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
81
|
+
const _response = yield core.fetcher({
|
|
82
|
+
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)
|
|
83
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}`),
|
|
84
|
+
method: "POST",
|
|
85
|
+
headers: _headers,
|
|
86
|
+
contentType: "application/json",
|
|
87
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
88
|
+
requestType: "json",
|
|
89
|
+
body: serializers.CreateListEntryRequest.jsonOrThrow(request, {
|
|
90
|
+
unrecognizedObjectKeys: "strip",
|
|
91
|
+
omitUndefined: true,
|
|
92
|
+
}),
|
|
93
|
+
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,
|
|
94
|
+
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,
|
|
95
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
96
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
97
|
+
logging: this._options.logging,
|
|
98
|
+
});
|
|
99
|
+
if (_response.ok) {
|
|
100
|
+
return {
|
|
101
|
+
data: serializers.PodListEntry.parseOrThrow(_response.body, {
|
|
102
|
+
unrecognizedObjectKeys: "passthrough",
|
|
103
|
+
allowUnrecognizedUnionMembers: true,
|
|
104
|
+
allowUnrecognizedEnumValues: true,
|
|
105
|
+
skipValidation: true,
|
|
106
|
+
breadcrumbsPrefix: ["response"],
|
|
107
|
+
}),
|
|
108
|
+
rawResponse: _response.rawResponse,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (_response.error.reason === "status-code") {
|
|
112
|
+
switch (_response.error.statusCode) {
|
|
113
|
+
case 400:
|
|
114
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
115
|
+
unrecognizedObjectKeys: "passthrough",
|
|
116
|
+
allowUnrecognizedUnionMembers: true,
|
|
117
|
+
allowUnrecognizedEnumValues: true,
|
|
118
|
+
skipValidation: true,
|
|
119
|
+
breadcrumbsPrefix: ["response"],
|
|
120
|
+
}), _response.rawResponse);
|
|
121
|
+
default:
|
|
122
|
+
throw new errors.AgentMailError({
|
|
123
|
+
statusCode: _response.error.statusCode,
|
|
124
|
+
body: _response.error.body,
|
|
125
|
+
rawResponse: _response.rawResponse,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/pods/{pod_id}/lists/{direction}/{type}");
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
134
|
+
* @param {AgentMail.Direction} direction
|
|
135
|
+
* @param {AgentMail.ListType} type
|
|
136
|
+
* @param {AgentMail.pods.ListListEntriesRequest} request
|
|
137
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* await client.pods.lists.list("pod_id", "send", "allow")
|
|
141
|
+
*/
|
|
142
|
+
list(pod_id, direction, type, request = {}, requestOptions) {
|
|
143
|
+
return core.HttpResponsePromise.fromPromise(this.__list(pod_id, direction, type, request, requestOptions));
|
|
144
|
+
}
|
|
145
|
+
__list(pod_id_1, direction_1, type_1) {
|
|
146
|
+
return __awaiter(this, arguments, void 0, function* (pod_id, direction, type, request = {}, requestOptions) {
|
|
147
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
148
|
+
const { limit, pageToken } = request;
|
|
149
|
+
const _queryParams = {
|
|
150
|
+
limit,
|
|
151
|
+
page_token: pageToken,
|
|
152
|
+
};
|
|
153
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
154
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
155
|
+
const _response = yield core.fetcher({
|
|
156
|
+
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)
|
|
157
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}`),
|
|
158
|
+
method: "GET",
|
|
159
|
+
headers: _headers,
|
|
160
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
161
|
+
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,
|
|
162
|
+
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,
|
|
163
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
164
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
165
|
+
logging: this._options.logging,
|
|
166
|
+
});
|
|
167
|
+
if (_response.ok) {
|
|
168
|
+
return {
|
|
169
|
+
data: serializers.PodListListEntriesResponse.parseOrThrow(_response.body, {
|
|
170
|
+
unrecognizedObjectKeys: "passthrough",
|
|
171
|
+
allowUnrecognizedUnionMembers: true,
|
|
172
|
+
allowUnrecognizedEnumValues: true,
|
|
173
|
+
skipValidation: true,
|
|
174
|
+
breadcrumbsPrefix: ["response"],
|
|
175
|
+
}),
|
|
176
|
+
rawResponse: _response.rawResponse,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
if (_response.error.reason === "status-code") {
|
|
180
|
+
throw new errors.AgentMailError({
|
|
181
|
+
statusCode: _response.error.statusCode,
|
|
182
|
+
body: _response.error.body,
|
|
183
|
+
rawResponse: _response.rawResponse,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/lists/{direction}/{type}");
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
191
|
+
* @param {AgentMail.Direction} direction
|
|
192
|
+
* @param {AgentMail.ListType} type
|
|
193
|
+
* @param {string} entry - Email address or domain.
|
|
194
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
195
|
+
*
|
|
196
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* await client.pods.lists.get("pod_id", "send", "allow", "entry")
|
|
200
|
+
*/
|
|
201
|
+
get(pod_id, direction, type, entry, requestOptions) {
|
|
202
|
+
return core.HttpResponsePromise.fromPromise(this.__get(pod_id, direction, type, entry, requestOptions));
|
|
203
|
+
}
|
|
204
|
+
__get(pod_id, direction, type, entry, requestOptions) {
|
|
205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
207
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
208
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
209
|
+
const _response = yield core.fetcher({
|
|
210
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
211
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}/${core.url.encodePathParam(entry)}`),
|
|
212
|
+
method: "GET",
|
|
213
|
+
headers: _headers,
|
|
214
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
215
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
216
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
217
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
218
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
219
|
+
logging: this._options.logging,
|
|
220
|
+
});
|
|
221
|
+
if (_response.ok) {
|
|
222
|
+
return {
|
|
223
|
+
data: serializers.PodListEntry.parseOrThrow(_response.body, {
|
|
224
|
+
unrecognizedObjectKeys: "passthrough",
|
|
225
|
+
allowUnrecognizedUnionMembers: true,
|
|
226
|
+
allowUnrecognizedEnumValues: true,
|
|
227
|
+
skipValidation: true,
|
|
228
|
+
breadcrumbsPrefix: ["response"],
|
|
229
|
+
}),
|
|
230
|
+
rawResponse: _response.rawResponse,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
if (_response.error.reason === "status-code") {
|
|
234
|
+
switch (_response.error.statusCode) {
|
|
235
|
+
case 404:
|
|
236
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
237
|
+
unrecognizedObjectKeys: "passthrough",
|
|
238
|
+
allowUnrecognizedUnionMembers: true,
|
|
239
|
+
allowUnrecognizedEnumValues: true,
|
|
240
|
+
skipValidation: true,
|
|
241
|
+
breadcrumbsPrefix: ["response"],
|
|
242
|
+
}), _response.rawResponse);
|
|
243
|
+
default:
|
|
244
|
+
throw new errors.AgentMailError({
|
|
245
|
+
statusCode: _response.error.statusCode,
|
|
246
|
+
body: _response.error.body,
|
|
247
|
+
rawResponse: _response.rawResponse,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/lists/{direction}/{type}/{entry}");
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
256
|
+
* @param {AgentMail.Direction} direction
|
|
257
|
+
* @param {AgentMail.ListType} type
|
|
258
|
+
* @param {string} entry - Email address or domain.
|
|
259
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
260
|
+
*
|
|
261
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* await client.pods.lists.delete("pod_id", "send", "allow", "entry")
|
|
265
|
+
*/
|
|
266
|
+
delete(pod_id, direction, type, entry, requestOptions) {
|
|
267
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(pod_id, direction, type, entry, requestOptions));
|
|
268
|
+
}
|
|
269
|
+
__delete(pod_id, direction, type, entry, requestOptions) {
|
|
270
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
271
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
272
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
273
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
274
|
+
const _response = yield core.fetcher({
|
|
275
|
+
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)
|
|
276
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}/${core.url.encodePathParam(entry)}`),
|
|
277
|
+
method: "DELETE",
|
|
278
|
+
headers: _headers,
|
|
279
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
280
|
+
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,
|
|
281
|
+
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,
|
|
282
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
283
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
284
|
+
logging: this._options.logging,
|
|
285
|
+
});
|
|
286
|
+
if (_response.ok) {
|
|
287
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
288
|
+
}
|
|
289
|
+
if (_response.error.reason === "status-code") {
|
|
290
|
+
switch (_response.error.statusCode) {
|
|
291
|
+
case 404:
|
|
292
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
293
|
+
unrecognizedObjectKeys: "passthrough",
|
|
294
|
+
allowUnrecognizedUnionMembers: true,
|
|
295
|
+
allowUnrecognizedEnumValues: true,
|
|
296
|
+
skipValidation: true,
|
|
297
|
+
breadcrumbsPrefix: ["response"],
|
|
298
|
+
}), _response.rawResponse);
|
|
299
|
+
default:
|
|
300
|
+
throw new errors.AgentMailError({
|
|
301
|
+
statusCode: _response.error.statusCode,
|
|
302
|
+
body: _response.error.body,
|
|
303
|
+
rawResponse: _response.rawResponse,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v0/pods/{pod_id}/lists/{direction}/{type}/{entry}");
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
exports.ListsClient = ListsClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|