agentmail 0.3.7 → 0.3.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.
Files changed (42) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +2 -1
  3. package/dist/cjs/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -0
  4. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +2 -1
  5. package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
  6. package/dist/cjs/api/resources/pods/resources/domains/client/Client.d.ts +12 -0
  7. package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +63 -0
  8. package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +2 -1
  9. package/dist/cjs/api/resources/pods/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
  10. package/dist/cjs/api/types/IncludeTrash.d.ts +4 -0
  11. package/dist/cjs/api/types/IncludeTrash.js +3 -0
  12. package/dist/cjs/api/types/index.d.ts +1 -0
  13. package/dist/cjs/api/types/index.js +1 -0
  14. package/dist/cjs/serialization/types/IncludeTrash.d.ts +7 -0
  15. package/dist/cjs/serialization/types/IncludeTrash.js +39 -0
  16. package/dist/cjs/serialization/types/index.d.ts +1 -0
  17. package/dist/cjs/serialization/types/index.js +1 -0
  18. package/dist/cjs/version.d.ts +1 -1
  19. package/dist/cjs/version.js +1 -1
  20. package/dist/esm/BaseClient.mjs +2 -2
  21. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +2 -1
  22. package/dist/esm/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.mts +1 -0
  23. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +2 -1
  24. package/dist/esm/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.mts +1 -0
  25. package/dist/esm/api/resources/pods/resources/domains/client/Client.d.mts +12 -0
  26. package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +63 -0
  27. package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +2 -1
  28. package/dist/esm/api/resources/pods/resources/threads/client/requests/ListThreadsRequest.d.mts +1 -0
  29. package/dist/esm/api/types/IncludeTrash.d.mts +4 -0
  30. package/dist/esm/api/types/IncludeTrash.mjs +2 -0
  31. package/dist/esm/api/types/index.d.mts +1 -0
  32. package/dist/esm/api/types/index.mjs +1 -0
  33. package/dist/esm/serialization/types/IncludeTrash.d.mts +7 -0
  34. package/dist/esm/serialization/types/IncludeTrash.mjs +3 -0
  35. package/dist/esm/serialization/types/index.d.mts +1 -0
  36. package/dist/esm/serialization/types/index.mjs +1 -0
  37. package/dist/esm/version.d.mts +1 -1
  38. package/dist/esm/version.mjs +1 -1
  39. package/dist/llms-full.txt +623 -184
  40. package/dist/llms.txt +2 -0
  41. package/package.json +1 -1
  42. package/reference.md +57 -0
@@ -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.3.7",
47
- "User-Agent": "agentmail/0.3.7",
46
+ "X-Fern-SDK-Version": "0.3.9",
47
+ "User-Agent": "agentmail/0.3.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);
@@ -73,7 +73,7 @@ class MessagesClient {
73
73
  __list(inbox_id_1) {
74
74
  return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
75
75
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
76
- const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked } = request;
76
+ const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeTrash } = request;
77
77
  const _queryParams = {
78
78
  limit,
79
79
  page_token: pageToken,
@@ -92,6 +92,7 @@ class MessagesClient {
92
92
  ascending,
93
93
  include_spam: includeSpam,
94
94
  include_blocked: includeBlocked,
95
+ include_trash: includeTrash,
95
96
  };
96
97
  const _authRequest = yield this._options.authProvider.getAuthRequest();
97
98
  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);
@@ -12,4 +12,5 @@ export interface ListMessagesRequest {
12
12
  ascending?: AgentMail.Ascending;
13
13
  includeSpam?: AgentMail.IncludeSpam;
14
14
  includeBlocked?: AgentMail.IncludeBlocked;
15
+ includeTrash?: AgentMail.IncludeTrash;
15
16
  }
@@ -73,7 +73,7 @@ class ThreadsClient {
73
73
  __list(inbox_id_1) {
74
74
  return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
75
75
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
76
- const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked } = request;
76
+ const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeTrash } = request;
77
77
  const _queryParams = {
78
78
  limit,
79
79
  page_token: pageToken,
@@ -92,6 +92,7 @@ class ThreadsClient {
92
92
  ascending,
93
93
  include_spam: includeSpam,
94
94
  include_blocked: includeBlocked,
95
+ include_trash: includeTrash,
95
96
  };
96
97
  const _authRequest = yield this._options.authProvider.getAuthRequest();
97
98
  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);
