agentmail 0.4.3 → 0.4.5
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/drafts/types/Draft.d.ts +0 -1
- package/dist/cjs/api/resources/drafts/types/DraftItem.d.ts +0 -1
- 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 +2 -2
- package/dist/cjs/api/resources/pods/client/Client.js +4 -4
- 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/drafts/types/Draft.d.ts +0 -2
- package/dist/cjs/serialization/resources/drafts/types/Draft.js +0 -2
- package/dist/cjs/serialization/resources/drafts/types/DraftItem.d.ts +0 -2
- package/dist/cjs/serialization/resources/drafts/types/DraftItem.js +0 -2
- 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/drafts/types/Draft.d.mts +0 -1
- package/dist/esm/api/resources/drafts/types/DraftItem.d.mts +0 -1
- 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 +2 -2
- package/dist/esm/api/resources/pods/client/Client.mjs +4 -4
- 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/drafts/types/Draft.d.mts +0 -2
- package/dist/esm/serialization/resources/drafts/types/Draft.mjs +0 -2
- package/dist/esm/serialization/resources/drafts/types/DraftItem.d.mts +0 -2
- package/dist/esm/serialization/resources/drafts/types/DraftItem.mjs +0 -2
- 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 +18788 -13694
- package/dist/llms.txt +81 -46
- package/package.json +1 -1
- package/reference.md +570 -117
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "agentmail",
|
|
46
|
-
"X-Fern-SDK-Version": "0.4.
|
|
47
|
-
"User-Agent": "agentmail/0.4.
|
|
46
|
+
"X-Fern-SDK-Version": "0.4.5",
|
|
47
|
+
"User-Agent": "agentmail/0.4.5",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -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.
|
|
@@ -292,6 +292,75 @@ class DomainsClient {
|
|
|
292
292
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/domains");
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
|
+
/**
|
|
296
|
+
* @param {AgentMail.DomainId} domain_id
|
|
297
|
+
* @param {AgentMail.UpdateDomainRequest} request
|
|
298
|
+
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
299
|
+
*
|
|
300
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
301
|
+
*
|
|
302
|
+
* @example
|
|
303
|
+
* await client.domains.update("domain_id", {})
|
|
304
|
+
*/
|
|
305
|
+
update(domain_id, request, requestOptions) {
|
|
306
|
+
return core.HttpResponsePromise.fromPromise(this.__update(domain_id, request, requestOptions));
|
|
307
|
+
}
|
|
308
|
+
__update(domain_id, request, requestOptions) {
|
|
309
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
310
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
311
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
312
|
+
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);
|
|
313
|
+
const _response = yield core.fetcher({
|
|
314
|
+
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)
|
|
315
|
+
.http, `/v0/domains/${core.url.encodePathParam(serializers.DomainId.jsonOrThrow(domain_id, { omitUndefined: true }))}`),
|
|
316
|
+
method: "PATCH",
|
|
317
|
+
headers: _headers,
|
|
318
|
+
contentType: "application/json",
|
|
319
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
320
|
+
requestType: "json",
|
|
321
|
+
body: serializers.UpdateDomainRequest.jsonOrThrow(request, {
|
|
322
|
+
unrecognizedObjectKeys: "strip",
|
|
323
|
+
omitUndefined: true,
|
|
324
|
+
}),
|
|
325
|
+
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,
|
|
326
|
+
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,
|
|
327
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
328
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
329
|
+
logging: this._options.logging,
|
|
330
|
+
});
|
|
331
|
+
if (_response.ok) {
|
|
332
|
+
return {
|
|
333
|
+
data: serializers.Domain.parseOrThrow(_response.body, {
|
|
334
|
+
unrecognizedObjectKeys: "passthrough",
|
|
335
|
+
allowUnrecognizedUnionMembers: true,
|
|
336
|
+
allowUnrecognizedEnumValues: true,
|
|
337
|
+
skipValidation: true,
|
|
338
|
+
breadcrumbsPrefix: ["response"],
|
|
339
|
+
}),
|
|
340
|
+
rawResponse: _response.rawResponse,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
if (_response.error.reason === "status-code") {
|
|
344
|
+
switch (_response.error.statusCode) {
|
|
345
|
+
case 404:
|
|
346
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
347
|
+
unrecognizedObjectKeys: "passthrough",
|
|
348
|
+
allowUnrecognizedUnionMembers: true,
|
|
349
|
+
allowUnrecognizedEnumValues: true,
|
|
350
|
+
skipValidation: true,
|
|
351
|
+
breadcrumbsPrefix: ["response"],
|
|
352
|
+
}), _response.rawResponse);
|
|
353
|
+
default:
|
|
354
|
+
throw new errors.AgentMailError({
|
|
355
|
+
statusCode: _response.error.statusCode,
|
|
356
|
+
body: _response.error.body,
|
|
357
|
+
rawResponse: _response.rawResponse,
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/domains/{domain_id}");
|
|
362
|
+
});
|
|
363
|
+
}
|
|
295
364
|
/**
|
|
296
365
|
* @param {AgentMail.DomainId} domain_id
|
|
297
366
|
* @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -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);
|
|
@@ -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
|
}
|
|
@@ -407,36 +407,27 @@ class DraftsClient {
|
|
|
407
407
|
/**
|
|
408
408
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
409
409
|
* @param {AgentMail.DraftId} draft_id
|
|
410
|
-
* @param {AgentMail.UpdateMessageRequest} request
|
|
411
410
|
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
412
411
|
*
|
|
413
412
|
* @throws {@link AgentMail.NotFoundError}
|
|
414
|
-
* @throws {@link AgentMail.ValidationError}
|
|
415
|
-
* @throws {@link AgentMail.MessageRejectedError}
|
|
416
413
|
*
|
|
417
414
|
* @example
|
|
418
|
-
* await client.inboxes.drafts.
|
|
415
|
+
* await client.inboxes.drafts.delete("inbox_id", "draft_id")
|
|
419
416
|
*/
|
|
420
|
-
|
|
421
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
417
|
+
delete(inbox_id, draft_id, requestOptions) {
|
|
418
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, draft_id, requestOptions));
|
|
422
419
|
}
|
|
423
|
-
|
|
420
|
+
__delete(inbox_id, draft_id, requestOptions) {
|
|
424
421
|
return __awaiter(this, void 0, void 0, function* () {
|
|
425
422
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
426
423
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
427
424
|
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);
|
|
428
425
|
const _response = yield core.fetcher({
|
|
429
426
|
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)
|
|
430
|
-
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}
|
|
431
|
-
method: "
|
|
427
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}`),
|
|
428
|
+
method: "DELETE",
|
|
432
429
|
headers: _headers,
|
|
433
|
-
contentType: "application/json",
|
|
434
430
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
435
|
-
requestType: "json",
|
|
436
|
-
body: serializers.UpdateMessageRequest.jsonOrThrow(request, {
|
|
437
|
-
unrecognizedObjectKeys: "strip",
|
|
438
|
-
omitUndefined: true,
|
|
439
|
-
}),
|
|
440
431
|
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,
|
|
441
432
|
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,
|
|
442
433
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -444,16 +435,7 @@ class DraftsClient {
|
|
|
444
435
|
logging: this._options.logging,
|
|
445
436
|
});
|
|
446
437
|
if (_response.ok) {
|
|
447
|
-
return {
|
|
448
|
-
data: serializers.SendMessageResponse.parseOrThrow(_response.body, {
|
|
449
|
-
unrecognizedObjectKeys: "passthrough",
|
|
450
|
-
allowUnrecognizedUnionMembers: true,
|
|
451
|
-
allowUnrecognizedEnumValues: true,
|
|
452
|
-
skipValidation: true,
|
|
453
|
-
breadcrumbsPrefix: ["response"],
|
|
454
|
-
}),
|
|
455
|
-
rawResponse: _response.rawResponse,
|
|
456
|
-
};
|
|
438
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
457
439
|
}
|
|
458
440
|
if (_response.error.reason === "status-code") {
|
|
459
441
|
switch (_response.error.statusCode) {
|
|
@@ -465,22 +447,6 @@ class DraftsClient {
|
|
|
465
447
|
skipValidation: true,
|
|
466
448
|
breadcrumbsPrefix: ["response"],
|
|
467
449
|
}), _response.rawResponse);
|
|
468
|
-
case 400:
|
|
469
|
-
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
470
|
-
unrecognizedObjectKeys: "passthrough",
|
|
471
|
-
allowUnrecognizedUnionMembers: true,
|
|
472
|
-
allowUnrecognizedEnumValues: true,
|
|
473
|
-
skipValidation: true,
|
|
474
|
-
breadcrumbsPrefix: ["response"],
|
|
475
|
-
}), _response.rawResponse);
|
|
476
|
-
case 403:
|
|
477
|
-
throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
478
|
-
unrecognizedObjectKeys: "passthrough",
|
|
479
|
-
allowUnrecognizedUnionMembers: true,
|
|
480
|
-
allowUnrecognizedEnumValues: true,
|
|
481
|
-
skipValidation: true,
|
|
482
|
-
breadcrumbsPrefix: ["response"],
|
|
483
|
-
}), _response.rawResponse);
|
|
484
450
|
default:
|
|
485
451
|
throw new errors.AgentMailError({
|
|
486
452
|
statusCode: _response.error.statusCode,
|
|
@@ -489,33 +455,42 @@ class DraftsClient {
|
|
|
489
455
|
});
|
|
490
456
|
}
|
|
491
457
|
}
|
|
492
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
458
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v0/inboxes/{inbox_id}/drafts/{draft_id}");
|
|
493
459
|
});
|
|
494
460
|
}
|
|
495
461
|
/**
|
|
496
462
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
497
463
|
* @param {AgentMail.DraftId} draft_id
|
|
464
|
+
* @param {AgentMail.UpdateMessageRequest} request
|
|
498
465
|
* @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
499
466
|
*
|
|
500
467
|
* @throws {@link AgentMail.NotFoundError}
|
|
468
|
+
* @throws {@link AgentMail.ValidationError}
|
|
469
|
+
* @throws {@link AgentMail.MessageRejectedError}
|
|
501
470
|
*
|
|
502
471
|
* @example
|
|
503
|
-
* await client.inboxes.drafts.
|
|
472
|
+
* await client.inboxes.drafts.send("inbox_id", "draft_id", {})
|
|
504
473
|
*/
|
|
505
|
-
|
|
506
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
474
|
+
send(inbox_id, draft_id, request, requestOptions) {
|
|
475
|
+
return core.HttpResponsePromise.fromPromise(this.__send(inbox_id, draft_id, request, requestOptions));
|
|
507
476
|
}
|
|
508
|
-
|
|
477
|
+
__send(inbox_id, draft_id, request, requestOptions) {
|
|
509
478
|
return __awaiter(this, void 0, void 0, function* () {
|
|
510
479
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
511
480
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
512
481
|
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);
|
|
513
482
|
const _response = yield core.fetcher({
|
|
514
483
|
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)
|
|
515
|
-
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}`),
|
|
516
|
-
method: "
|
|
484
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}/send`),
|
|
485
|
+
method: "POST",
|
|
517
486
|
headers: _headers,
|
|
487
|
+
contentType: "application/json",
|
|
518
488
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
489
|
+
requestType: "json",
|
|
490
|
+
body: serializers.UpdateMessageRequest.jsonOrThrow(request, {
|
|
491
|
+
unrecognizedObjectKeys: "strip",
|
|
492
|
+
omitUndefined: true,
|
|
493
|
+
}),
|
|
519
494
|
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,
|
|
520
495
|
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,
|
|
521
496
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -523,7 +498,16 @@ class DraftsClient {
|
|
|
523
498
|
logging: this._options.logging,
|
|
524
499
|
});
|
|
525
500
|
if (_response.ok) {
|
|
526
|
-
return {
|
|
501
|
+
return {
|
|
502
|
+
data: serializers.SendMessageResponse.parseOrThrow(_response.body, {
|
|
503
|
+
unrecognizedObjectKeys: "passthrough",
|
|
504
|
+
allowUnrecognizedUnionMembers: true,
|
|
505
|
+
allowUnrecognizedEnumValues: true,
|
|
506
|
+
skipValidation: true,
|
|
507
|
+
breadcrumbsPrefix: ["response"],
|
|
508
|
+
}),
|
|
509
|
+
rawResponse: _response.rawResponse,
|
|
510
|
+
};
|
|
527
511
|
}
|
|
528
512
|
if (_response.error.reason === "status-code") {
|
|
529
513
|
switch (_response.error.statusCode) {
|
|
@@ -535,6 +519,22 @@ class DraftsClient {
|
|
|
535
519
|
skipValidation: true,
|
|
536
520
|
breadcrumbsPrefix: ["response"],
|
|
537
521
|
}), _response.rawResponse);
|
|
522
|
+
case 400:
|
|
523
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
524
|
+
unrecognizedObjectKeys: "passthrough",
|
|
525
|
+
allowUnrecognizedUnionMembers: true,
|
|
526
|
+
allowUnrecognizedEnumValues: true,
|
|
527
|
+
skipValidation: true,
|
|
528
|
+
breadcrumbsPrefix: ["response"],
|
|
529
|
+
}), _response.rawResponse);
|
|
530
|
+
case 403:
|
|
531
|
+
throw new AgentMail.MessageRejectedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
532
|
+
unrecognizedObjectKeys: "passthrough",
|
|
533
|
+
allowUnrecognizedUnionMembers: true,
|
|
534
|
+
allowUnrecognizedEnumValues: true,
|
|
535
|
+
skipValidation: true,
|
|
536
|
+
breadcrumbsPrefix: ["response"],
|
|
537
|
+
}), _response.rawResponse);
|
|
538
538
|
default:
|
|
539
539
|
throw new errors.AgentMailError({
|
|
540
540
|
statusCode: _response.error.statusCode,
|
|
@@ -543,7 +543,7 @@ class DraftsClient {
|
|
|
543
543
|
});
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
546
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/drafts/{draft_id}/send");
|
|
547
547
|
});
|
|
548
548
|
}
|
|
549
549
|
}
|
|
@@ -48,10 +48,31 @@ export declare class MessagesClient {
|
|
|
48
48
|
getAttachment(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, attachment_id: AgentMail.AttachmentId, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
|
|
49
49
|
private __getAttachment;
|
|
50
50
|
/**
|
|
51
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
52
|
+
* @param {AgentMail.MessageId} message_id
|
|
53
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
|
+
*
|
|
51
55
|
* @throws {@link AgentMail.NotFoundError}
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* await client.inboxes.messages.getRaw("inbox_id", "message_id")
|
|
52
59
|
*/
|
|
53
|
-
getRaw(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<
|
|
60
|
+
getRaw(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.RawMessageResponse>;
|
|
54
61
|
private __getRaw;
|
|
62
|
+
/**
|
|
63
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
64
|
+
* @param {AgentMail.MessageId} message_id
|
|
65
|
+
* @param {AgentMail.UpdateMessageRequest} request
|
|
66
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
|
+
*
|
|
68
|
+
* @throws {@link AgentMail.ValidationError}
|
|
69
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* await client.inboxes.messages.update("inbox_id", "message_id", {})
|
|
73
|
+
*/
|
|
74
|
+
update(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.UpdateMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.Message>;
|
|
75
|
+
private __update;
|
|
55
76
|
/**
|
|
56
77
|
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
57
78
|
* @param {AgentMail.SendMessageRequest} request
|
|
@@ -111,18 +132,4 @@ export declare class MessagesClient {
|
|
|
111
132
|
*/
|
|
112
133
|
forward(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.SendMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.SendMessageResponse>;
|
|
113
134
|
private __forward;
|
|
114
|
-
/**
|
|
115
|
-
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
116
|
-
* @param {AgentMail.MessageId} message_id
|
|
117
|
-
* @param {AgentMail.UpdateMessageRequest} request
|
|
118
|
-
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
119
|
-
*
|
|
120
|
-
* @throws {@link AgentMail.ValidationError}
|
|
121
|
-
* @throws {@link AgentMail.NotFoundError}
|
|
122
|
-
*
|
|
123
|
-
* @example
|
|
124
|
-
* await client.inboxes.messages.update("inbox_id", "message_id", {})
|
|
125
|
-
*/
|
|
126
|
-
update(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.UpdateMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.Message>;
|
|
127
|
-
private __update;
|
|
128
135
|
}
|