agentmail 0.5.27 → 0.5.29

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 (139) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/accounts/client/Client.d.ts +38 -1
  3. package/dist/cjs/api/resources/accounts/client/Client.js +111 -1
  4. package/dist/cjs/api/resources/accounts/types/Account.d.ts +4 -0
  5. package/dist/cjs/api/resources/accounts/types/AccountStatus.d.ts +8 -0
  6. package/dist/cjs/api/resources/accounts/types/AccountStatus.js +11 -0
  7. package/dist/cjs/api/resources/accounts/types/UpdateAccountRequest.d.ts +9 -0
  8. package/dist/cjs/api/resources/accounts/types/UpdateAccountRequest.js +3 -0
  9. package/dist/cjs/api/resources/accounts/types/UpdateAccountStatus.d.ts +10 -0
  10. package/dist/cjs/api/resources/accounts/types/UpdateAccountStatus.js +13 -0
  11. package/dist/cjs/api/resources/accounts/types/index.d.ts +3 -0
  12. package/dist/cjs/api/resources/accounts/types/index.js +3 -0
  13. package/dist/cjs/api/resources/apiKeys/types/ApiKeyPermissions.d.ts +5 -0
  14. package/dist/cjs/api/resources/attachments/types/AttachmentResponse.d.ts +4 -2
  15. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +3 -0
  16. package/dist/cjs/api/resources/inboxes/client/Client.js +21 -16
  17. package/dist/cjs/api/resources/inboxes/resources/accounts/client/Client.d.ts +42 -0
  18. package/dist/cjs/api/resources/inboxes/resources/accounts/client/Client.js +197 -0
  19. package/dist/cjs/api/resources/inboxes/resources/accounts/client/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/inboxes/resources/accounts/client/index.js +17 -0
  21. package/dist/cjs/api/resources/inboxes/resources/accounts/client/requests/ListAccountsRequest.d.ts +10 -0
  22. package/dist/cjs/api/resources/inboxes/resources/accounts/client/requests/ListAccountsRequest.js +3 -0
  23. package/dist/cjs/api/resources/inboxes/resources/accounts/client/requests/index.d.ts +1 -0
  24. package/dist/cjs/api/resources/inboxes/resources/accounts/client/requests/index.js +2 -0
  25. package/dist/cjs/api/resources/inboxes/resources/accounts/exports.d.ts +2 -0
  26. package/dist/cjs/api/resources/inboxes/resources/accounts/exports.js +21 -0
  27. package/dist/cjs/api/resources/inboxes/resources/accounts/index.d.ts +1 -0
  28. package/dist/cjs/api/resources/inboxes/resources/accounts/index.js +17 -0
  29. package/dist/cjs/api/resources/inboxes/resources/index.d.ts +2 -0
  30. package/dist/cjs/api/resources/inboxes/resources/index.js +3 -1
  31. package/dist/cjs/api/resources/messages/types/RawMessageResponse.d.ts +2 -2
  32. package/dist/cjs/api/resources/pods/client/Client.d.ts +3 -0
  33. package/dist/cjs/api/resources/pods/client/Client.js +21 -16
  34. package/dist/cjs/api/resources/pods/resources/accounts/client/Client.d.ts +42 -0
  35. package/dist/cjs/api/resources/pods/resources/accounts/client/Client.js +197 -0
  36. package/dist/cjs/api/resources/pods/resources/accounts/client/index.d.ts +1 -0
  37. package/dist/cjs/api/resources/pods/resources/accounts/client/index.js +17 -0
  38. package/dist/cjs/api/resources/pods/resources/accounts/client/requests/ListAccountsRequest.d.ts +10 -0
  39. package/dist/cjs/api/resources/pods/resources/accounts/client/requests/ListAccountsRequest.js +3 -0
  40. package/dist/cjs/api/resources/pods/resources/accounts/client/requests/index.d.ts +1 -0
  41. package/dist/cjs/api/resources/pods/resources/accounts/client/requests/index.js +2 -0
  42. package/dist/cjs/api/resources/pods/resources/accounts/exports.d.ts +2 -0
  43. package/dist/cjs/api/resources/pods/resources/accounts/exports.js +21 -0
  44. package/dist/cjs/api/resources/pods/resources/accounts/index.d.ts +1 -0
  45. package/dist/cjs/api/resources/pods/resources/accounts/index.js +17 -0
  46. package/dist/cjs/api/resources/pods/resources/index.d.ts +2 -0
  47. package/dist/cjs/api/resources/pods/resources/index.js +3 -1
  48. package/dist/cjs/api/resources/webhooks/types/CreateWebhookRequest.d.ts +4 -0
  49. package/dist/cjs/api/resources/webhooks/types/UpdatePodWebhookRequest.d.ts +5 -1
  50. package/dist/cjs/api/resources/webhooks/types/Webhook.d.ts +11 -0
  51. package/dist/cjs/serialization/resources/accounts/types/Account.d.ts +3 -0
  52. package/dist/cjs/serialization/resources/accounts/types/Account.js +3 -0
  53. package/dist/cjs/serialization/resources/accounts/types/AccountStatus.d.ts +7 -0
  54. package/dist/cjs/serialization/resources/accounts/types/AccountStatus.js +39 -0
  55. package/dist/cjs/serialization/resources/accounts/types/UpdateAccountRequest.d.ts +10 -0
  56. package/dist/cjs/serialization/resources/accounts/types/UpdateAccountRequest.js +42 -0
  57. package/dist/cjs/serialization/resources/accounts/types/UpdateAccountStatus.d.ts +7 -0
  58. package/dist/cjs/serialization/resources/accounts/types/UpdateAccountStatus.js +39 -0
  59. package/dist/cjs/serialization/resources/accounts/types/index.d.ts +3 -0
  60. package/dist/cjs/serialization/resources/accounts/types/index.js +3 -0
  61. package/dist/cjs/serialization/resources/apiKeys/types/ApiKeyPermissions.d.ts +1 -0
  62. package/dist/cjs/serialization/resources/apiKeys/types/ApiKeyPermissions.js +1 -0
  63. package/dist/cjs/serialization/resources/attachments/types/AttachmentResponse.d.ts +1 -0
  64. package/dist/cjs/serialization/resources/attachments/types/AttachmentResponse.js +1 -0
  65. package/dist/cjs/serialization/resources/webhooks/types/Webhook.d.ts +2 -0
  66. package/dist/cjs/serialization/resources/webhooks/types/Webhook.js +2 -0
  67. package/dist/cjs/version.d.ts +1 -1
  68. package/dist/cjs/version.js +1 -1
  69. package/dist/esm/BaseClient.mjs +2 -2
  70. package/dist/esm/api/resources/accounts/client/Client.d.mts +38 -1
  71. package/dist/esm/api/resources/accounts/client/Client.mjs +111 -1
  72. package/dist/esm/api/resources/accounts/types/Account.d.mts +4 -0
  73. package/dist/esm/api/resources/accounts/types/AccountStatus.d.mts +8 -0
  74. package/dist/esm/api/resources/accounts/types/AccountStatus.mjs +8 -0
  75. package/dist/esm/api/resources/accounts/types/UpdateAccountRequest.d.mts +9 -0
  76. package/dist/esm/api/resources/accounts/types/UpdateAccountRequest.mjs +2 -0
  77. package/dist/esm/api/resources/accounts/types/UpdateAccountStatus.d.mts +10 -0
  78. package/dist/esm/api/resources/accounts/types/UpdateAccountStatus.mjs +10 -0
  79. package/dist/esm/api/resources/accounts/types/index.d.mts +3 -0
  80. package/dist/esm/api/resources/accounts/types/index.mjs +3 -0
  81. package/dist/esm/api/resources/apiKeys/types/ApiKeyPermissions.d.mts +5 -0
  82. package/dist/esm/api/resources/attachments/types/AttachmentResponse.d.mts +4 -2
  83. package/dist/esm/api/resources/inboxes/client/Client.d.mts +3 -0
  84. package/dist/esm/api/resources/inboxes/client/Client.mjs +5 -0
  85. package/dist/esm/api/resources/inboxes/resources/accounts/client/Client.d.mts +42 -0
  86. package/dist/esm/api/resources/inboxes/resources/accounts/client/Client.mjs +160 -0
  87. package/dist/esm/api/resources/inboxes/resources/accounts/client/index.d.mts +1 -0
  88. package/dist/esm/api/resources/inboxes/resources/accounts/client/index.mjs +1 -0
  89. package/dist/esm/api/resources/inboxes/resources/accounts/client/requests/ListAccountsRequest.d.mts +10 -0
  90. package/dist/esm/api/resources/inboxes/resources/accounts/client/requests/ListAccountsRequest.mjs +2 -0
  91. package/dist/esm/api/resources/inboxes/resources/accounts/client/requests/index.d.mts +1 -0
  92. package/dist/esm/api/resources/inboxes/resources/accounts/client/requests/index.mjs +1 -0
  93. package/dist/esm/api/resources/inboxes/resources/accounts/exports.d.mts +2 -0
  94. package/dist/esm/api/resources/inboxes/resources/accounts/exports.mjs +3 -0
  95. package/dist/esm/api/resources/inboxes/resources/accounts/index.d.mts +1 -0
  96. package/dist/esm/api/resources/inboxes/resources/accounts/index.mjs +1 -0
  97. package/dist/esm/api/resources/inboxes/resources/index.d.mts +2 -0
  98. package/dist/esm/api/resources/inboxes/resources/index.mjs +2 -0
  99. package/dist/esm/api/resources/messages/types/RawMessageResponse.d.mts +2 -2
  100. package/dist/esm/api/resources/pods/client/Client.d.mts +3 -0
  101. package/dist/esm/api/resources/pods/client/Client.mjs +5 -0
  102. package/dist/esm/api/resources/pods/resources/accounts/client/Client.d.mts +42 -0
  103. package/dist/esm/api/resources/pods/resources/accounts/client/Client.mjs +160 -0
  104. package/dist/esm/api/resources/pods/resources/accounts/client/index.d.mts +1 -0
  105. package/dist/esm/api/resources/pods/resources/accounts/client/index.mjs +1 -0
  106. package/dist/esm/api/resources/pods/resources/accounts/client/requests/ListAccountsRequest.d.mts +10 -0
  107. package/dist/esm/api/resources/pods/resources/accounts/client/requests/ListAccountsRequest.mjs +2 -0
  108. package/dist/esm/api/resources/pods/resources/accounts/client/requests/index.d.mts +1 -0
  109. package/dist/esm/api/resources/pods/resources/accounts/client/requests/index.mjs +1 -0
  110. package/dist/esm/api/resources/pods/resources/accounts/exports.d.mts +2 -0
  111. package/dist/esm/api/resources/pods/resources/accounts/exports.mjs +3 -0
  112. package/dist/esm/api/resources/pods/resources/accounts/index.d.mts +1 -0
  113. package/dist/esm/api/resources/pods/resources/accounts/index.mjs +1 -0
  114. package/dist/esm/api/resources/pods/resources/index.d.mts +2 -0
  115. package/dist/esm/api/resources/pods/resources/index.mjs +2 -0
  116. package/dist/esm/api/resources/webhooks/types/CreateWebhookRequest.d.mts +4 -0
  117. package/dist/esm/api/resources/webhooks/types/UpdatePodWebhookRequest.d.mts +5 -1
  118. package/dist/esm/api/resources/webhooks/types/Webhook.d.mts +11 -0
  119. package/dist/esm/serialization/resources/accounts/types/Account.d.mts +3 -0
  120. package/dist/esm/serialization/resources/accounts/types/Account.mjs +3 -0
  121. package/dist/esm/serialization/resources/accounts/types/AccountStatus.d.mts +7 -0
  122. package/dist/esm/serialization/resources/accounts/types/AccountStatus.mjs +3 -0
  123. package/dist/esm/serialization/resources/accounts/types/UpdateAccountRequest.d.mts +10 -0
  124. package/dist/esm/serialization/resources/accounts/types/UpdateAccountRequest.mjs +6 -0
  125. package/dist/esm/serialization/resources/accounts/types/UpdateAccountStatus.d.mts +7 -0
  126. package/dist/esm/serialization/resources/accounts/types/UpdateAccountStatus.mjs +3 -0
  127. package/dist/esm/serialization/resources/accounts/types/index.d.mts +3 -0
  128. package/dist/esm/serialization/resources/accounts/types/index.mjs +3 -0
  129. package/dist/esm/serialization/resources/apiKeys/types/ApiKeyPermissions.d.mts +1 -0
  130. package/dist/esm/serialization/resources/apiKeys/types/ApiKeyPermissions.mjs +1 -0
  131. package/dist/esm/serialization/resources/attachments/types/AttachmentResponse.d.mts +1 -0
  132. package/dist/esm/serialization/resources/attachments/types/AttachmentResponse.mjs +1 -0
  133. package/dist/esm/serialization/resources/webhooks/types/Webhook.d.mts +2 -0
  134. package/dist/esm/serialization/resources/webhooks/types/Webhook.mjs +2 -0
  135. package/dist/esm/version.d.mts +1 -1
  136. package/dist/esm/version.mjs +1 -1
  137. package/dist/llms.txt +8 -2
  138. package/package.json +23 -1
  139. package/reference.md +393 -1
