agentmail 0.5.8 → 0.5.10
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 +1 -2
- package/dist/cjs/api/resources/domains/client/Client.js +1 -2
- package/dist/cjs/api/resources/domains/types/CreateDomainRequest.d.ts +2 -1
- package/dist/cjs/api/resources/domains/types/Domain.d.ts +5 -1
- package/dist/cjs/api/resources/domains/types/DomainItem.d.ts +1 -0
- package/dist/cjs/api/resources/domains/types/SubdomainsEnabled.d.ts +5 -0
- package/dist/cjs/api/resources/domains/types/SubdomainsEnabled.js +3 -0
- package/dist/cjs/api/resources/domains/types/UpdateDomainRequest.d.ts +7 -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/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/client/Client.js +9 -0
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +101 -1
- package/dist/cjs/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.ts +6 -0
- package/dist/cjs/api/resources/inboxes/resources/messages/client/requests/SearchMessagesRequest.d.ts +14 -0
- package/dist/cjs/api/resources/inboxes/resources/messages/client/requests/SearchMessagesRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/messages/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.d.ts +25 -0
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +100 -1
- package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.ts +6 -0
- package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/SearchThreadsRequest.d.ts +14 -0
- package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/SearchThreadsRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/types/CreateInboxRequest.d.ts +5 -1
- package/dist/cjs/api/resources/messages/types/SearchMessageHighlights.d.ts +15 -0
- package/dist/cjs/api/resources/messages/types/SearchMessageHighlights.js +3 -0
- package/dist/cjs/api/resources/messages/types/SearchMessageItem.d.ts +5 -0
- package/dist/cjs/api/resources/messages/types/SearchMessageItem.js +3 -0
- package/dist/cjs/api/resources/messages/types/SearchMessagesResponse.d.ts +8 -0
- package/dist/cjs/api/resources/messages/types/SearchMessagesResponse.js +3 -0
- package/dist/cjs/api/resources/messages/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/messages/types/index.js +3 -0
- package/dist/cjs/api/resources/pods/resources/domains/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +1 -2
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +9 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.d.ts +25 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +100 -1
- package/dist/cjs/api/resources/pods/resources/threads/client/requests/ListThreadsRequest.d.ts +6 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/requests/SearchThreadsRequest.d.ts +14 -0
- package/dist/cjs/api/resources/pods/resources/threads/client/requests/SearchThreadsRequest.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 +26 -0
- package/dist/cjs/api/resources/threads/client/Client.js +101 -1
- package/dist/cjs/api/resources/threads/client/requests/ListThreadsRequest.d.ts +6 -0
- package/dist/cjs/api/resources/threads/client/requests/SearchThreadsRequest.d.ts +14 -0
- package/dist/cjs/api/resources/threads/client/requests/SearchThreadsRequest.js +3 -0
- package/dist/cjs/api/resources/threads/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/threads/types/SearchThreadHighlights.d.ts +15 -0
- package/dist/cjs/api/resources/threads/types/SearchThreadHighlights.js +3 -0
- package/dist/cjs/api/resources/threads/types/SearchThreadItem.d.ts +5 -0
- package/dist/cjs/api/resources/threads/types/SearchThreadItem.js +3 -0
- package/dist/cjs/api/resources/threads/types/SearchThreadsResponse.d.ts +8 -0
- package/dist/cjs/api/resources/threads/types/SearchThreadsResponse.js +3 -0
- package/dist/cjs/api/resources/threads/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/threads/types/index.js +3 -0
- package/dist/cjs/api/types/Query.d.ts +5 -0
- package/dist/cjs/api/types/Query.js +3 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/serialization/resources/domains/types/CreateDomainRequest.d.ts +3 -1
- package/dist/cjs/serialization/resources/domains/types/CreateDomainRequest.js +3 -1
- package/dist/cjs/serialization/resources/domains/types/Domain.d.ts +2 -0
- package/dist/cjs/serialization/resources/domains/types/Domain.js +2 -0
- package/dist/cjs/serialization/resources/domains/types/DomainItem.d.ts +2 -0
- package/dist/cjs/serialization/resources/domains/types/DomainItem.js +2 -0
- package/dist/cjs/serialization/resources/domains/types/SubdomainsEnabled.d.ts +7 -0
- package/dist/cjs/serialization/resources/domains/types/SubdomainsEnabled.js +39 -0
- package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.d.ts +2 -0
- package/dist/cjs/serialization/resources/domains/types/UpdateDomainRequest.js +2 -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/SearchMessageHighlights.d.ts +12 -0
- package/dist/cjs/serialization/resources/messages/types/SearchMessageHighlights.js +44 -0
- package/dist/cjs/serialization/resources/messages/types/SearchMessageItem.d.ts +11 -0
- package/dist/cjs/serialization/resources/messages/types/SearchMessageItem.js +45 -0
- package/dist/cjs/serialization/resources/messages/types/SearchMessagesResponse.d.ts +16 -0
- package/dist/cjs/serialization/resources/messages/types/SearchMessagesResponse.js +48 -0
- package/dist/cjs/serialization/resources/messages/types/index.d.ts +3 -0
- package/dist/cjs/serialization/resources/messages/types/index.js +3 -0
- package/dist/cjs/serialization/resources/threads/types/SearchThreadHighlights.d.ts +12 -0
- package/dist/cjs/serialization/resources/threads/types/SearchThreadHighlights.js +44 -0
- package/dist/cjs/serialization/resources/threads/types/SearchThreadItem.d.ts +11 -0
- package/dist/cjs/serialization/resources/threads/types/SearchThreadItem.js +45 -0
- package/dist/cjs/serialization/resources/threads/types/SearchThreadsResponse.d.ts +16 -0
- package/dist/cjs/serialization/resources/threads/types/SearchThreadsResponse.js +48 -0
- package/dist/cjs/serialization/resources/threads/types/index.d.ts +3 -0
- package/dist/cjs/serialization/resources/threads/types/index.js +3 -0
- package/dist/cjs/serialization/types/Query.d.ts +7 -0
- package/dist/cjs/serialization/types/Query.js +39 -0
- package/dist/cjs/serialization/types/index.d.ts +1 -0
- package/dist/cjs/serialization/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 +1 -2
- package/dist/esm/api/resources/domains/client/Client.mjs +1 -2
- package/dist/esm/api/resources/domains/types/CreateDomainRequest.d.mts +2 -1
- package/dist/esm/api/resources/domains/types/Domain.d.mts +5 -1
- package/dist/esm/api/resources/domains/types/DomainItem.d.mts +1 -0
- package/dist/esm/api/resources/domains/types/SubdomainsEnabled.d.mts +5 -0
- package/dist/esm/api/resources/domains/types/SubdomainsEnabled.mjs +2 -0
- package/dist/esm/api/resources/domains/types/UpdateDomainRequest.d.mts +7 -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/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/client/Client.mjs +9 -0
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +101 -1
- package/dist/esm/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.mts +6 -0
- package/dist/esm/api/resources/inboxes/resources/messages/client/requests/SearchMessagesRequest.d.mts +14 -0
- package/dist/esm/api/resources/inboxes/resources/messages/client/requests/SearchMessagesRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/messages/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.d.mts +25 -0
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +100 -1
- package/dist/esm/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.mts +6 -0
- package/dist/esm/api/resources/inboxes/resources/threads/client/requests/SearchThreadsRequest.d.mts +14 -0
- package/dist/esm/api/resources/inboxes/resources/threads/client/requests/SearchThreadsRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/threads/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/types/CreateInboxRequest.d.mts +5 -1
- package/dist/esm/api/resources/messages/types/SearchMessageHighlights.d.mts +15 -0
- package/dist/esm/api/resources/messages/types/SearchMessageHighlights.mjs +2 -0
- package/dist/esm/api/resources/messages/types/SearchMessageItem.d.mts +5 -0
- package/dist/esm/api/resources/messages/types/SearchMessageItem.mjs +2 -0
- package/dist/esm/api/resources/messages/types/SearchMessagesResponse.d.mts +8 -0
- package/dist/esm/api/resources/messages/types/SearchMessagesResponse.mjs +2 -0
- package/dist/esm/api/resources/messages/types/index.d.mts +3 -0
- package/dist/esm/api/resources/messages/types/index.mjs +3 -0
- package/dist/esm/api/resources/pods/resources/domains/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +1 -2
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +9 -0
- package/dist/esm/api/resources/pods/resources/threads/client/Client.d.mts +25 -0
- package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +100 -1
- package/dist/esm/api/resources/pods/resources/threads/client/requests/ListThreadsRequest.d.mts +6 -0
- package/dist/esm/api/resources/pods/resources/threads/client/requests/SearchThreadsRequest.d.mts +14 -0
- package/dist/esm/api/resources/pods/resources/threads/client/requests/SearchThreadsRequest.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 +26 -0
- package/dist/esm/api/resources/threads/client/Client.mjs +101 -1
- package/dist/esm/api/resources/threads/client/requests/ListThreadsRequest.d.mts +6 -0
- package/dist/esm/api/resources/threads/client/requests/SearchThreadsRequest.d.mts +14 -0
- package/dist/esm/api/resources/threads/client/requests/SearchThreadsRequest.mjs +2 -0
- package/dist/esm/api/resources/threads/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/threads/types/SearchThreadHighlights.d.mts +15 -0
- package/dist/esm/api/resources/threads/types/SearchThreadHighlights.mjs +2 -0
- package/dist/esm/api/resources/threads/types/SearchThreadItem.d.mts +5 -0
- package/dist/esm/api/resources/threads/types/SearchThreadItem.mjs +2 -0
- package/dist/esm/api/resources/threads/types/SearchThreadsResponse.d.mts +8 -0
- package/dist/esm/api/resources/threads/types/SearchThreadsResponse.mjs +2 -0
- package/dist/esm/api/resources/threads/types/index.d.mts +3 -0
- package/dist/esm/api/resources/threads/types/index.mjs +3 -0
- package/dist/esm/api/types/Query.d.mts +5 -0
- package/dist/esm/api/types/Query.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/serialization/resources/domains/types/CreateDomainRequest.d.mts +3 -1
- package/dist/esm/serialization/resources/domains/types/CreateDomainRequest.mjs +3 -1
- package/dist/esm/serialization/resources/domains/types/Domain.d.mts +2 -0
- package/dist/esm/serialization/resources/domains/types/Domain.mjs +2 -0
- package/dist/esm/serialization/resources/domains/types/DomainItem.d.mts +2 -0
- package/dist/esm/serialization/resources/domains/types/DomainItem.mjs +2 -0
- package/dist/esm/serialization/resources/domains/types/SubdomainsEnabled.d.mts +7 -0
- package/dist/esm/serialization/resources/domains/types/SubdomainsEnabled.mjs +3 -0
- package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.d.mts +2 -0
- package/dist/esm/serialization/resources/domains/types/UpdateDomainRequest.mjs +2 -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/SearchMessageHighlights.d.mts +12 -0
- package/dist/esm/serialization/resources/messages/types/SearchMessageHighlights.mjs +8 -0
- package/dist/esm/serialization/resources/messages/types/SearchMessageItem.d.mts +11 -0
- package/dist/esm/serialization/resources/messages/types/SearchMessageItem.mjs +9 -0
- package/dist/esm/serialization/resources/messages/types/SearchMessagesResponse.d.mts +16 -0
- package/dist/esm/serialization/resources/messages/types/SearchMessagesResponse.mjs +12 -0
- package/dist/esm/serialization/resources/messages/types/index.d.mts +3 -0
- package/dist/esm/serialization/resources/messages/types/index.mjs +3 -0
- package/dist/esm/serialization/resources/threads/types/SearchThreadHighlights.d.mts +12 -0
- package/dist/esm/serialization/resources/threads/types/SearchThreadHighlights.mjs +8 -0
- package/dist/esm/serialization/resources/threads/types/SearchThreadItem.d.mts +11 -0
- package/dist/esm/serialization/resources/threads/types/SearchThreadItem.mjs +9 -0
- package/dist/esm/serialization/resources/threads/types/SearchThreadsResponse.d.mts +16 -0
- package/dist/esm/serialization/resources/threads/types/SearchThreadsResponse.mjs +12 -0
- package/dist/esm/serialization/resources/threads/types/index.d.mts +3 -0
- package/dist/esm/serialization/resources/threads/types/index.mjs +3 -0
- package/dist/esm/serialization/types/Query.d.mts +7 -0
- package/dist/esm/serialization/types/Query.mjs +3 -0
- package/dist/esm/serialization/types/index.d.mts +1 -0
- package/dist/esm/serialization/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 +10309 -2931
- package/dist/llms.txt +5 -0
- package/package.json +1 -1
- package/reference.md +321 -4
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.5.
|
|
47
|
-
"User-Agent": "agentmail/0.5.
|
|
46
|
+
"X-Fern-SDK-Version": "0.5.10",
|
|
47
|
+
"User-Agent": "agentmail/0.5.10",
|
|
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);
|
|
@@ -63,8 +63,7 @@ export declare class DomainsClient {
|
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
65
|
* await client.domains.create({
|
|
66
|
-
* domain: "domain"
|
|
67
|
-
* feedbackEnabled: true
|
|
66
|
+
* domain: "domain"
|
|
68
67
|
* })
|
|
69
68
|
*/
|
|
70
69
|
create(request: AgentMail.CreateDomainRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type * as AgentMail from "../../../index.js";
|
|
2
2
|
export interface CreateDomainRequest {
|
|
3
3
|
domain: AgentMail.DomainName;
|
|
4
|
-
feedbackEnabled
|
|
4
|
+
feedbackEnabled?: AgentMail.FeedbackEnabled;
|
|
5
|
+
subdomainsEnabled?: AgentMail.SubdomainsEnabled;
|
|
5
6
|
}
|
|
@@ -5,7 +5,11 @@ export interface Domain {
|
|
|
5
5
|
domain: AgentMail.DomainName;
|
|
6
6
|
status: AgentMail.Status;
|
|
7
7
|
feedbackEnabled: AgentMail.FeedbackEnabled;
|
|
8
|
-
|
|
8
|
+
subdomainsEnabled: AgentMail.SubdomainsEnabled;
|
|
9
|
+
/**
|
|
10
|
+
* A list of DNS records required to verify the domain. Includes a
|
|
11
|
+
* wildcard MX record (`*.<domain>`) when `subdomains_enabled` is true.
|
|
12
|
+
*/
|
|
9
13
|
records: AgentMail.VerificationRecord[];
|
|
10
14
|
clientId?: AgentMail.ClientId;
|
|
11
15
|
/** Time at which the domain was last updated. */
|
|
@@ -4,6 +4,7 @@ export interface DomainItem {
|
|
|
4
4
|
domainId: AgentMail.DomainId;
|
|
5
5
|
domain: AgentMail.DomainName;
|
|
6
6
|
feedbackEnabled: AgentMail.FeedbackEnabled;
|
|
7
|
+
subdomainsEnabled: AgentMail.SubdomainsEnabled;
|
|
7
8
|
clientId?: AgentMail.ClientId;
|
|
8
9
|
/** Time at which the domain was last updated. */
|
|
9
10
|
updatedAt: Date;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import type * as AgentMail from "../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Provide at least one of `feedback_enabled` or `subdomains_enabled`. Omitted
|
|
4
|
+
* fields are left unchanged; an empty body is rejected. Enabling
|
|
5
|
+
* `subdomains_enabled` on a verified domain returns it to `PENDING` until the
|
|
6
|
+
* newly-required wildcard MX record (`*.<domain>`) is published and verified.
|
|
7
|
+
*/
|
|
2
8
|
export interface UpdateDomainRequest {
|
|
3
9
|
feedbackEnabled?: AgentMail.FeedbackEnabled;
|
|
10
|
+
subdomainsEnabled?: AgentMail.SubdomainsEnabled;
|
|
4
11
|
}
|
|
@@ -9,6 +9,7 @@ export * from "./ListDomainsResponse.js";
|
|
|
9
9
|
export * from "./RecordStatus.js";
|
|
10
10
|
export * from "./RecordType.js";
|
|
11
11
|
export * from "./Status.js";
|
|
12
|
+
export * from "./SubdomainsEnabled.js";
|
|
12
13
|
export * from "./UpdateDomainRequest.js";
|
|
13
14
|
export * from "./VerificationRecord.js";
|
|
14
15
|
export * from "./VerificationStatus.js";
|
|
@@ -25,6 +25,7 @@ __exportStar(require("./ListDomainsResponse.js"), exports);
|
|
|
25
25
|
__exportStar(require("./RecordStatus.js"), exports);
|
|
26
26
|
__exportStar(require("./RecordType.js"), exports);
|
|
27
27
|
__exportStar(require("./Status.js"), exports);
|
|
28
|
+
__exportStar(require("./SubdomainsEnabled.js"), exports);
|
|
28
29
|
__exportStar(require("./UpdateDomainRequest.js"), exports);
|
|
29
30
|
__exportStar(require("./VerificationRecord.js"), exports);
|
|
30
31
|
__exportStar(require("./VerificationStatus.js"), exports);
|
|
@@ -71,6 +71,7 @@ export declare class InboxesClient {
|
|
|
71
71
|
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
72
|
*
|
|
73
73
|
* @throws {@link AgentMail.ValidationError}
|
|
74
|
+
* @throws {@link AgentMail.UnprocessableError}
|
|
74
75
|
*
|
|
75
76
|
* @example
|
|
76
77
|
* await client.inboxes.create(undefined)
|
|
@@ -228,6 +228,7 @@ class InboxesClient {
|
|
|
228
228
|
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
229
229
|
*
|
|
230
230
|
* @throws {@link AgentMail.ValidationError}
|
|
231
|
+
* @throws {@link AgentMail.UnprocessableError}
|
|
231
232
|
*
|
|
232
233
|
* @example
|
|
233
234
|
* await client.inboxes.create(undefined)
|
|
@@ -280,6 +281,14 @@ class InboxesClient {
|
|
|
280
281
|
skipValidation: true,
|
|
281
282
|
breadcrumbsPrefix: ["response"],
|
|
282
283
|
}), _response.rawResponse);
|
|
284
|
+
case 422:
|
|
285
|
+
throw new AgentMail.UnprocessableError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
286
|
+
unrecognizedObjectKeys: "passthrough",
|
|
287
|
+
allowUnrecognizedUnionMembers: true,
|
|
288
|
+
allowUnrecognizedEnumValues: true,
|
|
289
|
+
skipValidation: true,
|
|
290
|
+
breadcrumbsPrefix: ["response"],
|
|
291
|
+
}), _response.rawResponse);
|
|
283
292
|
default:
|
|
284
293
|
throw new errors.AgentMailError({
|
|
285
294
|
statusCode: _response.error.statusCode,
|
|
@@ -11,6 +11,12 @@ export declare class MessagesClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<MessagesClient.Options>;
|
|
12
12
|
constructor(options?: MessagesClient.Options);
|
|
13
13
|
/**
|
|
14
|
+
* Lists messages in the inbox, most recent first. Pass `from`, `to`, or
|
|
15
|
+
* `subject` to filter by substring. Filtered requests are served by
|
|
16
|
+
* search, which caps `limit` at 100. For relevance-ranked full-text
|
|
17
|
+
* search across sender, recipients, subject, and message body, use
|
|
18
|
+
* `Search Messages`.
|
|
19
|
+
*
|
|
14
20
|
* **CLI:**
|
|
15
21
|
* ```bash
|
|
16
22
|
* agentmail inboxes:messages list --inbox-id <inbox_id>
|
|
@@ -27,6 +33,26 @@ export declare class MessagesClient {
|
|
|
27
33
|
*/
|
|
28
34
|
list(inbox_id: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListMessagesRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListMessagesResponse>;
|
|
29
35
|
private __list;
|
|
36
|
+
/**
|
|
37
|
+
* Full-text search across messages in the inbox, ranked by relevance. The
|
|
38
|
+
* query is matched against the sender, recipients, and subject (substring)
|
|
39
|
+
* and the message body (tokenized full text). Spam, trash, blocked, and
|
|
40
|
+
* unauthenticated messages are always excluded. `limit` cannot exceed 100.
|
|
41
|
+
*
|
|
42
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
43
|
+
* @param {AgentMail.inboxes.SearchMessagesRequest} request
|
|
44
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
45
|
+
*
|
|
46
|
+
* @throws {@link AgentMail.ValidationError}
|
|
47
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* await client.inboxes.messages.search("inbox_id", {
|
|
51
|
+
* q: "q"
|
|
52
|
+
* })
|
|
53
|
+
*/
|
|
54
|
+
search(inbox_id: AgentMail.inboxes.InboxId, request: AgentMail.inboxes.SearchMessagesRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.SearchMessagesResponse>;
|
|
55
|
+
private __search;
|
|
30
56
|
/**
|
|
31
57
|
* **CLI:**
|
|
32
58
|
* ```bash
|
|
@@ -58,6 +58,12 @@ class MessagesClient {
|
|
|
58
58
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
+
* Lists messages in the inbox, most recent first. Pass `from`, `to`, or
|
|
62
|
+
* `subject` to filter by substring. Filtered requests are served by
|
|
63
|
+
* search, which caps `limit` at 100. For relevance-ranked full-text
|
|
64
|
+
* search across sender, recipients, subject, and message body, use
|
|
65
|
+
* `Search Messages`.
|
|
66
|
+
*
|
|
61
67
|
* **CLI:**
|
|
62
68
|
* ```bash
|
|
63
69
|
* agentmail inboxes:messages list --inbox-id <inbox_id>
|
|
@@ -78,7 +84,7 @@ class MessagesClient {
|
|
|
78
84
|
__list(inbox_id_1) {
|
|
79
85
|
return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
|
|
80
86
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
81
|
-
const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeUnauthenticated, includeTrash, } = request;
|
|
87
|
+
const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeUnauthenticated, includeTrash, from: from_, to, subject, } = request;
|
|
82
88
|
const _queryParams = {
|
|
83
89
|
limit,
|
|
84
90
|
page_token: pageToken,
|
|
@@ -99,6 +105,9 @@ class MessagesClient {
|
|
|
99
105
|
include_blocked: includeBlocked,
|
|
100
106
|
include_unauthenticated: includeUnauthenticated,
|
|
101
107
|
include_trash: includeTrash,
|
|
108
|
+
from: from_ != null ? (0, json_js_1.toJson)(from_) : undefined,
|
|
109
|
+
to: to != null ? (0, json_js_1.toJson)(to) : undefined,
|
|
110
|
+
subject: subject != null ? (0, json_js_1.toJson)(subject) : undefined,
|
|
102
111
|
};
|
|
103
112
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
104
113
|
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);
|
|
@@ -147,6 +156,97 @@ class MessagesClient {
|
|
|
147
156
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/messages");
|
|
148
157
|
});
|
|
149
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* Full-text search across messages in the inbox, ranked by relevance. The
|
|
161
|
+
* query is matched against the sender, recipients, and subject (substring)
|
|
162
|
+
* and the message body (tokenized full text). Spam, trash, blocked, and
|
|
163
|
+
* unauthenticated messages are always excluded. `limit` cannot exceed 100.
|
|
164
|
+
*
|
|
165
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
166
|
+
* @param {AgentMail.inboxes.SearchMessagesRequest} request
|
|
167
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
168
|
+
*
|
|
169
|
+
* @throws {@link AgentMail.ValidationError}
|
|
170
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* await client.inboxes.messages.search("inbox_id", {
|
|
174
|
+
* q: "q"
|
|
175
|
+
* })
|
|
176
|
+
*/
|
|
177
|
+
search(inbox_id, request, requestOptions) {
|
|
178
|
+
return core.HttpResponsePromise.fromPromise(this.__search(inbox_id, request, requestOptions));
|
|
179
|
+
}
|
|
180
|
+
__search(inbox_id, request, requestOptions) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
183
|
+
const { q, limit, pageToken, before, after } = request;
|
|
184
|
+
const _queryParams = {
|
|
185
|
+
q,
|
|
186
|
+
limit,
|
|
187
|
+
page_token: pageToken,
|
|
188
|
+
before: before != null
|
|
189
|
+
? serializers.Before.jsonOrThrow(before, { unrecognizedObjectKeys: "strip", omitUndefined: true })
|
|
190
|
+
: undefined,
|
|
191
|
+
after: after != null
|
|
192
|
+
? serializers.After.jsonOrThrow(after, { unrecognizedObjectKeys: "strip", omitUndefined: true })
|
|
193
|
+
: undefined,
|
|
194
|
+
};
|
|
195
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
196
|
+
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);
|
|
197
|
+
const _response = yield core.fetcher({
|
|
198
|
+
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)
|
|
199
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/search`),
|
|
200
|
+
method: "GET",
|
|
201
|
+
headers: _headers,
|
|
202
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
203
|
+
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,
|
|
204
|
+
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,
|
|
205
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
206
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
207
|
+
logging: this._options.logging,
|
|
208
|
+
});
|
|
209
|
+
if (_response.ok) {
|
|
210
|
+
return {
|
|
211
|
+
data: serializers.SearchMessagesResponse.parseOrThrow(_response.body, {
|
|
212
|
+
unrecognizedObjectKeys: "passthrough",
|
|
213
|
+
allowUnrecognizedUnionMembers: true,
|
|
214
|
+
allowUnrecognizedEnumValues: true,
|
|
215
|
+
skipValidation: true,
|
|
216
|
+
breadcrumbsPrefix: ["response"],
|
|
217
|
+
}),
|
|
218
|
+
rawResponse: _response.rawResponse,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
if (_response.error.reason === "status-code") {
|
|
222
|
+
switch (_response.error.statusCode) {
|
|
223
|
+
case 400:
|
|
224
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
225
|
+
unrecognizedObjectKeys: "passthrough",
|
|
226
|
+
allowUnrecognizedUnionMembers: true,
|
|
227
|
+
allowUnrecognizedEnumValues: true,
|
|
228
|
+
skipValidation: true,
|
|
229
|
+
breadcrumbsPrefix: ["response"],
|
|
230
|
+
}), _response.rawResponse);
|
|
231
|
+
case 404:
|
|
232
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
233
|
+
unrecognizedObjectKeys: "passthrough",
|
|
234
|
+
allowUnrecognizedUnionMembers: true,
|
|
235
|
+
allowUnrecognizedEnumValues: true,
|
|
236
|
+
skipValidation: true,
|
|
237
|
+
breadcrumbsPrefix: ["response"],
|
|
238
|
+
}), _response.rawResponse);
|
|
239
|
+
default:
|
|
240
|
+
throw new errors.AgentMailError({
|
|
241
|
+
statusCode: _response.error.statusCode,
|
|
242
|
+
body: _response.error.body,
|
|
243
|
+
rawResponse: _response.rawResponse,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/messages/search");
|
|
248
|
+
});
|
|
249
|
+
}
|
|
150
250
|
/**
|
|
151
251
|
* **CLI:**
|
|
152
252
|
* ```bash
|
package/dist/cjs/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.ts
CHANGED
|
@@ -14,4 +14,10 @@ export interface ListMessagesRequest {
|
|
|
14
14
|
includeBlocked?: AgentMail.IncludeBlocked;
|
|
15
15
|
includeUnauthenticated?: AgentMail.IncludeUnauthenticated;
|
|
16
16
|
includeTrash?: AgentMail.IncludeTrash;
|
|
17
|
+
/** Filter to messages whose sender contains this value (substring match). Repeatable; all values must match. */
|
|
18
|
+
from?: string[];
|
|
19
|
+
/** Filter to messages whose recipients (to, cc, or bcc) contain this value (substring match). Repeatable; all values must match. */
|
|
20
|
+
to?: string[];
|
|
21
|
+
/** Filter to messages whose subject contains this value (substring match). Repeatable; all values must match. */
|
|
22
|
+
subject?: string[];
|
|
17
23
|
}
|
package/dist/cjs/api/resources/inboxes/resources/messages/client/requests/SearchMessagesRequest.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* q: "q"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface SearchMessagesRequest {
|
|
9
|
+
q: AgentMail.Query;
|
|
10
|
+
limit?: AgentMail.Limit;
|
|
11
|
+
pageToken?: AgentMail.PageToken;
|
|
12
|
+
before?: AgentMail.Before;
|
|
13
|
+
after?: AgentMail.After;
|
|
14
|
+
}
|
|
@@ -11,6 +11,11 @@ export declare class ThreadsClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<ThreadsClient.Options>;
|
|
12
12
|
constructor(options?: ThreadsClient.Options);
|
|
13
13
|
/**
|
|
14
|
+
* Lists threads in the inbox, most recent first. Pass `senders`,
|
|
15
|
+
* `recipients`, or `subject` to filter by substring. Filtered requests are
|
|
16
|
+
* served by search, which caps `limit` at 100. For relevance-ranked
|
|
17
|
+
* full-text search, use `Search Threads`.
|
|
18
|
+
*
|
|
14
19
|
* **CLI:**
|
|
15
20
|
* ```bash
|
|
16
21
|
* agentmail inboxes:threads list --inbox-id <inbox_id>
|
|
@@ -27,6 +32,26 @@ export declare class ThreadsClient {
|
|
|
27
32
|
*/
|
|
28
33
|
list(inbox_id: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListThreadsResponse>;
|
|
29
34
|
private __list;
|
|
35
|
+
/**
|
|
36
|
+
* Full-text search across threads in the inbox, ranked by relevance. The
|
|
37
|
+
* query is matched against senders, recipients, and subject (substring)
|
|
38
|
+
* and the message body (tokenized full text). Spam, trash, blocked, and
|
|
39
|
+
* unauthenticated threads are always excluded. `limit` cannot exceed 100.
|
|
40
|
+
*
|
|
41
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
42
|
+
* @param {AgentMail.inboxes.SearchThreadsRequest} request
|
|
43
|
+
* @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
|
+
*
|
|
45
|
+
* @throws {@link AgentMail.ValidationError}
|
|
46
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* await client.inboxes.threads.search("inbox_id", {
|
|
50
|
+
* q: "q"
|
|
51
|
+
* })
|
|
52
|
+
*/
|
|
53
|
+
search(inbox_id: AgentMail.inboxes.InboxId, request: AgentMail.inboxes.SearchThreadsRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<AgentMail.SearchThreadsResponse>;
|
|
54
|
+
private __search;
|
|
30
55
|
/**
|
|
31
56
|
* **CLI:**
|
|
32
57
|
* ```bash
|
|
@@ -58,6 +58,11 @@ class ThreadsClient {
|
|
|
58
58
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
+
* Lists threads in the inbox, most recent first. Pass `senders`,
|
|
62
|
+
* `recipients`, or `subject` to filter by substring. Filtered requests are
|
|
63
|
+
* served by search, which caps `limit` at 100. For relevance-ranked
|
|
64
|
+
* full-text search, use `Search Threads`.
|
|
65
|
+
*
|
|
61
66
|
* **CLI:**
|
|
62
67
|
* ```bash
|
|
63
68
|
* agentmail inboxes:threads list --inbox-id <inbox_id>
|
|
@@ -78,7 +83,7 @@ class ThreadsClient {
|
|
|
78
83
|
__list(inbox_id_1) {
|
|
79
84
|
return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
|
|
80
85
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
81
|
-
const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeUnauthenticated, includeTrash, } = request;
|
|
86
|
+
const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeUnauthenticated, includeTrash, senders, recipients, subject, } = request;
|
|
82
87
|
const _queryParams = {
|
|
83
88
|
limit,
|
|
84
89
|
page_token: pageToken,
|
|
@@ -99,6 +104,9 @@ class ThreadsClient {
|
|
|
99
104
|
include_blocked: includeBlocked,
|
|
100
105
|
include_unauthenticated: includeUnauthenticated,
|
|
101
106
|
include_trash: includeTrash,
|
|
107
|
+
senders: senders != null ? (0, json_js_1.toJson)(senders) : undefined,
|
|
108
|
+
recipients: recipients != null ? (0, json_js_1.toJson)(recipients) : undefined,
|
|
109
|
+
subject: subject != null ? (0, json_js_1.toJson)(subject) : undefined,
|
|
102
110
|
};
|
|
103
111
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
104
112
|
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);
|
|
@@ -147,6 +155,97 @@ class ThreadsClient {
|
|
|
147
155
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/threads");
|
|
148
156
|
});
|
|
149
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Full-text search across threads in the inbox, ranked by relevance. The
|
|
160
|
+
* query is matched against senders, recipients, and subject (substring)
|
|
161
|
+
* and the message body (tokenized full text). Spam, trash, blocked, and
|
|
162
|
+
* unauthenticated threads are always excluded. `limit` cannot exceed 100.
|
|
163
|
+
*
|
|
164
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
165
|
+
* @param {AgentMail.inboxes.SearchThreadsRequest} request
|
|
166
|
+
* @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
167
|
+
*
|
|
168
|
+
* @throws {@link AgentMail.ValidationError}
|
|
169
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* await client.inboxes.threads.search("inbox_id", {
|
|
173
|
+
* q: "q"
|
|
174
|
+
* })
|
|
175
|
+
*/
|
|
176
|
+
search(inbox_id, request, requestOptions) {
|
|
177
|
+
return core.HttpResponsePromise.fromPromise(this.__search(inbox_id, request, requestOptions));
|
|
178
|
+
}
|
|
179
|
+
__search(inbox_id, request, requestOptions) {
|
|
180
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
182
|
+
const { q, limit, pageToken, before, after } = request;
|
|
183
|
+
const _queryParams = {
|
|
184
|
+
q,
|
|
185
|
+
limit,
|
|
186
|
+
page_token: pageToken,
|
|
187
|
+
before: before != null
|
|
188
|
+
? serializers.Before.jsonOrThrow(before, { unrecognizedObjectKeys: "strip", omitUndefined: true })
|
|
189
|
+
: undefined,
|
|
190
|
+
after: after != null
|
|
191
|
+
? serializers.After.jsonOrThrow(after, { unrecognizedObjectKeys: "strip", omitUndefined: true })
|
|
192
|
+
: undefined,
|
|
193
|
+
};
|
|
194
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
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);
|
|
196
|
+
const _response = yield core.fetcher({
|
|
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)
|
|
198
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/threads/search`),
|
|
199
|
+
method: "GET",
|
|
200
|
+
headers: _headers,
|
|
201
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
202
|
+
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,
|
|
203
|
+
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,
|
|
204
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
205
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
206
|
+
logging: this._options.logging,
|
|
207
|
+
});
|
|
208
|
+
if (_response.ok) {
|
|
209
|
+
return {
|
|
210
|
+
data: serializers.SearchThreadsResponse.parseOrThrow(_response.body, {
|
|
211
|
+
unrecognizedObjectKeys: "passthrough",
|
|
212
|
+
allowUnrecognizedUnionMembers: true,
|
|
213
|
+
allowUnrecognizedEnumValues: true,
|
|
214
|
+
skipValidation: true,
|
|
215
|
+
breadcrumbsPrefix: ["response"],
|
|
216
|
+
}),
|
|
217
|
+
rawResponse: _response.rawResponse,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
if (_response.error.reason === "status-code") {
|
|
221
|
+
switch (_response.error.statusCode) {
|
|
222
|
+
case 400:
|
|
223
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
224
|
+
unrecognizedObjectKeys: "passthrough",
|
|
225
|
+
allowUnrecognizedUnionMembers: true,
|
|
226
|
+
allowUnrecognizedEnumValues: true,
|
|
227
|
+
skipValidation: true,
|
|
228
|
+
breadcrumbsPrefix: ["response"],
|
|
229
|
+
}), _response.rawResponse);
|
|
230
|
+
case 404:
|
|
231
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
232
|
+
unrecognizedObjectKeys: "passthrough",
|
|
233
|
+
allowUnrecognizedUnionMembers: true,
|
|
234
|
+
allowUnrecognizedEnumValues: true,
|
|
235
|
+
skipValidation: true,
|
|
236
|
+
breadcrumbsPrefix: ["response"],
|
|
237
|
+
}), _response.rawResponse);
|
|
238
|
+
default:
|
|
239
|
+
throw new errors.AgentMailError({
|
|
240
|
+
statusCode: _response.error.statusCode,
|
|
241
|
+
body: _response.error.body,
|
|
242
|
+
rawResponse: _response.rawResponse,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/threads/search");
|
|
247
|
+
});
|
|
248
|
+
}
|
|
150
249
|
/**
|
|
151
250
|
* **CLI:**
|
|
152
251
|
* ```bash
|
package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.ts
CHANGED
|
@@ -14,4 +14,10 @@ export interface ListThreadsRequest {
|
|
|
14
14
|
includeBlocked?: AgentMail.IncludeBlocked;
|
|
15
15
|
includeUnauthenticated?: AgentMail.IncludeUnauthenticated;
|
|
16
16
|
includeTrash?: AgentMail.IncludeTrash;
|
|
17
|
+
/** Filter to threads whose senders contain this value (substring match). Repeatable; all values must match. */
|
|
18
|
+
senders?: string[];
|
|
19
|
+
/** Filter to threads whose recipients contain this value (substring match). Repeatable; all values must match. */
|
|
20
|
+
recipients?: string[];
|
|
21
|
+
/** Filter to threads whose subject contains this value (substring match). Repeatable; all values must match. */
|
|
22
|
+
subject?: string[];
|
|
17
23
|
}
|
package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/SearchThreadsRequest.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* q: "q"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface SearchThreadsRequest {
|
|
9
|
+
q: AgentMail.Query;
|
|
10
|
+
limit?: AgentMail.Limit;
|
|
11
|
+
pageToken?: AgentMail.PageToken;
|
|
12
|
+
before?: AgentMail.Before;
|
|
13
|
+
after?: AgentMail.After;
|
|
14
|
+
}
|
|
@@ -2,7 +2,11 @@ import type * as AgentMail from "../../../index.js";
|
|
|
2
2
|
export interface CreateInboxRequest {
|
|
3
3
|
/** Username of address. Randomly generated if not specified. */
|
|
4
4
|
username?: string;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Domain of address. Must be a verified domain, or any subdomain of a
|
|
7
|
+
* verified domain that has subdomains enabled (e.g., `bot.example.com`).
|
|
8
|
+
* Defaults to `agentmail.to`.
|
|
9
|
+
*/
|
|
6
10
|
domain?: string;
|
|
7
11
|
displayName?: AgentMail.inboxes.DisplayName;
|
|
8
12
|
clientId?: AgentMail.inboxes.ClientId;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matched fragments per field on a message search result, with matched terms
|
|
3
|
+
* wrapped in `**`. A field key is present only when the query matched that
|
|
4
|
+
* field, so the present keys also tell you which fields produced the hit.
|
|
5
|
+
*/
|
|
6
|
+
export interface SearchMessageHighlights {
|
|
7
|
+
/** Matched fragments from the sender address. */
|
|
8
|
+
from?: string[];
|
|
9
|
+
/** Matched fragments from the recipient addresses (to, cc, or bcc). */
|
|
10
|
+
recipients?: string[];
|
|
11
|
+
/** Matched fragments from the subject. */
|
|
12
|
+
subject?: string[];
|
|
13
|
+
/** Matched fragments from the message body. */
|
|
14
|
+
text?: string[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.js";
|
|
2
|
+
export interface SearchMessagesResponse {
|
|
3
|
+
count: AgentMail.Count;
|
|
4
|
+
limit?: AgentMail.Limit;
|
|
5
|
+
nextPageToken?: AgentMail.PageToken;
|
|
6
|
+
/** Ordered by relevance, best match first. */
|
|
7
|
+
messages: AgentMail.SearchMessageItem[];
|
|
8
|
+
}
|
|
@@ -28,6 +28,9 @@ export * from "./RawMessageResponse.js";
|
|
|
28
28
|
export * from "./ReplyAll.js";
|
|
29
29
|
export * from "./ReplyAllMessageRequest.js";
|
|
30
30
|
export * from "./ReplyToMessageRequest.js";
|
|
31
|
+
export * from "./SearchMessageHighlights.js";
|
|
32
|
+
export * from "./SearchMessageItem.js";
|
|
33
|
+
export * from "./SearchMessagesResponse.js";
|
|
31
34
|
export * from "./SendMessageAttachments.js";
|
|
32
35
|
export * from "./SendMessageBcc.js";
|
|
33
36
|
export * from "./SendMessageCc.js";
|
|
@@ -44,6 +44,9 @@ __exportStar(require("./RawMessageResponse.js"), exports);
|
|
|
44
44
|
__exportStar(require("./ReplyAll.js"), exports);
|
|
45
45
|
__exportStar(require("./ReplyAllMessageRequest.js"), exports);
|
|
46
46
|
__exportStar(require("./ReplyToMessageRequest.js"), exports);
|
|
47
|
+
__exportStar(require("./SearchMessageHighlights.js"), exports);
|
|
48
|
+
__exportStar(require("./SearchMessageItem.js"), exports);
|
|
49
|
+
__exportStar(require("./SearchMessagesResponse.js"), exports);
|
|
47
50
|
__exportStar(require("./SendMessageAttachments.js"), exports);
|
|
48
51
|
__exportStar(require("./SendMessageBcc.js"), exports);
|
|
49
52
|
__exportStar(require("./SendMessageCc.js"), exports);
|