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,31 +1,32 @@
|
|
|
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
|
-
* @param {AgentMail.pods.PodId}
|
|
15
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
15
16
|
* @param {AgentMail.pods.ListDomainsRequest} request
|
|
16
|
-
* @param {
|
|
17
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
18
|
*
|
|
18
19
|
* @throws {@link AgentMail.NotFoundError}
|
|
19
20
|
*
|
|
20
21
|
* @example
|
|
21
22
|
* await client.pods.domains.list("pod_id")
|
|
22
23
|
*/
|
|
23
|
-
list(
|
|
24
|
+
list(pod_id: AgentMail.pods.PodId, request?: AgentMail.pods.ListDomainsRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListDomainsResponse>;
|
|
24
25
|
private __list;
|
|
25
26
|
/**
|
|
26
|
-
* @param {AgentMail.pods.PodId}
|
|
27
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
27
28
|
* @param {AgentMail.CreateDomainRequest} request
|
|
28
|
-
* @param {
|
|
29
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
30
|
*
|
|
30
31
|
* @throws {@link AgentMail.ValidationError}
|
|
31
32
|
*
|
|
@@ -35,19 +36,18 @@ export declare class Domains {
|
|
|
35
36
|
* feedbackEnabled: true
|
|
36
37
|
* })
|
|
37
38
|
*/
|
|
38
|
-
create(
|
|
39
|
+
create(pod_id: AgentMail.pods.PodId, request: AgentMail.CreateDomainRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
|
|
39
40
|
private __create;
|
|
40
41
|
/**
|
|
41
|
-
* @param {AgentMail.pods.PodId}
|
|
42
|
-
* @param {AgentMail.DomainId}
|
|
43
|
-
* @param {
|
|
42
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
43
|
+
* @param {AgentMail.DomainId} domain_id
|
|
44
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
45
|
*
|
|
45
46
|
* @throws {@link AgentMail.NotFoundError}
|
|
46
47
|
*
|
|
47
48
|
* @example
|
|
48
49
|
* await client.pods.domains.delete("pod_id", "domain_id")
|
|
49
50
|
*/
|
|
50
|
-
delete(
|
|
51
|
+
delete(pod_id: AgentMail.pods.PodId, domain_id: AgentMail.DomainId, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
51
52
|
private __delete;
|
|
52
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
53
53
|
}
|
|
@@ -8,33 +8,34 @@ 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 { toJson } from "../../../../../../core/json.mjs";
|
|
14
15
|
import * as environments from "../../../../../../environments.mjs";
|
|
15
16
|
import * as errors from "../../../../../../errors/index.mjs";
|
|
16
17
|
import * as serializers from "../../../../../../serialization/index.mjs";
|
|
17
18
|
import * as AgentMail from "../../../../../index.mjs";
|
|
18
|
-
export class
|
|
19
|
-
constructor(
|
|
20
|
-
this._options =
|
|
19
|
+
export class DomainsClient {
|
|
20
|
+
constructor(options = {}) {
|
|
21
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
|
-
* @param {AgentMail.pods.PodId}
|
|
24
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
24
25
|
* @param {AgentMail.pods.ListDomainsRequest} request
|
|
25
|
-
* @param {
|
|
26
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
27
|
*
|
|
27
28
|
* @throws {@link AgentMail.NotFoundError}
|
|
28
29
|
*
|
|
29
30
|
* @example
|
|
30
31
|
* await client.pods.domains.list("pod_id")
|
|
31
32
|
*/
|
|
32
|
-
list(
|
|
33
|
-
return core.HttpResponsePromise.fromPromise(this.__list(
|
|
33
|
+
list(pod_id, request = {}, requestOptions) {
|
|
34
|
+
return core.HttpResponsePromise.fromPromise(this.__list(pod_id, request, requestOptions));
|
|
34
35
|
}
|
|
35
|
-
__list(
|
|
36
|
-
return __awaiter(this, arguments, void 0, function* (
|
|
37
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
36
|
+
__list(pod_id_1) {
|
|
37
|
+
return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
38
39
|
const { limit, pageToken, labels, before, after, ascending } = request;
|
|
39
40
|
const _queryParams = {};
|
|
40
41
|
if (limit != null) {
|
|
@@ -60,15 +61,18 @@ export class Domains {
|
|
|
60
61
|
if (ascending != null) {
|
|
61
62
|
_queryParams.ascending = ascending.toString();
|
|
62
63
|
}
|
|
63
|
-
const
|
|
64
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
65
|
+
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);
|
|
64
66
|
const _response = yield core.fetcher({
|
|
65
|
-
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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(
|
|
67
|
+
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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/domains`),
|
|
66
68
|
method: "GET",
|
|
67
69
|
headers: _headers,
|
|
68
70
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
69
71
|
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,
|
|
70
72
|
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,
|
|
71
73
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
74
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
75
|
+
logging: this._options.logging,
|
|
72
76
|
});
|
|
73
77
|
if (_response.ok) {
|
|
74
78
|
return {
|
|
@@ -118,9 +122,9 @@ export class Domains {
|
|
|
118
122
|
});
|
|
119
123
|
}
|
|
120
124
|
/**
|
|
121
|
-
* @param {AgentMail.pods.PodId}
|
|
125
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
122
126
|
* @param {AgentMail.CreateDomainRequest} request
|
|
123
|
-
* @param {
|
|
127
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
124
128
|
*
|
|
125
129
|
* @throws {@link AgentMail.ValidationError}
|
|
126
130
|
*
|
|
@@ -130,15 +134,16 @@ export class Domains {
|
|
|
130
134
|
* feedbackEnabled: true
|
|
131
135
|
* })
|
|
132
136
|
*/
|
|
133
|
-
create(
|
|
134
|
-
return core.HttpResponsePromise.fromPromise(this.__create(
|
|
137
|
+
create(pod_id, request, requestOptions) {
|
|
138
|
+
return core.HttpResponsePromise.fromPromise(this.__create(pod_id, request, requestOptions));
|
|
135
139
|
}
|
|
136
|
-
__create(
|
|
140
|
+
__create(pod_id, request, requestOptions) {
|
|
137
141
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
139
|
-
const
|
|
142
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
143
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
144
|
+
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);
|
|
140
145
|
const _response = yield core.fetcher({
|
|
141
|
-
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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(
|
|
146
|
+
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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/domains`),
|
|
142
147
|
method: "POST",
|
|
143
148
|
headers: _headers,
|
|
144
149
|
contentType: "application/json",
|
|
@@ -153,6 +158,8 @@ export class Domains {
|
|
|
153
158
|
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,
|
|
154
159
|
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,
|
|
155
160
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
161
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
162
|
+
logging: this._options.logging,
|
|
156
163
|
});
|
|
157
164
|
if (_response.ok) {
|
|
158
165
|
return {
|
|
@@ -202,30 +209,33 @@ export class Domains {
|
|
|
202
209
|
});
|
|
203
210
|
}
|
|
204
211
|
/**
|
|
205
|
-
* @param {AgentMail.pods.PodId}
|
|
206
|
-
* @param {AgentMail.DomainId}
|
|
207
|
-
* @param {
|
|
212
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
213
|
+
* @param {AgentMail.DomainId} domain_id
|
|
214
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
208
215
|
*
|
|
209
216
|
* @throws {@link AgentMail.NotFoundError}
|
|
210
217
|
*
|
|
211
218
|
* @example
|
|
212
219
|
* await client.pods.domains.delete("pod_id", "domain_id")
|
|
213
220
|
*/
|
|
214
|
-
delete(
|
|
215
|
-
return core.HttpResponsePromise.fromPromise(this.__delete(
|
|
221
|
+
delete(pod_id, domain_id, requestOptions) {
|
|
222
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(pod_id, domain_id, requestOptions));
|
|
216
223
|
}
|
|
217
|
-
__delete(
|
|
224
|
+
__delete(pod_id, domain_id, requestOptions) {
|
|
218
225
|
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
220
|
-
const
|
|
226
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
227
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
228
|
+
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);
|
|
221
229
|
const _response = yield core.fetcher({
|
|
222
|
-
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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(
|
|
230
|
+
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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/domains/${core.url.encodePathParam(serializers.DomainId.jsonOrThrow(domain_id, { omitUndefined: true }))}`),
|
|
223
231
|
method: "DELETE",
|
|
224
232
|
headers: _headers,
|
|
225
233
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
226
234
|
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,
|
|
227
235
|
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,
|
|
228
236
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
237
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
238
|
+
logging: this._options.logging,
|
|
229
239
|
});
|
|
230
240
|
if (_response.ok) {
|
|
231
241
|
return { data: undefined, rawResponse: _response.rawResponse };
|
|
@@ -265,16 +275,4 @@ export class Domains {
|
|
|
265
275
|
}
|
|
266
276
|
});
|
|
267
277
|
}
|
|
268
|
-
_getAuthorizationHeader() {
|
|
269
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
270
|
-
var _a;
|
|
271
|
-
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;
|
|
272
|
-
if (bearer == null) {
|
|
273
|
-
throw new errors.AgentMailError({
|
|
274
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a AGENTMAIL_API_KEY environment variable",
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
return `Bearer ${bearer}`;
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
278
|
}
|
|
@@ -1,38 +1,38 @@
|
|
|
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 DraftsClient {
|
|
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 DraftsClient {
|
|
12
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<DraftsClient.Options>;
|
|
13
|
+
constructor(options?: DraftsClient.Options);
|
|
13
14
|
/**
|
|
14
|
-
* @param {AgentMail.pods.PodId}
|
|
15
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
15
16
|
* @param {AgentMail.pods.ListDraftsRequest} request
|
|
16
|
-
* @param {
|
|
17
|
+
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
18
|
*
|
|
18
19
|
* @throws {@link AgentMail.NotFoundError}
|
|
19
20
|
*
|
|
20
21
|
* @example
|
|
21
22
|
* await client.pods.drafts.list("pod_id")
|
|
22
23
|
*/
|
|
23
|
-
list(
|
|
24
|
+
list(pod_id: AgentMail.pods.PodId, request?: AgentMail.pods.ListDraftsRequest, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListDraftsResponse>;
|
|
24
25
|
private __list;
|
|
25
26
|
/**
|
|
26
|
-
* @param {AgentMail.pods.PodId}
|
|
27
|
-
* @param {AgentMail.DraftId}
|
|
28
|
-
* @param {
|
|
27
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
28
|
+
* @param {AgentMail.DraftId} draft_id
|
|
29
|
+
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
30
|
*
|
|
30
31
|
* @throws {@link AgentMail.NotFoundError}
|
|
31
32
|
*
|
|
32
33
|
* @example
|
|
33
34
|
* await client.pods.drafts.get("pod_id", "draft_id")
|
|
34
35
|
*/
|
|
35
|
-
get(
|
|
36
|
+
get(pod_id: AgentMail.pods.PodId, draft_id: AgentMail.DraftId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
|
|
36
37
|
private __get;
|
|
37
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
38
38
|
}
|
|
@@ -8,33 +8,34 @@ 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 { toJson } from "../../../../../../core/json.mjs";
|
|
14
15
|
import * as environments from "../../../../../../environments.mjs";
|
|
15
16
|
import * as errors from "../../../../../../errors/index.mjs";
|
|
16
17
|
import * as serializers from "../../../../../../serialization/index.mjs";
|
|
17
18
|
import * as AgentMail from "../../../../../index.mjs";
|
|
18
|
-
export class
|
|
19
|
-
constructor(
|
|
20
|
-
this._options =
|
|
19
|
+
export class DraftsClient {
|
|
20
|
+
constructor(options = {}) {
|
|
21
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
|
-
* @param {AgentMail.pods.PodId}
|
|
24
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
24
25
|
* @param {AgentMail.pods.ListDraftsRequest} request
|
|
25
|
-
* @param {
|
|
26
|
+
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
27
|
*
|
|
27
28
|
* @throws {@link AgentMail.NotFoundError}
|
|
28
29
|
*
|
|
29
30
|
* @example
|
|
30
31
|
* await client.pods.drafts.list("pod_id")
|
|
31
32
|
*/
|
|
32
|
-
list(
|
|
33
|
-
return core.HttpResponsePromise.fromPromise(this.__list(
|
|
33
|
+
list(pod_id, request = {}, requestOptions) {
|
|
34
|
+
return core.HttpResponsePromise.fromPromise(this.__list(pod_id, request, requestOptions));
|
|
34
35
|
}
|
|
35
|
-
__list(
|
|
36
|
-
return __awaiter(this, arguments, void 0, function* (
|
|
37
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
36
|
+
__list(pod_id_1) {
|
|
37
|
+
return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
38
39
|
const { limit, pageToken, labels, before, after, ascending } = request;
|
|
39
40
|
const _queryParams = {};
|
|
40
41
|
if (limit != null) {
|
|
@@ -60,15 +61,18 @@ export class Drafts {
|
|
|
60
61
|
if (ascending != null) {
|
|
61
62
|
_queryParams.ascending = ascending.toString();
|
|
62
63
|
}
|
|
63
|
-
const
|
|
64
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
65
|
+
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);
|
|
64
66
|
const _response = yield core.fetcher({
|
|
65
|
-
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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(
|
|
67
|
+
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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/drafts`),
|
|
66
68
|
method: "GET",
|
|
67
69
|
headers: _headers,
|
|
68
70
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
69
71
|
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,
|
|
70
72
|
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,
|
|
71
73
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
74
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
75
|
+
logging: this._options.logging,
|
|
72
76
|
});
|
|
73
77
|
if (_response.ok) {
|
|
74
78
|
return {
|
|
@@ -118,30 +122,33 @@ export class Drafts {
|
|
|
118
122
|
});
|
|
119
123
|
}
|
|
120
124
|
/**
|
|
121
|
-
* @param {AgentMail.pods.PodId}
|
|
122
|
-
* @param {AgentMail.DraftId}
|
|
123
|
-
* @param {
|
|
125
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
126
|
+
* @param {AgentMail.DraftId} draft_id
|
|
127
|
+
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
124
128
|
*
|
|
125
129
|
* @throws {@link AgentMail.NotFoundError}
|
|
126
130
|
*
|
|
127
131
|
* @example
|
|
128
132
|
* await client.pods.drafts.get("pod_id", "draft_id")
|
|
129
133
|
*/
|
|
130
|
-
get(
|
|
131
|
-
return core.HttpResponsePromise.fromPromise(this.__get(
|
|
134
|
+
get(pod_id, draft_id, requestOptions) {
|
|
135
|
+
return core.HttpResponsePromise.fromPromise(this.__get(pod_id, draft_id, requestOptions));
|
|
132
136
|
}
|
|
133
|
-
__get(
|
|
137
|
+
__get(pod_id, draft_id, requestOptions) {
|
|
134
138
|
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
136
|
-
const
|
|
139
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
140
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
141
|
+
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);
|
|
137
142
|
const _response = yield core.fetcher({
|
|
138
|
-
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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(
|
|
143
|
+
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/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}`),
|
|
139
144
|
method: "GET",
|
|
140
145
|
headers: _headers,
|
|
141
146
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
142
147
|
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,
|
|
143
148
|
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,
|
|
144
149
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
150
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
151
|
+
logging: this._options.logging,
|
|
145
152
|
});
|
|
146
153
|
if (_response.ok) {
|
|
147
154
|
return {
|
|
@@ -190,16 +197,4 @@ export class Drafts {
|
|
|
190
197
|
}
|
|
191
198
|
});
|
|
192
199
|
}
|
|
193
|
-
_getAuthorizationHeader() {
|
|
194
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
195
|
-
var _a;
|
|
196
|
-
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;
|
|
197
|
-
if (bearer == null) {
|
|
198
|
-
throw new errors.AgentMailError({
|
|
199
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a AGENTMAIL_API_KEY environment variable",
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
return `Bearer ${bearer}`;
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
200
|
}
|
|
@@ -1,62 +1,62 @@
|
|
|
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 InboxesClient {
|
|
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 InboxesClient {
|
|
12
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<InboxesClient.Options>;
|
|
13
|
+
constructor(options?: InboxesClient.Options);
|
|
13
14
|
/**
|
|
14
|
-
* @param {AgentMail.pods.PodId}
|
|
15
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
15
16
|
* @param {AgentMail.pods.ListInboxesRequest} request
|
|
16
|
-
* @param {
|
|
17
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
18
|
*
|
|
18
19
|
* @throws {@link AgentMail.NotFoundError}
|
|
19
20
|
*
|
|
20
21
|
* @example
|
|
21
22
|
* await client.pods.inboxes.list("pod_id")
|
|
22
23
|
*/
|
|
23
|
-
list(
|
|
24
|
+
list(pod_id: AgentMail.pods.PodId, request?: AgentMail.pods.ListInboxesRequest, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.ListInboxesResponse>;
|
|
24
25
|
private __list;
|
|
25
26
|
/**
|
|
26
|
-
* @param {AgentMail.pods.PodId}
|
|
27
|
-
* @param {AgentMail.inboxes.InboxId}
|
|
28
|
-
* @param {
|
|
27
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
28
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
29
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
30
|
*
|
|
30
31
|
* @throws {@link AgentMail.NotFoundError}
|
|
31
32
|
*
|
|
32
33
|
* @example
|
|
33
34
|
* await client.pods.inboxes.get("pod_id", "inbox_id")
|
|
34
35
|
*/
|
|
35
|
-
get(
|
|
36
|
+
get(pod_id: AgentMail.pods.PodId, inbox_id: AgentMail.inboxes.InboxId, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.Inbox>;
|
|
36
37
|
private __get;
|
|
37
38
|
/**
|
|
38
|
-
* @param {AgentMail.pods.PodId}
|
|
39
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
39
40
|
* @param {AgentMail.inboxes.CreateInboxRequest} request
|
|
40
|
-
* @param {
|
|
41
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
41
42
|
*
|
|
42
43
|
* @throws {@link AgentMail.ValidationError}
|
|
43
44
|
*
|
|
44
45
|
* @example
|
|
45
46
|
* await client.pods.inboxes.create("pod_id", {})
|
|
46
47
|
*/
|
|
47
|
-
create(
|
|
48
|
+
create(pod_id: AgentMail.pods.PodId, request: AgentMail.inboxes.CreateInboxRequest, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.Inbox>;
|
|
48
49
|
private __create;
|
|
49
50
|
/**
|
|
50
|
-
* @param {AgentMail.pods.PodId}
|
|
51
|
-
* @param {AgentMail.inboxes.InboxId}
|
|
52
|
-
* @param {
|
|
51
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
52
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
53
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
54
|
*
|
|
54
55
|
* @throws {@link AgentMail.NotFoundError}
|
|
55
56
|
*
|
|
56
57
|
* @example
|
|
57
58
|
* await client.pods.inboxes.delete("pod_id", "inbox_id")
|
|
58
59
|
*/
|
|
59
|
-
delete(
|
|
60
|
+
delete(pod_id: AgentMail.pods.PodId, inbox_id: AgentMail.inboxes.InboxId, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
60
61
|
private __delete;
|
|
61
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
62
62
|
}
|