@@ -12,4 +12,5 @@ export interface ListThreadsRequest {
12
12
  ascending?: AgentMail.Ascending;
13
13
  includeSpam?: AgentMail.IncludeSpam;
14
14
  includeBlocked?: AgentMail.IncludeBlocked;
15
+ includeTrash?: AgentMail.IncludeTrash;
15
16
  }
@@ -37,6 +37,18 @@ export declare class DomainsClient {
37
37
  */
38
38
  create(pod_id: AgentMail.pods.PodId, request: AgentMail.CreateDomainRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
39
39
  private __create;
40
+ /**
41
+ * @param {AgentMail.pods.PodId} pod_id
42
+ * @param {AgentMail.DomainId} domain_id
43
+ * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
44
+ *
45
+ * @throws {@link AgentMail.NotFoundError}
46
+ *
47
+ * @example
48
+ * await client.pods.domains.get("pod_id", "domain_id")
49
+ */
50
+ get(pod_id: AgentMail.pods.PodId, domain_id: AgentMail.DomainId, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
51
+ private __get;
40
52
  /**
41
53
  * @param {AgentMail.pods.PodId} pod_id
42
54
  * @param {AgentMail.DomainId} domain_id
@@ -196,6 +196,69 @@ class DomainsClient {
196
196
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/pods/{pod_id}/domains");
197
197
  });
198
198
  }
199
+ /**
200
+ * @param {AgentMail.pods.PodId} pod_id
201
+ * @param {AgentMail.DomainId} domain_id
202
+ * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
203
+ *
204
+ * @throws {@link AgentMail.NotFoundError}
205
+ *
206
+ * @example
207
+ * await client.pods.domains.get("pod_id", "domain_id")
208
+ */
209
+ get(pod_id, domain_id, requestOptions) {
210
+ return core.HttpResponsePromise.fromPromise(this.__get(pod_id, domain_id, requestOptions));
211
+ }
212
+ __get(pod_id, domain_id, requestOptions) {
213
+ return __awaiter(this, void 0, void 0, function* () {
214
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
215
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
216
+ 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);
217
+ const _response = yield core.fetcher({
218
+ 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)
219
+ .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/domains/${core.url.encodePathParam(serializers.DomainId.jsonOrThrow(domain_id, { omitUndefined: true }))}`),
220
+ method: "GET",
221
+ headers: _headers,
222
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
223
+ 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,
224
+ 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,
225
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
226
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
227
+ logging: this._options.logging,
228
+ });
229
+ if (_response.ok) {
230
+ return {
231
+ data: serializers.Domain.parseOrThrow(_response.body, {
232
+ unrecognizedObjectKeys: "passthrough",
233
+ allowUnrecognizedUnionMembers: true,
234
+ allowUnrecognizedEnumValues: true,
235
+ skipValidation: true,
236
+ breadcrumbsPrefix: ["response"],
237
+ }),
238
+ rawResponse: _response.rawResponse,
239
+ };
240
+ }
241
+ if (_response.error.reason === "status-code") {
242
+ switch (_response.error.statusCode) {
243
+ case 404:
244
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
245
+ unrecognizedObjectKeys: "passthrough",
246
+ allowUnrecognizedUnionMembers: true,
247
+ allowUnrecognizedEnumValues: true,
248
+ skipValidation: true,
249
+ breadcrumbsPrefix: ["response"],
250
+ }), _response.rawResponse);
251
+ default:
252
+ throw new errors.AgentMailError({
253
+ statusCode: _response.error.statusCode,
254
+ body: _response.error.body,
255
+ rawResponse: _response.rawResponse,
256
+ });
257
+ }
258
+ }
259
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/domains/{domain_id}");
260
+ });
261
+ }
199
262
  /**
200
263
  * @param {AgentMail.pods.PodId} pod_id
201
264
  * @param {AgentMail.DomainId} domain_id
@@ -73,7 +73,7 @@ class ThreadsClient {
73
73
  __list(pod_id_1) {
74
74
  return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
75
75
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
76
- const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked } = request;
76
+ const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeTrash } = request;
77
77
  const _queryParams = {
78
78
  limit,
79
79
  page_token: pageToken,
@@ -92,6 +92,7 @@ class ThreadsClient {
92
92
  ascending,
93
93
  include_spam: includeSpam,
94
94
  include_blocked: includeBlocked,
95
+ include_trash: includeTrash,
95
96
  };
96
97
  const _authRequest = yield this._options.authProvider.getAuthRequest();
97
98
  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);
@@ -12,4 +12,5 @@ export interface ListThreadsRequest {
12
12
  ascending?: AgentMail.Ascending;
13
13
  includeSpam?: AgentMail.IncludeSpam;
14
14
  includeBlocked?: AgentMail.IncludeBlocked;
15
+ includeTrash?: AgentMail.IncludeTrash;
15
16
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Include trash in results.
3
+ */
4
+ export type IncludeTrash = boolean;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,6 +7,7 @@ export * from "./ErrorName.js";
7
7
  export * from "./ErrorResponse.js";
8
8
  export * from "./IncludeBlocked.js";
9
9
  export * from "./IncludeSpam.js";
10
+ export * from "./IncludeTrash.js";
10
11
  export * from "./Labels.js";
11
12
  export * from "./Limit.js";
12
13
  export * from "./OrganizationId.js";
@@ -23,6 +23,7 @@ __exportStar(require("./ErrorName.js"), exports);
23
23
  __exportStar(require("./ErrorResponse.js"), exports);
24
24
  __exportStar(require("./IncludeBlocked.js"), exports);
25
25
  __exportStar(require("./IncludeSpam.js"), exports);
26
+ __exportStar(require("./IncludeTrash.js"), exports);
26
27
  __exportStar(require("./Labels.js"), exports);
27
28
  __exportStar(require("./Limit.js"), exports);
28
29
  __exportStar(require("./OrganizationId.js"), exports);
@@ -0,0 +1,7 @@
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
+ export declare const IncludeTrash: core.serialization.Schema<serializers.IncludeTrash.Raw, AgentMail.IncludeTrash>;
5
+ export declare namespace IncludeTrash {
6
+ type Raw = boolean;
7
+ }
@@ -0,0 +1,39 @@
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.IncludeTrash = void 0;
38
+ const core = __importStar(require("../../core/index.js"));
39
+ exports.IncludeTrash = core.serialization.boolean();
@@ -7,6 +7,7 @@ export * from "./ErrorName.js";
7
7
  export * from "./ErrorResponse.js";
8
8
  export * from "./IncludeBlocked.js";
9
9
  export * from "./IncludeSpam.js";
10
+ export * from "./IncludeTrash.js";
10
11
  export * from "./Labels.js";
11
12
  export * from "./Limit.js";
12
13
  export * from "./OrganizationId.js";
@@ -23,6 +23,7 @@ __exportStar(require("./ErrorName.js"), exports);
23
23
  __exportStar(require("./ErrorResponse.js"), exports);
24
24
  __exportStar(require("./IncludeBlocked.js"), exports);
25
25
  __exportStar(require("./IncludeSpam.js"), exports);
26
+ __exportStar(require("./IncludeTrash.js"), exports);
26
27
  __exportStar(require("./Labels.js"), exports);
27
28
  __exportStar(require("./Limit.js"), exports);
28
29
  __exportStar(require("./OrganizationId.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.3.7";
1
+ export declare const SDK_VERSION = "0.3.9";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.3.7";
4
+ exports.SDK_VERSION = "0.3.9";
@@ -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.3.7",
10
- "User-Agent": "agentmail/0.3.7",
9
+ "X-Fern-SDK-Version": "0.3.9",
10
+ "User-Agent": "agentmail/0.3.9",
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);
@@ -37,7 +37,7 @@ export class MessagesClient {
37
37
  __list(inbox_id_1) {
38
38
  return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
39
39
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40
- const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked } = request;
40
+ const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeTrash } = request;
41
41
  const _queryParams = {
42
42
  limit,
43
43
  page_token: pageToken,
@@ -56,6 +56,7 @@ export class MessagesClient {
56
56
  ascending,
57
57
  include_spam: includeSpam,
58
58
  include_blocked: includeBlocked,
59
+ include_trash: includeTrash,
59
60
  };
60
61
  const _authRequest = yield this._options.authProvider.getAuthRequest();
61
62
  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);
@@ -12,4 +12,5 @@ export interface ListMessagesRequest {
12
12
  ascending?: AgentMail.Ascending;
13
13
  includeSpam?: AgentMail.IncludeSpam;
14
14
  includeBlocked?: AgentMail.IncludeBlocked;
15
+ includeTrash?: AgentMail.IncludeTrash;
15
16
  }
@@ -37,7 +37,7 @@ export class ThreadsClient {
37
37
  __list(inbox_id_1) {
38
38
  return __awaiter(this, arguments, void 0, function* (inbox_id, request = {}, requestOptions) {
39
39
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40
- const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked } = request;
40
+ const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeTrash } = request;
41
41
  const _queryParams = {
42
42
  limit,
43
43
  page_token: pageToken,
@@ -56,6 +56,7 @@ export class ThreadsClient {
56
56
  ascending,
57
57
  include_spam: includeSpam,
58
58
  include_blocked: includeBlocked,
59
+ include_trash: includeTrash,
59
60
  };
60
61
  const _authRequest = yield this._options.authProvider.getAuthRequest();
61
62
  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);
@@ -12,4 +12,5 @@ export interface ListThreadsRequest {
12
12
  ascending?: AgentMail.Ascending;
13
13
  includeSpam?: AgentMail.IncludeSpam;
14
14
  includeBlocked?: AgentMail.IncludeBlocked;
15
+ includeTrash?: AgentMail.IncludeTrash;
15
16
  }
@@ -37,6 +37,18 @@ export declare class DomainsClient {
37
37
  */
38
38
  create(pod_id: AgentMail.pods.PodId, request: AgentMail.CreateDomainRequest, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
39
39
  private __create;
40
+ /**
41
+ * @param {AgentMail.pods.PodId} pod_id
42
+ * @param {AgentMail.DomainId} domain_id
43
+ * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
44
+ *
45
+ * @throws {@link AgentMail.NotFoundError}
46
+ *
47
+ * @example
48
+ * await client.pods.domains.get("pod_id", "domain_id")
49
+ */
50
+ get(pod_id: AgentMail.pods.PodId, domain_id: AgentMail.DomainId, requestOptions?: DomainsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Domain>;
51
+ private __get;
40
52
  /**
41
53
  * @param {AgentMail.pods.PodId} pod_id
42
54
  * @param {AgentMail.DomainId} domain_id
@@ -160,6 +160,69 @@ export class DomainsClient {
160
160
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/pods/{pod_id}/domains");
161
161
  });
162
162
  }
163
+ /**
164
+ * @param {AgentMail.pods.PodId} pod_id
165
+ * @param {AgentMail.DomainId} domain_id
166
+ * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
167
+ *
168
+ * @throws {@link AgentMail.NotFoundError}
169
+ *
170
+ * @example
171
+ * await client.pods.domains.get("pod_id", "domain_id")
172
+ */
173
+ get(pod_id, domain_id, requestOptions) {
174
+ return core.HttpResponsePromise.fromPromise(this.__get(pod_id, domain_id, requestOptions));
175
+ }
176
+ __get(pod_id, domain_id, requestOptions) {
177
+ return __awaiter(this, void 0, void 0, function* () {
178
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
179
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
180
+ 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);
181
+ const _response = yield core.fetcher({
182
+ 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)
183
+ .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/domains/${core.url.encodePathParam(serializers.DomainId.jsonOrThrow(domain_id, { omitUndefined: true }))}`),
184
+ method: "GET",
185
+ headers: _headers,
186
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
187
+ 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,
188
+ 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,
189
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
190
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
191
+ logging: this._options.logging,
192
+ });
193
+ if (_response.ok) {
194
+ return {
195
+ data: serializers.Domain.parseOrThrow(_response.body, {
196
+ unrecognizedObjectKeys: "passthrough",
197
+ allowUnrecognizedUnionMembers: true,
198
+ allowUnrecognizedEnumValues: true,
199
+ skipValidation: true,
200
+ breadcrumbsPrefix: ["response"],
201
+ }),
202
+ rawResponse: _response.rawResponse,
203
+ };
204
+ }
205
+ if (_response.error.reason === "status-code") {
206
+ switch (_response.error.statusCode) {
207
+ case 404:
208
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
209
+ unrecognizedObjectKeys: "passthrough",
210
+ allowUnrecognizedUnionMembers: true,
211
+ allowUnrecognizedEnumValues: true,
212
+ skipValidation: true,
213
+ breadcrumbsPrefix: ["response"],
214
+ }), _response.rawResponse);
215
+ default:
216
+ throw new errors.AgentMailError({
217
+ statusCode: _response.error.statusCode,
218
+ body: _response.error.body,
219
+ rawResponse: _response.rawResponse,
220
+ });
221
+ }
222
+ }
223
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/domains/{domain_id}");
224
+ });
225
+ }
163
226
  /**
164
227
  * @param {AgentMail.pods.PodId} pod_id
165
228
  * @param {AgentMail.DomainId} domain_id
@@ -37,7 +37,7 @@ export class ThreadsClient {
37
37
  __list(pod_id_1) {
38
38
  return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
39
39
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40
- const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked } = request;
40
+ const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeTrash } = request;
41
41
  const _queryParams = {
42
42
  limit,
43
43
  page_token: pageToken,
@@ -56,6 +56,7 @@ export class ThreadsClient {
56
56
  ascending,
57
57
  include_spam: includeSpam,
58
58
  include_blocked: includeBlocked,
59
+ include_trash: includeTrash,
59
60
  };
60
61
  const _authRequest = yield this._options.authProvider.getAuthRequest();
61
62
  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);
@@ -12,4 +12,5 @@ export interface ListThreadsRequest {
12
12
  ascending?: AgentMail.Ascending;
13
13
  includeSpam?: AgentMail.IncludeSpam;
14
14
  includeBlocked?: AgentMail.IncludeBlocked;
15
+ includeTrash?: AgentMail.IncludeTrash;
15
16
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Include trash in results.
3
+ */
4
+ export type IncludeTrash = boolean;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -7,6 +7,7 @@ export * from "./ErrorName.mjs";
7
7
  export * from "./ErrorResponse.mjs";
