agentmail 0.5.22 → 0.5.23
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/inboxes/client/Client.d.ts +20 -0
- package/dist/cjs/api/resources/inboxes/client/Client.js +77 -0
- package/dist/cjs/api/resources/inboxes/client/requests/SearchInboxesRequest.d.ts +13 -0
- package/dist/cjs/api/resources/inboxes/client/requests/SearchInboxesRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/types/SearchInboxesResponse.d.ts +8 -0
- package/dist/cjs/api/resources/inboxes/types/SearchInboxesResponse.js +3 -0
- package/dist/cjs/api/resources/inboxes/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/types/index.js +1 -0
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.d.ts +22 -0
- package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +87 -0
- package/dist/cjs/api/resources/pods/resources/inboxes/client/requests/SearchInboxesRequest.d.ts +13 -0
- package/dist/cjs/api/resources/pods/resources/inboxes/client/requests/SearchInboxesRequest.js +3 -0
- package/dist/cjs/api/resources/pods/resources/inboxes/client/requests/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/inboxes/types/SearchInboxesResponse.d.ts +16 -0
- package/dist/cjs/serialization/resources/inboxes/types/SearchInboxesResponse.js +48 -0
- package/dist/cjs/serialization/resources/inboxes/types/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/inboxes/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/inboxes/client/Client.d.mts +20 -0
- package/dist/esm/api/resources/inboxes/client/Client.mjs +77 -0
- package/dist/esm/api/resources/inboxes/client/requests/SearchInboxesRequest.d.mts +13 -0
- package/dist/esm/api/resources/inboxes/client/requests/SearchInboxesRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/types/SearchInboxesResponse.d.mts +8 -0
- package/dist/esm/api/resources/inboxes/types/SearchInboxesResponse.mjs +2 -0
- package/dist/esm/api/resources/inboxes/types/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/types/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.d.mts +22 -0
- package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +87 -0
- package/dist/esm/api/resources/pods/resources/inboxes/client/requests/SearchInboxesRequest.d.mts +13 -0
- package/dist/esm/api/resources/pods/resources/inboxes/client/requests/SearchInboxesRequest.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/inboxes/client/requests/index.d.mts +1 -0
- package/dist/esm/serialization/resources/inboxes/types/SearchInboxesResponse.d.mts +16 -0
- package/dist/esm/serialization/resources/inboxes/types/SearchInboxesResponse.mjs +12 -0
- package/dist/esm/serialization/resources/inboxes/types/index.d.mts +1 -0
- package/dist/esm/serialization/resources/inboxes/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +148 -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.23",
|
|
47
|
+
"User-Agent": "agentmail/0.5.23",
|
|
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);
|
|
@@ -51,6 +51,26 @@ export declare class InboxesClient {
|
|
|
51
51
|
*/
|
|
52
52
|
list(request?: AgentMail.inboxes.ListInboxesRequest, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.ListInboxesResponse>;
|
|
53
53
|
private __list;
|
|
54
|
+
/**
|
|
55
|
+
* Searches inboxes in the organization by address or display name, ranked
|
|
56
|
+
* by relevance. Each word in the query matches the start of a word in the
|
|
57
|
+
* address or display name, so `sup` matches `support@example.com` but
|
|
58
|
+
* `port` does not. An exact address match always ranks first. `limit`
|
|
59
|
+
* cannot exceed 100. A page can be empty and still carry a
|
|
60
|
+
* `next_page_token`; keep paging until the token is absent.
|
|
61
|
+
*
|
|
62
|
+
* @param {AgentMail.inboxes.SearchInboxesRequest} request
|
|
63
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link AgentMail.ValidationError}
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* await client.inboxes.search({
|
|
69
|
+
* q: "q"
|
|
70
|
+
* })
|
|
71
|
+
*/
|
|
72
|
+
search(request: AgentMail.inboxes.SearchInboxesRequest, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.SearchInboxesResponse>;
|
|
73
|
+
private __search;
|
|
54
74
|
/**
|
|
55
75
|
* **CLI:**
|
|
56
76
|
* ```bash
|
|
@@ -161,6 +161,83 @@ class InboxesClient {
|
|
|
161
161
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/inboxes");
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Searches inboxes in the organization by address or display name, ranked
|
|
166
|
+
* by relevance. Each word in the query matches the start of a word in the
|
|
167
|
+
* address or display name, so `sup` matches `support@example.com` but
|
|
168
|
+
* `port` does not. An exact address match always ranks first. `limit`
|
|
169
|
+
* cannot exceed 100. A page can be empty and still carry a
|
|
170
|
+
* `next_page_token`; keep paging until the token is absent.
|
|
171
|
+
*
|
|
172
|
+
* @param {AgentMail.inboxes.SearchInboxesRequest} request
|
|
173
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
174
|
+
*
|
|
175
|
+
* @throws {@link AgentMail.ValidationError}
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* await client.inboxes.search({
|
|
179
|
+
* q: "q"
|
|
180
|
+
* })
|
|
181
|
+
*/
|
|
182
|
+
search(request, requestOptions) {
|
|
183
|
+
return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions));
|
|
184
|
+
}
|
|
185
|
+
__search(request, requestOptions) {
|
|
186
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
188
|
+
const { q, limit, pageToken } = request;
|
|
189
|
+
const _queryParams = {
|
|
190
|
+
q,
|
|
191
|
+
limit,
|
|
192
|
+
page_token: pageToken,
|
|
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/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.inboxes.SearchInboxesResponse.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
|
+
default:
|
|
231
|
+
throw new errors.AgentMailError({
|
|
232
|
+
statusCode: _response.error.statusCode,
|
|
233
|
+
body: _response.error.body,
|
|
234
|
+
rawResponse: _response.rawResponse,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/inboxes/search");
|
|
239
|
+
});
|
|
240
|
+
}
|
|
164
241
|
/**
|
|
165
242
|
* **CLI:**
|
|
166
243
|
* ```bash
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* q: "q"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface SearchInboxesRequest {
|
|
9
|
+
/** Address or display name to search for. Matches word prefixes. Must be 2 to 256 characters. */
|
|
10
|
+
q: string;
|
|
11
|
+
limit?: AgentMail.Limit;
|
|
12
|
+
pageToken?: AgentMail.PageToken;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.js";
|
|
2
|
+
export interface SearchInboxesResponse {
|
|
3
|
+
count: AgentMail.Count;
|
|
4
|
+
limit?: AgentMail.Limit;
|
|
5
|
+
nextPageToken?: AgentMail.PageToken;
|
|
6
|
+
/** Ordered by relevance, best match first. */
|
|
7
|
+
inboxes: AgentMail.inboxes.Inbox[];
|
|
8
|
+
}
|
|
@@ -7,5 +7,6 @@ export * from "./InboxId.js";
|
|
|
7
7
|
export * from "./ListInboxesResponse.js";
|
|
8
8
|
export * from "./Metadata.js";
|
|
9
9
|
export * from "./MetadataValue.js";
|
|
10
|
+
export * from "./SearchInboxesResponse.js";
|
|
10
11
|
export * from "./UpdateInboxRequest.js";
|
|
11
12
|
export * from "./UpdateMetadata.js";
|
|
@@ -23,5 +23,6 @@ __exportStar(require("./InboxId.js"), exports);
|
|
|
23
23
|
__exportStar(require("./ListInboxesResponse.js"), exports);
|
|
24
24
|
__exportStar(require("./Metadata.js"), exports);
|
|
25
25
|
__exportStar(require("./MetadataValue.js"), exports);
|
|
26
|
+
__exportStar(require("./SearchInboxesResponse.js"), exports);
|
|
26
27
|
__exportStar(require("./UpdateInboxRequest.js"), exports);
|
|
27
28
|
__exportStar(require("./UpdateMetadata.js"), exports);
|
|
@@ -27,6 +27,28 @@ export declare class InboxesClient {
|
|
|
27
27
|
*/
|
|
28
28
|
list(pod_id: AgentMail.pods.PodId, request?: AgentMail.pods.ListInboxesRequest, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.ListInboxesResponse>;
|
|
29
29
|
private __list;
|
|
30
|
+
/**
|
|
31
|
+
* Searches inboxes in the pod by address or display name, ranked by
|
|
32
|
+
* relevance. Each word in the query matches the start of a word in the
|
|
33
|
+
* address or display name, so `sup` matches `support@example.com` but
|
|
34
|
+
* `port` does not. An exact address match always ranks first. `limit`
|
|
35
|
+
* cannot exceed 100. A page can be empty and still carry a
|
|
36
|
+
* `next_page_token`; keep paging until the token is absent.
|
|
37
|
+
*
|
|
38
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
39
|
+
* @param {AgentMail.pods.SearchInboxesRequest} request
|
|
40
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
41
|
+
*
|
|
42
|
+
* @throws {@link AgentMail.ValidationError}
|
|
43
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* await client.pods.inboxes.search("pod_id", {
|
|
47
|
+
* q: "q"
|
|
48
|
+
* })
|
|
49
|
+
*/
|
|
50
|
+
search(pod_id: AgentMail.pods.PodId, request: AgentMail.pods.SearchInboxesRequest, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.SearchInboxesResponse>;
|
|
51
|
+
private __search;
|
|
30
52
|
/**
|
|
31
53
|
* **CLI:**
|
|
32
54
|
* ```bash
|
|
@@ -130,6 +130,93 @@ class InboxesClient {
|
|
|
130
130
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/inboxes");
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Searches inboxes in the pod by address or display name, ranked by
|
|
135
|
+
* relevance. Each word in the query matches the start of a word in the
|
|
136
|
+
* address or display name, so `sup` matches `support@example.com` but
|
|
137
|
+
* `port` does not. An exact address match always ranks first. `limit`
|
|
138
|
+
* cannot exceed 100. A page can be empty and still carry a
|
|
139
|
+
* `next_page_token`; keep paging until the token is absent.
|
|
140
|
+
*
|
|
141
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
142
|
+
* @param {AgentMail.pods.SearchInboxesRequest} request
|
|
143
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
144
|
+
*
|
|
145
|
+
* @throws {@link AgentMail.ValidationError}
|
|
146
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* await client.pods.inboxes.search("pod_id", {
|
|
150
|
+
* q: "q"
|
|
151
|
+
* })
|
|
152
|
+
*/
|
|
153
|
+
search(pod_id, request, requestOptions) {
|
|
154
|
+
return core.HttpResponsePromise.fromPromise(this.__search(pod_id, request, requestOptions));
|
|
155
|
+
}
|
|
156
|
+
__search(pod_id, request, requestOptions) {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
159
|
+
const { q, limit, pageToken } = request;
|
|
160
|
+
const _queryParams = {
|
|
161
|
+
q,
|
|
162
|
+
limit,
|
|
163
|
+
page_token: pageToken,
|
|
164
|
+
};
|
|
165
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
166
|
+
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);
|
|
167
|
+
const _response = yield core.fetcher({
|
|
168
|
+
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)
|
|
169
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/inboxes/search`),
|
|
170
|
+
method: "GET",
|
|
171
|
+
headers: _headers,
|
|
172
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
173
|
+
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,
|
|
174
|
+
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,
|
|
175
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
176
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
177
|
+
logging: this._options.logging,
|
|
178
|
+
});
|
|
179
|
+
if (_response.ok) {
|
|
180
|
+
return {
|
|
181
|
+
data: serializers.inboxes.SearchInboxesResponse.parseOrThrow(_response.body, {
|
|
182
|
+
unrecognizedObjectKeys: "passthrough",
|
|
183
|
+
allowUnrecognizedUnionMembers: true,
|
|
184
|
+
allowUnrecognizedEnumValues: true,
|
|
185
|
+
skipValidation: true,
|
|
186
|
+
breadcrumbsPrefix: ["response"],
|
|
187
|
+
}),
|
|
188
|
+
rawResponse: _response.rawResponse,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
if (_response.error.reason === "status-code") {
|
|
192
|
+
switch (_response.error.statusCode) {
|
|
193
|
+
case 400:
|
|
194
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
195
|
+
unrecognizedObjectKeys: "passthrough",
|
|
196
|
+
allowUnrecognizedUnionMembers: true,
|
|
197
|
+
allowUnrecognizedEnumValues: true,
|
|
198
|
+
skipValidation: true,
|
|
199
|
+
breadcrumbsPrefix: ["response"],
|
|
200
|
+
}), _response.rawResponse);
|
|
201
|
+
case 404:
|
|
202
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
203
|
+
unrecognizedObjectKeys: "passthrough",
|
|
204
|
+
allowUnrecognizedUnionMembers: true,
|
|
205
|
+
allowUnrecognizedEnumValues: true,
|
|
206
|
+
skipValidation: true,
|
|
207
|
+
breadcrumbsPrefix: ["response"],
|
|
208
|
+
}), _response.rawResponse);
|
|
209
|
+
default:
|
|
210
|
+
throw new errors.AgentMailError({
|
|
211
|
+
statusCode: _response.error.statusCode,
|
|
212
|
+
body: _response.error.body,
|
|
213
|
+
rawResponse: _response.rawResponse,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/inboxes/search");
|
|
218
|
+
});
|
|
219
|
+
}
|
|
133
220
|
/**
|
|
134
221
|
* **CLI:**
|
|
135
222
|
* ```bash
|
package/dist/cjs/api/resources/pods/resources/inboxes/client/requests/SearchInboxesRequest.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* q: "q"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface SearchInboxesRequest {
|
|
9
|
+
/** Address or display name to search for. Matches word prefixes. Must be 2 to 256 characters. */
|
|
10
|
+
q: string;
|
|
11
|
+
limit?: AgentMail.Limit;
|
|
12
|
+
pageToken?: AgentMail.PageToken;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.js";
|
|
2
|
+
import * as core from "../../../../core/index.js";
|
|
3
|
+
import type * as serializers from "../../../index.js";
|
|
4
|
+
import { Count } from "../../../types/Count.js";
|
|
5
|
+
import { Limit } from "../../../types/Limit.js";
|
|
6
|
+
import { PageToken } from "../../../types/PageToken.js";
|
|
7
|
+
import { Inbox } from "./Inbox.js";
|
|
8
|
+
export declare const SearchInboxesResponse: core.serialization.ObjectSchema<serializers.inboxes.SearchInboxesResponse.Raw, AgentMail.inboxes.SearchInboxesResponse>;
|
|
9
|
+
export declare namespace SearchInboxesResponse {
|
|
10
|
+
interface Raw {
|
|
11
|
+
count: Count.Raw;
|
|
12
|
+
limit?: Limit.Raw | null;
|
|
13
|
+
next_page_token?: PageToken.Raw | null;
|
|
14
|
+
inboxes: Inbox.Raw[];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.SearchInboxesResponse = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
const Count_js_1 = require("../../../types/Count.js");
|
|
40
|
+
const Limit_js_1 = require("../../../types/Limit.js");
|
|
41
|
+
const PageToken_js_1 = require("../../../types/PageToken.js");
|
|
42
|
+
const Inbox_js_1 = require("./Inbox.js");
|
|
43
|
+
exports.SearchInboxesResponse = core.serialization.object({
|
|
44
|
+
count: Count_js_1.Count,
|
|
45
|
+
limit: Limit_js_1.Limit.optional(),
|
|
46
|
+
nextPageToken: core.serialization.property("next_page_token", PageToken_js_1.PageToken.optional()),
|
|
47
|
+
inboxes: core.serialization.list(Inbox_js_1.Inbox),
|
|
48
|
+
});
|
|
@@ -7,5 +7,6 @@ export * from "./InboxId.js";
|
|
|
7
7
|
export * from "./ListInboxesResponse.js";
|
|
8
8
|
export * from "./Metadata.js";
|
|
9
9
|
export * from "./MetadataValue.js";
|
|
10
|
+
export * from "./SearchInboxesResponse.js";
|
|
10
11
|
export * from "./UpdateInboxRequest.js";
|
|
11
12
|
export * from "./UpdateMetadata.js";
|
|
@@ -23,5 +23,6 @@ __exportStar(require("./InboxId.js"), exports);
|
|
|
23
23
|
__exportStar(require("./ListInboxesResponse.js"), exports);
|
|
24
24
|
__exportStar(require("./Metadata.js"), exports);
|
|
25
25
|
__exportStar(require("./MetadataValue.js"), exports);
|
|
26
|
+
__exportStar(require("./SearchInboxesResponse.js"), exports);
|
|
26
27
|
__exportStar(require("./UpdateInboxRequest.js"), exports);
|
|
27
28
|
__exportStar(require("./UpdateMetadata.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.5.
|
|
1
|
+
export declare const SDK_VERSION = "0.5.23";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "agentmail",
|
|
9
|
-
"X-Fern-SDK-Version": "0.5.
|
|
10
|
-
"User-Agent": "agentmail/0.5.
|
|
9
|
+
"X-Fern-SDK-Version": "0.5.23",
|
|
10
|
+
"User-Agent": "agentmail/0.5.23",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -51,6 +51,26 @@ export declare class InboxesClient {
|
|
|
51
51
|
*/
|
|
52
52
|
list(request?: AgentMail.inboxes.ListInboxesRequest, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.ListInboxesResponse>;
|
|
53
53
|
private __list;
|
|
54
|
+
/**
|
|
55
|
+
* Searches inboxes in the organization by address or display name, ranked
|
|
56
|
+
* by relevance. Each word in the query matches the start of a word in the
|
|
57
|
+
* address or display name, so `sup` matches `support@example.com` but
|
|
58
|
+
* `port` does not. An exact address match always ranks first. `limit`
|
|
59
|
+
* cannot exceed 100. A page can be empty and still carry a
|
|
60
|
+
* `next_page_token`; keep paging until the token is absent.
|
|
61
|
+
*
|
|
62
|
+
* @param {AgentMail.inboxes.SearchInboxesRequest} request
|
|
63
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link AgentMail.ValidationError}
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* await client.inboxes.search({
|
|
69
|
+
* q: "q"
|
|
70
|
+
* })
|
|
71
|
+
*/
|
|
72
|
+
search(request: AgentMail.inboxes.SearchInboxesRequest, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.SearchInboxesResponse>;
|
|
73
|
+
private __search;
|
|
54
74
|
/**
|
|
55
75
|
* **CLI:**
|
|
56
76
|
* ```bash
|
|
@@ -125,6 +125,83 @@ export class InboxesClient {
|
|
|
125
125
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes");
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Searches inboxes in the organization by address or display name, ranked
|
|
130
|
+
* by relevance. Each word in the query matches the start of a word in the
|
|
131
|
+
* address or display name, so `sup` matches `support@example.com` but
|
|
132
|
+
* `port` does not. An exact address match always ranks first. `limit`
|
|
133
|
+
* cannot exceed 100. A page can be empty and still carry a
|
|
134
|
+
* `next_page_token`; keep paging until the token is absent.
|
|
135
|
+
*
|
|
136
|
+
* @param {AgentMail.inboxes.SearchInboxesRequest} request
|
|
137
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
138
|
+
*
|
|
139
|
+
* @throws {@link AgentMail.ValidationError}
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* await client.inboxes.search({
|
|
143
|
+
* q: "q"
|
|
144
|
+
* })
|
|
145
|
+
*/
|
|
146
|
+
search(request, requestOptions) {
|
|
147
|
+
return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions));
|
|
148
|
+
}
|
|
149
|
+
__search(request, requestOptions) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
152
|
+
const { q, limit, pageToken } = request;
|
|
153
|
+
const _queryParams = {
|
|
154
|
+
q,
|
|
155
|
+
limit,
|
|
156
|
+
page_token: pageToken,
|
|
157
|
+
};
|
|
158
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
159
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
160
|
+
const _response = yield core.fetcher({
|
|
161
|
+
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)
|
|
162
|
+
.http, "/v0/inboxes/search"),
|
|
163
|
+
method: "GET",
|
|
164
|
+
headers: _headers,
|
|
165
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
166
|
+
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,
|
|
167
|
+
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,
|
|
168
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
169
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
170
|
+
logging: this._options.logging,
|
|
171
|
+
});
|
|
172
|
+
if (_response.ok) {
|
|
173
|
+
return {
|
|
174
|
+
data: serializers.inboxes.SearchInboxesResponse.parseOrThrow(_response.body, {
|
|
175
|
+
unrecognizedObjectKeys: "passthrough",
|
|
176
|
+
allowUnrecognizedUnionMembers: true,
|
|
177
|
+
allowUnrecognizedEnumValues: true,
|
|
178
|
+
skipValidation: true,
|
|
179
|
+
breadcrumbsPrefix: ["response"],
|
|
180
|
+
}),
|
|
181
|
+
rawResponse: _response.rawResponse,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
if (_response.error.reason === "status-code") {
|
|
185
|
+
switch (_response.error.statusCode) {
|
|
186
|
+
case 400:
|
|
187
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
188
|
+
unrecognizedObjectKeys: "passthrough",
|
|
189
|
+
allowUnrecognizedUnionMembers: true,
|
|
190
|
+
allowUnrecognizedEnumValues: true,
|
|
191
|
+
skipValidation: true,
|
|
192
|
+
breadcrumbsPrefix: ["response"],
|
|
193
|
+
}), _response.rawResponse);
|
|
194
|
+
default:
|
|
195
|
+
throw new errors.AgentMailError({
|
|
196
|
+
statusCode: _response.error.statusCode,
|
|
197
|
+
body: _response.error.body,
|
|
198
|
+
rawResponse: _response.rawResponse,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/search");
|
|
203
|
+
});
|
|
204
|
+
}
|
|
128
205
|
/**
|
|
129
206
|
* **CLI:**
|
|
130
207
|
* ```bash
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* q: "q"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface SearchInboxesRequest {
|
|
9
|
+
/** Address or display name to search for. Matches word prefixes. Must be 2 to 256 characters. */
|
|
10
|
+
q: string;
|
|
11
|
+
limit?: AgentMail.Limit;
|
|
12
|
+
pageToken?: AgentMail.PageToken;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
export interface SearchInboxesResponse {
|
|
3
|
+
count: AgentMail.Count;
|
|
4
|
+
limit?: AgentMail.Limit;
|
|
5
|
+
nextPageToken?: AgentMail.PageToken;
|
|
6
|
+
/** Ordered by relevance, best match first. */
|
|
7
|
+
inboxes: AgentMail.inboxes.Inbox[];
|
|
8
|
+
}
|
|
@@ -7,5 +7,6 @@ export * from "./InboxId.mjs";
|
|
|
7
7
|
export * from "./ListInboxesResponse.mjs";
|
|
8
8
|
export * from "./Metadata.mjs";
|
|
9
9
|
export * from "./MetadataValue.mjs";
|
|
10
|
+
export * from "./SearchInboxesResponse.mjs";
|
|
10
11
|
export * from "./UpdateInboxRequest.mjs";
|
|
11
12
|
export * from "./UpdateMetadata.mjs";
|
|
@@ -7,5 +7,6 @@ export * from "./InboxId.mjs";
|
|
|
7
7
|
export * from "./ListInboxesResponse.mjs";
|
|
8
8
|
export * from "./Metadata.mjs";
|
|
9
9
|
export * from "./MetadataValue.mjs";
|
|
10
|
+
export * from "./SearchInboxesResponse.mjs";
|
|
10
11
|
export * from "./UpdateInboxRequest.mjs";
|
|
11
12
|
export * from "./UpdateMetadata.mjs";
|
|
@@ -27,6 +27,28 @@ export declare class InboxesClient {
|
|
|
27
27
|
*/
|
|
28
28
|
list(pod_id: AgentMail.pods.PodId, request?: AgentMail.pods.ListInboxesRequest, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.ListInboxesResponse>;
|
|
29
29
|
private __list;
|
|
30
|
+
/**
|
|
31
|
+
* Searches inboxes in the pod by address or display name, ranked by
|
|
32
|
+
* relevance. Each word in the query matches the start of a word in the
|
|
33
|
+
* address or display name, so `sup` matches `support@example.com` but
|
|
34
|
+
* `port` does not. An exact address match always ranks first. `limit`
|
|
35
|
+
* cannot exceed 100. A page can be empty and still carry a
|
|
36
|
+
* `next_page_token`; keep paging until the token is absent.
|
|
37
|
+
*
|
|
38
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
39
|
+
* @param {AgentMail.pods.SearchInboxesRequest} request
|
|
40
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
41
|
+
*
|
|
42
|
+
* @throws {@link AgentMail.ValidationError}
|
|
43
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* await client.pods.inboxes.search("pod_id", {
|
|
47
|
+
* q: "q"
|
|
48
|
+
* })
|
|
49
|
+
*/
|
|
50
|
+
search(pod_id: AgentMail.pods.PodId, request: AgentMail.pods.SearchInboxesRequest, requestOptions?: InboxesClient.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.SearchInboxesResponse>;
|
|
51
|
+
private __search;
|
|
30
52
|
/**
|
|
31
53
|
* **CLI:**
|
|
32
54
|
* ```bash
|
|
@@ -94,6 +94,93 @@ export class InboxesClient {
|
|
|
94
94
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/inboxes");
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Searches inboxes in the pod by address or display name, ranked by
|
|
99
|
+
* relevance. Each word in the query matches the start of a word in the
|
|
100
|
+
* address or display name, so `sup` matches `support@example.com` but
|
|
101
|
+
* `port` does not. An exact address match always ranks first. `limit`
|
|
102
|
+
* cannot exceed 100. A page can be empty and still carry a
|
|
103
|
+
* `next_page_token`; keep paging until the token is absent.
|
|
104
|
+
*
|
|
105
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
106
|
+
* @param {AgentMail.pods.SearchInboxesRequest} request
|
|
107
|
+
* @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
|
+
*
|
|
109
|
+
* @throws {@link AgentMail.ValidationError}
|
|
110
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* await client.pods.inboxes.search("pod_id", {
|
|
114
|
+
* q: "q"
|
|
115
|
+
* })
|
|
116
|
+
*/
|
|
117
|
+
search(pod_id, request, requestOptions) {
|
|
118
|
+
return core.HttpResponsePromise.fromPromise(this.__search(pod_id, request, requestOptions));
|
|
119
|
+
}
|
|
120
|
+
__search(pod_id, request, requestOptions) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
123
|
+
const { q, limit, pageToken } = request;
|
|
124
|
+
const _queryParams = {
|
|
125
|
+
q,
|
|
126
|
+
limit,
|
|
127
|
+
page_token: pageToken,
|
|
128
|
+
};
|
|
129
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
130
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
131
|
+
const _response = yield core.fetcher({
|
|
132
|
+
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)
|
|
133
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/inboxes/search`),
|
|
134
|
+
method: "GET",
|
|
135
|
+
headers: _headers,
|
|
136
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
137
|
+
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,
|
|
138
|
+
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,
|
|
139
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
140
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
141
|
+
logging: this._options.logging,
|
|
142
|
+
});
|
|
143
|
+
if (_response.ok) {
|
|
144
|
+
return {
|
|
145
|
+
data: serializers.inboxes.SearchInboxesResponse.parseOrThrow(_response.body, {
|
|
146
|
+
unrecognizedObjectKeys: "passthrough",
|
|
147
|
+
allowUnrecognizedUnionMembers: true,
|
|
148
|
+
allowUnrecognizedEnumValues: true,
|
|
149
|
+
skipValidation: true,
|
|
150
|
+
breadcrumbsPrefix: ["response"],
|
|
151
|
+
}),
|
|
152
|
+
rawResponse: _response.rawResponse,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
if (_response.error.reason === "status-code") {
|
|
156
|
+
switch (_response.error.statusCode) {
|
|
157
|
+
case 400:
|
|
158
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
159
|
+
unrecognizedObjectKeys: "passthrough",
|
|
160
|
+
allowUnrecognizedUnionMembers: true,
|
|
161
|
+
allowUnrecognizedEnumValues: true,
|
|
162
|
+
skipValidation: true,
|
|
163
|
+
breadcrumbsPrefix: ["response"],
|
|
164
|
+
}), _response.rawResponse);
|
|
165
|
+
case 404:
|
|
166
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
167
|
+
unrecognizedObjectKeys: "passthrough",
|
|
168
|
+
allowUnrecognizedUnionMembers: true,
|
|
169
|
+
allowUnrecognizedEnumValues: true,
|
|
170
|
+
skipValidation: true,
|
|
171
|
+
breadcrumbsPrefix: ["response"],
|
|
172
|
+
}), _response.rawResponse);
|
|
173
|
+
default:
|
|
174
|
+
throw new errors.AgentMailError({
|
|
175
|
+
statusCode: _response.error.statusCode,
|
|
176
|
+
body: _response.error.body,
|
|
177
|
+
rawResponse: _response.rawResponse,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/inboxes/search");
|
|
182
|
+
});
|
|
183
|
+
}
|
|
97
184
|
/**
|
|
98
185
|
* **CLI:**
|
|
99
186
|
* ```bash
|
package/dist/esm/api/resources/pods/resources/inboxes/client/requests/SearchInboxesRequest.d.mts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* q: "q"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface SearchInboxesRequest {
|
|
9
|
+
/** Address or display name to search for. Matches word prefixes. Must be 2 to 256 characters. */
|
|
10
|
+
q: string;
|
|
11
|
+
limit?: AgentMail.Limit;
|
|
12
|
+
pageToken?: AgentMail.PageToken;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.mjs";
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../../../index.mjs";
|
|
4
|
+
import { Count } from "../../../types/Count.mjs";
|
|
5
|
+
import { Limit } from "../../../types/Limit.mjs";
|
|
6
|
+
import { PageToken } from "../../../types/PageToken.mjs";
|
|
7
|
+
import { Inbox } from "./Inbox.mjs";
|
|
8
|
+
export declare const SearchInboxesResponse: core.serialization.ObjectSchema<serializers.inboxes.SearchInboxesResponse.Raw, AgentMail.inboxes.SearchInboxesResponse>;
|
|
9
|
+
export declare namespace SearchInboxesResponse {
|
|
10
|
+
interface Raw {
|
|
11
|
+
count: Count.Raw;
|
|
12
|
+
limit?: Limit.Raw | null;
|
|
13
|
+
next_page_token?: PageToken.Raw | null;
|
|
14
|
+
inboxes: Inbox.Raw[];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import { Count } from "../../../types/Count.mjs";
|
|
4
|
+
import { Limit } from "../../../types/Limit.mjs";
|
|
5
|
+
import { PageToken } from "../../../types/PageToken.mjs";
|
|
6
|
+
import { Inbox } from "./Inbox.mjs";
|
|
7
|
+
export const SearchInboxesResponse = core.serialization.object({
|
|
8
|
+
count: Count,
|
|
9
|
+
limit: Limit.optional(),
|
|
10
|
+
nextPageToken: core.serialization.property("next_page_token", PageToken.optional()),
|
|
11
|
+
inboxes: core.serialization.list(Inbox),
|
|
12
|
+
});
|
|
@@ -7,5 +7,6 @@ export * from "./InboxId.mjs";
|
|
|
7
7
|
export * from "./ListInboxesResponse.mjs";
|
|
8
8
|
export * from "./Metadata.mjs";
|
|
9
9
|
export * from "./MetadataValue.mjs";
|
|
10
|
+
export * from "./SearchInboxesResponse.mjs";
|
|
10
11
|
export * from "./UpdateInboxRequest.mjs";
|
|
11
12
|
export * from "./UpdateMetadata.mjs";
|
|
@@ -7,5 +7,6 @@ export * from "./InboxId.mjs";
|
|
|
7
7
|
export * from "./ListInboxesResponse.mjs";
|
|
8
8
|
export * from "./Metadata.mjs";
|
|
9
9
|
export * from "./MetadataValue.mjs";
|
|
10
|
+
export * from "./SearchInboxesResponse.mjs";
|
|
10
11
|
export * from "./UpdateInboxRequest.mjs";
|
|
11
12
|
export * from "./UpdateMetadata.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.5.
|
|
1
|
+
export declare const SDK_VERSION = "0.5.23";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.5.
|
|
1
|
+
export const SDK_VERSION = "0.5.23";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -62,6 +62,76 @@ await client.inboxes.list();
|
|
|
62
62
|
</dl>
|
|
63
63
|
|
|
64
64
|
|
|
65
|
+
</dd>
|
|
66
|
+
</dl>
|
|
67
|
+
</details>
|
|
68
|
+
|
|
69
|
+
<details><summary><code>client.inboxes.<a href="/src/api/resources/inboxes/client/Client.ts">search</a>({ ...params }) -> AgentMail.SearchInboxesResponse</code></summary>
|
|
70
|
+
<dl>
|
|
71
|
+
<dd>
|
|
72
|
+
|
|
73
|
+
#### 📝 Description
|
|
74
|
+
|
|
75
|
+
<dl>
|
|
76
|
+
<dd>
|
|
77
|
+
|
|
78
|
+
<dl>
|
|
79
|
+
<dd>
|
|
80
|
+
|
|
81
|
+
Searches inboxes in the organization by address or display name, ranked
|
|
82
|
+
by relevance. Each word in the query matches the start of a word in the
|
|
83
|
+
address or display name, so `sup` matches `support@example.com` but
|
|
84
|
+
`port` does not. An exact address match always ranks first. `limit`
|
|
85
|
+
cannot exceed 100. A page can be empty and still carry a
|
|
86
|
+
`next_page_token`; keep paging until the token is absent.
|
|
87
|
+
</dd>
|
|
88
|
+
</dl>
|
|
89
|
+
</dd>
|
|
90
|
+
</dl>
|
|
91
|
+
|
|
92
|
+
#### 🔌 Usage
|
|
93
|
+
|
|
94
|
+
<dl>
|
|
95
|
+
<dd>
|
|
96
|
+
|
|
97
|
+
<dl>
|
|
98
|
+
<dd>
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
await client.inboxes.search({
|
|
102
|
+
q: "q"
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
</dd>
|
|
107
|
+
</dl>
|
|
108
|
+
</dd>
|
|
109
|
+
</dl>
|
|
110
|
+
|
|
111
|
+
#### ⚙️ Parameters
|
|
112
|
+
|
|
113
|
+
<dl>
|
|
114
|
+
<dd>
|
|
115
|
+
|
|
116
|
+
<dl>
|
|
117
|
+
<dd>
|
|
118
|
+
|
|
119
|
+
**request:** `AgentMail.inboxes.SearchInboxesRequest`
|
|
120
|
+
|
|
121
|
+
</dd>
|
|
122
|
+
</dl>
|
|
123
|
+
|
|
124
|
+
<dl>
|
|
125
|
+
<dd>
|
|
126
|
+
|
|
127
|
+
**requestOptions:** `InboxesClient.RequestOptions`
|
|
128
|
+
|
|
129
|
+
</dd>
|
|
130
|
+
</dl>
|
|
131
|
+
</dd>
|
|
132
|
+
</dl>
|
|
133
|
+
|
|
134
|
+
|
|
65
135
|
</dd>
|
|
66
136
|
</dl>
|
|
67
137
|
</details>
|
|
@@ -8171,6 +8241,84 @@ await client.pods.inboxes.list("pod_id");
|
|
|
8171
8241
|
</dl>
|
|
8172
8242
|
|
|
8173
8243
|
|
|
8244
|
+
</dd>
|
|
8245
|
+
</dl>
|
|
8246
|
+
</details>
|
|
8247
|
+
|
|
8248
|
+
<details><summary><code>client.pods.inboxes.<a href="/src/api/resources/pods/resources/inboxes/client/Client.ts">search</a>(pod_id, { ...params }) -> AgentMail.SearchInboxesResponse</code></summary>
|
|
8249
|
+
<dl>
|
|
8250
|
+
<dd>
|
|
8251
|
+
|
|
8252
|
+
#### 📝 Description
|
|
8253
|
+
|
|
8254
|
+
<dl>
|
|
8255
|
+
<dd>
|
|
8256
|
+
|
|
8257
|
+
<dl>
|
|
8258
|
+
<dd>
|
|
8259
|
+
|
|
8260
|
+
Searches inboxes in the pod by address or display name, ranked by
|
|
8261
|
+
relevance. Each word in the query matches the start of a word in the
|
|
8262
|
+
address or display name, so `sup` matches `support@example.com` but
|
|
8263
|
+
`port` does not. An exact address match always ranks first. `limit`
|
|
8264
|
+
cannot exceed 100. A page can be empty and still carry a
|
|
8265
|
+
`next_page_token`; keep paging until the token is absent.
|
|
8266
|
+
</dd>
|
|
8267
|
+
</dl>
|
|
8268
|
+
</dd>
|
|
8269
|
+
</dl>
|
|
8270
|
+
|
|
8271
|
+
#### 🔌 Usage
|
|
8272
|
+
|
|
8273
|
+
<dl>
|
|
8274
|
+
<dd>
|
|
8275
|
+
|
|
8276
|
+
<dl>
|
|
8277
|
+
<dd>
|
|
8278
|
+
|
|
8279
|
+
```typescript
|
|
8280
|
+
await client.pods.inboxes.search("pod_id", {
|
|
8281
|
+
q: "q"
|
|
8282
|
+
});
|
|
8283
|
+
|
|
8284
|
+
```
|
|
8285
|
+
</dd>
|
|
8286
|
+
</dl>
|
|
8287
|
+
</dd>
|
|
8288
|
+
</dl>
|
|
8289
|
+
|
|
8290
|
+
#### ⚙️ Parameters
|
|
8291
|
+
|
|
8292
|
+
<dl>
|
|
8293
|
+
<dd>
|
|
8294
|
+
|
|
8295
|
+
<dl>
|
|
8296
|
+
<dd>
|
|
8297
|
+
|
|
8298
|
+
**pod_id:** `AgentMail.PodId`
|
|
8299
|
+
|
|
8300
|
+
</dd>
|
|
8301
|
+
</dl>
|
|
8302
|
+
|
|
8303
|
+
<dl>
|
|
8304
|
+
<dd>
|
|
8305
|
+
|
|
8306
|
+
**request:** `AgentMail.pods.SearchInboxesRequest`
|
|
8307
|
+
|
|
8308
|
+
</dd>
|
|
8309
|
+
</dl>
|
|
8310
|
+
|
|
8311
|
+
<dl>
|
|
8312
|
+
<dd>
|
|
8313
|
+
|
|
8314
|
+
**requestOptions:** `InboxesClient.RequestOptions`
|
|
8315
|
+
|
|
8316
|
+
</dd>
|
|
8317
|
+
</dl>
|
|
8318
|
+
</dd>
|
|
8319
|
+
</dl>
|
|
8320
|
+
|
|
8321
|
+
|
|
8174
8322
|
</dd>
|
|
8175
8323
|
</dl>
|
|
8176
8324
|
</details>
|