agentmail 0.1.6 → 0.1.7
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/README.md +63 -0
- package/dist/cjs/BaseClient.d.ts +14 -1
- package/dist/cjs/BaseClient.js +59 -0
- package/dist/cjs/Client.d.ts +30 -29
- package/dist/cjs/Client.js +12 -53
- package/dist/cjs/api/resources/apiKeys/client/Client.d.ts +12 -12
- package/dist/cjs/api/resources/apiKeys/client/Client.js +29 -31
- package/dist/cjs/api/resources/domains/client/Client.d.ts +19 -19
- package/dist/cjs/api/resources/domains/client/Client.js +60 -53
- package/dist/cjs/api/resources/drafts/client/Client.d.ts +10 -10
- package/dist/cjs/api/resources/drafts/client/Client.js +23 -28
- package/dist/cjs/api/resources/events/types/DomainVerifiedEvent.d.ts +7 -0
- package/dist/cjs/api/resources/{webhooks → events}/types/EventType.d.ts +1 -0
- package/dist/cjs/api/resources/{webhooks → events}/types/EventType.js +1 -0
- package/dist/cjs/api/resources/events/types/EventTypes.d.ts +5 -0
- package/dist/cjs/api/resources/events/types/EventTypes.js +3 -0
- package/dist/cjs/api/resources/events/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/events/types/index.js +3 -0
- package/dist/cjs/api/resources/inboxes/client/Client.d.ts +30 -30
- package/dist/cjs/api/resources/inboxes/client/Client.js +55 -51
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +27 -27
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +77 -70
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +25 -25
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +83 -73
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.d.ts +8 -8
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.js +17 -25
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.d.ts +17 -17
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +51 -50
- package/dist/cjs/api/resources/metrics/client/Client.d.ts +7 -7
- package/dist/cjs/api/resources/metrics/client/Client.js +12 -20
- package/dist/cjs/api/resources/pods/client/Client.d.ts +27 -27
- package/dist/cjs/api/resources/pods/client/Client.js +44 -43
- package/dist/cjs/api/resources/pods/resources/domains/client/Client.d.ts +15 -15
- package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +41 -43
- package/dist/cjs/api/resources/pods/resources/drafts/client/Client.d.ts +12 -12
- package/dist/cjs/api/resources/pods/resources/drafts/client/Client.js +30 -35
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.d.ts +19 -19
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +53 -52
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.d.ts +13 -13
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +39 -41
- package/dist/cjs/api/resources/threads/client/Client.d.ts +11 -11
- package/dist/cjs/api/resources/threads/client/Client.js +32 -34
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +15 -15
- package/dist/cjs/api/resources/webhooks/client/Client.js +40 -39
- package/dist/cjs/api/resources/webhooks/types/CreateWebhookRequest.d.ts +1 -1
- package/dist/cjs/api/resources/webhooks/types/Webhook.d.ts +1 -1
- package/dist/cjs/api/resources/webhooks/types/index.d.ts +0 -2
- package/dist/cjs/api/resources/webhooks/types/index.js +0 -2
- package/dist/cjs/api/resources/websockets/client/Client.d.ts +6 -6
- package/dist/cjs/api/resources/websockets/client/Client.js +8 -19
- package/dist/cjs/api/resources/websockets/client/Socket.d.ts +1 -1
- package/dist/cjs/api/resources/websockets/types/Subscribe.d.ts +5 -1
- package/dist/cjs/api/resources/websockets/types/Subscribed.d.ts +5 -1
- package/dist/cjs/auth/BearerAuthProvider.d.ts +14 -0
- package/dist/cjs/auth/BearerAuthProvider.js +72 -0
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +4 -1
- package/dist/cjs/core/auth/BearerToken.d.ts +3 -1
- package/dist/cjs/core/auth/BearerToken.js +7 -6
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +1 -0
- package/dist/cjs/core/auth/index.js +3 -1
- package/dist/cjs/core/exports.d.ts +1 -0
- package/dist/cjs/core/exports.js +1 -0
- package/dist/cjs/core/fetcher/Fetcher.d.ts +4 -1
- package/dist/cjs/core/fetcher/Fetcher.js +202 -9
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
- package/dist/cjs/core/fetcher/getRequestBody.js +4 -0
- package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/cjs/core/fetcher/makeRequest.js +0 -2
- package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
- package/dist/cjs/core/fetcher/signals.d.ts +0 -6
- package/dist/cjs/core/fetcher/signals.js +0 -12
- package/dist/cjs/core/headers.js +6 -4
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/core/index.js +2 -1
- package/dist/cjs/core/logging/exports.d.ts +18 -0
- package/dist/cjs/core/logging/exports.js +45 -0
- package/dist/cjs/core/logging/index.d.ts +1 -0
- package/dist/cjs/core/logging/index.js +17 -0
- package/dist/cjs/core/logging/logger.d.ts +126 -0
- package/dist/cjs/core/logging/logger.js +144 -0
- package/dist/cjs/core/schemas/Schema.d.ts +1 -0
- package/dist/cjs/core/schemas/Schema.js +1 -0
- package/dist/cjs/core/schemas/builders/primitives/index.d.ts +1 -0
- package/dist/cjs/core/schemas/builders/primitives/index.js +3 -1
- package/dist/cjs/core/schemas/builders/primitives/never.d.ts +2 -0
- package/dist/cjs/core/schemas/builders/primitives/never.js +14 -0
- package/dist/cjs/core/url/join.js +0 -1
- package/dist/cjs/serialization/resources/events/types/DomainVerifiedEvent.d.ts +14 -0
- package/dist/cjs/serialization/resources/events/types/DomainVerifiedEvent.js +46 -0
- package/dist/cjs/serialization/resources/{webhooks → events}/types/EventType.d.ts +2 -2
- package/dist/cjs/serialization/resources/{webhooks → events}/types/EventType.js +1 -0
- package/dist/cjs/serialization/resources/{webhooks → events}/types/EventTypes.d.ts +1 -1
- package/dist/cjs/serialization/resources/events/types/index.d.ts +3 -0
- package/dist/cjs/serialization/resources/events/types/index.js +3 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookRequest.d.ts +1 -1
- package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookRequest.js +1 -1
- package/dist/cjs/serialization/resources/webhooks/types/Webhook.d.ts +1 -1
- package/dist/cjs/serialization/resources/webhooks/types/Webhook.js +1 -1
- package/dist/cjs/serialization/resources/webhooks/types/index.d.ts +0 -2
- package/dist/cjs/serialization/resources/webhooks/types/index.js +0 -2
- package/dist/cjs/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.ts +3 -2
- package/dist/cjs/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.js +2 -0
- package/dist/cjs/serialization/resources/websockets/types/Subscribe.d.ts +4 -1
- package/dist/cjs/serialization/resources/websockets/types/Subscribe.js +4 -1
- package/dist/cjs/serialization/resources/websockets/types/Subscribed.d.ts +4 -1
- package/dist/cjs/serialization/resources/websockets/types/Subscribed.js +4 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +14 -1
- package/dist/esm/BaseClient.mjs +24 -1
- package/dist/esm/Client.d.mts +30 -29
- package/dist/esm/Client.mjs +21 -29
- package/dist/esm/api/resources/apiKeys/client/Client.d.mts +12 -12
- package/dist/esm/api/resources/apiKeys/client/Client.mjs +28 -30
- package/dist/esm/api/resources/domains/client/Client.d.mts +19 -19
- package/dist/esm/api/resources/domains/client/Client.mjs +59 -52
- package/dist/esm/api/resources/drafts/client/Client.d.mts +10 -10
- package/dist/esm/api/resources/drafts/client/Client.mjs +22 -27
- package/dist/esm/api/resources/events/types/DomainVerifiedEvent.d.mts +7 -0
- package/dist/esm/api/resources/{webhooks → events}/types/EventType.d.mts +1 -0
- package/dist/esm/api/resources/{webhooks → events}/types/EventType.mjs +1 -0
- package/dist/esm/api/resources/events/types/EventTypes.d.mts +5 -0
- package/dist/esm/api/resources/events/types/EventTypes.mjs +2 -0
- package/dist/esm/api/resources/events/types/index.d.mts +3 -0
- package/dist/esm/api/resources/events/types/index.mjs +3 -0
- package/dist/esm/api/resources/inboxes/client/Client.d.mts +30 -30
- package/dist/esm/api/resources/inboxes/client/Client.mjs +58 -54
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +27 -27
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +76 -69
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +25 -25
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +82 -72
- package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.d.mts +8 -8
- package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.mjs +16 -24
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.d.mts +17 -17
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +50 -49
- package/dist/esm/api/resources/metrics/client/Client.d.mts +7 -7
- package/dist/esm/api/resources/metrics/client/Client.mjs +11 -19
- package/dist/esm/api/resources/pods/client/Client.d.mts +27 -27
- package/dist/esm/api/resources/pods/client/Client.mjs +47 -46
- package/dist/esm/api/resources/pods/resources/domains/client/Client.d.mts +15 -15
- package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +40 -42
- package/dist/esm/api/resources/pods/resources/drafts/client/Client.d.mts +12 -12
- package/dist/esm/api/resources/pods/resources/drafts/client/Client.mjs +29 -34
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.d.mts +19 -19
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +52 -51
- package/dist/esm/api/resources/pods/resources/threads/client/Client.d.mts +13 -13
- package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +38 -40
- package/dist/esm/api/resources/threads/client/Client.d.mts +11 -11
- package/dist/esm/api/resources/threads/client/Client.mjs +31 -33
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +15 -15
- package/dist/esm/api/resources/webhooks/client/Client.mjs +39 -38
- package/dist/esm/api/resources/webhooks/types/CreateWebhookRequest.d.mts +1 -1
- package/dist/esm/api/resources/webhooks/types/Webhook.d.mts +1 -1
- package/dist/esm/api/resources/webhooks/types/index.d.mts +0 -2
- package/dist/esm/api/resources/webhooks/types/index.mjs +0 -2
- package/dist/esm/api/resources/websockets/client/Client.d.mts +6 -6
- package/dist/esm/api/resources/websockets/client/Client.mjs +7 -18
- package/dist/esm/api/resources/websockets/client/Socket.d.mts +1 -1
- package/dist/esm/api/resources/websockets/types/Subscribe.d.mts +5 -1
- package/dist/esm/api/resources/websockets/types/Subscribed.d.mts +5 -1
- package/dist/esm/auth/BearerAuthProvider.d.mts +14 -0
- package/dist/esm/auth/BearerAuthProvider.mjs +35 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +4 -1
- package/dist/esm/core/auth/BearerToken.d.mts +3 -1
- package/dist/esm/core/auth/BearerToken.mjs +7 -6
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +1 -0
- package/dist/esm/core/auth/index.mjs +1 -0
- package/dist/esm/core/exports.d.mts +1 -0
- package/dist/esm/core/exports.mjs +1 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +4 -1
- package/dist/esm/core/fetcher/Fetcher.mjs +202 -9
- package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
- package/dist/esm/core/fetcher/getRequestBody.mjs +4 -0
- package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
- package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
- package/dist/esm/core/fetcher/signals.d.mts +0 -6
- package/dist/esm/core/fetcher/signals.mjs +0 -12
- package/dist/esm/core/headers.mjs +6 -4
- package/dist/esm/core/index.d.mts +1 -0
- package/dist/esm/core/index.mjs +1 -0
- package/dist/esm/core/logging/exports.d.mts +18 -0
- package/dist/esm/core/logging/exports.mjs +9 -0
- package/dist/esm/core/logging/index.d.mts +1 -0
- package/dist/esm/core/logging/index.mjs +1 -0
- package/dist/esm/core/logging/logger.d.mts +126 -0
- package/dist/esm/core/logging/logger.mjs +138 -0
- package/dist/esm/core/schemas/Schema.d.mts +1 -0
- package/dist/esm/core/schemas/Schema.mjs +1 -0
- package/dist/esm/core/schemas/builders/primitives/index.d.mts +1 -0
- package/dist/esm/core/schemas/builders/primitives/index.mjs +1 -0
- package/dist/esm/core/schemas/builders/primitives/never.d.mts +2 -0
- package/dist/esm/core/schemas/builders/primitives/never.mjs +11 -0
- package/dist/esm/core/url/join.mjs +0 -1
- package/dist/esm/serialization/resources/events/types/DomainVerifiedEvent.d.mts +14 -0
- package/dist/esm/serialization/resources/events/types/DomainVerifiedEvent.mjs +10 -0
- package/dist/esm/serialization/resources/{webhooks → events}/types/EventType.d.mts +2 -2
- package/dist/esm/serialization/resources/{webhooks → events}/types/EventType.mjs +1 -0
- package/dist/esm/serialization/resources/{webhooks → events}/types/EventTypes.d.mts +1 -1
- package/dist/esm/serialization/resources/events/types/index.d.mts +3 -0
- package/dist/esm/serialization/resources/events/types/index.mjs +3 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateWebhookRequest.d.mts +1 -1
- package/dist/esm/serialization/resources/webhooks/types/CreateWebhookRequest.mjs +1 -1
- package/dist/esm/serialization/resources/webhooks/types/Webhook.d.mts +1 -1
- package/dist/esm/serialization/resources/webhooks/types/Webhook.mjs +1 -1
- package/dist/esm/serialization/resources/webhooks/types/index.d.mts +0 -2
- package/dist/esm/serialization/resources/webhooks/types/index.mjs +0 -2
- package/dist/esm/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.mts +3 -2
- package/dist/esm/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.mjs +2 -0
- package/dist/esm/serialization/resources/websockets/types/Subscribe.d.mts +4 -1
- package/dist/esm/serialization/resources/websockets/types/Subscribe.mjs +4 -1
- package/dist/esm/serialization/resources/websockets/types/Subscribed.d.mts +4 -1
- package/dist/esm/serialization/resources/websockets/types/Subscribed.mjs +4 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms-full.txt +620 -54
- package/dist/llms.txt +6 -1
- package/package.json +1 -1
- package/reference.md +170 -170
- package/dist/cjs/api/resources/webhooks/types/EventTypes.d.ts +0 -5
- package/dist/esm/api/resources/webhooks/types/EventTypes.d.mts +0 -5
- /package/dist/cjs/api/resources/{webhooks/types/EventTypes.js → events/types/DomainVerifiedEvent.js} +0 -0
- /package/dist/cjs/serialization/resources/{webhooks → events}/types/EventTypes.js +0 -0
- /package/dist/esm/api/resources/{webhooks/types/EventTypes.mjs → events/types/DomainVerifiedEvent.mjs} +0 -0
- /package/dist/esm/serialization/resources/{webhooks → events}/types/EventTypes.mjs +0 -0
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type * as AgentMail from "../../../../api/index.js";
|
|
2
2
|
import * as core from "../../../../core/index.js";
|
|
3
3
|
import type * as serializers from "../../../index.js";
|
|
4
|
+
import { EventTypes } from "../../events/types/EventTypes.js";
|
|
4
5
|
export declare const Subscribe: core.serialization.ObjectSchema<serializers.Subscribe.Raw, AgentMail.Subscribe>;
|
|
5
6
|
export declare namespace Subscribe {
|
|
6
7
|
interface Raw {
|
|
7
8
|
type: "subscribe";
|
|
8
|
-
|
|
9
|
+
event_types?: EventTypes.Raw | null;
|
|
10
|
+
inbox_ids?: string[] | null;
|
|
11
|
+
pod_ids?: string[] | null;
|
|
9
12
|
}
|
|
10
13
|
}
|
|
@@ -36,7 +36,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.Subscribe = void 0;
|
|
38
38
|
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
const EventTypes_js_1 = require("../../events/types/EventTypes.js");
|
|
39
40
|
exports.Subscribe = core.serialization.object({
|
|
40
41
|
type: core.serialization.stringLiteral("subscribe"),
|
|
41
|
-
|
|
42
|
+
eventTypes: core.serialization.property("event_types", EventTypes_js_1.EventTypes.optional()),
|
|
43
|
+
inboxIds: core.serialization.property("inbox_ids", core.serialization.list(core.serialization.string()).optional()),
|
|
44
|
+
podIds: core.serialization.property("pod_ids", core.serialization.list(core.serialization.string()).optional()),
|
|
42
45
|
});
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type * as AgentMail from "../../../../api/index.js";
|
|
2
2
|
import * as core from "../../../../core/index.js";
|
|
3
3
|
import type * as serializers from "../../../index.js";
|
|
4
|
+
import { EventTypes } from "../../events/types/EventTypes.js";
|
|
4
5
|
export declare const Subscribed: core.serialization.ObjectSchema<serializers.Subscribed.Raw, AgentMail.Subscribed>;
|
|
5
6
|
export declare namespace Subscribed {
|
|
6
7
|
interface Raw {
|
|
7
8
|
type: "subscribed";
|
|
8
|
-
|
|
9
|
+
event_types?: EventTypes.Raw | null;
|
|
10
|
+
inbox_ids?: string[] | null;
|
|
11
|
+
pod_ids?: string[] | null;
|
|
9
12
|
}
|
|
10
13
|
}
|
|
@@ -36,7 +36,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.Subscribed = void 0;
|
|
38
38
|
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
const EventTypes_js_1 = require("../../events/types/EventTypes.js");
|
|
39
40
|
exports.Subscribed = core.serialization.object({
|
|
40
41
|
type: core.serialization.stringLiteral("subscribed"),
|
|
41
|
-
|
|
42
|
+
eventTypes: core.serialization.property("event_types", EventTypes_js_1.EventTypes.optional()),
|
|
43
|
+
inboxIds: core.serialization.property("inbox_ids", core.serialization.list(core.serialization.string()).optional()),
|
|
44
|
+
podIds: core.serialization.property("pod_ids", core.serialization.list(core.serialization.string()).optional()),
|
|
42
45
|
});
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
1
|
+
export declare const SDK_VERSION = "0.1.7";
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as core from "./core/index.mjs";
|
|
2
2
|
import type * as environments from "./environments.mjs";
|
|
3
3
|
export interface BaseClientOptions {
|
|
4
4
|
environment?: core.Supplier<environments.AgentMailEnvironment | environments.AgentMailEnvironmentUrls>;
|
|
@@ -11,6 +11,10 @@ export interface BaseClientOptions {
|
|
|
11
11
|
timeoutInSeconds?: number;
|
|
12
12
|
/** The default number of times to retry the request. Defaults to 2. */
|
|
13
13
|
maxRetries?: number;
|
|
14
|
+
/** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */
|
|
15
|
+
fetch?: typeof fetch;
|
|
16
|
+
/** Configure logging for the client. */
|
|
17
|
+
logging?: core.logging.LogConfig | core.logging.Logger;
|
|
14
18
|
}
|
|
15
19
|
export interface BaseRequestOptions {
|
|
16
20
|
/** The maximum time to wait for a response in seconds. */
|
|
@@ -24,3 +28,12 @@ export interface BaseRequestOptions {
|
|
|
24
28
|
/** Additional headers to include in the request. */
|
|
25
29
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
26
30
|
}
|
|
31
|
+
export type NormalizedClientOptions<T extends BaseClientOptions> = T & {
|
|
32
|
+
logging: core.logging.Logger;
|
|
33
|
+
authProvider?: core.AuthProvider;
|
|
34
|
+
};
|
|
35
|
+
export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions> = NormalizedClientOptions<T> & {
|
|
36
|
+
authProvider: core.AuthProvider;
|
|
37
|
+
};
|
|
38
|
+
export declare function normalizeClientOptions<T extends BaseClientOptions>(options: T): NormalizedClientOptions<T>;
|
|
39
|
+
export declare function normalizeClientOptionsWithAuth<T extends BaseClientOptions>(options: T): NormalizedClientOptionsWithAuth<T>;
|
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -1,2 +1,25 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
2
|
+
import { BearerAuthProvider } from "./auth/BearerAuthProvider.mjs";
|
|
3
|
+
import { mergeHeaders } from "./core/headers.mjs";
|
|
4
|
+
import * as core from "./core/index.mjs";
|
|
5
|
+
export function normalizeClientOptions(options) {
|
|
6
|
+
const headers = mergeHeaders({
|
|
7
|
+
"X-Fern-Language": "JavaScript",
|
|
8
|
+
"X-Fern-SDK-Name": "agentmail",
|
|
9
|
+
"X-Fern-SDK-Version": "0.1.7",
|
|
10
|
+
"User-Agent": "agentmail/0.1.7",
|
|
11
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
|
+
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
14
|
+
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
15
|
+
}
|
|
16
|
+
export function normalizeClientOptionsWithAuth(options) {
|
|
17
|
+
var _a;
|
|
18
|
+
const normalized = normalizeClientOptions(options);
|
|
19
|
+
const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
|
|
20
|
+
(_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = new BearerAuthProvider(normalizedWithNoOpAuthProvider));
|
|
21
|
+
return normalized;
|
|
22
|
+
}
|
|
23
|
+
function withNoOpAuthProvider(options) {
|
|
24
|
+
return Object.assign(Object.assign({}, options), { authProvider: new core.NoOpAuthProvider() });
|
|
25
|
+
}
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { ApiKeysClient } from "./api/resources/apiKeys/client/Client.mjs";
|
|
2
|
+
import { DomainsClient } from "./api/resources/domains/client/Client.mjs";
|
|
3
|
+
import { DraftsClient } from "./api/resources/drafts/client/Client.mjs";
|
|
4
|
+
import { InboxesClient } from "./api/resources/inboxes/client/Client.mjs";
|
|
5
|
+
import { MetricsClient } from "./api/resources/metrics/client/Client.mjs";
|
|
6
|
+
import { PodsClient } from "./api/resources/pods/client/Client.mjs";
|
|
7
|
+
import { ThreadsClient } from "./api/resources/threads/client/Client.mjs";
|
|
8
|
+
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
9
|
+
import { WebsocketsClient } from "./api/resources/websockets/client/Client.mjs";
|
|
10
10
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
11
|
+
import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
11
12
|
export declare namespace AgentMailClient {
|
|
12
13
|
interface Options extends BaseClientOptions {
|
|
13
14
|
}
|
|
@@ -15,24 +16,24 @@ export declare namespace AgentMailClient {
|
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
export declare class AgentMailClient {
|
|
18
|
-
protected readonly _options: AgentMailClient.Options
|
|
19
|
-
protected _inboxes:
|
|
20
|
-
protected _pods:
|
|
21
|
-
protected _webhooks:
|
|
22
|
-
protected _apiKeys:
|
|
23
|
-
protected _domains:
|
|
24
|
-
protected _drafts:
|
|
25
|
-
protected _metrics:
|
|
26
|
-
protected _threads:
|
|
27
|
-
protected _websockets:
|
|
28
|
-
constructor(
|
|
29
|
-
get inboxes():
|
|
30
|
-
get pods():
|
|
31
|
-
get webhooks():
|
|
32
|
-
get apiKeys():
|
|
33
|
-
get domains():
|
|
34
|
-
get drafts():
|
|
35
|
-
get metrics():
|
|
36
|
-
get threads():
|
|
37
|
-
get websockets():
|
|
19
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<AgentMailClient.Options>;
|
|
20
|
+
protected _inboxes: InboxesClient | undefined;
|
|
21
|
+
protected _pods: PodsClient | undefined;
|
|
22
|
+
protected _webhooks: WebhooksClient | undefined;
|
|
23
|
+
protected _apiKeys: ApiKeysClient | undefined;
|
|
24
|
+
protected _domains: DomainsClient | undefined;
|
|
25
|
+
protected _drafts: DraftsClient | undefined;
|
|
26
|
+
protected _metrics: MetricsClient | undefined;
|
|
27
|
+
protected _threads: ThreadsClient | undefined;
|
|
28
|
+
protected _websockets: WebsocketsClient | undefined;
|
|
29
|
+
constructor(options?: AgentMailClient.Options);
|
|
30
|
+
get inboxes(): InboxesClient;
|
|
31
|
+
get pods(): PodsClient;
|
|
32
|
+
get webhooks(): WebhooksClient;
|
|
33
|
+
get apiKeys(): ApiKeysClient;
|
|
34
|
+
get domains(): DomainsClient;
|
|
35
|
+
get drafts(): DraftsClient;
|
|
36
|
+
get metrics(): MetricsClient;
|
|
37
|
+
get threads(): ThreadsClient;
|
|
38
|
+
get websockets(): WebsocketsClient;
|
|
38
39
|
}
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -1,60 +1,52 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import * as core from "./core/index.mjs";
|
|
2
|
+
import { ApiKeysClient } from "./api/resources/apiKeys/client/Client.mjs";
|
|
3
|
+
import { DomainsClient } from "./api/resources/domains/client/Client.mjs";
|
|
4
|
+
import { DraftsClient } from "./api/resources/drafts/client/Client.mjs";
|
|
5
|
+
import { InboxesClient } from "./api/resources/inboxes/client/Client.mjs";
|
|
6
|
+
import { MetricsClient } from "./api/resources/metrics/client/Client.mjs";
|
|
7
|
+
import { PodsClient } from "./api/resources/pods/client/Client.mjs";
|
|
8
|
+
import { ThreadsClient } from "./api/resources/threads/client/Client.mjs";
|
|
9
|
+
import { WebhooksClient } from "./api/resources/webhooks/client/Client.mjs";
|
|
10
|
+
import { WebsocketsClient } from "./api/resources/websockets/client/Client.mjs";
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
13
12
|
export class AgentMailClient {
|
|
14
|
-
constructor(
|
|
15
|
-
this._options =
|
|
16
|
-
"X-Fern-Language": "JavaScript",
|
|
17
|
-
"X-Fern-SDK-Name": "agentmail",
|
|
18
|
-
"X-Fern-SDK-Version": "0.1.6",
|
|
19
|
-
"User-Agent": "agentmail/0.1.6",
|
|
20
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
21
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
22
|
-
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
13
|
+
constructor(options = {}) {
|
|
14
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
23
15
|
}
|
|
24
16
|
get inboxes() {
|
|
25
17
|
var _a;
|
|
26
|
-
return ((_a = this._inboxes) !== null && _a !== void 0 ? _a : (this._inboxes = new
|
|
18
|
+
return ((_a = this._inboxes) !== null && _a !== void 0 ? _a : (this._inboxes = new InboxesClient(this._options)));
|
|
27
19
|
}
|
|
28
20
|
get pods() {
|
|
29
21
|
var _a;
|
|
30
|
-
return ((_a = this._pods) !== null && _a !== void 0 ? _a : (this._pods = new
|
|
22
|
+
return ((_a = this._pods) !== null && _a !== void 0 ? _a : (this._pods = new PodsClient(this._options)));
|
|
31
23
|
}
|
|
32
24
|
get webhooks() {
|
|
33
25
|
var _a;
|
|
34
|
-
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new
|
|
26
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new WebhooksClient(this._options)));
|
|
35
27
|
}
|
|
36
28
|
get apiKeys() {
|
|
37
29
|
var _a;
|
|
38
|
-
return ((_a = this._apiKeys) !== null && _a !== void 0 ? _a : (this._apiKeys = new
|
|
30
|
+
return ((_a = this._apiKeys) !== null && _a !== void 0 ? _a : (this._apiKeys = new ApiKeysClient(this._options)));
|
|
39
31
|
}
|
|
40
32
|
get domains() {
|
|
41
33
|
var _a;
|
|
42
|
-
return ((_a = this._domains) !== null && _a !== void 0 ? _a : (this._domains = new
|
|
34
|
+
return ((_a = this._domains) !== null && _a !== void 0 ? _a : (this._domains = new DomainsClient(this._options)));
|
|
43
35
|
}
|
|
44
36
|
get drafts() {
|
|
45
37
|
var _a;
|
|
46
|
-
return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new
|
|
38
|
+
return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new DraftsClient(this._options)));
|
|
47
39
|
}
|
|
48
40
|
get metrics() {
|
|
49
41
|
var _a;
|
|
50
|
-
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new
|
|
42
|
+
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new MetricsClient(this._options)));
|
|
51
43
|
}
|
|
52
44
|
get threads() {
|
|
53
45
|
var _a;
|
|
54
|
-
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new
|
|
46
|
+
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new ThreadsClient(this._options)));
|
|
55
47
|
}
|
|
56
48
|
get websockets() {
|
|
57
49
|
var _a;
|
|
58
|
-
return ((_a = this._websockets) !== null && _a !== void 0 ? _a : (this._websockets = new
|
|
50
|
+
return ((_a = this._websockets) !== null && _a !== void 0 ? _a : (this._websockets = new WebsocketsClient(this._options)));
|
|
59
51
|
}
|
|
60
52
|
}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
2
3
|
import * as core from "../../../../core/index.mjs";
|
|
3
4
|
import * as AgentMail from "../../../index.mjs";
|
|
4
|
-
export declare namespace
|
|
5
|
+
export declare namespace ApiKeysClient {
|
|
5
6
|
interface Options extends BaseClientOptions {
|
|
6
7
|
}
|
|
7
8
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
11
|
+
export declare class ApiKeysClient {
|
|
12
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ApiKeysClient.Options>;
|
|
13
|
+
constructor(options?: ApiKeysClient.Options);
|
|
13
14
|
/**
|
|
14
15
|
* @param {AgentMail.ListApiKeysRequest} request
|
|
15
|
-
* @param {
|
|
16
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* await client.apiKeys.list()
|
|
19
20
|
*/
|
|
20
|
-
list(request?: AgentMail.ListApiKeysRequest, requestOptions?:
|
|
21
|
+
list(request?: AgentMail.ListApiKeysRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListApiKeysResponse>;
|
|
21
22
|
private __list;
|
|
22
23
|
/**
|
|
23
24
|
* @param {AgentMail.CreateApiKeyRequest} request
|
|
24
|
-
* @param {
|
|
25
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
26
|
*
|
|
26
27
|
* @throws {@link AgentMail.ValidationError}
|
|
27
28
|
*
|
|
@@ -30,18 +31,17 @@ export declare class ApiKeys {
|
|
|
30
31
|
* name: "name"
|
|
31
32
|
* })
|
|
32
33
|
*/
|
|
33
|
-
create(request: AgentMail.CreateApiKeyRequest, requestOptions?:
|
|
34
|
+
create(request: AgentMail.CreateApiKeyRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<AgentMail.CreateApiKeyResponse>;
|
|
34
35
|
private __create;
|
|
35
36
|
/**
|
|
36
|
-
* @param {AgentMail.ApiKeyId}
|
|
37
|
-
* @param {
|
|
37
|
+
* @param {AgentMail.ApiKeyId} api_key
|
|
38
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
39
|
*
|
|
39
40
|
* @throws {@link AgentMail.NotFoundError}
|
|
40
41
|
*
|
|
41
42
|
* @example
|
|
42
43
|
* await client.apiKeys.delete("api_key")
|
|
43
44
|
*/
|
|
44
|
-
delete(
|
|
45
|
+
delete(api_key: AgentMail.ApiKeyId, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
45
46
|
private __delete;
|
|
46
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
47
47
|
}
|
|
@@ -8,19 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
import {
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
12
13
|
import * as core from "../../../../core/index.mjs";
|
|
13
14
|
import * as environments from "../../../../environments.mjs";
|
|
14
15
|
import * as errors from "../../../../errors/index.mjs";
|
|
15
16
|
import * as serializers from "../../../../serialization/index.mjs";
|
|
16
17
|
import * as AgentMail from "../../../index.mjs";
|
|
17
|
-
export class
|
|
18
|
-
constructor(
|
|
19
|
-
this._options =
|
|
18
|
+
export class ApiKeysClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* @param {AgentMail.ListApiKeysRequest} request
|
|
23
|
-
* @param {
|
|
24
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
24
25
|
*
|
|
25
26
|
* @example
|
|
26
27
|
* await client.apiKeys.list()
|
|
@@ -30,7 +31,7 @@ export class ApiKeys {
|
|
|
30
31
|
}
|
|
31
32
|
__list() {
|
|
32
33
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
33
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
34
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
34
35
|
const { limit, pageToken } = request;
|
|
35
36
|
const _queryParams = {};
|
|
36
37
|
if (limit != null) {
|
|
@@ -39,7 +40,8 @@ export class ApiKeys {
|
|
|
39
40
|
if (pageToken != null) {
|
|
40
41
|
_queryParams.page_token = pageToken;
|
|
41
42
|
}
|
|
42
|
-
const
|
|
43
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
44
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
43
45
|
const _response = yield core.fetcher({
|
|
44
46
|
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.Production).http, "/v0/api-keys"),
|
|
45
47
|
method: "GET",
|
|
@@ -48,6 +50,8 @@ export class ApiKeys {
|
|
|
48
50
|
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,
|
|
49
51
|
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,
|
|
50
52
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
53
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
54
|
+
logging: this._options.logging,
|
|
51
55
|
});
|
|
52
56
|
if (_response.ok) {
|
|
53
57
|
return {
|
|
@@ -87,7 +91,7 @@ export class ApiKeys {
|
|
|
87
91
|
}
|
|
88
92
|
/**
|
|
89
93
|
* @param {AgentMail.CreateApiKeyRequest} request
|
|
90
|
-
* @param {
|
|
94
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
91
95
|
*
|
|
92
96
|
* @throws {@link AgentMail.ValidationError}
|
|
93
97
|
*
|
|
@@ -101,8 +105,9 @@ export class ApiKeys {
|
|
|
101
105
|
}
|
|
102
106
|
__create(request, requestOptions) {
|
|
103
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
105
|
-
const
|
|
108
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
109
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
110
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
106
111
|
const _response = yield core.fetcher({
|
|
107
112
|
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.Production).http, "/v0/api-keys"),
|
|
108
113
|
method: "POST",
|
|
@@ -119,6 +124,8 @@ export class ApiKeys {
|
|
|
119
124
|
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,
|
|
120
125
|
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,
|
|
121
126
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
127
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
128
|
+
logging: this._options.logging,
|
|
122
129
|
});
|
|
123
130
|
if (_response.ok) {
|
|
124
131
|
return {
|
|
@@ -168,29 +175,32 @@ export class ApiKeys {
|
|
|
168
175
|
});
|
|
169
176
|
}
|
|
170
177
|
/**
|
|
171
|
-
* @param {AgentMail.ApiKeyId}
|
|
172
|
-
* @param {
|
|
178
|
+
* @param {AgentMail.ApiKeyId} api_key
|
|
179
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
173
180
|
*
|
|
174
181
|
* @throws {@link AgentMail.NotFoundError}
|
|
175
182
|
*
|
|
176
183
|
* @example
|
|
177
184
|
* await client.apiKeys.delete("api_key")
|
|
178
185
|
*/
|
|
179
|
-
delete(
|
|
180
|
-
return core.HttpResponsePromise.fromPromise(this.__delete(
|
|
186
|
+
delete(api_key, requestOptions) {
|
|
187
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(api_key, requestOptions));
|
|
181
188
|
}
|
|
182
|
-
__delete(
|
|
189
|
+
__delete(api_key, requestOptions) {
|
|
183
190
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
185
|
-
const
|
|
191
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
192
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
193
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
186
194
|
const _response = yield core.fetcher({
|
|
187
|
-
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.Production).http, `/v0/api-keys/${core.url.encodePathParam(serializers.ApiKeyId.jsonOrThrow(
|
|
195
|
+
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.Production).http, `/v0/api-keys/${core.url.encodePathParam(serializers.ApiKeyId.jsonOrThrow(api_key, { omitUndefined: true }))}`),
|
|
188
196
|
method: "DELETE",
|
|
189
197
|
headers: _headers,
|
|
190
198
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
191
199
|
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,
|
|
192
200
|
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,
|
|
193
201
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
202
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
203
|
+
logging: this._options.logging,
|
|
194
204
|
});
|
|
195
205
|
if (_response.ok) {
|
|
196
206
|
return { data: undefined, rawResponse: _response.rawResponse };
|
|
@@ -230,16 +240,4 @@ export class ApiKeys {
|
|
|
230
240
|
}
|
|
231
241
|
});
|
|
232
242
|
}
|
|
233
|
-
_getAuthorizationHeader() {
|
|
234
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
235
|
-
var _a;
|
|
236
|
-
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env.AGENTMAIL_API_KEY;
|
|
237
|
-
if (bearer == null) {
|
|
238
|
-
throw new errors.AgentMailError({
|
|
239
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a AGENTMAIL_API_KEY environment variable",
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
return `Bearer ${bearer}`;
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
243
|
}
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
2
3
|
import * as core from "../../../../core/index.mjs";
|
|
3
4
|
import * as AgentMail from "../../../index.mjs";
|
|
4
|
-
export declare namespace
|
|
5
|
+
export declare namespace DomainsClient {
|
|
5
6
|
interface Options extends BaseClientOptions {
|
|
6
7
|
}
|
|
7
8
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
11
|
+
export declare class DomainsClient {
|
|
12
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<DomainsClient.Options>;
|
|
13
|
+
constructor(options?: DomainsClient.Options);
|
|
13
14
|
/**
|
|
14
15
|
* @param {AgentMail.ListDomainsRequest} request
|
|
15
|
-
* @param {
|
|
16
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* await client.domains.list()
|
|
19
20
|
*/
|
|
20
|
-
list(request?: AgentMail.ListDomainsRequest, requestOptions?:
|
|
21
|
+
list(request?: AgentMail.ListDomainsRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListDomainsResponse>;
|
|
21
22
|
private __list;
|
|
22
23
|
/**
|
|
23
|
-
* @param {AgentMail.DomainId}
|
|
24
|
-
* @param {
|
|
24
|
+
* @param {AgentMail.DomainId} domain_id
|
|
25
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
26
|
*
|
|
26
27
|
* @throws {@link AgentMail.NotFoundError}
|
|
27
28
|
*
|
|
28
29
|
* @example
|
|
29
30
|
* await client.domains.get("domain_id")
|
|
30
31
|
*/
|
|
31
|
-
get(
|
|
32
|
+
get(domain_id: AgentMail.DomainId, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
|
|
32
33
|
private __get;
|
|
33
34
|
/**
|
|
34
35
|
* @throws {@link AgentMail.NotFoundError}
|
|
35
36
|
*/
|
|
36
|
-
getZoneFile(
|
|
37
|
+
getZoneFile(domain_id: AgentMail.DomainId, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
37
38
|
private __getZoneFile;
|
|
38
39
|
/**
|
|
39
40
|
* @param {AgentMail.CreateDomainRequest} request
|
|
40
|
-
* @param {
|
|
41
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
41
42
|
*
|
|
42
43
|
* @throws {@link AgentMail.ValidationError}
|
|
43
44
|
*
|
|
@@ -47,29 +48,28 @@ export declare class Domains {
|
|
|
47
48
|
* feedbackEnabled: true
|
|
48
49
|
* })
|
|
49
50
|
*/
|
|
50
|
-
create(request: AgentMail.CreateDomainRequest, requestOptions?:
|
|
51
|
+
create(request: AgentMail.CreateDomainRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
|
|
51
52
|
private __create;
|
|
52
53
|
/**
|
|
53
|
-
* @param {AgentMail.DomainId}
|
|
54
|
-
* @param {
|
|
54
|
+
* @param {AgentMail.DomainId} domain_id
|
|
55
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
56
|
*
|
|
56
57
|
* @throws {@link AgentMail.NotFoundError}
|
|
57
58
|
*
|
|
58
59
|
* @example
|
|
59
60
|
* await client.domains.delete("domain_id")
|
|
60
61
|
*/
|
|
61
|
-
delete(
|
|
62
|
+
delete(domain_id: AgentMail.DomainId, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
62
63
|
private __delete;
|
|
63
64
|
/**
|
|
64
|
-
* @param {AgentMail.DomainId}
|
|
65
|
-
* @param {
|
|
65
|
+
* @param {AgentMail.DomainId} domain_id
|
|
66
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
67
|
*
|
|
67
68
|
* @throws {@link AgentMail.NotFoundError}
|
|
68
69
|
*
|
|
69
70
|
* @example
|
|
70
71
|
* await client.domains.verify("domain_id")
|
|
71
72
|
*/
|
|
72
|
-
verify(
|
|
73
|
+
verify(domain_id: AgentMail.DomainId, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
73
74
|
private __verify;
|
|
74
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
75
75
|
}
|