8
8
  export * from "./IncludeBlocked.mjs";
9
9
  export * from "./IncludeSpam.mjs";
10
+ export * from "./IncludeTrash.mjs";
10
11
  export * from "./Labels.mjs";
11
12
  export * from "./Limit.mjs";
12
13
  export * from "./OrganizationId.mjs";
@@ -7,6 +7,7 @@ export * from "./ErrorName.mjs";
7
7
  export * from "./ErrorResponse.mjs";
8
8
  export * from "./IncludeBlocked.mjs";
9
9
  export * from "./IncludeSpam.mjs";
10
+ export * from "./IncludeTrash.mjs";
10
11
  export * from "./Labels.mjs";
11
12
  export * from "./Limit.mjs";
12
13
  export * from "./OrganizationId.mjs";
@@ -0,0 +1,7 @@
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
+ export declare const IncludeTrash: core.serialization.Schema<serializers.IncludeTrash.Raw, AgentMail.IncludeTrash>;
5
+ export declare namespace IncludeTrash {
6
+ type Raw = boolean;
7
+ }
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../core/index.mjs";
3
+ export const IncludeTrash = core.serialization.boolean();
@@ -7,6 +7,7 @@ export * from "./ErrorName.mjs";
7
7
  export * from "./ErrorResponse.mjs";
8
8
  export * from "./IncludeBlocked.mjs";
9
9
  export * from "./IncludeSpam.mjs";
10
+ export * from "./IncludeTrash.mjs";
10
11
  export * from "./Labels.mjs";
11
12
  export * from "./Limit.mjs";
12
13
  export * from "./OrganizationId.mjs";
@@ -7,6 +7,7 @@ export * from "./ErrorName.mjs";
7
7
  export * from "./ErrorResponse.mjs";
8
8
  export * from "./IncludeBlocked.mjs";
9
9
  export * from "./IncludeSpam.mjs";
10
+ export * from "./IncludeTrash.mjs";
10
11
  export * from "./Labels.mjs";
11
12
  export * from "./Limit.mjs";
12
13
  export * from "./OrganizationId.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.3.7";
1
+ export declare const SDK_VERSION = "0.3.9";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.3.7";
1
+ export const SDK_VERSION = "0.3.9";