@@ -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.27",
47
- "User-Agent": "agentmail/0.5.27",
46
+ "X-Fern-SDK-Version": "0.5.29",
47
+ "User-Agent": "agentmail/0.5.29",
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);
@@ -11,7 +11,9 @@ export declare class AccountsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<AccountsClient.Options>;
12
12
  constructor(options?: AccountsClient.Options);
13
13
  /**
14
- * Lists accounts across all providers.
14
+ * Lists accounts across all providers, scoped to the API key: an
15
+ * organization key sees every account, a pod key its pod's, an inbox key
16
+ * its inbox's. Requires `inbox_read`.
15
17
  *
16
18
  * @param {AgentMail.ListAccountsRequest} request
17
19
  * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -24,6 +26,9 @@ export declare class AccountsClient {
24
26
  list(request?: AgentMail.ListAccountsRequest, requestOptions?: AccountsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListAccountsResponse>;
25
27
  private __list;
26
28
  /**
29
+ * Returns one account by ID. An account outside the key's scope is a 404.
30
+ * Requires `inbox_read`.
31
+ *
27
32
  * @param {AgentMail.AccountId} account_id
28
33
  * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
29
34
  *
@@ -34,4 +39,36 @@ export declare class AccountsClient {
34
39
  */
35
40
  get(account_id: AgentMail.AccountId, requestOptions?: AccountsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Account>;
36
41
  private __get;
42
+ /**
43
+ * Updates one account. Set `status` to `disabled` to stop the inbox from
44
+ * signing in at the provider again, or to `enabled` to re-enable it.
45
+ * Idempotent: disabling an already disabled account keeps its original
46
+ * `disabled_at`, and enabling an enabled account is a no-op.
47
+ *
48
+ * Find the `account_id` with List Accounts. An account exists only after an
49
+ * inbox's first sign-in at a provider, so it cannot be disabled in advance.
50
+ * A disable applies to that inbox at that provider whichever sign-in key is
51
+ * used: the provider's next authorization ends in `access_denied`, and a code
52
+ * issued earlier is refused with `invalid_grant`. Access tokens already
53
+ * issued stay valid until they expire, and the provider's own session is
54
+ * unaffected.
55
+ *
56
+ * Requires `account_update`, which sign-in keys (`type: public_key`) cannot
57
+ * hold, so call this with a bearer API key. An account outside the key's
58
+ * scope is a 404. A 409 means the account changed during the write; read it
59
+ * again and retry.
60
+ *
61
+ * @param {AgentMail.AccountId} account_id
62
+ * @param {AgentMail.UpdateAccountRequest} request
63
+ * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
64
+ *
65
+ * @throws {@link AgentMail.ValidationError}
66
+ * @throws {@link AgentMail.NotFoundError}
67
+ * @throws {@link AgentMail.ConflictError}
68
+ *
69
+ * @example
70
+ * await client.accounts.update("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", {})
71
+ */
72
+ update(account_id: AgentMail.AccountId, request: AgentMail.UpdateAccountRequest, requestOptions?: AccountsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Account>;
73
+ private __update;
37
74
  }
@@ -57,7 +57,9 @@ class AccountsClient {
57
57
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
58
58
  }
59
59
  /**
60
- * Lists accounts across all providers.
60
+ * Lists accounts across all providers, scoped to the API key: an
61
+ * organization key sees every account, a pod key its pod's, an inbox key
62
+ * its inbox's. Requires `inbox_read`.
61
63
  *
62
64
  * @param {AgentMail.ListAccountsRequest} request
63
65
  * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -127,6 +129,9 @@ class AccountsClient {
127
129
  });
128
130
  }
129
131
  /**
132
+ * Returns one account by ID. An account outside the key's scope is a 404.
133
+ * Requires `inbox_read`.
134
+ *
130
135
  * @param {AgentMail.AccountId} account_id
131
136
  * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
132
137
  *
@@ -188,5 +193,110 @@ class AccountsClient {
188
193
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/accounts/{account_id}");
189
194
  });
190
195
  }
196
+ /**
197
+ * Updates one account. Set `status` to `disabled` to stop the inbox from
198
+ * signing in at the provider again, or to `enabled` to re-enable it.
199
+ * Idempotent: disabling an already disabled account keeps its original
200
+ * `disabled_at`, and enabling an enabled account is a no-op.
201
+ *
202
+ * Find the `account_id` with List Accounts. An account exists only after an
203
+ * inbox's first sign-in at a provider, so it cannot be disabled in advance.
204
+ * A disable applies to that inbox at that provider whichever sign-in key is
205
+ * used: the provider's next authorization ends in `access_denied`, and a code
206
+ * issued earlier is refused with `invalid_grant`. Access tokens already
207
+ * issued stay valid until they expire, and the provider's own session is
208
+ * unaffected.
209
+ *
210
+ * Requires `account_update`, which sign-in keys (`type: public_key`) cannot
211
+ * hold, so call this with a bearer API key. An account outside the key's
212
+ * scope is a 404. A 409 means the account changed during the write; read it
213
+ * again and retry.
214
+ *
215
+ * @param {AgentMail.AccountId} account_id
216
+ * @param {AgentMail.UpdateAccountRequest} request
217
+ * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
218
+ *
219
+ * @throws {@link AgentMail.ValidationError}
220
+ * @throws {@link AgentMail.NotFoundError}
221
+ * @throws {@link AgentMail.ConflictError}
222
+ *
223
+ * @example
224
+ * await client.accounts.update("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", {})
225
+ */
226
+ update(account_id, request, requestOptions) {
227
+ return core.HttpResponsePromise.fromPromise(this.__update(account_id, request, requestOptions));
228
+ }
229
+ __update(account_id, request, requestOptions) {
230
+ return __awaiter(this, void 0, void 0, function* () {
231
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
232
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
233
+ 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);
234
+ const _response = yield core.fetcher({
235
+ 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)
236
+ .http, `/v0/accounts/${core.url.encodePathParam(serializers.AccountId.jsonOrThrow(account_id, { omitUndefined: true }))}/update`),
237
+ method: "PATCH",
238
+ headers: _headers,
239
+ contentType: "application/json",
240
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
241
+ requestType: "json",
242
+ body: serializers.UpdateAccountRequest.jsonOrThrow(request, {
243
+ unrecognizedObjectKeys: "strip",
244
+ omitUndefined: true,
245
+ }),
246
+ 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,
247
+ 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,
248
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
249
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
250
+ logging: this._options.logging,
251
+ });
252
+ if (_response.ok) {
253
+ return {
254
+ data: serializers.Account.parseOrThrow(_response.body, {
255
+ unrecognizedObjectKeys: "passthrough",
256
+ allowUnrecognizedUnionMembers: true,
257
+ allowUnrecognizedEnumValues: true,
258
+ skipValidation: true,
259
+ breadcrumbsPrefix: ["response"],
260
+ }),
261
+ rawResponse: _response.rawResponse,
262
+ };
263
+ }
264
+ if (_response.error.reason === "status-code") {
265
+ switch (_response.error.statusCode) {
266
+ case 400:
267
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
268
+ unrecognizedObjectKeys: "passthrough",
269
+ allowUnrecognizedUnionMembers: true,
270
+ allowUnrecognizedEnumValues: true,
271
+ skipValidation: true,
272
+ breadcrumbsPrefix: ["response"],
273
+ }), _response.rawResponse);
274
+ case 404:
275
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
276
+ unrecognizedObjectKeys: "passthrough",
277
+ allowUnrecognizedUnionMembers: true,
278
+ allowUnrecognizedEnumValues: true,
279
+ skipValidation: true,
280
+ breadcrumbsPrefix: ["response"],
281
+ }), _response.rawResponse);
282
+ case 409:
283
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
284
+ unrecognizedObjectKeys: "passthrough",
285
+ allowUnrecognizedUnionMembers: true,
286
+ allowUnrecognizedEnumValues: true,
287
+ skipValidation: true,
288
+ breadcrumbsPrefix: ["response"],
289
+ }), _response.rawResponse);
290
+ default:
291
+ throw new errors.AgentMailError({
292
+ statusCode: _response.error.statusCode,
293
+ body: _response.error.body,
294
+ rawResponse: _response.rawResponse,
295
+ });
296
+ }
297
+ }
298
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/accounts/{account_id}/update");
299
+ });
300
+ }
191
301
  }
