agentmail 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/domains/client/Client.d.ts +12 -0
- package/dist/cjs/api/resources/domains/client/Client.js +69 -0
- package/dist/cjs/api/resources/domains/types/UpdateDomainRequest.d.ts +4 -0
- package/dist/cjs/api/resources/domains/types/UpdateDomainRequest.js +3 -0
- package/dist/cjs/api/resources/domains/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/domains/types/index.js +1 -0
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +9 -9
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +50 -50
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +22 -15
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +71 -56
- package/dist/cjs/api/resources/lists/client/Client.d.ts +15 -15
- package/dist/cjs/api/resources/lists/client/Client.js +67 -67
- package/dist/cjs/api/resources/messages/types/RawMessageResponse.d.ts +14 -0
- package/dist/cjs/api/resources/messages/types/RawMessageResponse.js +3 -0
- package/dist/cjs/api/resources/messages/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/types/index.js +1 -0
- package/dist/cjs/api/resources/pods/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/pods/client/Client.js +8 -8
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/Client.d.ts +11 -11
- package/dist/cjs/api/resources/pods/resources/apiKeys/client/Client.js +42 -42
- package/dist/cjs/api/resources/pods/resources/domains/client/Client.d.ts +33 -3
- package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +178 -6
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.d.ts +15 -0
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +72 -0
- package/dist/cjs/api/resources/pods/resources/lists/client/Client.d.ts +16 -16
- package/dist/cjs/api/resources/pods/resources/lists/client/Client.js +67 -67
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.d.ts +15 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +61 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.d.ts +8 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.js +3 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/threads/client/Client.d.ts +14 -0
- package/dist/cjs/api/resources/threads/client/Client.js +60 -0
- package/dist/cjs/api/resources/threads/client/requests/DeleteThreadRequest.d.ts +8 -0
- package/dist/cjs/api/resources/threads/client/requests/DeleteThreadRequest.js +3 -0
- package/dist/cjs/api/resources/threads/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +13 -13
- package/dist/cjs/api/resources/webhooks/client/Client.js +31 -31
- package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.d.ts +10 -0
- package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.js +42 -0
- package/dist/cjs/serialization/resources/domains/types/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/domains/types/index.js +1 -0
- package/dist/cjs/serialization/resources/messages/types/RawMessageResponse.d.ts +14 -0
- package/dist/cjs/serialization/resources/messages/types/RawMessageResponse.js +46 -0
- package/dist/cjs/serialization/resources/messages/types/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/messages/types/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/domains/client/Client.d.mts +12 -0
- package/dist/esm/api/resources/domains/client/Client.mjs +69 -0
- package/dist/esm/api/resources/domains/types/UpdateDomainRequest.d.mts +4 -0
- package/dist/esm/api/resources/domains/types/UpdateDomainRequest.mjs +2 -0
- package/dist/esm/api/resources/domains/types/index.d.mts +1 -0
- package/dist/esm/api/resources/domains/types/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +9 -9
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +50 -50
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +22 -15
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +71 -56
- package/dist/esm/api/resources/lists/client/Client.d.mts +15 -15
- package/dist/esm/api/resources/lists/client/Client.mjs +67 -67
- package/dist/esm/api/resources/messages/types/RawMessageResponse.d.mts +14 -0
- package/dist/esm/api/resources/messages/types/RawMessageResponse.mjs +2 -0
- package/dist/esm/api/resources/messages/types/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/types/index.mjs +1 -0
- package/dist/esm/api/resources/pods/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/pods/client/Client.mjs +8 -8
- package/dist/esm/api/resources/pods/resources/apiKeys/client/Client.d.mts +11 -11
- package/dist/esm/api/resources/pods/resources/apiKeys/client/Client.mjs +42 -42
- package/dist/esm/api/resources/pods/resources/domains/client/Client.d.mts +33 -3
- package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +178 -6
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.d.mts +15 -0
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +72 -0
- package/dist/esm/api/resources/pods/resources/lists/client/Client.d.mts +16 -16
- package/dist/esm/api/resources/pods/resources/lists/client/Client.mjs +67 -67
- package/dist/esm/api/resources/pods/resources/threads/client/Client.d.mts +15 -0
- package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +61 -0
- package/dist/esm/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.d.mts +8 -0
- package/dist/esm/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/threads/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/threads/client/Client.d.mts +14 -0
- package/dist/esm/api/resources/threads/client/Client.mjs +60 -0
- package/dist/esm/api/resources/threads/client/requests/DeleteThreadRequest.d.mts +8 -0
- package/dist/esm/api/resources/threads/client/requests/DeleteThreadRequest.mjs +2 -0
- package/dist/esm/api/resources/threads/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +13 -13
- package/dist/esm/api/resources/webhooks/client/Client.mjs +31 -31
- package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.d.mts +10 -0
- package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.mjs +6 -0
- package/dist/esm/serialization/resources/domains/types/index.d.mts +1 -0
- package/dist/esm/serialization/resources/domains/types/index.mjs +1 -0
- package/dist/esm/serialization/resources/messages/types/RawMessageResponse.d.mts +14 -0
- package/dist/esm/serialization/resources/messages/types/RawMessageResponse.mjs +10 -0
- package/dist/esm/serialization/resources/messages/types/index.d.mts +1 -0
- package/dist/esm/serialization/resources/messages/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms-full.txt +16825 -11774
- package/dist/llms.txt +94 -25
- package/package.json +1 -1
- package/reference.md +570 -117
|
@@ -174,33 +174,34 @@ class WebhooksClient {
|
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
|
-
* @param {AgentMail.webhooks.
|
|
178
|
-
* @param {AgentMail.webhooks.UpdateWebhookRequest} request
|
|
177
|
+
* @param {AgentMail.webhooks.CreateWebhookRequest} request
|
|
179
178
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
180
179
|
*
|
|
181
|
-
* @throws {@link AgentMail.NotFoundError}
|
|
182
180
|
* @throws {@link AgentMail.ValidationError}
|
|
183
181
|
*
|
|
184
182
|
* @example
|
|
185
|
-
* await client.webhooks.
|
|
183
|
+
* await client.webhooks.create({
|
|
184
|
+
* url: "url",
|
|
185
|
+
* eventTypes: ["message.received", "message.received"]
|
|
186
|
+
* })
|
|
186
187
|
*/
|
|
187
|
-
|
|
188
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
188
|
+
create(request, requestOptions) {
|
|
189
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
189
190
|
}
|
|
190
|
-
|
|
191
|
+
__create(request, requestOptions) {
|
|
191
192
|
return __awaiter(this, void 0, void 0, function* () {
|
|
192
193
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
193
194
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
194
195
|
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);
|
|
195
196
|
const _response = yield core.fetcher({
|
|
196
197
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
197
|
-
.http,
|
|
198
|
-
method: "
|
|
198
|
+
.http, "/v0/webhooks"),
|
|
199
|
+
method: "POST",
|
|
199
200
|
headers: _headers,
|
|
200
201
|
contentType: "application/json",
|
|
201
202
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
202
203
|
requestType: "json",
|
|
203
|
-
body: serializers.webhooks.
|
|
204
|
+
body: serializers.webhooks.CreateWebhookRequest.jsonOrThrow(request, {
|
|
204
205
|
unrecognizedObjectKeys: "strip",
|
|
205
206
|
omitUndefined: true,
|
|
206
207
|
}),
|
|
@@ -224,14 +225,6 @@ class WebhooksClient {
|
|
|
224
225
|
}
|
|
225
226
|
if (_response.error.reason === "status-code") {
|
|
226
227
|
switch (_response.error.statusCode) {
|
|
227
|
-
case 404:
|
|
228
|
-
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
229
|
-
unrecognizedObjectKeys: "passthrough",
|
|
230
|
-
allowUnrecognizedUnionMembers: true,
|
|
231
|
-
allowUnrecognizedEnumValues: true,
|
|
232
|
-
skipValidation: true,
|
|
233
|
-
breadcrumbsPrefix: ["response"],
|
|
234
|
-
}), _response.rawResponse);
|
|
235
228
|
case 400:
|
|
236
229
|
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
237
230
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -248,38 +241,37 @@ class WebhooksClient {
|
|
|
248
241
|
});
|
|
249
242
|
}
|
|
250
243
|
}
|
|
251
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
244
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/webhooks");
|
|
252
245
|
});
|
|
253
246
|
}
|
|
254
247
|
/**
|
|
255
|
-
* @param {AgentMail.webhooks.
|
|
248
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
249
|
+
* @param {AgentMail.webhooks.UpdateWebhookRequest} request
|
|
256
250
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
257
251
|
*
|
|
252
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
258
253
|
* @throws {@link AgentMail.ValidationError}
|
|
259
254
|
*
|
|
260
255
|
* @example
|
|
261
|
-
* await client.webhooks.
|
|
262
|
-
* url: "url",
|
|
263
|
-
* eventTypes: ["message.received", "message.received"]
|
|
264
|
-
* })
|
|
256
|
+
* await client.webhooks.update("webhook_id", {})
|
|
265
257
|
*/
|
|
266
|
-
|
|
267
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
258
|
+
update(webhook_id, request, requestOptions) {
|
|
259
|
+
return core.HttpResponsePromise.fromPromise(this.__update(webhook_id, request, requestOptions));
|
|
268
260
|
}
|
|
269
|
-
|
|
261
|
+
__update(webhook_id, request, requestOptions) {
|
|
270
262
|
return __awaiter(this, void 0, void 0, function* () {
|
|
271
263
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
272
264
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
273
265
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
274
266
|
const _response = yield core.fetcher({
|
|
275
267
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
276
|
-
.http,
|
|
277
|
-
method: "
|
|
268
|
+
.http, `/v0/webhooks/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}`),
|
|
269
|
+
method: "PATCH",
|
|
278
270
|
headers: _headers,
|
|
279
271
|
contentType: "application/json",
|
|
280
272
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
281
273
|
requestType: "json",
|
|
282
|
-
body: serializers.webhooks.
|
|
274
|
+
body: serializers.webhooks.UpdateWebhookRequest.jsonOrThrow(request, {
|
|
283
275
|
unrecognizedObjectKeys: "strip",
|
|
284
276
|
omitUndefined: true,
|
|
285
277
|
}),
|
|
@@ -303,6 +295,14 @@ class WebhooksClient {
|
|
|
303
295
|
}
|
|
304
296
|
if (_response.error.reason === "status-code") {
|
|
305
297
|
switch (_response.error.statusCode) {
|
|
298
|
+
case 404:
|
|
299
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
300
|
+
unrecognizedObjectKeys: "passthrough",
|
|
301
|
+
allowUnrecognizedUnionMembers: true,
|
|
302
|
+
allowUnrecognizedEnumValues: true,
|
|
303
|
+
skipValidation: true,
|
|
304
|
+
breadcrumbsPrefix: ["response"],
|
|
305
|
+
}), _response.rawResponse);
|
|
306
306
|
case 400:
|
|
307
307
|
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
308
308
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -319,7 +319,7 @@ class WebhooksClient {
|
|
|
319
319
|
});
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
322
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/webhooks/{webhook_id}");
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
325
|
/**
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.js";
|
|
2
|
+
import * as core from "../../../../core/index.js";
|
|
3
|
+
import type * as serializers from "../../../index.js";
|
|
4
|
+
import { FeedbackEnabled } from "./FeedbackEnabled.js";
|
|
5
|
+
export declare const UpdateDomainRequest: core.serialization.ObjectSchema<serializers.UpdateDomainRequest.Raw, AgentMail.UpdateDomainRequest>;
|
|
6
|
+
export declare namespace UpdateDomainRequest {
|
|
7
|
+
interface Raw {
|
|
8
|
+
feedback_enabled?: FeedbackEnabled.Raw | null;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.UpdateDomainRequest = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
const FeedbackEnabled_js_1 = require("./FeedbackEnabled.js");
|
|
40
|
+
exports.UpdateDomainRequest = core.serialization.object({
|
|
41
|
+
feedbackEnabled: core.serialization.property("feedback_enabled", FeedbackEnabled_js_1.FeedbackEnabled.optional()),
|
|
42
|
+
});
|
|
@@ -8,5 +8,6 @@ export * from "./FeedbackEnabled.js";
|
|
|
8
8
|
export * from "./ListDomainsResponse.js";
|
|
9
9
|
export * from "./RecordStatus.js";
|
|
10
10
|
export * from "./RecordType.js";
|
|
11
|
+
export * from "./UpdateDomainRequest.js";
|
|
11
12
|
export * from "./VerificationRecord.js";
|
|
12
13
|
export * from "./VerificationStatus.js";
|
|
@@ -24,5 +24,6 @@ __exportStar(require("./FeedbackEnabled.js"), exports);
|
|
|
24
24
|
__exportStar(require("./ListDomainsResponse.js"), exports);
|
|
25
25
|
__exportStar(require("./RecordStatus.js"), exports);
|
|
26
26
|
__exportStar(require("./RecordType.js"), exports);
|
|
27
|
+
__exportStar(require("./UpdateDomainRequest.js"), exports);
|
|
27
28
|
__exportStar(require("./VerificationRecord.js"), exports);
|
|
28
29
|
__exportStar(require("./VerificationStatus.js"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.js";
|
|
2
|
+
import * as core from "../../../../core/index.js";
|
|
3
|
+
import type * as serializers from "../../../index.js";
|
|
4
|
+
import { MessageId } from "./MessageId.js";
|
|
5
|
+
import { MessageSize } from "./MessageSize.js";
|
|
6
|
+
export declare const RawMessageResponse: core.serialization.ObjectSchema<serializers.RawMessageResponse.Raw, AgentMail.RawMessageResponse>;
|
|
7
|
+
export declare namespace RawMessageResponse {
|
|
8
|
+
interface Raw {
|
|
9
|
+
message_id: MessageId.Raw;
|
|
10
|
+
size: MessageSize.Raw;
|
|
11
|
+
download_url: string;
|
|
12
|
+
expires_at: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.RawMessageResponse = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
const MessageId_js_1 = require("./MessageId.js");
|
|
40
|
+
const MessageSize_js_1 = require("./MessageSize.js");
|
|
41
|
+
exports.RawMessageResponse = core.serialization.object({
|
|
42
|
+
messageId: core.serialization.property("message_id", MessageId_js_1.MessageId),
|
|
43
|
+
size: MessageSize_js_1.MessageSize,
|
|
44
|
+
downloadUrl: core.serialization.property("download_url", core.serialization.string()),
|
|
45
|
+
expiresAt: core.serialization.property("expires_at", core.serialization.date()),
|
|
46
|
+
});
|
|
@@ -21,6 +21,7 @@ export * from "./MessageText.js";
|
|
|
21
21
|
export * from "./MessageTimestamp.js";
|
|
22
22
|
export * from "./MessageTo.js";
|
|
23
23
|
export * from "./MessageUpdatedAt.js";
|
|
24
|
+
export * from "./RawMessageResponse.js";
|
|
24
25
|
export * from "./ReplyAll.js";
|
|
25
26
|
export * from "./ReplyAllMessageRequest.js";
|
|
26
27
|
export * from "./ReplyToMessageRequest.js";
|
|
@@ -37,6 +37,7 @@ __exportStar(require("./MessageText.js"), exports);
|
|
|
37
37
|
__exportStar(require("./MessageTimestamp.js"), exports);
|
|
38
38
|
__exportStar(require("./MessageTo.js"), exports);
|
|
39
39
|
__exportStar(require("./MessageUpdatedAt.js"), exports);
|
|
40
|
+
__exportStar(require("./RawMessageResponse.js"), exports);
|
|
40
41
|
__exportStar(require("./ReplyAll.js"), exports);
|
|
41
42
|
__exportStar(require("./ReplyAllMessageRequest.js"), exports);
|
|
42
43
|
__exportStar(require("./ReplyToMessageRequest.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.4.
|
|
1
|
+
export declare const SDK_VERSION = "0.4.4";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "agentmail",
|
|
9
|
-
"X-Fern-SDK-Version": "0.4.
|
|
10
|
-
"User-Agent": "agentmail/0.4.
|
|
9
|
+
"X-Fern-SDK-Version": "0.4.4",
|
|
10
|
+
"User-Agent": "agentmail/0.4.4",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -49,6 +49,18 @@ export declare class DomainsClient {
|
|
|
49
49
|
*/
|
|
50
50
|
create(request: AgentMail.CreateDomainRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
|
|
51
51
|
private __create;
|
|
52
|
+
/**
|
|
53
|
+
* @param {AgentMail.DomainId} domain_id
|
|
54
|
+
* @param {AgentMail.UpdateDomainRequest} request
|
|
55
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
|
+
*
|
|
57
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await client.domains.update("domain_id", {})
|
|
61
|
+
*/
|
|
62
|
+
update(domain_id: AgentMail.DomainId, request: AgentMail.UpdateDomainRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
|
|
63
|
+
private __update;
|
|
52
64
|
/**
|
|
53
65
|
* @param {AgentMail.DomainId} domain_id
|
|
54
66
|
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -256,6 +256,75 @@ export class DomainsClient {
|
|
|
256
256
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/domains");
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* @param {AgentMail.DomainId} domain_id
|
|
261
|
+
* @param {AgentMail.UpdateDomainRequest} request
|
|
262
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
263
|
+
*
|
|
264
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* await client.domains.update("domain_id", {})
|
|
268
|
+
*/
|
|
269
|
+
update(domain_id, request, requestOptions) {
|
|
270
|
+
return core.HttpResponsePromise.fromPromise(this.__update(domain_id, request, requestOptions));
|
|
271
|
+
}
|
|
272
|
+
__update(domain_id, request, requestOptions) {
|
|
273
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
274
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
275
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
276
|
+
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);
|
|
277
|
+
const _response = yield core.fetcher({
|
|
278
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
279
|
+
.http, `/v0/domains/${core.url.encodePathParam(serializers.DomainId.jsonOrThrow(domain_id, { omitUndefined: true }))}`),
|
|
280
|
+
method: "PATCH",
|
|
281
|
+
headers: _headers,
|
|
282
|
+
contentType: "application/json",
|
|
283
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
284
|
+
requestType: "json",
|
|
285
|
+
body: serializers.UpdateDomainRequest.jsonOrThrow(request, {
|
|
286
|
+
unrecognizedObjectKeys: "strip",
|
|
287
|
+
omitUndefined: true,
|
|
288
|
+
}),
|
|
289
|
+
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,
|
|
290
|
+
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,
|
|
291
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
292
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
293
|
+
logging: this._options.logging,
|
|
294
|
+
});
|
|
295
|
+
if (_response.ok) {
|
|
296
|
+
return {
|
|
297
|
+
data: serializers.Domain.parseOrThrow(_response.body, {
|
|
298
|
+
unrecognizedObjectKeys: "passthrough",
|
|
299
|
+
allowUnrecognizedUnionMembers: true,
|
|
300
|
+
allowUnrecognizedEnumValues: true,
|
|
301
|
+
skipValidation: true,
|
|
302
|
+
breadcrumbsPrefix: ["response"],
|
|
303
|
+
}),
|
|
304
|
+
rawResponse: _response.rawResponse,
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
if (_response.error.reason === "status-code") {
|
|
308
|
+
switch (_response.error.statusCode) {
|
|
309
|
+
case 404:
|
|
310
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
311
|
+
unrecognizedObjectKeys: "passthrough",
|
|
312
|
+
allowUnrecognizedUnionMembers: true,
|
|
313
|
+
allowUnrecognizedEnumValues: true,
|
|
314
|
+
skipValidation: true,
|
|
315
|
+
breadcrumbsPrefix: ["response"],
|
|
316
|
+
}), _response.rawResponse);
|
|
317
|
+
default:
|
|
318
|
+
throw new errors.AgentMailError({
|
|
319
|
+
statusCode: _response.error.statusCode,
|
|
320
|
+
body: _response.error.body,
|
|
321
|
+
rawResponse: _response.rawResponse,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/domains/{domain_id}");
|
|
326
|
+
});
|
|
327
|
+
}
|
|
259
328
|
/**
|
|
260
329
|
* @param {AgentMail.DomainId} domain_id
|
|
261
330
|
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -8,5 +8,6 @@ export * from "./FeedbackEnabled.mjs";
|
|
|
8
8
|
export * from "./ListDomainsResponse.mjs";
|
|
9
9
|
export * from "./RecordStatus.mjs";
|
|
10
10
|
export * from "./RecordType.mjs";
|
|
11
|
+
export * from "./UpdateDomainRequest.mjs";
|
|
11
12
|
export * from "./VerificationRecord.mjs";
|
|
12
13
|
export * from "./VerificationStatus.mjs";
|
|
@@ -8,5 +8,6 @@ export * from "./FeedbackEnabled.mjs";
|
|
|
8
8
|
export * from "./ListDomainsResponse.mjs";
|
|
9
9
|
export * from "./RecordStatus.mjs";
|
|
10
10
|
export * from "./RecordType.mjs";
|
|
11
|
+
export * from "./UpdateDomainRequest.mjs";
|
|
11
12
|
export * from "./VerificationRecord.mjs";
|
|
12
13
|
export * from "./VerificationStatus.mjs";
|
|
@@ -75,28 +75,28 @@ export declare class DraftsClient {
|
|
|
75
75
|
/**
|
|
76
76
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
77
77
|
* @param {AgentMail.DraftId} draft_id
|
|
78
|
-
* @param {AgentMail.UpdateMessageRequest} request
|
|
79
78
|
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
79
|
*
|
|
81
80
|
* @throws {@link AgentMail.NotFoundError}
|
|
82
|
-
* @throws {@link AgentMail.ValidationError}
|
|
83
|
-
* @throws {@link AgentMail.MessageRejectedError}
|
|
84
81
|
*
|
|
85
82
|
* @example
|
|
86
|
-
* await client.inboxes.drafts.
|
|
83
|
+
* await client.inboxes.drafts.delete("inbox_id", "draft_id")
|
|
87
84
|
*/
|
|
88
|
-
|
|
89
|
-
private
|
|
85
|
+
delete(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
86
|
+
private __delete;
|
|
90
87
|
/**
|
|
91
88
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
92
89
|
* @param {AgentMail.DraftId} draft_id
|
|
90
|
+
* @param {AgentMail.UpdateMessageRequest} request
|
|
93
91
|
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
94
92
|
*
|
|
95
93
|
* @throws {@link AgentMail.NotFoundError}
|
|
94
|
+
* @throws {@link AgentMail.ValidationError}
|
|
95
|
+
* @throws {@link AgentMail.MessageRejectedError}
|
|
96
96
|
*
|
|
97
97
|
* @example
|
|
98
|
-
* await client.inboxes.drafts.
|
|
98
|
+
* await client.inboxes.drafts.send("inbox_id", "draft_id", {})
|
|
99
99
|
*/
|
|
100
|
-
|
|
101
|
-
private
|
|
100
|
+
send(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, request: AgentMail.UpdateMessageRequest, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
|
|
101
|
+
private __send;
|
|
102
102
|
}
|