agentmail 0.3.8 → 0.4.0

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 (70) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/apiKeys/client/Client.js +2 -1
  3. package/dist/cjs/api/resources/apiKeys/client/requests/ListApiKeysRequest.d.ts +1 -0
  4. package/dist/cjs/api/resources/domains/client/Client.js +2 -1
  5. package/dist/cjs/api/resources/domains/client/requests/ListDomainsRequest.d.ts +1 -0
  6. package/dist/cjs/api/resources/inboxes/client/Client.js +2 -1
  7. package/dist/cjs/api/resources/inboxes/client/requests/ListInboxesRequest.d.ts +1 -0
  8. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +2 -1
  9. package/dist/cjs/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -0
  10. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +2 -1
  11. package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
  12. package/dist/cjs/api/resources/inboxes/types/InboxId.d.ts +1 -1
  13. package/dist/cjs/api/resources/pods/client/Client.js +2 -1
  14. package/dist/cjs/api/resources/pods/client/requests/ListPodsRequest.d.ts +1 -0
  15. package/dist/cjs/api/resources/pods/resources/domains/client/Client.d.ts +12 -0
  16. package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +65 -1
  17. package/dist/cjs/api/resources/pods/resources/domains/client/requests/ListDomainsRequest.d.ts +1 -0
  18. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +2 -1
  19. package/dist/cjs/api/resources/pods/resources/inboxes/client/requests/ListInboxesRequest.d.ts +1 -0
  20. package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +2 -1
  21. package/dist/cjs/api/resources/pods/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
  22. package/dist/cjs/api/resources/webhooks/client/Client.js +2 -1
  23. package/dist/cjs/api/resources/webhooks/client/requests/ListWebhooksRequest.d.ts +1 -0
  24. package/dist/cjs/api/types/IncludeTrash.d.ts +4 -0
  25. package/dist/cjs/api/types/IncludeTrash.js +3 -0
  26. package/dist/cjs/api/types/index.d.ts +1 -0
  27. package/dist/cjs/api/types/index.js +1 -0
  28. package/dist/cjs/serialization/types/IncludeTrash.d.ts +7 -0
  29. package/dist/cjs/serialization/types/IncludeTrash.js +39 -0
  30. package/dist/cjs/serialization/types/index.d.ts +1 -0
  31. package/dist/cjs/serialization/types/index.js +1 -0
  32. package/dist/cjs/version.d.ts +1 -1
  33. package/dist/cjs/version.js +1 -1
  34. package/dist/esm/BaseClient.mjs +2 -2
  35. package/dist/esm/api/resources/apiKeys/client/Client.mjs +2 -1
  36. package/dist/esm/api/resources/apiKeys/client/requests/ListApiKeysRequest.d.mts +1 -0
  37. package/dist/esm/api/resources/domains/client/Client.mjs +2 -1
  38. package/dist/esm/api/resources/domains/client/requests/ListDomainsRequest.d.mts +1 -0
  39. package/dist/esm/api/resources/inboxes/client/Client.mjs +2 -1
  40. package/dist/esm/api/resources/inboxes/client/requests/ListInboxesRequest.d.mts +1 -0
  41. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +2 -1
  42. package/dist/esm/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.mts +1 -0
  43. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +2 -1
  44. package/dist/esm/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.mts +1 -0
  45. package/dist/esm/api/resources/inboxes/types/InboxId.d.mts +1 -1
  46. package/dist/esm/api/resources/pods/client/Client.mjs +2 -1
  47. package/dist/esm/api/resources/pods/client/requests/ListPodsRequest.d.mts +1 -0
  48. package/dist/esm/api/resources/pods/resources/domains/client/Client.d.mts +12 -0
  49. package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +65 -1
  50. package/dist/esm/api/resources/pods/resources/domains/client/requests/ListDomainsRequest.d.mts +1 -0
  51. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +2 -1
  52. package/dist/esm/api/resources/pods/resources/inboxes/client/requests/ListInboxesRequest.d.mts +1 -0
  53. package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +2 -1
  54. package/dist/esm/api/resources/pods/resources/threads/client/requests/ListThreadsRequest.d.mts +1 -0
  55. package/dist/esm/api/resources/webhooks/client/Client.mjs +2 -1
  56. package/dist/esm/api/resources/webhooks/client/requests/ListWebhooksRequest.d.mts +1 -0
  57. package/dist/esm/api/types/IncludeTrash.d.mts +4 -0
  58. package/dist/esm/api/types/IncludeTrash.mjs +2 -0
  59. package/dist/esm/api/types/index.d.mts +1 -0
  60. package/dist/esm/api/types/index.mjs +1 -0
  61. package/dist/esm/serialization/types/IncludeTrash.d.mts +7 -0
  62. package/dist/esm/serialization/types/IncludeTrash.mjs +3 -0
  63. package/dist/esm/serialization/types/index.d.mts +1 -0
  64. package/dist/esm/serialization/types/index.mjs +1 -0
  65. package/dist/esm/version.d.mts +1 -1
  66. package/dist/esm/version.mjs +1 -1
  67. package/dist/llms-full.txt +376 -139
  68. package/dist/llms.txt +3 -2
  69. package/package.json +1 -1
  70. package/reference.md +57 -0