192
302
  exports.AccountsClient = AccountsClient;
@@ -16,4 +16,8 @@ export interface Account {
16
16
  lastSignedInAt: Date;
17
17
  /** Number of sign-ins at provider. */
18
18
  signInCount: number;
19
+ /** Present only while the account is disabled. Absent means the inbox may sign in. */
20
+ status?: AgentMail.AccountStatus;
21
+ /** Time at which the account was disabled. Present only while `status` is `disabled`. */
22
+ disabledAt?: Date;
19
23
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `disabled` refuses every new sign-in for the account until it is
3
+ * re-enabled. Access tokens already issued are not revoked.
4
+ */
5
+ export declare const AccountStatus: {
6
+ readonly Disabled: "disabled";
7
+ };
8
+ export type AccountStatus = (typeof AccountStatus)[keyof typeof AccountStatus];
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AccountStatus = void 0;
5
+ /**
6
+ * `disabled` refuses every new sign-in for the account until it is
7
+ * re-enabled. Access tokens already issued are not revoked.
8
+ */
9
+ exports.AccountStatus = {
10
+ Disabled: "disabled",
11
+ };
@@ -0,0 +1,9 @@
1
+ import type * as AgentMail from "../../../index.js";
2
+ /**
3
+ * Fields to change on the account. Fields you omit are left unchanged and
4
+ * unknown fields are rejected. Expects at least one field; today that is
5
+ * `status`.
6
+ */
7
+ export interface UpdateAccountRequest {
8
+ status?: AgentMail.UpdateAccountStatus;
9
+ }
@@ -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 });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Status to set. `disabled` stops the inbox from signing in at the
3
+ * provider; `enabled` re-enables it. An enabled account reads back with no
4
+ * `status`.
5
+ */
6
+ export declare const UpdateAccountStatus: {
7
+ readonly Enabled: "enabled";
8
+ readonly Disabled: "disabled";
9
+ };
10
+ export type UpdateAccountStatus = (typeof UpdateAccountStatus)[keyof typeof UpdateAccountStatus];
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.UpdateAccountStatus = void 0;
5
+ /**
6
+ * Status to set. `disabled` stops the inbox from signing in at the
7
+ * provider; `enabled` re-enables it. An enabled account reads back with no
8
+ * `status`.
9
+ */
10
+ exports.UpdateAccountStatus = {
11
+ Enabled: "enabled",
12
+ Disabled: "disabled",
13
+ };
@@ -1,4 +1,7 @@
1
1
  export * from "./Account.js";
