agentmail 0.5.7 → 0.5.9
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/Client.d.ts +3 -0
- package/dist/cjs/Client.js +25 -20
- package/dist/cjs/api/resources/auth/client/Client.d.ts +28 -0
- package/dist/cjs/api/resources/auth/client/Client.js +114 -0
- package/dist/cjs/api/resources/auth/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/auth/client/index.js +2 -0
- package/dist/cjs/api/resources/auth/exports.d.ts +2 -0
- package/dist/cjs/api/resources/auth/exports.js +21 -0
- package/dist/cjs/api/resources/auth/index.d.ts +2 -0
- package/dist/cjs/api/resources/auth/index.js +18 -0
- package/dist/cjs/api/resources/auth/types/Identity.d.ts +19 -0
- package/dist/cjs/api/resources/auth/types/Identity.js +3 -0
- package/dist/cjs/api/resources/auth/types/ScopeType.d.ts +7 -0
- package/dist/cjs/api/resources/auth/types/ScopeType.js +10 -0
- package/dist/cjs/api/resources/auth/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/auth/types/index.js +18 -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/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -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/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/auth/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/auth/index.js +17 -0
- package/dist/cjs/serialization/resources/auth/types/Identity.d.ts +16 -0
- package/dist/cjs/serialization/resources/auth/types/Identity.js +48 -0
- package/dist/cjs/serialization/resources/auth/types/ScopeType.d.ts +7 -0
- package/dist/cjs/serialization/resources/auth/types/ScopeType.js +39 -0
- package/dist/cjs/serialization/resources/auth/types/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/auth/types/index.js +18 -0
- package/dist/cjs/serialization/resources/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/index.js +3 -1
- 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/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/resources/auth/client/Client.d.mts +28 -0
- package/dist/esm/api/resources/auth/client/Client.mjs +77 -0
- package/dist/esm/api/resources/auth/client/index.d.mts +1 -0
- package/dist/esm/api/resources/auth/client/index.mjs +1 -0
- package/dist/esm/api/resources/auth/exports.d.mts +2 -0
- package/dist/esm/api/resources/auth/exports.mjs +3 -0
- package/dist/esm/api/resources/auth/index.d.mts +2 -0
- package/dist/esm/api/resources/auth/index.mjs +2 -0
- package/dist/esm/api/resources/auth/types/Identity.d.mts +19 -0
- package/dist/esm/api/resources/auth/types/Identity.mjs +2 -0
- package/dist/esm/api/resources/auth/types/ScopeType.d.mts +7 -0
- package/dist/esm/api/resources/auth/types/ScopeType.mjs +7 -0
- package/dist/esm/api/resources/auth/types/index.d.mts +2 -0
- package/dist/esm/api/resources/auth/types/index.mjs +2 -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/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- 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/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/auth/index.d.mts +1 -0
- package/dist/esm/serialization/resources/auth/index.mjs +1 -0
- package/dist/esm/serialization/resources/auth/types/Identity.d.mts +16 -0
- package/dist/esm/serialization/resources/auth/types/Identity.mjs +12 -0
- package/dist/esm/serialization/resources/auth/types/ScopeType.d.mts +7 -0
- package/dist/esm/serialization/resources/auth/types/ScopeType.mjs +3 -0
- package/dist/esm/serialization/resources/auth/types/index.d.mts +2 -0
- package/dist/esm/serialization/resources/auth/types/index.mjs +2 -0
- package/dist/esm/serialization/resources/index.d.mts +2 -0
- package/dist/esm/serialization/resources/index.mjs +2 -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/package.json +12 -1
- package/reference.md +380 -0
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.9",
|
|
47
|
+
"User-Agent": "agentmail/0.5.9",
|
|
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);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AgentClient } from "./api/resources/agent/client/Client.js";
|
|
2
2
|
import { ApiKeysClient } from "./api/resources/apiKeys/client/Client.js";
|
|
3
|
+
import { AuthClient } from "./api/resources/auth/client/Client.js";
|
|
3
4
|
import { DomainsClient } from "./api/resources/domains/client/Client.js";
|
|
4
5
|
import { DraftsClient } from "./api/resources/drafts/client/Client.js";
|
|
5
6
|
import { InboxesClient } from "./api/resources/inboxes/client/Client.js";
|
|
@@ -25,6 +26,7 @@ export declare class AgentMailClient {
|
|
|
25
26
|
protected _webhooks: WebhooksClient | undefined;
|
|
26
27
|
protected _agent: AgentClient | undefined;
|
|
27
28
|
protected _apiKeys: ApiKeysClient | undefined;
|
|
29
|
+
protected _auth: AuthClient | undefined;
|
|
28
30
|
protected _domains: DomainsClient | undefined;
|
|
29
31
|
protected _drafts: DraftsClient | undefined;
|
|
30
32
|
protected _lists: ListsClient | undefined;
|
|
@@ -38,6 +40,7 @@ export declare class AgentMailClient {
|
|
|
38
40
|
get webhooks(): WebhooksClient;
|
|
39
41
|
get agent(): AgentClient;
|
|
40
42
|
get apiKeys(): ApiKeysClient;
|
|
43
|
+
get auth(): AuthClient;
|
|
41
44
|
get domains(): DomainsClient;
|
|
42
45
|
get drafts(): DraftsClient;
|
|
43
46
|
get lists(): ListsClient;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -46,16 +46,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
46
46
|
exports.AgentMailClient = void 0;
|
|
47
47
|
const Client_js_1 = require("./api/resources/agent/client/Client.js");
|
|
48
48
|
const Client_js_2 = require("./api/resources/apiKeys/client/Client.js");
|
|
49
|
-
const Client_js_3 = require("./api/resources/
|
|
50
|
-
const Client_js_4 = require("./api/resources/
|
|
51
|
-
const Client_js_5 = require("./api/resources/
|
|
52
|
-
const Client_js_6 = require("./api/resources/
|
|
53
|
-
const Client_js_7 = require("./api/resources/
|
|
54
|
-
const Client_js_8 = require("./api/resources/
|
|
55
|
-
const Client_js_9 = require("./api/resources/
|
|
56
|
-
const Client_js_10 = require("./api/resources/
|
|
57
|
-
const Client_js_11 = require("./api/resources/
|
|
58
|
-
const Client_js_12 = require("./api/resources/
|
|
49
|
+
const Client_js_3 = require("./api/resources/auth/client/Client.js");
|
|
50
|
+
const Client_js_4 = require("./api/resources/domains/client/Client.js");
|
|
51
|
+
const Client_js_5 = require("./api/resources/drafts/client/Client.js");
|
|
52
|
+
const Client_js_6 = require("./api/resources/inboxes/client/Client.js");
|
|
53
|
+
const Client_js_7 = require("./api/resources/lists/client/Client.js");
|
|
54
|
+
const Client_js_8 = require("./api/resources/metrics/client/Client.js");
|
|
55
|
+
const Client_js_9 = require("./api/resources/organizations/client/Client.js");
|
|
56
|
+
const Client_js_10 = require("./api/resources/pods/client/Client.js");
|
|
57
|
+
const Client_js_11 = require("./api/resources/threads/client/Client.js");
|
|
58
|
+
const Client_js_12 = require("./api/resources/webhooks/client/Client.js");
|
|
59
|
+
const Client_js_13 = require("./api/resources/websockets/client/Client.js");
|
|
59
60
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
60
61
|
const core = __importStar(require("./core/index.js"));
|
|
61
62
|
const environments = __importStar(require("./environments.js"));
|
|
@@ -65,15 +66,15 @@ class AgentMailClient {
|
|
|
65
66
|
}
|
|
66
67
|
get inboxes() {
|
|
67
68
|
var _a;
|
|
68
|
-
return ((_a = this._inboxes) !== null && _a !== void 0 ? _a : (this._inboxes = new
|
|
69
|
+
return ((_a = this._inboxes) !== null && _a !== void 0 ? _a : (this._inboxes = new Client_js_6.InboxesClient(this._options)));
|
|
69
70
|
}
|
|
70
71
|
get pods() {
|
|
71
72
|
var _a;
|
|
72
|
-
return ((_a = this._pods) !== null && _a !== void 0 ? _a : (this._pods = new
|
|
73
|
+
return ((_a = this._pods) !== null && _a !== void 0 ? _a : (this._pods = new Client_js_10.PodsClient(this._options)));
|
|
73
74
|
}
|
|
74
75
|
get webhooks() {
|
|
75
76
|
var _a;
|
|
76
|
-
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new
|
|
77
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_12.WebhooksClient(this._options)));
|
|
77
78
|
}
|
|
78
79
|
get agent() {
|
|
79
80
|
var _a;
|
|
@@ -83,33 +84,37 @@ class AgentMailClient {
|
|
|
83
84
|
var _a;
|
|
84
85
|
return ((_a = this._apiKeys) !== null && _a !== void 0 ? _a : (this._apiKeys = new Client_js_2.ApiKeysClient(this._options)));
|
|
85
86
|
}
|
|
87
|
+
get auth() {
|
|
88
|
+
var _a;
|
|
89
|
+
return ((_a = this._auth) !== null && _a !== void 0 ? _a : (this._auth = new Client_js_3.AuthClient(this._options)));
|
|
90
|
+
}
|
|
86
91
|
get domains() {
|
|
87
92
|
var _a;
|
|
88
|
-
return ((_a = this._domains) !== null && _a !== void 0 ? _a : (this._domains = new
|
|
93
|
+
return ((_a = this._domains) !== null && _a !== void 0 ? _a : (this._domains = new Client_js_4.DomainsClient(this._options)));
|
|
89
94
|
}
|
|
90
95
|
get drafts() {
|
|
91
96
|
var _a;
|
|
92
|
-
return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new
|
|
97
|
+
return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new Client_js_5.DraftsClient(this._options)));
|
|
93
98
|
}
|
|
94
99
|
get lists() {
|
|
95
100
|
var _a;
|
|
96
|
-
return ((_a = this._lists) !== null && _a !== void 0 ? _a : (this._lists = new
|
|
101
|
+
return ((_a = this._lists) !== null && _a !== void 0 ? _a : (this._lists = new Client_js_7.ListsClient(this._options)));
|
|
97
102
|
}
|
|
98
103
|
get metrics() {
|
|
99
104
|
var _a;
|
|
100
|
-
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new
|
|
105
|
+
return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_js_8.MetricsClient(this._options)));
|
|
101
106
|
}
|
|
102
107
|
get organizations() {
|
|
103
108
|
var _a;
|
|
104
|
-
return ((_a = this._organizations) !== null && _a !== void 0 ? _a : (this._organizations = new
|
|
109
|
+
return ((_a = this._organizations) !== null && _a !== void 0 ? _a : (this._organizations = new Client_js_9.OrganizationsClient(this._options)));
|
|
105
110
|
}
|
|
106
111
|
get threads() {
|
|
107
112
|
var _a;
|
|
108
|
-
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new
|
|
113
|
+
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new Client_js_11.ThreadsClient(this._options)));
|
|
109
114
|
}
|
|
110
115
|
get websockets() {
|
|
111
116
|
var _a;
|
|
112
|
-
return ((_a = this._websockets) !== null && _a !== void 0 ? _a : (this._websockets = new
|
|
117
|
+
return ((_a = this._websockets) !== null && _a !== void 0 ? _a : (this._websockets = new Client_js_13.WebsocketsClient(this._options)));
|
|
113
118
|
}
|
|
114
119
|
/**
|
|
115
120
|
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../core/index.js";
|
|
4
|
+
import type * as AgentMail from "../../../index.js";
|
|
5
|
+
export declare namespace AuthClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class AuthClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<AuthClient.Options>;
|
|
12
|
+
constructor(options?: AuthClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Returns the identity and scope of the authenticated credential. Useful when a client holds a pod-scoped or inbox-scoped API key and needs to discover the parent organization, pod, or inbox without prior knowledge.
|
|
15
|
+
*
|
|
16
|
+
* **CLI:**
|
|
17
|
+
* ```bash
|
|
18
|
+
* agentmail auth me
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* await client.auth.me()
|
|
25
|
+
*/
|
|
26
|
+
me(requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<AgentMail.Identity>;
|
|
27
|
+
private __me;
|
|
28
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.AuthClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
48
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
49
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
50
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
52
|
+
const errors = __importStar(require("../../../../errors/index.js"));
|
|
53
|
+
const serializers = __importStar(require("../../../../serialization/index.js"));
|
|
54
|
+
class AuthClient {
|
|
55
|
+
constructor(options = {}) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Returns the identity and scope of the authenticated credential. Useful when a client holds a pod-scoped or inbox-scoped API key and needs to discover the parent organization, pod, or inbox without prior knowledge.
|
|
60
|
+
*
|
|
61
|
+
* **CLI:**
|
|
62
|
+
* ```bash
|
|
63
|
+
* agentmail auth me
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* await client.auth.me()
|
|
70
|
+
*/
|
|
71
|
+
me(requestOptions) {
|
|
72
|
+
return core.HttpResponsePromise.fromPromise(this.__me(requestOptions));
|
|
73
|
+
}
|
|
74
|
+
__me(requestOptions) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
77
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
78
|
+
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);
|
|
79
|
+
const _response = yield core.fetcher({
|
|
80
|
+
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)
|
|
81
|
+
.http, "/v0/auth/me"),
|
|
82
|
+
method: "GET",
|
|
83
|
+
headers: _headers,
|
|
84
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
85
|
+
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,
|
|
86
|
+
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,
|
|
87
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
88
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
89
|
+
logging: this._options.logging,
|
|
90
|
+
});
|
|
91
|
+
if (_response.ok) {
|
|
92
|
+
return {
|
|
93
|
+
data: serializers.Identity.parseOrThrow(_response.body, {
|
|
94
|
+
unrecognizedObjectKeys: "passthrough",
|
|
95
|
+
allowUnrecognizedUnionMembers: true,
|
|
96
|
+
allowUnrecognizedEnumValues: true,
|
|
97
|
+
skipValidation: true,
|
|
98
|
+
breadcrumbsPrefix: ["response"],
|
|
99
|
+
}),
|
|
100
|
+
rawResponse: _response.rawResponse,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if (_response.error.reason === "status-code") {
|
|
104
|
+
throw new errors.AgentMailError({
|
|
105
|
+
statusCode: _response.error.statusCode,
|
|
106
|
+
body: _response.error.body,
|
|
107
|
+
rawResponse: _response.rawResponse,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/auth/me");
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.AuthClient = AuthClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AuthClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "AuthClient", { enumerable: true, get: function () { return Client_js_1.AuthClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
18
|
+
__exportStar(require("./types/index.js"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Identity and scope of the authenticated credential.
|
|
4
|
+
*/
|
|
5
|
+
export interface Identity {
|
|
6
|
+
scopeType: AgentMail.ScopeType;
|
|
7
|
+
/**
|
|
8
|
+
* ID of the most specific scope the credential is bound to.
|
|
9
|
+
* Equals inbox_id when scope_type is inbox, pod_id when pod, organization_id when organization.
|
|
10
|
+
*/
|
|
11
|
+
scopeId: string;
|
|
12
|
+
organizationId: AgentMail.OrganizationId;
|
|
13
|
+
/** ID of the pod the credential is scoped to. Present when scope_type is pod or inbox. */
|
|
14
|
+
podId?: string;
|
|
15
|
+
/** ID of the inbox the credential is scoped to. Present when scope_type is inbox. */
|
|
16
|
+
inboxId?: string;
|
|
17
|
+
/** ID of the API key used to authenticate. Absent for JWT and proxy credentials. */
|
|
18
|
+
apiKeyId?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ScopeType = void 0;
|
|
5
|
+
/** The scope tier the authenticated credential is bound to. */
|
|
6
|
+
exports.ScopeType = {
|
|
7
|
+
Organization: "organization",
|
|
8
|
+
Pod: "pod",
|
|
9
|
+
Inbox: "inbox",
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Identity.js"), exports);
|
|
18
|
+
__exportStar(require("./ScopeType.js"), exports);
|
|
@@ -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
|