@@ -36,10 +36,11 @@ export class DomainsClient {
36
36
  __list(pod_id_1) {
37
37
  return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
38
38
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
39
- const { limit, pageToken } = request;
39
+ const { limit, pageToken, ascending } = request;
40
40
  const _queryParams = {
41
41
  limit,
42
42
  page_token: pageToken,
43
+ ascending,
43
44
  };
44
45
  const _authRequest = yield this._options.authProvider.getAuthRequest();
45
46
  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,6 +161,69 @@ export class DomainsClient {
160
161
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/pods/{pod_id}/domains");
161
162
  });
162
163
  }
164
+ /**
165
+ * @param {AgentMail.pods.PodId} pod_id
166
+ * @param {AgentMail.DomainId} domain_id
167
+ * @param {DomainsClient.RequestOptions} requestOptions - Request-specific configuration.
168
+ *
169
+ * @throws {@link AgentMail.NotFoundError}
170
+ *
171
+ * @example
172
+ * await client.pods.domains.get("pod_id", "domain_id")
173
+ */
174
+ get(pod_id, domain_id, requestOptions) {
175
+ return core.HttpResponsePromise.fromPromise(this.__get(pod_id, domain_id, requestOptions));
176
+ }
177
+ __get(pod_id, domain_id, requestOptions) {
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
180
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
181
+ 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);
182
+ const _response = yield core.fetcher({
183
+ 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)
184
+ .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 }))}`),
185
+ method: "GET",
186
+ headers: _headers,
187
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
188
+ 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,
189
+ 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,
190
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
191
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
192
+ logging: this._options.logging,
193
+ });
194
+ if (_response.ok) {
195
+ return {
196
+ data: serializers.Domain.parseOrThrow(_response.body, {
197
+ unrecognizedObjectKeys: "passthrough",
198
+ allowUnrecognizedUnionMembers: true,
199
+ allowUnrecognizedEnumValues: true,
200
+ skipValidation: true,
201
+ breadcrumbsPrefix: ["response"],
202
+ }),
203
+ rawResponse: _response.rawResponse,
204
+ };
205
+ }
206
+ if (_response.error.reason === "status-code") {
207
+ switch (_response.error.statusCode) {
208
+ case 404:
209
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
210
+ unrecognizedObjectKeys: "passthrough",
211
+ allowUnrecognizedUnionMembers: true,
212
+ allowUnrecognizedEnumValues: true,
213
+ skipValidation: true,
214
+ breadcrumbsPrefix: ["response"],
215
+ }), _response.rawResponse);
216
+ default:
217
+ throw new errors.AgentMailError({
218
+ statusCode: _response.error.statusCode,
219
+ body: _response.error.body,
220
+ rawResponse: _response.rawResponse,
221
+ });
222
+ }
223
+ }
224
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/domains/{domain_id}");
225
+ });
226
+ }
163
227
  /**
164
228
  * @param {AgentMail.pods.PodId} pod_id
165
229
  * @param {AgentMail.DomainId} domain_id
@@ -6,4 +6,5 @@ import type * as AgentMail from "../../../../../../index.mjs";
6
6
  export interface ListDomainsRequest {
7
7
  limit?: AgentMail.Limit;
8
8
  pageToken?: AgentMail.PageToken;
9
+ ascending?: AgentMail.Ascending;
9
10
  }
@@ -36,10 +36,11 @@ export class InboxesClient {
36
36
  __list(pod_id_1) {
37
37
  return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
38
38
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
39
- const { limit, pageToken } = request;
39
+ const { limit, pageToken, ascending } = request;
40
40
  const _queryParams = {
41
41
  limit,
42
42
  page_token: pageToken,
43
+ ascending,
43
44
  };
44
45
  const _authRequest = yield this._options.authProvider.getAuthRequest();
45
46
  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);
@@ -6,4 +6,5 @@ import type * as AgentMail from "../../../../../../index.mjs";
6
6
  export interface ListInboxesRequest {
7
7
  limit?: AgentMail.Limit;
8
8
  pageToken?: AgentMail.PageToken;
9
+ ascending?: AgentMail.Ascending;
9
10
  }
@@ -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
  }
@@ -33,10 +33,11 @@ export class WebhooksClient {
33
33
  __list() {
34
34
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
35
35
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
36
- const { limit, pageToken } = request;
36
+ const { limit, pageToken, ascending } = request;
37
37
  const _queryParams = {
38
38
  limit,
39
39
  page_token: pageToken,
40
+ ascending,
40
41
  };
41
42
  const _authRequest = yield this._options.authProvider.getAuthRequest();
42
43
  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);
@@ -6,4 +6,5 @@ import type * as AgentMail from "../../../../index.mjs";
6
6
  export interface ListWebhooksRequest {
7
7
  limit?: AgentMail.Limit;
8
8
  pageToken?: AgentMail.PageToken;
9
+ ascending?: AgentMail.Ascending;
9
10
  }
@@ -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.8";
1
+ export declare const SDK_VERSION = "0.4.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.3.8";
1
+ export const SDK_VERSION = "0.4.0";