agentmail 0.3.2 → 0.3.4
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/cjs/wrapper/Client.d.ts +4 -4
- package/dist/cjs/wrapper/Client.js +7 -7
- package/dist/cjs/wrapper/mppx.d.ts +8 -0
- package/dist/cjs/wrapper/{mpp.js → mppx.js} +5 -5
- package/dist/{esm/wrapper/probe402.d.mts → cjs/wrapper/util.d.ts} +1 -0
- package/dist/cjs/wrapper/{probe402.js → util.js} +5 -1
- package/dist/cjs/wrapper/x402.js +2 -2
- 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/esm/wrapper/Client.d.mts +4 -4
- package/dist/esm/wrapper/Client.mjs +7 -7
- package/dist/esm/wrapper/mppx.d.mts +8 -0
- package/dist/esm/wrapper/{mpp.mjs → mppx.mjs} +4 -4
- package/dist/{cjs/wrapper/probe402.d.ts → esm/wrapper/util.d.mts} +1 -0
- package/dist/esm/wrapper/{probe402.mjs → util.mjs} +4 -1
- package/dist/esm/wrapper/x402.mjs +1 -1
- package/dist/llms-full.txt +5436 -3440
- package/dist/llms.txt +15 -1
- package/package.json +1 -1
- package/reference.md +558 -0
- package/dist/cjs/wrapper/mpp.d.ts +0 -2
- package/dist/esm/wrapper/mpp.d.mts +0 -2
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "agentmail",
|
|
46
|
-
"X-Fern-SDK-Version": "0.3.
|
|
47
|
-
"User-Agent": "agentmail/0.3.
|
|
46
|
+
"X-Fern-SDK-Version": "0.3.4",
|
|
47
|
+
"User-Agent": "agentmail/0.3.4",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ApiKeysClient } from "./api/resources/apiKeys/client/Client.js";
|
|
|
2
2
|
import { DomainsClient } from "./api/resources/domains/client/Client.js";
|
|
3
3
|
import { DraftsClient } from "./api/resources/drafts/client/Client.js";
|
|
4
4
|
import { InboxesClient } from "./api/resources/inboxes/client/Client.js";
|
|
5
|
+
import { ListsClient } from "./api/resources/lists/client/Client.js";
|
|
5
6
|
import { MetricsClient } from "./api/resources/metrics/client/Client.js";
|
|
6
7
|
import { OrganizationsClient } from "./api/resources/organizations/client/Client.js";
|
|
7
8
|
import { PodsClient } from "./api/resources/pods/client/Client.js";
|
|
@@ -23,6 +24,7 @@ export declare class AgentMailClient {
|
|
|
23
24
|
protected _apiKeys: ApiKeysClient | undefined;
|
|
24
25
|
protected _domains: DomainsClient | undefined;
|
|
25
26
|
protected _drafts: DraftsClient | undefined;
|
|
27
|
+
protected _lists: ListsClient | undefined;
|
|
26
28
|
protected _metrics: MetricsClient | undefined;
|
|
27
29
|
protected _organizations: OrganizationsClient | undefined;
|
|
28
30
|
protected _threads: ThreadsClient | undefined;
|
|
@@ -34,6 +36,7 @@ export declare class AgentMailClient {
|
|
|
34
36
|
get apiKeys(): ApiKeysClient;
|
|
35
37
|
get domains(): DomainsClient;
|
|
36
38
|
get drafts(): DraftsClient;
|
|
39
|
+
get lists(): ListsClient;
|
|
37
40
|
get metrics(): MetricsClient;
|
|
38
41
|
get organizations(): OrganizationsClient;
|
|
39
42
|
get threads(): ThreadsClient;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -6,12 +6,13 @@ const Client_js_1 = require("./api/resources/apiKeys/client/Client.js");
|
|
|
6
6
|
const Client_js_2 = require("./api/resources/domains/client/Client.js");
|
|
7
7
|
const Client_js_3 = require("./api/resources/drafts/client/Client.js");
|
|
8
8
|
const Client_js_4 = require("./api/resources/inboxes/client/Client.js");
|
|
9
|
-
const Client_js_5 = require("./api/resources/
|
|
10
|
-
const Client_js_6 = require("./api/resources/
|
|
11
|
-
const Client_js_7 = require("./api/resources/
|
|
12
|
-
const Client_js_8 = require("./api/resources/
|
|
13
|
-
const Client_js_9 = require("./api/resources/
|
|
14
|
-
const Client_js_10 = require("./api/resources/
|
|
9
|
+
const Client_js_5 = require("./api/resources/lists/client/Client.js");
|
|
10
|
+
const Client_js_6 = require("./api/resources/metrics/client/Client.js");
|
|
11
|
+
const Client_js_7 = require("./api/resources/organizations/client/Client.js");
|
|
12
|
+
const Client_js_8 = require("./api/resources/pods/client/Client.js");
|
|
13
|
+
const Client_js_9 = require("./api/resources/threads/client/Client.js");
|
|
14
|
+
const Client_js_10 = require("./api/resources/webhooks/client/Client.js");
|
|
15
|
+
const Client_js_11 = require("./api/resources/websockets/client/Client.js");
|
|
15
16
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
16
17
|
class AgentMailClient {
|
|
17
18
|
constructor(options = {}) {
|
|
@@ -23,11 +24,11 @@ class AgentMailClient {
|
|
|
23
24
|
}
|
|
24
25
|
get pods() {
|
|
25
26
|
var _a;
|
|
26
|
-
return ((_a = this._pods) !== null && _a !== void 0 ? _a : (this._pods = new
|
|
27
|
+
return ((_a = this._pods) !== null && _a !== void 0 ? _a : (this._pods = new Client_js_8.PodsClient(this._options)));
|
|
27
28
|
}
|
|
28
29
|
get webhooks() {
|
|
29
30
|
var _a;
|
|
30
|
-
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new
|
|
31
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_10.WebhooksClient(this._options)));
|
|
31
32
|
}
|
|
32
33
|
get apiKeys() {
|
|
33
34
|
var _a;
|
|
@@ -41,21 +42,25 @@ class AgentMailClient {
|
|
|
41
42
|
var _a;
|
|
42
43
|
return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new Client_js_3.DraftsClient(this._options)));
|
|
43
44
|
}
|
|
45
|
+
get lists() {
|
|
46
|
+
var _a;
|
|
47
|
+
return ((_a = this._lists) !== null && _a !== void 0 ? _a : (this._lists = new Client_js_5.ListsClient(this._options)));
|
|
48
|
+
}
|
|
44
49
|
get metrics() {
|
|
45
50
|
var _a;
|
|
46
|
-
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new
|
|
51
|
+
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_js_6.MetricsClient(this._options)));
|
|
47
52
|
}
|
|
48
53
|
get organizations() {
|
|
49
54
|
var _a;
|
|
50
|
-
return ((_a = this._organizations) !== null && _a !== void 0 ? _a : (this._organizations = new
|
|
55
|
+
return ((_a = this._organizations) !== null && _a !== void 0 ? _a : (this._organizations = new Client_js_7.OrganizationsClient(this._options)));
|
|
51
56
|
}
|
|
52
57
|
get threads() {
|
|
53
58
|
var _a;
|
|
54
|
-
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new
|
|
59
|
+
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new Client_js_9.ThreadsClient(this._options)));
|
|
55
60
|
}
|
|
56
61
|
get websockets() {
|
|
57
62
|
var _a;
|
|
58
|
-
return ((_a = this._websockets) !== null && _a !== void 0 ? _a : (this._websockets = new
|
|
63
|
+
return ((_a = this._websockets) !== null && _a !== void 0 ? _a : (this._websockets = new Client_js_11.WebsocketsClient(this._options)));
|
|
59
64
|
}
|
|
60
65
|
}
|
|
61
66
|
exports.AgentMailClient = AgentMailClient;
|
|
@@ -73,7 +73,7 @@ class MessagesClient {
|
|
|
73
73
|
__list(inbox_id_1) {
|
|
74
74
|
return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
|
|
75
75
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
76
|
-
const { limit, pageToken, labels, before, after, ascending, includeSpam } = request;
|
|
76
|
+
const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked } = request;
|
|
77
77
|
const _queryParams = {
|
|
78
78
|
limit,
|
|
79
79
|
page_token: pageToken,
|
|
@@ -91,6 +91,7 @@ class MessagesClient {
|
|
|
91
91
|
: undefined,
|
|
92
92
|
ascending,
|
|
93
93
|
include_spam: includeSpam,
|
|
94
|
+
include_blocked: includeBlocked,
|
|
94
95
|
};
|
|
95
96
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
96
97
|
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);
|
|
@@ -73,7 +73,7 @@ class ThreadsClient {
|
|
|
73
73
|
__list(inbox_id_1) {
|
|
74
74
|
return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
|
|
75
75
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
76
|
-
const { limit, pageToken, labels, before, after, ascending, includeSpam } = request;
|
|
76
|
+
const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked } = request;
|
|
77
77
|
const _queryParams = {
|
|
78
78
|
limit,
|
|
79
79
|
page_token: pageToken,
|
|
@@ -91,6 +91,7 @@ class ThreadsClient {
|
|
|
91
91
|
: undefined,
|
|
92
92
|
ascending,
|
|
93
93
|
include_spam: includeSpam,
|
|
94
|
+
include_blocked: includeBlocked,
|
|
94
95
|
};
|
|
95
96
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
96
97
|
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);
|
|
@@ -12,6 +12,9 @@ export * from "./drafts/types/index.js";
|
|
|
12
12
|
export * as events from "./events/index.js";
|
|
13
13
|
export * from "./events/types/index.js";
|
|
14
14
|
export * as inboxes from "./inboxes/index.js";
|
|
15
|
+
export * from "./lists/client/requests/index.js";
|
|
16
|
+
export * as lists from "./lists/index.js";
|
|
17
|
+
export * from "./lists/types/index.js";
|
|
15
18
|
export * from "./messages/errors/index.js";
|
|
16
19
|
export * as messages from "./messages/index.js";
|
|
17
20
|
export * from "./messages/types/index.js";
|
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.websockets = exports.webhooks = exports.threads = exports.pods = exports.organizations = exports.metrics = exports.messages = exports.inboxes = exports.events = exports.drafts = exports.domains = exports.attachments = exports.apiKeys = void 0;
|
|
39
|
+
exports.websockets = exports.webhooks = exports.threads = exports.pods = exports.organizations = exports.metrics = exports.messages = exports.lists = exports.inboxes = exports.events = exports.drafts = exports.domains = exports.attachments = exports.apiKeys = void 0;
|
|
40
40
|
__exportStar(require("./apiKeys/client/requests/index.js"), exports);
|
|
41
41
|
exports.apiKeys = __importStar(require("./apiKeys/index.js"));
|
|
42
42
|
__exportStar(require("./apiKeys/types/index.js"), exports);
|
|
@@ -51,6 +51,9 @@ __exportStar(require("./drafts/types/index.js"), exports);
|
|
|
51
51
|
exports.events = __importStar(require("./events/index.js"));
|
|
52
52
|
__exportStar(require("./events/types/index.js"), exports);
|
|
53
53
|
exports.inboxes = __importStar(require("./inboxes/index.js"));
|
|
54
|
+
__exportStar(require("./lists/client/requests/index.js"), exports);
|
|
55
|
+
exports.lists = __importStar(require("./lists/index.js"));
|
|
56
|
+
__exportStar(require("./lists/types/index.js"), exports);
|
|
54
57
|
__exportStar(require("./messages/errors/index.js"), exports);
|
|
55
58
|
exports.messages = __importStar(require("./messages/index.js"));
|
|
56
59
|
__exportStar(require("./messages/types/index.js"), exports);
|
|
@@ -0,0 +1,65 @@
|
|
|
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.Direction} direction
|
|
15
|
+
* @param {AgentMail.ListType} type
|
|
16
|
+
* @param {AgentMail.CreateListEntryRequest} request
|
|
17
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link AgentMail.ValidationError}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* await client.lists.create("send", "allow", {
|
|
23
|
+
* entry: "entry"
|
|
24
|
+
* })
|
|
25
|
+
*/
|
|
26
|
+
create(direction: AgentMail.Direction, type: AgentMail.ListType, request: AgentMail.CreateListEntryRequest, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListEntry>;
|
|
27
|
+
private __create;
|
|
28
|
+
/**
|
|
29
|
+
* @param {AgentMail.Direction} direction
|
|
30
|
+
* @param {AgentMail.ListType} type
|
|
31
|
+
* @param {AgentMail.ListListEntriesRequest} request
|
|
32
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* await client.lists.list("send", "allow")
|
|
36
|
+
*/
|
|
37
|
+
list(direction: AgentMail.Direction, type: AgentMail.ListType, request?: AgentMail.ListListEntriesRequest, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListListEntriesResponse>;
|
|
38
|
+
private __list;
|
|
39
|
+
/**
|
|
40
|
+
* @param {AgentMail.Direction} direction
|
|
41
|
+
* @param {AgentMail.ListType} type
|
|
42
|
+
* @param {string} entry - Email address or domain.
|
|
43
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
|
+
*
|
|
45
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* await client.lists.get("send", "allow", "entry")
|
|
49
|
+
*/
|
|
50
|
+
get(direction: AgentMail.Direction, type: AgentMail.ListType, entry: string, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListEntry>;
|
|
51
|
+
private __get;
|
|
52
|
+
/**
|
|
53
|
+
* @param {AgentMail.Direction} direction
|
|
54
|
+
* @param {AgentMail.ListType} type
|
|
55
|
+
* @param {string} entry - Email address or domain.
|
|
56
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* await client.lists.delete("send", "allow", "entry")
|
|
62
|
+
*/
|
|
63
|
+
delete(direction: AgentMail.Direction, type: AgentMail.ListType, entry: string, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
64
|
+
private __delete;
|
|
65
|
+
}
|
|
@@ -0,0 +1,307 @@
|
|
|
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.Direction} direction
|
|
61
|
+
* @param {AgentMail.ListType} type
|
|
62
|
+
* @param {AgentMail.CreateListEntryRequest} request
|
|
63
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link AgentMail.ValidationError}
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* await client.lists.create("send", "allow", {
|
|
69
|
+
* entry: "entry"
|
|
70
|
+
* })
|
|
71
|
+
*/
|
|
72
|
+
create(direction, type, request, requestOptions) {
|
|
73
|
+
return core.HttpResponsePromise.fromPromise(this.__create(direction, type, request, requestOptions));
|
|
74
|
+
}
|
|
75
|
+
__create(direction, type, request, requestOptions) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
78
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
79
|
+
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);
|
|
80
|
+
const _response = yield core.fetcher({
|
|
81
|
+
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)
|
|
82
|
+
.http, `/v0/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}`),
|
|
83
|
+
method: "POST",
|
|
84
|
+
headers: _headers,
|
|
85
|
+
contentType: "application/json",
|
|
86
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
87
|
+
requestType: "json",
|
|
88
|
+
body: serializers.CreateListEntryRequest.jsonOrThrow(request, {
|
|
89
|
+
unrecognizedObjectKeys: "strip",
|
|
90
|
+
omitUndefined: true,
|
|
91
|
+
}),
|
|
92
|
+
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,
|
|
93
|
+
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,
|
|
94
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
95
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
96
|
+
logging: this._options.logging,
|
|
97
|
+
});
|
|
98
|
+
if (_response.ok) {
|
|
99
|
+
return {
|
|
100
|
+
data: serializers.ListEntry.parseOrThrow(_response.body, {
|
|
101
|
+
unrecognizedObjectKeys: "passthrough",
|
|
102
|
+
allowUnrecognizedUnionMembers: true,
|
|
103
|
+
allowUnrecognizedEnumValues: true,
|
|
104
|
+
skipValidation: true,
|
|
105
|
+
breadcrumbsPrefix: ["response"],
|
|
106
|
+
}),
|
|
107
|
+
rawResponse: _response.rawResponse,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
if (_response.error.reason === "status-code") {
|
|
111
|
+
switch (_response.error.statusCode) {
|
|
112
|
+
case 400:
|
|
113
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
114
|
+
unrecognizedObjectKeys: "passthrough",
|
|
115
|
+
allowUnrecognizedUnionMembers: true,
|
|
116
|
+
allowUnrecognizedEnumValues: true,
|
|
117
|
+
skipValidation: true,
|
|
118
|
+
breadcrumbsPrefix: ["response"],
|
|
119
|
+
}), _response.rawResponse);
|
|
120
|
+
default:
|
|
121
|
+
throw new errors.AgentMailError({
|
|
122
|
+
statusCode: _response.error.statusCode,
|
|
123
|
+
body: _response.error.body,
|
|
124
|
+
rawResponse: _response.rawResponse,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/lists/{direction}/{type}");
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* @param {AgentMail.Direction} direction
|
|
133
|
+
* @param {AgentMail.ListType} type
|
|
134
|
+
* @param {AgentMail.ListListEntriesRequest} request
|
|
135
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* await client.lists.list("send", "allow")
|
|
139
|
+
*/
|
|
140
|
+
list(direction, type, request = {}, requestOptions) {
|
|
141
|
+
return core.HttpResponsePromise.fromPromise(this.__list(direction, type, request, requestOptions));
|
|
142
|
+
}
|
|
143
|
+
__list(direction_1, type_1) {
|
|
144
|
+
return __awaiter(this, arguments, void 0, function* (direction, type, request = {}, requestOptions) {
|
|
145
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
146
|
+
const { limit, pageToken } = request;
|
|
147
|
+
const _queryParams = {
|
|
148
|
+
limit,
|
|
149
|
+
page_token: pageToken,
|
|
150
|
+
};
|
|
151
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
152
|
+
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);
|
|
153
|
+
const _response = yield core.fetcher({
|
|
154
|
+
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)
|
|
155
|
+
.http, `/v0/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}`),
|
|
156
|
+
method: "GET",
|
|
157
|
+
headers: _headers,
|
|
158
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
159
|
+
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,
|
|
160
|
+
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,
|
|
161
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
162
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
163
|
+
logging: this._options.logging,
|
|
164
|
+
});
|
|
165
|
+
if (_response.ok) {
|
|
166
|
+
return {
|
|
167
|
+
data: serializers.ListListEntriesResponse.parseOrThrow(_response.body, {
|
|
168
|
+
unrecognizedObjectKeys: "passthrough",
|
|
169
|
+
allowUnrecognizedUnionMembers: true,
|
|
170
|
+
allowUnrecognizedEnumValues: true,
|
|
171
|
+
skipValidation: true,
|
|
172
|
+
breadcrumbsPrefix: ["response"],
|
|
173
|
+
}),
|
|
174
|
+
rawResponse: _response.rawResponse,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
if (_response.error.reason === "status-code") {
|
|
178
|
+
throw new errors.AgentMailError({
|
|
179
|
+
statusCode: _response.error.statusCode,
|
|
180
|
+
body: _response.error.body,
|
|
181
|
+
rawResponse: _response.rawResponse,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/lists/{direction}/{type}");
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* @param {AgentMail.Direction} direction
|
|
189
|
+
* @param {AgentMail.ListType} type
|
|
190
|
+
* @param {string} entry - Email address or domain.
|
|
191
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
192
|
+
*
|
|
193
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* await client.lists.get("send", "allow", "entry")
|
|
197
|
+
*/
|
|
198
|
+
get(direction, type, entry, requestOptions) {
|
|
199
|
+
return core.HttpResponsePromise.fromPromise(this.__get(direction, type, entry, requestOptions));
|
|
200
|
+
}
|
|
201
|
+
__get(direction, type, entry, requestOptions) {
|
|
202
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
204
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
205
|
+
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);
|
|
206
|
+
const _response = yield core.fetcher({
|
|
207
|
+
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)
|
|
208
|
+
.http, `/v0/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}/${core.url.encodePathParam(entry)}`),
|
|
209
|
+
method: "GET",
|
|
210
|
+
headers: _headers,
|
|
211
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
212
|
+
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,
|
|
213
|
+
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,
|
|
214
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
215
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
216
|
+
logging: this._options.logging,
|
|
217
|
+
});
|
|
218
|
+
if (_response.ok) {
|
|
219
|
+
return {
|
|
220
|
+
data: serializers.ListEntry.parseOrThrow(_response.body, {
|
|
221
|
+
unrecognizedObjectKeys: "passthrough",
|
|
222
|
+
allowUnrecognizedUnionMembers: true,
|
|
223
|
+
allowUnrecognizedEnumValues: true,
|
|
224
|
+
skipValidation: true,
|
|
225
|
+
breadcrumbsPrefix: ["response"],
|
|
226
|
+
}),
|
|
227
|
+
rawResponse: _response.rawResponse,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
if (_response.error.reason === "status-code") {
|
|
231
|
+
switch (_response.error.statusCode) {
|
|
232
|
+
case 404:
|
|
233
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
234
|
+
unrecognizedObjectKeys: "passthrough",
|
|
235
|
+
allowUnrecognizedUnionMembers: true,
|
|
236
|
+
allowUnrecognizedEnumValues: true,
|
|
237
|
+
skipValidation: true,
|
|
238
|
+
breadcrumbsPrefix: ["response"],
|
|
239
|
+
}), _response.rawResponse);
|
|
240
|
+
default:
|
|
241
|
+
throw new errors.AgentMailError({
|
|
242
|
+
statusCode: _response.error.statusCode,
|
|
243
|
+
body: _response.error.body,
|
|
244
|
+
rawResponse: _response.rawResponse,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/lists/{direction}/{type}/{entry}");
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* @param {AgentMail.Direction} direction
|
|
253
|
+
* @param {AgentMail.ListType} type
|
|
254
|
+
* @param {string} entry - Email address or domain.
|
|
255
|
+
* @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
256
|
+
*
|
|
257
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* await client.lists.delete("send", "allow", "entry")
|
|
261
|
+
*/
|
|
262
|
+
delete(direction, type, entry, requestOptions) {
|
|
263
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(direction, type, entry, requestOptions));
|
|
264
|
+
}
|
|
265
|
+
__delete(direction, type, entry, requestOptions) {
|
|
266
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
267
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
268
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
269
|
+
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);
|
|
270
|
+
const _response = yield core.fetcher({
|
|
271
|
+
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)
|
|
272
|
+
.http, `/v0/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}/${core.url.encodePathParam(entry)}`),
|
|
273
|
+
method: "DELETE",
|
|
274
|
+
headers: _headers,
|
|
275
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
276
|
+
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,
|
|
277
|
+
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,
|
|
278
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
279
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
280
|
+
logging: this._options.logging,
|
|
281
|
+
});
|
|
282
|
+
if (_response.ok) {
|
|
283
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
284
|
+
}
|
|
285
|
+
if (_response.error.reason === "status-code") {
|
|
286
|
+
switch (_response.error.statusCode) {
|
|
287
|
+
case 404:
|
|
288
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
289
|
+
unrecognizedObjectKeys: "passthrough",
|
|
290
|
+
allowUnrecognizedUnionMembers: true,
|
|
291
|
+
allowUnrecognizedEnumValues: true,
|
|
292
|
+
skipValidation: true,
|
|
293
|
+
breadcrumbsPrefix: ["response"],
|
|
294
|
+
}), _response.rawResponse);
|
|
295
|
+
default:
|
|
296
|
+
throw new errors.AgentMailError({
|
|
297
|
+
statusCode: _response.error.statusCode,
|
|
298
|
+
body: _response.error.body,
|
|
299
|
+
rawResponse: _response.rawResponse,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v0/lists/{direction}/{type}/{entry}");
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
exports.ListsClient = ListsClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ListListEntriesRequest } from "./ListListEntriesRequest.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
18
|
+
__exportStar(require("./types/index.js"), exports);
|