agentmail 0.0.58 → 0.0.66
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/Client.d.ts +2 -2
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/domains/client/Client.d.ts +7 -7
- package/dist/cjs/api/resources/domains/client/Client.js +69 -58
- package/dist/cjs/api/resources/drafts/client/Client.d.ts +3 -4
- package/dist/cjs/api/resources/drafts/client/Client.js +84 -71
- package/dist/cjs/api/resources/inboxes/client/Client.d.ts +14 -4
- package/dist/cjs/api/resources/inboxes/client/Client.js +127 -54
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +3 -4
- package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +87 -74
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +3 -4
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +89 -76
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.js +1 -1
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.d.ts +15 -4
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +138 -61
- package/dist/cjs/api/resources/messages/types/Message.d.ts +5 -8
- package/dist/cjs/api/resources/messages/types/MessageCreatedAt.d.ts +7 -0
- package/dist/cjs/api/resources/messages/types/MessageCreatedAt.js +5 -0
- package/dist/cjs/api/resources/messages/types/MessageInReplyTo.d.ts +7 -0
- package/dist/cjs/api/resources/messages/types/MessageInReplyTo.js +5 -0
- package/dist/cjs/api/resources/messages/types/MessageItem.d.ts +5 -0
- package/dist/cjs/api/resources/messages/types/MessageReferences.d.ts +7 -0
- package/dist/cjs/api/resources/messages/types/MessageReferences.js +5 -0
- package/dist/cjs/api/resources/messages/types/MessageReplyTo.d.ts +7 -0
- package/dist/cjs/api/resources/messages/types/MessageReplyTo.js +5 -0
- package/dist/cjs/api/resources/messages/types/MessageSize.d.ts +7 -0
- package/dist/cjs/api/resources/messages/types/MessageSize.js +5 -0
- package/dist/cjs/api/resources/messages/types/MessageUpdatedAt.d.ts +7 -0
- package/dist/cjs/api/resources/messages/types/MessageUpdatedAt.js +5 -0
- package/dist/cjs/api/resources/messages/types/index.d.ts +6 -0
- package/dist/cjs/api/resources/messages/types/index.js +6 -0
- package/dist/cjs/api/resources/metrics/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/metrics/client/Client.js +1 -1
- package/dist/cjs/api/resources/threads/client/Client.d.ts +14 -4
- package/dist/cjs/api/resources/threads/client/Client.js +136 -60
- package/dist/cjs/api/resources/threads/types/Thread.d.ts +6 -4
- package/dist/cjs/api/resources/threads/types/ThreadCreatedAt.d.ts +7 -0
- package/dist/cjs/api/resources/threads/types/ThreadCreatedAt.js +5 -0
- package/dist/cjs/api/resources/threads/types/ThreadItem.d.ts +6 -0
- package/dist/cjs/api/resources/threads/types/ThreadLastMessageId.d.ts +7 -0
- package/dist/cjs/api/resources/threads/types/ThreadLastMessageId.js +5 -0
- package/dist/cjs/api/resources/threads/types/ThreadReceivedTimestamp.d.ts +7 -0
- package/dist/cjs/api/resources/threads/types/ThreadReceivedTimestamp.js +5 -0
- package/dist/cjs/api/resources/threads/types/ThreadSentTimestamp.d.ts +7 -0
- package/dist/cjs/api/resources/threads/types/ThreadSentTimestamp.js +5 -0
- package/dist/cjs/api/resources/threads/types/ThreadSize.d.ts +7 -0
- package/dist/cjs/api/resources/threads/types/ThreadSize.js +5 -0
- package/dist/cjs/api/resources/threads/types/ThreadTimestamp.d.ts +1 -1
- package/dist/cjs/api/resources/threads/types/ThreadUpdatedAt.d.ts +7 -0
- package/dist/cjs/api/resources/threads/types/ThreadUpdatedAt.js +5 -0
- package/dist/cjs/api/resources/threads/types/index.d.ts +6 -0
- package/dist/cjs/api/resources/threads/types/index.js +6 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +3 -4
- package/dist/cjs/api/resources/webhooks/client/Client.js +65 -55
- package/dist/cjs/api/resources/websockets/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/websockets/client/Client.js +2 -1
- package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -1
- package/dist/cjs/core/fetcher/requestWithRetries.js +44 -8
- package/dist/cjs/core/headers.d.ts +2 -2
- package/dist/cjs/core/index.d.ts +2 -0
- package/dist/cjs/core/index.js +2 -0
- package/dist/cjs/core/pagination/Page.d.ts +32 -0
- package/dist/cjs/core/pagination/Page.js +100 -0
- package/dist/cjs/core/pagination/Pageable.d.ts +14 -0
- package/dist/cjs/core/pagination/Pageable.js +10 -0
- package/dist/cjs/core/pagination/index.d.ts +2 -0
- package/dist/cjs/core/pagination/index.js +7 -0
- package/dist/cjs/core/utils/index.d.ts +1 -0
- package/dist/cjs/core/utils/index.js +5 -0
- package/dist/cjs/core/utils/setObjectProperty.d.ts +11 -0
- package/dist/cjs/core/utils/setObjectProperty.js +42 -0
- package/dist/cjs/core/websocket/ws.d.ts +1 -1
- package/dist/cjs/serialization/resources/messages/types/Message.d.ts +10 -4
- package/dist/cjs/serialization/resources/messages/types/Message.js +10 -4
- package/dist/cjs/serialization/resources/messages/types/MessageCreatedAt.d.ts +10 -0
- package/dist/cjs/serialization/resources/messages/types/MessageCreatedAt.js +41 -0
- package/dist/cjs/serialization/resources/messages/types/MessageInReplyTo.d.ts +10 -0
- package/dist/cjs/serialization/resources/messages/types/MessageInReplyTo.js +41 -0
- package/dist/cjs/serialization/resources/messages/types/MessageItem.d.ts +10 -0
- package/dist/cjs/serialization/resources/messages/types/MessageItem.js +10 -0
- package/dist/cjs/serialization/resources/messages/types/MessageReferences.d.ts +10 -0
- package/dist/cjs/serialization/resources/messages/types/MessageReferences.js +41 -0
- package/dist/cjs/serialization/resources/messages/types/MessageReplyTo.d.ts +10 -0
- package/dist/cjs/serialization/resources/messages/types/MessageReplyTo.js +41 -0
- package/dist/cjs/serialization/resources/messages/types/MessageSize.d.ts +10 -0
- package/dist/cjs/serialization/resources/messages/types/MessageSize.js +41 -0
- package/dist/cjs/serialization/resources/messages/types/MessageUpdatedAt.d.ts +10 -0
- package/dist/cjs/serialization/resources/messages/types/MessageUpdatedAt.js +41 -0
- package/dist/cjs/serialization/resources/messages/types/index.d.ts +6 -0
- package/dist/cjs/serialization/resources/messages/types/index.js +6 -0
- package/dist/cjs/serialization/resources/threads/types/Thread.d.ts +12 -2
- package/dist/cjs/serialization/resources/threads/types/Thread.js +12 -2
- package/dist/cjs/serialization/resources/threads/types/ThreadCreatedAt.d.ts +10 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadCreatedAt.js +41 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadItem.d.ts +12 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadItem.js +12 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadLastMessageId.d.ts +10 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadLastMessageId.js +41 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadReceivedTimestamp.d.ts +10 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadReceivedTimestamp.js +41 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadSentTimestamp.d.ts +10 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadSentTimestamp.js +41 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadSize.d.ts +10 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadSize.js +41 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadUpdatedAt.d.ts +10 -0
- package/dist/cjs/serialization/resources/threads/types/ThreadUpdatedAt.js +41 -0
- package/dist/cjs/serialization/resources/threads/types/index.d.ts +6 -0
- package/dist/cjs/serialization/resources/threads/types/index.js +6 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +2 -2
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/domains/client/Client.d.mts +7 -7
- package/dist/esm/api/resources/domains/client/Client.mjs +69 -58
- package/dist/esm/api/resources/drafts/client/Client.d.mts +3 -4
- package/dist/esm/api/resources/drafts/client/Client.mjs +84 -71
- package/dist/esm/api/resources/inboxes/client/Client.d.mts +14 -4
- package/dist/esm/api/resources/inboxes/client/Client.mjs +127 -54
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +3 -4
- package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +87 -74
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +3 -4
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +89 -76
- package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.mjs +1 -1
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.d.mts +15 -4
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +138 -61
- package/dist/esm/api/resources/messages/types/Message.d.mts +5 -8
- package/dist/esm/api/resources/messages/types/MessageCreatedAt.d.mts +7 -0
- package/dist/esm/api/resources/messages/types/MessageCreatedAt.mjs +4 -0
- package/dist/esm/api/resources/messages/types/MessageInReplyTo.d.mts +7 -0
- package/dist/esm/api/resources/messages/types/MessageInReplyTo.mjs +4 -0
- package/dist/esm/api/resources/messages/types/MessageItem.d.mts +5 -0
- package/dist/esm/api/resources/messages/types/MessageReferences.d.mts +7 -0
- package/dist/esm/api/resources/messages/types/MessageReferences.mjs +4 -0
- package/dist/esm/api/resources/messages/types/MessageReplyTo.d.mts +7 -0
- package/dist/esm/api/resources/messages/types/MessageReplyTo.mjs +4 -0
- package/dist/esm/api/resources/messages/types/MessageSize.d.mts +7 -0
- package/dist/esm/api/resources/messages/types/MessageSize.mjs +4 -0
- package/dist/esm/api/resources/messages/types/MessageUpdatedAt.d.mts +7 -0
- package/dist/esm/api/resources/messages/types/MessageUpdatedAt.mjs +4 -0
- package/dist/esm/api/resources/messages/types/index.d.mts +6 -0
- package/dist/esm/api/resources/messages/types/index.mjs +6 -0
- package/dist/esm/api/resources/metrics/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/metrics/client/Client.mjs +1 -1
- package/dist/esm/api/resources/threads/client/Client.d.mts +14 -4
- package/dist/esm/api/resources/threads/client/Client.mjs +136 -60
- package/dist/esm/api/resources/threads/types/Thread.d.mts +6 -4
- package/dist/esm/api/resources/threads/types/ThreadCreatedAt.d.mts +7 -0
- package/dist/esm/api/resources/threads/types/ThreadCreatedAt.mjs +4 -0
- package/dist/esm/api/resources/threads/types/ThreadItem.d.mts +6 -0
- package/dist/esm/api/resources/threads/types/ThreadLastMessageId.d.mts +7 -0
- package/dist/esm/api/resources/threads/types/ThreadLastMessageId.mjs +4 -0
- package/dist/esm/api/resources/threads/types/ThreadReceivedTimestamp.d.mts +7 -0
- package/dist/esm/api/resources/threads/types/ThreadReceivedTimestamp.mjs +4 -0
- package/dist/esm/api/resources/threads/types/ThreadSentTimestamp.d.mts +7 -0
- package/dist/esm/api/resources/threads/types/ThreadSentTimestamp.mjs +4 -0
- package/dist/esm/api/resources/threads/types/ThreadSize.d.mts +7 -0
- package/dist/esm/api/resources/threads/types/ThreadSize.mjs +4 -0
- package/dist/esm/api/resources/threads/types/ThreadTimestamp.d.mts +1 -1
- package/dist/esm/api/resources/threads/types/ThreadUpdatedAt.d.mts +7 -0
- package/dist/esm/api/resources/threads/types/ThreadUpdatedAt.mjs +4 -0
- package/dist/esm/api/resources/threads/types/index.d.mts +6 -0
- package/dist/esm/api/resources/threads/types/index.mjs +6 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +3 -4
- package/dist/esm/api/resources/webhooks/client/Client.mjs +65 -55
- package/dist/esm/api/resources/websockets/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/websockets/client/Client.mjs +2 -1
- package/dist/esm/core/fetcher/Fetcher.d.mts +1 -1
- package/dist/esm/core/fetcher/requestWithRetries.mjs +44 -8
- package/dist/esm/core/headers.d.mts +2 -2
- package/dist/esm/core/index.d.mts +2 -0
- package/dist/esm/core/index.mjs +2 -0
- package/dist/esm/core/pagination/Page.d.mts +32 -0
- package/dist/esm/core/pagination/Page.mjs +96 -0
- package/dist/esm/core/pagination/Pageable.d.mts +14 -0
- package/dist/esm/core/pagination/Pageable.mjs +6 -0
- package/dist/esm/core/pagination/index.d.mts +2 -0
- package/dist/esm/core/pagination/index.mjs +2 -0
- package/dist/esm/core/utils/index.d.mts +1 -0
- package/dist/esm/core/utils/index.mjs +1 -0
- package/dist/esm/core/utils/setObjectProperty.d.mts +11 -0
- package/dist/esm/core/utils/setObjectProperty.mjs +39 -0
- package/dist/esm/core/websocket/ws.d.mts +1 -1
- package/dist/esm/serialization/resources/messages/types/Message.d.mts +10 -4
- package/dist/esm/serialization/resources/messages/types/Message.mjs +10 -4
- package/dist/esm/serialization/resources/messages/types/MessageCreatedAt.d.mts +10 -0
- package/dist/esm/serialization/resources/messages/types/MessageCreatedAt.mjs +5 -0
- package/dist/esm/serialization/resources/messages/types/MessageInReplyTo.d.mts +10 -0
- package/dist/esm/serialization/resources/messages/types/MessageInReplyTo.mjs +5 -0
- package/dist/esm/serialization/resources/messages/types/MessageItem.d.mts +10 -0
- package/dist/esm/serialization/resources/messages/types/MessageItem.mjs +10 -0
- package/dist/esm/serialization/resources/messages/types/MessageReferences.d.mts +10 -0
- package/dist/esm/serialization/resources/messages/types/MessageReferences.mjs +5 -0
- package/dist/esm/serialization/resources/messages/types/MessageReplyTo.d.mts +10 -0
- package/dist/esm/serialization/resources/messages/types/MessageReplyTo.mjs +5 -0
- package/dist/esm/serialization/resources/messages/types/MessageSize.d.mts +10 -0
- package/dist/esm/serialization/resources/messages/types/MessageSize.mjs +5 -0
- package/dist/esm/serialization/resources/messages/types/MessageUpdatedAt.d.mts +10 -0
- package/dist/esm/serialization/resources/messages/types/MessageUpdatedAt.mjs +5 -0
- package/dist/esm/serialization/resources/messages/types/index.d.mts +6 -0
- package/dist/esm/serialization/resources/messages/types/index.mjs +6 -0
- package/dist/esm/serialization/resources/threads/types/Thread.d.mts +12 -2
- package/dist/esm/serialization/resources/threads/types/Thread.mjs +12 -2
- package/dist/esm/serialization/resources/threads/types/ThreadCreatedAt.d.mts +10 -0
- package/dist/esm/serialization/resources/threads/types/ThreadCreatedAt.mjs +5 -0
- package/dist/esm/serialization/resources/threads/types/ThreadItem.d.mts +12 -0
- package/dist/esm/serialization/resources/threads/types/ThreadItem.mjs +12 -0
- package/dist/esm/serialization/resources/threads/types/ThreadLastMessageId.d.mts +10 -0
- package/dist/esm/serialization/resources/threads/types/ThreadLastMessageId.mjs +5 -0
- package/dist/esm/serialization/resources/threads/types/ThreadReceivedTimestamp.d.mts +10 -0
- package/dist/esm/serialization/resources/threads/types/ThreadReceivedTimestamp.mjs +5 -0
- package/dist/esm/serialization/resources/threads/types/ThreadSentTimestamp.d.mts +10 -0
- package/dist/esm/serialization/resources/threads/types/ThreadSentTimestamp.mjs +5 -0
- package/dist/esm/serialization/resources/threads/types/ThreadSize.d.mts +10 -0
- package/dist/esm/serialization/resources/threads/types/ThreadSize.mjs +5 -0
- package/dist/esm/serialization/resources/threads/types/ThreadUpdatedAt.d.mts +10 -0
- package/dist/esm/serialization/resources/threads/types/ThreadUpdatedAt.mjs +5 -0
- package/dist/esm/serialization/resources/threads/types/index.d.mts +6 -0
- package/dist/esm/serialization/resources/threads/types/index.mjs +6 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +404 -11
|
@@ -31,87 +31,100 @@ export class Drafts {
|
|
|
31
31
|
* @example
|
|
32
32
|
* await client.inboxes.drafts.list("inbox_id")
|
|
33
33
|
*/
|
|
34
|
-
list(
|
|
35
|
-
return core.HttpResponsePromise.fromPromise(this.__list(inboxId, request, requestOptions));
|
|
36
|
-
}
|
|
37
|
-
__list(inboxId_1) {
|
|
34
|
+
list(inboxId_1) {
|
|
38
35
|
return __awaiter(this, arguments, void 0, function* (inboxId, request = {}, requestOptions) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
headers:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
breadcrumbsPrefix: ["response"],
|
|
78
|
-
}),
|
|
79
|
-
rawResponse: _response.rawResponse,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
if (_response.error.reason === "status-code") {
|
|
83
|
-
switch (_response.error.statusCode) {
|
|
84
|
-
case 404:
|
|
85
|
-
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
36
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
var _a, _b, _c;
|
|
38
|
+
const { limit, pageToken, labels, before, after, ascending } = request;
|
|
39
|
+
const _queryParams = {};
|
|
40
|
+
if (limit != null) {
|
|
41
|
+
_queryParams["limit"] = limit.toString();
|
|
42
|
+
}
|
|
43
|
+
if (pageToken != null) {
|
|
44
|
+
_queryParams["page_token"] = pageToken;
|
|
45
|
+
}
|
|
46
|
+
if (labels != null) {
|
|
47
|
+
_queryParams["labels"] = toJson(serializers.Labels.jsonOrThrow(labels, {
|
|
48
|
+
unrecognizedObjectKeys: "strip",
|
|
49
|
+
omitUndefined: true,
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
if (before != null) {
|
|
53
|
+
_queryParams["before"] = before.toISOString();
|
|
54
|
+
}
|
|
55
|
+
if (after != null) {
|
|
56
|
+
_queryParams["after"] = after.toISOString();
|
|
57
|
+
}
|
|
58
|
+
if (ascending != null) {
|
|
59
|
+
_queryParams["ascending"] = ascending.toString();
|
|
60
|
+
}
|
|
61
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
62
|
+
const _response = yield core.fetcher({
|
|
63
|
+
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/drafts`),
|
|
64
|
+
method: "GET",
|
|
65
|
+
headers: _headers,
|
|
66
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
67
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
68
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
69
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
70
|
+
});
|
|
71
|
+
if (_response.ok) {
|
|
72
|
+
return {
|
|
73
|
+
data: serializers.ListDraftsResponse.parseOrThrow(_response.body, {
|
|
86
74
|
unrecognizedObjectKeys: "passthrough",
|
|
87
75
|
allowUnrecognizedUnionMembers: true,
|
|
88
76
|
allowUnrecognizedEnumValues: true,
|
|
89
77
|
skipValidation: true,
|
|
90
78
|
breadcrumbsPrefix: ["response"],
|
|
91
|
-
}),
|
|
92
|
-
|
|
79
|
+
}),
|
|
80
|
+
rawResponse: _response.rawResponse,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
if (_response.error.reason === "status-code") {
|
|
84
|
+
switch (_response.error.statusCode) {
|
|
85
|
+
case 404:
|
|
86
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
87
|
+
unrecognizedObjectKeys: "passthrough",
|
|
88
|
+
allowUnrecognizedUnionMembers: true,
|
|
89
|
+
allowUnrecognizedEnumValues: true,
|
|
90
|
+
skipValidation: true,
|
|
91
|
+
breadcrumbsPrefix: ["response"],
|
|
92
|
+
}), _response.rawResponse);
|
|
93
|
+
default:
|
|
94
|
+
throw new errors.AgentMailError({
|
|
95
|
+
statusCode: _response.error.statusCode,
|
|
96
|
+
body: _response.error.body,
|
|
97
|
+
rawResponse: _response.rawResponse,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
switch (_response.error.reason) {
|
|
102
|
+
case "non-json":
|
|
93
103
|
throw new errors.AgentMailError({
|
|
94
104
|
statusCode: _response.error.statusCode,
|
|
95
|
-
body: _response.error.
|
|
105
|
+
body: _response.error.rawBody,
|
|
106
|
+
rawResponse: _response.rawResponse,
|
|
107
|
+
});
|
|
108
|
+
case "timeout":
|
|
109
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/inboxes/{inbox_id}/drafts.");
|
|
110
|
+
case "unknown":
|
|
111
|
+
throw new errors.AgentMailError({
|
|
112
|
+
message: _response.error.errorMessage,
|
|
96
113
|
rawResponse: _response.rawResponse,
|
|
97
114
|
});
|
|
98
115
|
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
message: _response.error.errorMessage,
|
|
112
|
-
rawResponse: _response.rawResponse,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
116
|
+
}));
|
|
117
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
118
|
+
return new core.Pageable({
|
|
119
|
+
response: dataWithRawResponse.data,
|
|
120
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
121
|
+
hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
|
|
122
|
+
!(typeof (response === null || response === void 0 ? void 0 : response.nextPageToken) === "string" && (response === null || response === void 0 ? void 0 : response.nextPageToken) === ""),
|
|
123
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.drafts) !== null && _a !== void 0 ? _a : []; },
|
|
124
|
+
loadPage: (response) => {
|
|
125
|
+
return list(core.setObjectProperty(request, "pageToken", response === null || response === void 0 ? void 0 : response.nextPageToken));
|
|
126
|
+
},
|
|
127
|
+
});
|
|
115
128
|
});
|
|
116
129
|
}
|
|
117
130
|
/**
|
|
@@ -130,7 +143,7 @@ export class Drafts {
|
|
|
130
143
|
__get(inboxId, draftId, requestOptions) {
|
|
131
144
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
145
|
var _a, _b, _c;
|
|
133
|
-
|
|
146
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
134
147
|
const _response = yield core.fetcher({
|
|
135
148
|
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/drafts/${encodeURIComponent(serializers.DraftId.jsonOrThrow(draftId, { omitUndefined: true }))}`),
|
|
136
149
|
method: "GET",
|
|
@@ -214,7 +227,7 @@ export class Drafts {
|
|
|
214
227
|
__create(inboxId, request, requestOptions) {
|
|
215
228
|
return __awaiter(this, void 0, void 0, function* () {
|
|
216
229
|
var _a, _b, _c;
|
|
217
|
-
|
|
230
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
218
231
|
const _response = yield core.fetcher({
|
|
219
232
|
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/drafts`),
|
|
220
233
|
method: "POST",
|
|
@@ -299,7 +312,7 @@ export class Drafts {
|
|
|
299
312
|
__send(inboxId, draftId, request, requestOptions) {
|
|
300
313
|
return __awaiter(this, void 0, void 0, function* () {
|
|
301
314
|
var _a, _b, _c;
|
|
302
|
-
|
|
315
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
303
316
|
const _response = yield core.fetcher({
|
|
304
317
|
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/drafts/${encodeURIComponent(serializers.DraftId.jsonOrThrow(draftId, { omitUndefined: true }))}/send`),
|
|
305
318
|
method: "POST",
|
|
@@ -394,7 +407,7 @@ export class Drafts {
|
|
|
394
407
|
__delete(inboxId, draftId, requestOptions) {
|
|
395
408
|
return __awaiter(this, void 0, void 0, function* () {
|
|
396
409
|
var _a, _b, _c;
|
|
397
|
-
|
|
410
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
398
411
|
const _response = yield core.fetcher({
|
|
399
412
|
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/drafts/${encodeURIComponent(serializers.DraftId.jsonOrThrow(draftId, { omitUndefined: true }))}`),
|
|
400
413
|
method: "DELETE",
|
|
@@ -11,7 +11,7 @@ export declare namespace Messages {
|
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
12
|
apiKey?: core.Supplier<core.BearerToken | undefined>;
|
|
13
13
|
/** Additional headers to include in requests. */
|
|
14
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
15
|
}
|
|
16
16
|
interface RequestOptions {
|
|
17
17
|
/** The maximum time to wait for a response in seconds. */
|
|
@@ -23,7 +23,7 @@ export declare namespace Messages {
|
|
|
23
23
|
/** Additional query string parameters to include in the request. */
|
|
24
24
|
queryParams?: Record<string, unknown>;
|
|
25
25
|
/** Additional headers to include in the request. */
|
|
26
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
26
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
export declare class Messages {
|
|
@@ -39,8 +39,7 @@ export declare class Messages {
|
|
|
39
39
|
* @example
|
|
40
40
|
* await client.inboxes.messages.list("inbox_id")
|
|
41
41
|
*/
|
|
42
|
-
list(inboxId: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListMessagesRequest, requestOptions?: Messages.RequestOptions): core.
|
|
43
|
-
private __list;
|
|
42
|
+
list(inboxId: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListMessagesRequest, requestOptions?: Messages.RequestOptions): Promise<core.Page<AgentMail.MessageItem>>;
|
|
44
43
|
/**
|
|
45
44
|
* @param {AgentMail.inboxes.InboxId} inboxId
|
|
46
45
|
* @param {AgentMail.MessageId} messageId
|
|
@@ -31,87 +31,100 @@ export class Messages {
|
|
|
31
31
|
* @example
|
|
32
32
|
* await client.inboxes.messages.list("inbox_id")
|
|
33
33
|
*/
|
|
34
|
-
list(
|
|
35
|
-
return core.HttpResponsePromise.fromPromise(this.__list(inboxId, request, requestOptions));
|
|
36
|
-
}
|
|
37
|
-
__list(inboxId_1) {
|
|
34
|
+
list(inboxId_1) {
|
|
38
35
|
return __awaiter(this, arguments, void 0, function* (inboxId, request = {}, requestOptions) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
headers:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
breadcrumbsPrefix: ["response"],
|
|
78
|
-
}),
|
|
79
|
-
rawResponse: _response.rawResponse,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
if (_response.error.reason === "status-code") {
|
|
83
|
-
switch (_response.error.statusCode) {
|
|
84
|
-
case 404:
|
|
85
|
-
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
36
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
var _a, _b, _c;
|
|
38
|
+
const { limit, pageToken, labels, before, after, ascending } = request;
|
|
39
|
+
const _queryParams = {};
|
|
40
|
+
if (limit != null) {
|
|
41
|
+
_queryParams["limit"] = limit.toString();
|
|
42
|
+
}
|
|
43
|
+
if (pageToken != null) {
|
|
44
|
+
_queryParams["page_token"] = pageToken;
|
|
45
|
+
}
|
|
46
|
+
if (labels != null) {
|
|
47
|
+
_queryParams["labels"] = toJson(serializers.Labels.jsonOrThrow(labels, {
|
|
48
|
+
unrecognizedObjectKeys: "strip",
|
|
49
|
+
omitUndefined: true,
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
if (before != null) {
|
|
53
|
+
_queryParams["before"] = before.toISOString();
|
|
54
|
+
}
|
|
55
|
+
if (after != null) {
|
|
56
|
+
_queryParams["after"] = after.toISOString();
|
|
57
|
+
}
|
|
58
|
+
if (ascending != null) {
|
|
59
|
+
_queryParams["ascending"] = ascending.toString();
|
|
60
|
+
}
|
|
61
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
62
|
+
const _response = yield core.fetcher({
|
|
63
|
+
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/messages`),
|
|
64
|
+
method: "GET",
|
|
65
|
+
headers: _headers,
|
|
66
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
67
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
68
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
69
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
70
|
+
});
|
|
71
|
+
if (_response.ok) {
|
|
72
|
+
return {
|
|
73
|
+
data: serializers.ListMessagesResponse.parseOrThrow(_response.body, {
|
|
86
74
|
unrecognizedObjectKeys: "passthrough",
|
|
87
75
|
allowUnrecognizedUnionMembers: true,
|
|
88
76
|
allowUnrecognizedEnumValues: true,
|
|
89
77
|
skipValidation: true,
|
|
90
78
|
breadcrumbsPrefix: ["response"],
|
|
91
|
-
}),
|
|
92
|
-
|
|
79
|
+
}),
|
|
80
|
+
rawResponse: _response.rawResponse,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
if (_response.error.reason === "status-code") {
|
|
84
|
+
switch (_response.error.statusCode) {
|
|
85
|
+
case 404:
|
|
86
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
87
|
+
unrecognizedObjectKeys: "passthrough",
|
|
88
|
+
allowUnrecognizedUnionMembers: true,
|
|
89
|
+
allowUnrecognizedEnumValues: true,
|
|
90
|
+
skipValidation: true,
|
|
91
|
+
breadcrumbsPrefix: ["response"],
|
|
92
|
+
}), _response.rawResponse);
|
|
93
|
+
default:
|
|
94
|
+
throw new errors.AgentMailError({
|
|
95
|
+
statusCode: _response.error.statusCode,
|
|
96
|
+
body: _response.error.body,
|
|
97
|
+
rawResponse: _response.rawResponse,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
switch (_response.error.reason) {
|
|
102
|
+
case "non-json":
|
|
93
103
|
throw new errors.AgentMailError({
|
|
94
104
|
statusCode: _response.error.statusCode,
|
|
95
|
-
body: _response.error.
|
|
105
|
+
body: _response.error.rawBody,
|
|
106
|
+
rawResponse: _response.rawResponse,
|
|
107
|
+
});
|
|
108
|
+
case "timeout":
|
|
109
|
+
throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/inboxes/{inbox_id}/messages.");
|
|
110
|
+
case "unknown":
|
|
111
|
+
throw new errors.AgentMailError({
|
|
112
|
+
message: _response.error.errorMessage,
|
|
96
113
|
rawResponse: _response.rawResponse,
|
|
97
114
|
});
|
|
98
115
|
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
message: _response.error.errorMessage,
|
|
112
|
-
rawResponse: _response.rawResponse,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
116
|
+
}));
|
|
117
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
118
|
+
return new core.Pageable({
|
|
119
|
+
response: dataWithRawResponse.data,
|
|
120
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
121
|
+
hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
|
|
122
|
+
!(typeof (response === null || response === void 0 ? void 0 : response.nextPageToken) === "string" && (response === null || response === void 0 ? void 0 : response.nextPageToken) === ""),
|
|
123
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.messages) !== null && _a !== void 0 ? _a : []; },
|
|
124
|
+
loadPage: (response) => {
|
|
125
|
+
return list(core.setObjectProperty(request, "pageToken", response === null || response === void 0 ? void 0 : response.nextPageToken));
|
|
126
|
+
},
|
|
127
|
+
});
|
|
115
128
|
});
|
|
116
129
|
}
|
|
117
130
|
/**
|
|
@@ -130,7 +143,7 @@ export class Messages {
|
|
|
130
143
|
__get(inboxId, messageId, requestOptions) {
|
|
131
144
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
145
|
var _a, _b, _c;
|
|
133
|
-
|
|
146
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
134
147
|
const _response = yield core.fetcher({
|
|
135
148
|
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/messages/${encodeURIComponent(serializers.MessageId.jsonOrThrow(messageId, { omitUndefined: true }))}`),
|
|
136
149
|
method: "GET",
|
|
@@ -196,7 +209,7 @@ export class Messages {
|
|
|
196
209
|
__getAttachment(inboxId, messageId, attachmentId, requestOptions) {
|
|
197
210
|
return __awaiter(this, void 0, void 0, function* () {
|
|
198
211
|
var _a, _b, _c;
|
|
199
|
-
|
|
212
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
200
213
|
const _response = yield core.fetcher({
|
|
201
214
|
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/messages/${encodeURIComponent(serializers.MessageId.jsonOrThrow(messageId, { omitUndefined: true }))}/attachments/${encodeURIComponent(serializers.AttachmentId.jsonOrThrow(attachmentId, { omitUndefined: true }))}`),
|
|
202
215
|
method: "GET",
|
|
@@ -254,7 +267,7 @@ export class Messages {
|
|
|
254
267
|
__getRaw(inboxId, messageId, requestOptions) {
|
|
255
268
|
return __awaiter(this, void 0, void 0, function* () {
|
|
256
269
|
var _a, _b, _c;
|
|
257
|
-
|
|
270
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
258
271
|
const _response = yield core.fetcher({
|
|
259
272
|
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/messages/${encodeURIComponent(serializers.MessageId.jsonOrThrow(messageId, { omitUndefined: true }))}/raw`),
|
|
260
273
|
method: "GET",
|
|
@@ -331,7 +344,7 @@ export class Messages {
|
|
|
331
344
|
__send(inboxId, request, requestOptions) {
|
|
332
345
|
return __awaiter(this, void 0, void 0, function* () {
|
|
333
346
|
var _a, _b, _c;
|
|
334
|
-
|
|
347
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
335
348
|
const _response = yield core.fetcher({
|
|
336
349
|
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/messages/send`),
|
|
337
350
|
method: "POST",
|
|
@@ -438,7 +451,7 @@ export class Messages {
|
|
|
438
451
|
__reply(inboxId, messageId, request, requestOptions) {
|
|
439
452
|
return __awaiter(this, void 0, void 0, function* () {
|
|
440
453
|
var _a, _b, _c;
|
|
441
|
-
|
|
454
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
442
455
|
const _response = yield core.fetcher({
|
|
443
456
|
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/messages/${encodeURIComponent(serializers.MessageId.jsonOrThrow(messageId, { omitUndefined: true }))}/reply`),
|
|
444
457
|
method: "POST",
|
|
@@ -538,7 +551,7 @@ export class Messages {
|
|
|
538
551
|
__update(inboxId, messageId, request, requestOptions) {
|
|
539
552
|
return __awaiter(this, void 0, void 0, function* () {
|
|
540
553
|
var _a, _b, _c;
|
|
541
|
-
|
|
554
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
542
555
|
const _response = yield core.fetcher({
|
|
543
556
|
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/messages/${encodeURIComponent(serializers.MessageId.jsonOrThrow(messageId, { omitUndefined: true }))}`),
|
|
544
557
|
method: "PATCH",
|
|
@@ -11,7 +11,7 @@ export declare namespace Metrics {
|
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
12
|
apiKey?: core.Supplier<core.BearerToken | undefined>;
|
|
13
13
|
/** Additional headers to include in requests. */
|
|
14
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
15
|
}
|
|
16
16
|
interface RequestOptions {
|
|
17
17
|
/** The maximum time to wait for a response in seconds. */
|
|
@@ -23,7 +23,7 @@ export declare namespace Metrics {
|
|
|
23
23
|
/** Additional query string parameters to include in the request. */
|
|
24
24
|
queryParams?: Record<string, unknown>;
|
|
25
25
|
/** Additional headers to include in the request. */
|
|
26
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
26
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
export declare class Metrics {
|
|
@@ -51,7 +51,7 @@ export class Metrics {
|
|
|
51
51
|
}
|
|
52
52
|
_queryParams["start_timestamp"] = startTimestamp.toISOString();
|
|
53
53
|
_queryParams["end_timestamp"] = endTimestamp.toISOString();
|
|
54
|
-
|
|
54
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
55
55
|
const _response = yield core.fetcher({
|
|
56
56
|
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/${encodeURIComponent(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}/metrics`),
|
|
57
57
|
method: "GET",
|
|
@@ -11,7 +11,7 @@ export declare namespace Threads {
|
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
12
|
apiKey?: core.Supplier<core.BearerToken | undefined>;
|
|
13
13
|
/** Additional headers to include in requests. */
|
|
14
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
15
|
}
|
|
16
16
|
interface RequestOptions {
|
|
17
17
|
/** The maximum time to wait for a response in seconds. */
|
|
@@ -23,7 +23,7 @@ export declare namespace Threads {
|
|
|
23
23
|
/** Additional query string parameters to include in the request. */
|
|
24
24
|
queryParams?: Record<string, unknown>;
|
|
25
25
|
/** Additional headers to include in the request. */
|
|
26
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
26
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
export declare class Threads {
|
|
@@ -39,8 +39,7 @@ export declare class Threads {
|
|
|
39
39
|
* @example
|
|
40
40
|
* await client.inboxes.threads.list("inbox_id")
|
|
41
41
|
*/
|
|
42
|
-
list(inboxId: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListThreadsRequest, requestOptions?: Threads.RequestOptions): core.
|
|
43
|
-
private __list;
|
|
42
|
+
list(inboxId: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListThreadsRequest, requestOptions?: Threads.RequestOptions): Promise<core.Page<AgentMail.ThreadItem>>;
|
|
44
43
|
/**
|
|
45
44
|
* @param {AgentMail.inboxes.InboxId} inboxId
|
|
46
45
|
* @param {AgentMail.ThreadId} threadId
|
|
@@ -58,5 +57,17 @@ export declare class Threads {
|
|
|
58
57
|
*/
|
|
59
58
|
getAttachment(inboxId: AgentMail.inboxes.InboxId, threadId: AgentMail.ThreadId, attachmentId: AgentMail.AttachmentId, requestOptions?: Threads.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
60
59
|
private __getAttachment;
|
|
60
|
+
/**
|
|
61
|
+
* @param {AgentMail.inboxes.InboxId} inboxId
|
|
62
|
+
* @param {AgentMail.ThreadId} threadId
|
|
63
|
+
* @param {Threads.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* await client.inboxes.threads.delete("inbox_id", "thread_id")
|
|
69
|
+
*/
|
|
70
|
+
delete(inboxId: AgentMail.inboxes.InboxId, threadId: AgentMail.ThreadId, requestOptions?: Threads.RequestOptions): core.HttpResponsePromise<void>;
|
|
71
|
+
private __delete;
|
|
61
72
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
62
73
|
}
|