2
2
  export * from "./AccountId.js";
3
+ export * from "./AccountStatus.js";
3
4
  export * from "./ListAccountsResponse.js";
4
5
  export * from "./ProviderId.js";
6
+ export * from "./UpdateAccountRequest.js";
7
+ export * from "./UpdateAccountStatus.js";
@@ -16,5 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Account.js"), exports);
18
18
  __exportStar(require("./AccountId.js"), exports);
19
+ __exportStar(require("./AccountStatus.js"), exports);
19
20
  __exportStar(require("./ListAccountsResponse.js"), exports);
20
21
  __exportStar(require("./ProviderId.js"), exports);
22
+ __exportStar(require("./UpdateAccountRequest.js"), exports);
23
+ __exportStar(require("./UpdateAccountStatus.js"), exports);
@@ -78,6 +78,11 @@ export interface ApiKeyPermissions {
78
78
  * for both values.
79
79
  */
80
80
  providerShareOwner?: boolean;
81
+ /**
82
+ * Update accounts: disable or re-enable an inbox's sign-in at a provider. Reading accounts
83
+ * needs only `inbox_read`.
84
+ */
85
+ accountUpdate?: boolean;
81
86
  /** Read pods. */
82
87
  podRead?: boolean;
83
88
  /** Create pods. */
@@ -6,8 +6,10 @@ export interface AttachmentResponse {
6
6
  contentType?: AgentMail.AttachmentContentType;
7
7
  contentDisposition?: AgentMail.AttachmentContentDisposition;
8
8
  contentId?: AgentMail.AttachmentContentId;
9
- /** URL to download the attachment. */
9
+ /** Signed HTTPS CDN URL to download the attachment bytes. Retrieve a fresh URL when needed rather than storing it permanently. */
10
10
  downloadUrl: string;
11
- /** Time at which the download URL expires. */
11
+ /** Signed HTTPS CDN URL to download extracted plain text, when available. Omitted when no extracted text is available. Expires at the same time as download_url. */
12
+ textUrl?: string;
13
+ /** Time at which download_url and text_url (when present) expire. Retrieve the attachment again to obtain fresh URLs. */
12
14
  expiresAt: Date;
13
15
  }
@@ -2,6 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClie
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
3
  import * as core from "../../../../core/index.js";
4
4
  import * as AgentMail from "../../../index.js";
5
+ import { AccountsClient } from "../resources/accounts/client/Client.js";
5
6
  import { ApiKeysClient } from "../resources/apiKeys/client/Client.js";
6
7
  import { DraftsClient } from "../resources/drafts/client/Client.js";
7
8
  import { EventsClient } from "../resources/events/client/Client.js";
@@ -25,6 +26,7 @@ export declare class InboxesClient {
25
26
  protected _metrics: MetricsClient | undefined;
26
27
  protected _events: EventsClient | undefined;
27
28
  protected _apiKeys: ApiKeysClient | undefined;
29
+ protected _accounts: AccountsClient | undefined;
28
30
  constructor(options?: InboxesClient.Options);
29
31
  get threads(): ThreadsClient;
30
32
  get messages(): MessagesClient;
@@ -34,6 +36,7 @@ export declare class InboxesClient {
34
36
  get metrics(): MetricsClient;
35
37
  get events(): EventsClient;
36
38
  get apiKeys(): ApiKeysClient;
39
+ get accounts(): AccountsClient;
37
40
  /**
38
41
  * **CLI:**
39
42
  * ```bash
@@ -52,49 +52,54 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
52
52
  const errors = __importStar(require("../../../../errors/index.js"));
53
53
  const serializers = __importStar(require("../../../../serialization/index.js"));
54
54
  const AgentMail = __importStar(require("../../../index.js"));
55
- const Client_js_1 = require("../resources/apiKeys/client/Client.js");
56
- const Client_js_2 = require("../resources/drafts/client/Client.js");
57
- const Client_js_3 = require("../resources/events/client/Client.js");
58
- const Client_js_4 = require("../resources/lists/client/Client.js");
59
- const Client_js_5 = require("../resources/messages/client/Client.js");
60
- const Client_js_6 = require("../resources/metrics/client/Client.js");
61
- const Client_js_7 = require("../resources/threads/client/Client.js");
62
- const Client_js_8 = require("../resources/webhooks/client/Client.js");
55
+ const Client_js_1 = require("../resources/accounts/client/Client.js");
56
+ const Client_js_2 = require("../resources/apiKeys/client/Client.js");
57
+ const Client_js_3 = require("../resources/drafts/client/Client.js");
58
+ const Client_js_4 = require("../resources/events/client/Client.js");
59
+ const Client_js_5 = require("../resources/lists/client/Client.js");
60
+ const Client_js_6 = require("../resources/messages/client/Client.js");
61
+ const Client_js_7 = require("../resources/metrics/client/Client.js");
62
+ const Client_js_8 = require("../resources/threads/client/Client.js");
63
+ const Client_js_9 = require("../resources/webhooks/client/Client.js");
63
64
  class InboxesClient {
64
65
  constructor(options = {}) {
65
66
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
66
67
  }
67
68
  get threads() {
68
69
  var _a;
69
- return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new Client_js_7.ThreadsClient(this._options)));
70
+ return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new Client_js_8.ThreadsClient(this._options)));
70
71
  }
71
72
  get messages() {
72
73
  var _a;
73
- return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_js_5.MessagesClient(this._options)));
74
+ return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_js_6.MessagesClient(this._options)));
74
75
  }
75
76
  get drafts() {
76
77
  var _a;
77
- return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new Client_js_2.DraftsClient(this._options)));
78
+ return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new Client_js_3.DraftsClient(this._options)));
78
79
  }
79
80
  get webhooks() {
80
81
  var _a;
81
- return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_8.WebhooksClient(this._options)));
82
+ return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_9.WebhooksClient(this._options)));
82
83
  }
83
84
  get lists() {
84
85
  var _a;
85
- return ((_a = this._lists) !== null && _a !== void 0 ? _a : (this._lists = new Client_js_4.ListsClient(this._options)));
86
+ return ((_a = this._lists) !== null && _a !== void 0 ? _a : (this._lists = new Client_js_5.ListsClient(this._options)));
86
87
  }
87
88
  get metrics() {
88
89
  var _a;
89
- return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_js_6.MetricsClient(this._options)));
90
+ return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_js_7.MetricsClient(this._options)));
90
91
  }
91
92
  get events() {
92
93
  var _a;
93
- return ((_a = this._events) !== null && _a !== void 0 ? _a : (this._events = new Client_js_3.EventsClient(this._options)));
94
+ return ((_a = this._events) !== null && _a !== void 0 ? _a : (this._events = new Client_js_4.EventsClient(this._options)));
94
95
  }
95
96
  get apiKeys() {
96
97
  var _a;
97
- return ((_a = this._apiKeys) !== null && _a !== void 0 ? _a : (this._apiKeys = new Client_js_1.ApiKeysClient(this._options)));
98
+ return ((_a = this._apiKeys) !== null && _a !== void 0 ? _a : (this._apiKeys = new Client_js_2.ApiKeysClient(this._options)));
99
+ }
100
+ get accounts() {
101
+ var _a;
102
+ return ((_a = this._accounts) !== null && _a !== void 0 ? _a : (this._accounts = new Client_js_1.AccountsClient(this._options)));
98
103
  }
99
104
  /**
100
105
  * **CLI:**
@@ -0,0 +1,42 @@
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 * as AgentMail from "../../../../../index.js";
5
+ export declare namespace AccountsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class AccountsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<AccountsClient.Options>;
12
+ constructor(options?: AccountsClient.Options);
13
+ /**
14
+ * Lists accounts held by the inbox, across all providers. Requires `inbox_read`.
15
+ *
16
+ * @param {AgentMail.inboxes.InboxId} inbox_id
17
+ * @param {AgentMail.inboxes.ListAccountsRequest} request
18
+ * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
19
+ *
20
+ * @throws {@link AgentMail.ValidationError}
21
+ *
22
+ * @example
23
+ * await client.inboxes.accounts.list("inbox_id")
24
+ */
25
+ list(inbox_id: AgentMail.inboxes.InboxId, request?: AgentMail.inboxes.ListAccountsRequest, requestOptions?: AccountsClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListAccountsResponse>;
26
+ private __list;
27
+ /**
28
+ * Returns one account held by the inbox. An account elsewhere is a 404. Requires
29
+ * `inbox_read`.
30
+ *
31
+ * @param {AgentMail.inboxes.InboxId} inbox_id
32
+ * @param {AgentMail.AccountId} account_id
33
+ * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
34
+ *
35
+ * @throws {@link AgentMail.NotFoundError}
36
+ *
37
+ * @example
38
+ * await client.inboxes.accounts.get("inbox_id", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
39
+ */
40
+ get(inbox_id: AgentMail.inboxes.InboxId, account_id: AgentMail.AccountId, requestOptions?: AccountsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Account>;
41
+ private __get;
42
+ }