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
|
@@ -43,7 +43,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.
|
|
46
|
+
exports.InboxesClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
47
48
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
49
|
const core = __importStar(require("../../../../core/index.js"));
|
|
49
50
|
const environments = __importStar(require("../../../../environments.js"));
|
|
@@ -54,29 +55,29 @@ const Client_js_1 = require("../resources/drafts/client/Client.js");
|
|
|
54
55
|
const Client_js_2 = require("../resources/messages/client/Client.js");
|
|
55
56
|
const Client_js_3 = require("../resources/metrics/client/Client.js");
|
|
56
57
|
const Client_js_4 = require("../resources/threads/client/Client.js");
|
|
57
|
-
class
|
|
58
|
-
constructor(
|
|
59
|
-
this._options =
|
|
58
|
+
class InboxesClient {
|
|
59
|
+
constructor(options = {}) {
|
|
60
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
60
61
|
}
|
|
61
62
|
get threads() {
|
|
62
63
|
var _a;
|
|
63
|
-
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new Client_js_4.
|
|
64
|
+
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new Client_js_4.ThreadsClient(this._options)));
|
|
64
65
|
}
|
|
65
66
|
get messages() {
|
|
66
67
|
var _a;
|
|
67
|
-
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_js_2.
|
|
68
|
+
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_js_2.MessagesClient(this._options)));
|
|
68
69
|
}
|
|
69
70
|
get drafts() {
|
|
70
71
|
var _a;
|
|
71
|
-
return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new Client_js_1.
|
|
72
|
+
return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new Client_js_1.DraftsClient(this._options)));
|
|
72
73
|
}
|
|
73
74
|
get metrics() {
|
|
74
75
|
var _a;
|
|
75
|
-
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_js_3.
|
|
76
|
+
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_js_3.MetricsClient(this._options)));
|
|
76
77
|
}
|
|
77
78
|
/**
|
|
78
79
|
* @param {AgentMail.inboxes.ListInboxesRequest} request
|
|
79
|
-
* @param {
|
|
80
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
81
|
*
|
|
81
82
|
* @example
|
|
82
83
|
* await client.inboxes.list()
|
|
@@ -86,7 +87,7 @@ class Inboxes {
|
|
|
86
87
|
}
|
|
87
88
|
__list() {
|
|
88
89
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
89
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
90
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
90
91
|
const { limit, pageToken } = request;
|
|
91
92
|
const _queryParams = {};
|
|
92
93
|
if (limit != null) {
|
|
@@ -95,7 +96,8 @@ class Inboxes {
|
|
|
95
96
|
if (pageToken != null) {
|
|
96
97
|
_queryParams.page_token = pageToken;
|
|
97
98
|
}
|
|
98
|
-
const
|
|
99
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
100
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
99
101
|
const _response = yield core.fetcher({
|
|
100
102
|
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/inboxes"),
|
|
101
103
|
method: "GET",
|
|
@@ -104,6 +106,8 @@ class Inboxes {
|
|
|
104
106
|
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,
|
|
105
107
|
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,
|
|
106
108
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
109
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
110
|
+
logging: this._options.logging,
|
|
107
111
|
});
|
|
108
112
|
if (_response.ok) {
|
|
109
113
|
return {
|
|
@@ -142,29 +146,32 @@ class Inboxes {
|
|
|
142
146
|
});
|
|
143
147
|
}
|
|
144
148
|
/**
|
|
145
|
-
* @param {AgentMail.inboxes.InboxId}
|
|
146
|
-
* @param {
|
|
149
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
150
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
147
151
|
*
|
|
148
152
|
* @throws {@link AgentMail.NotFoundError}
|
|
149
153
|
*
|
|
150
154
|
* @example
|
|
151
155
|
* await client.inboxes.get("inbox_id")
|
|
152
156
|
*/
|
|
153
|
-
get(
|
|
154
|
-
return core.HttpResponsePromise.fromPromise(this.__get(
|
|
157
|
+
get(inbox_id, requestOptions) {
|
|
158
|
+
return core.HttpResponsePromise.fromPromise(this.__get(inbox_id, requestOptions));
|
|
155
159
|
}
|
|
156
|
-
__get(
|
|
160
|
+
__get(inbox_id, requestOptions) {
|
|
157
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
159
|
-
const
|
|
162
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
163
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
164
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
160
165
|
const _response = yield core.fetcher({
|
|
161
|
-
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/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(
|
|
166
|
+
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/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}`),
|
|
162
167
|
method: "GET",
|
|
163
168
|
headers: _headers,
|
|
164
169
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
165
170
|
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,
|
|
166
171
|
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,
|
|
167
172
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
173
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
174
|
+
logging: this._options.logging,
|
|
168
175
|
});
|
|
169
176
|
if (_response.ok) {
|
|
170
177
|
return {
|
|
@@ -215,7 +222,7 @@ class Inboxes {
|
|
|
215
222
|
}
|
|
216
223
|
/**
|
|
217
224
|
* @param {AgentMail.inboxes.CreateInboxRequest} request
|
|
218
|
-
* @param {
|
|
225
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
219
226
|
*
|
|
220
227
|
* @throws {@link AgentMail.ValidationError}
|
|
221
228
|
*
|
|
@@ -227,8 +234,9 @@ class Inboxes {
|
|
|
227
234
|
}
|
|
228
235
|
__create(request, requestOptions) {
|
|
229
236
|
return __awaiter(this, void 0, void 0, function* () {
|
|
230
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
231
|
-
const
|
|
237
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
238
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
239
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
232
240
|
const _response = yield core.fetcher({
|
|
233
241
|
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/inboxes"),
|
|
234
242
|
method: "POST",
|
|
@@ -245,6 +253,8 @@ class Inboxes {
|
|
|
245
253
|
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,
|
|
246
254
|
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,
|
|
247
255
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
256
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
257
|
+
logging: this._options.logging,
|
|
248
258
|
});
|
|
249
259
|
if (_response.ok) {
|
|
250
260
|
return {
|
|
@@ -294,9 +304,9 @@ class Inboxes {
|
|
|
294
304
|
});
|
|
295
305
|
}
|
|
296
306
|
/**
|
|
297
|
-
* @param {AgentMail.inboxes.InboxId}
|
|
307
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
298
308
|
* @param {AgentMail.inboxes.UpdateInboxRequest} request
|
|
299
|
-
* @param {
|
|
309
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
300
310
|
*
|
|
301
311
|
* @throws {@link AgentMail.NotFoundError}
|
|
302
312
|
*
|
|
@@ -305,15 +315,16 @@ class Inboxes {
|
|
|
305
315
|
* displayName: "display_name"
|
|
306
316
|
* })
|
|
307
317
|
*/
|
|
308
|
-
update(
|
|
309
|
-
return core.HttpResponsePromise.fromPromise(this.__update(
|
|
318
|
+
update(inbox_id, request, requestOptions) {
|
|
319
|
+
return core.HttpResponsePromise.fromPromise(this.__update(inbox_id, request, requestOptions));
|
|
310
320
|
}
|
|
311
|
-
__update(
|
|
321
|
+
__update(inbox_id, request, requestOptions) {
|
|
312
322
|
return __awaiter(this, void 0, void 0, function* () {
|
|
313
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
314
|
-
const
|
|
323
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
324
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
325
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
315
326
|
const _response = yield core.fetcher({
|
|
316
|
-
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/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(
|
|
327
|
+
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/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}`),
|
|
317
328
|
method: "PATCH",
|
|
318
329
|
headers: _headers,
|
|
319
330
|
contentType: "application/json",
|
|
@@ -328,6 +339,8 @@ class Inboxes {
|
|
|
328
339
|
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,
|
|
329
340
|
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,
|
|
330
341
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
342
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
343
|
+
logging: this._options.logging,
|
|
331
344
|
});
|
|
332
345
|
if (_response.ok) {
|
|
333
346
|
return {
|
|
@@ -377,29 +390,32 @@ class Inboxes {
|
|
|
377
390
|
});
|
|
378
391
|
}
|
|
379
392
|
/**
|
|
380
|
-
* @param {AgentMail.inboxes.InboxId}
|
|
381
|
-
* @param {
|
|
393
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
394
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
382
395
|
*
|
|
383
396
|
* @throws {@link AgentMail.NotFoundError}
|
|
384
397
|
*
|
|
385
398
|
* @example
|
|
386
399
|
* await client.inboxes.delete("inbox_id")
|
|
387
400
|
*/
|
|
388
|
-
delete(
|
|
389
|
-
return core.HttpResponsePromise.fromPromise(this.__delete(
|
|
401
|
+
delete(inbox_id, requestOptions) {
|
|
402
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, requestOptions));
|
|
390
403
|
}
|
|
391
|
-
__delete(
|
|
404
|
+
__delete(inbox_id, requestOptions) {
|
|
392
405
|
return __awaiter(this, void 0, void 0, function* () {
|
|
393
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
394
|
-
const
|
|
406
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
407
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
408
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
395
409
|
const _response = yield core.fetcher({
|
|
396
|
-
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/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(
|
|
410
|
+
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/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}`),
|
|
397
411
|
method: "DELETE",
|
|
398
412
|
headers: _headers,
|
|
399
413
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
400
414
|
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,
|
|
401
415
|
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,
|
|
402
416
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
417
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
418
|
+
logging: this._options.logging,
|
|
403
419
|
});
|
|
404
420
|
if (_response.ok) {
|
|
405
421
|
return { data: undefined, rawResponse: _response.rawResponse };
|
|
@@ -439,17 +455,5 @@ class Inboxes {
|
|
|
439
455
|
}
|
|
440
456
|
});
|
|
441
457
|
}
|
|
442
|
-
_getAuthorizationHeader() {
|
|
443
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
444
|
-
var _a;
|
|
445
|
-
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;
|
|
446
|
-
if (bearer == null) {
|
|
447
|
-
throw new errors.AgentMailError({
|
|
448
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a AGENTMAIL_API_KEY environment variable",
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
return `Bearer ${bearer}`;
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
458
|
}
|
|
455
|
-
exports.
|
|
459
|
+
exports.InboxesClient = InboxesClient;
|
|
@@ -1,69 +1,70 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
|
|
2
3
|
import * as core from "../../../../../../core/index.js";
|
|
3
4
|
import * as AgentMail from "../../../../../index.js";
|
|
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.inboxes.InboxId}
|
|
15
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
15
16
|
* @param {AgentMail.inboxes.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.inboxes.drafts.list("inbox_id")
|
|
22
23
|
*/
|
|
23
|
-
list(
|
|
24
|
+
list(inbox_id: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListDraftsRequest, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListDraftsResponse>;
|
|
24
25
|
private __list;
|
|
25
26
|
/**
|
|
26
|
-
* @param {AgentMail.inboxes.InboxId}
|
|
27
|
-
* @param {AgentMail.DraftId}
|
|
28
|
-
* @param {
|
|
27
|
+
* @param {AgentMail.inboxes.InboxId} inbox_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.inboxes.drafts.get("inbox_id", "draft_id")
|
|
34
35
|
*/
|
|
35
|
-
get(
|
|
36
|
+
get(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
|
|
36
37
|
private __get;
|
|
37
38
|
/**
|
|
38
|
-
* @param {AgentMail.inboxes.InboxId}
|
|
39
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
39
40
|
* @param {AgentMail.CreateDraftRequest} request
|
|
40
|
-
* @param {
|
|
41
|
+
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
41
42
|
*
|
|
42
43
|
* @throws {@link AgentMail.NotFoundError}
|
|
43
44
|
*
|
|
44
45
|
* @example
|
|
45
46
|
* await client.inboxes.drafts.create("inbox_id", {})
|
|
46
47
|
*/
|
|
47
|
-
create(
|
|
48
|
+
create(inbox_id: AgentMail.inboxes.InboxId, request: AgentMail.CreateDraftRequest, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
|
|
48
49
|
private __create;
|
|
49
50
|
/**
|
|
50
|
-
* @param {AgentMail.inboxes.InboxId}
|
|
51
|
-
* @param {AgentMail.DraftId}
|
|
51
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
52
|
+
* @param {AgentMail.DraftId} draft_id
|
|
52
53
|
* @param {AgentMail.UpdateDraftRequest} request
|
|
53
|
-
* @param {
|
|
54
|
+
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
55
|
*
|
|
55
56
|
* @throws {@link AgentMail.NotFoundError}
|
|
56
57
|
*
|
|
57
58
|
* @example
|
|
58
59
|
* await client.inboxes.drafts.update("inbox_id", "draft_id", {})
|
|
59
60
|
*/
|
|
60
|
-
update(
|
|
61
|
+
update(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, request: AgentMail.UpdateDraftRequest, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
|
|
61
62
|
private __update;
|
|
62
63
|
/**
|
|
63
|
-
* @param {AgentMail.inboxes.InboxId}
|
|
64
|
-
* @param {AgentMail.DraftId}
|
|
64
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
65
|
+
* @param {AgentMail.DraftId} draft_id
|
|
65
66
|
* @param {AgentMail.UpdateMessageRequest} request
|
|
66
|
-
* @param {
|
|
67
|
+
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
68
|
*
|
|
68
69
|
* @throws {@link AgentMail.NotFoundError}
|
|
69
70
|
* @throws {@link AgentMail.ValidationError}
|
|
@@ -72,19 +73,18 @@ export declare class Drafts {
|
|
|
72
73
|
* @example
|
|
73
74
|
* await client.inboxes.drafts.send("inbox_id", "draft_id", {})
|
|
74
75
|
*/
|
|
75
|
-
send(
|
|
76
|
+
send(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, request: AgentMail.UpdateMessageRequest, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
|
|
76
77
|
private __send;
|
|
77
78
|
/**
|
|
78
|
-
* @param {AgentMail.inboxes.InboxId}
|
|
79
|
-
* @param {AgentMail.DraftId}
|
|
80
|
-
* @param {
|
|
79
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
80
|
+
* @param {AgentMail.DraftId} draft_id
|
|
81
|
+
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
81
82
|
*
|
|
82
83
|
* @throws {@link AgentMail.NotFoundError}
|
|
83
84
|
*
|
|
84
85
|
* @example
|
|
85
86
|
* await client.inboxes.drafts.delete("inbox_id", "draft_id")
|
|
86
87
|
*/
|
|
87
|
-
delete(
|
|
88
|
+
delete(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
88
89
|
private __delete;
|
|
89
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
90
90
|
}
|