agentmail 0.5.27 → 0.5.28

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 (125) 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/inboxes/client/Client.d.ts +3 -0
  15. package/dist/cjs/api/resources/inboxes/client/Client.js +21 -16
  16. package/dist/cjs/api/resources/inboxes/resources/accounts/client/Client.d.ts +42 -0
  17. package/dist/cjs/api/resources/inboxes/resources/accounts/client/Client.js +197 -0
  18. package/dist/cjs/api/resources/inboxes/resources/accounts/client/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/inboxes/resources/accounts/client/index.js +17 -0
  20. package/dist/cjs/api/resources/inboxes/resources/accounts/client/requests/ListAccountsRequest.d.ts +10 -0
  21. package/dist/cjs/api/resources/inboxes/resources/accounts/client/requests/ListAccountsRequest.js +3 -0
  22. package/dist/cjs/api/resources/inboxes/resources/accounts/client/requests/index.d.ts +1 -0
  23. package/dist/cjs/api/resources/inboxes/resources/accounts/client/requests/index.js +2 -0
  24. package/dist/cjs/api/resources/inboxes/resources/accounts/exports.d.ts +2 -0
  25. package/dist/cjs/api/resources/inboxes/resources/accounts/exports.js +21 -0
  26. package/dist/cjs/api/resources/inboxes/resources/accounts/index.d.ts +1 -0
  27. package/dist/cjs/api/resources/inboxes/resources/accounts/index.js +17 -0
  28. package/dist/cjs/api/resources/inboxes/resources/index.d.ts +2 -0
  29. package/dist/cjs/api/resources/inboxes/resources/index.js +3 -1
  30. package/dist/cjs/api/resources/pods/client/Client.d.ts +3 -0
  31. package/dist/cjs/api/resources/pods/client/Client.js +21 -16
  32. package/dist/cjs/api/resources/pods/resources/accounts/client/Client.d.ts +42 -0
  33. package/dist/cjs/api/resources/pods/resources/accounts/client/Client.js +197 -0
  34. package/dist/cjs/api/resources/pods/resources/accounts/client/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/pods/resources/accounts/client/index.js +17 -0
  36. package/dist/cjs/api/resources/pods/resources/accounts/client/requests/ListAccountsRequest.d.ts +10 -0
  37. package/dist/cjs/api/resources/pods/resources/accounts/client/requests/ListAccountsRequest.js +3 -0
  38. package/dist/cjs/api/resources/pods/resources/accounts/client/requests/index.d.ts +1 -0
  39. package/dist/cjs/api/resources/pods/resources/accounts/client/requests/index.js +2 -0
  40. package/dist/cjs/api/resources/pods/resources/accounts/exports.d.ts +2 -0
  41. package/dist/cjs/api/resources/pods/resources/accounts/exports.js +21 -0
  42. package/dist/cjs/api/resources/pods/resources/accounts/index.d.ts +1 -0
  43. package/dist/cjs/api/resources/pods/resources/accounts/index.js +17 -0
  44. package/dist/cjs/api/resources/pods/resources/index.d.ts +2 -0
  45. package/dist/cjs/api/resources/pods/resources/index.js +3 -1
  46. package/dist/cjs/api/resources/webhooks/types/CreateWebhookRequest.d.ts +4 -0
  47. package/dist/cjs/api/resources/webhooks/types/UpdatePodWebhookRequest.d.ts +5 -1
  48. package/dist/cjs/serialization/resources/accounts/types/Account.d.ts +3 -0
  49. package/dist/cjs/serialization/resources/accounts/types/Account.js +3 -0
  50. package/dist/cjs/serialization/resources/accounts/types/AccountStatus.d.ts +7 -0
  51. package/dist/cjs/serialization/resources/accounts/types/AccountStatus.js +39 -0
  52. package/dist/cjs/serialization/resources/accounts/types/UpdateAccountRequest.d.ts +10 -0
  53. package/dist/cjs/serialization/resources/accounts/types/UpdateAccountRequest.js +42 -0
  54. package/dist/cjs/serialization/resources/accounts/types/UpdateAccountStatus.d.ts +7 -0
  55. package/dist/cjs/serialization/resources/accounts/types/UpdateAccountStatus.js +39 -0
  56. package/dist/cjs/serialization/resources/accounts/types/index.d.ts +3 -0
  57. package/dist/cjs/serialization/resources/accounts/types/index.js +3 -0
  58. package/dist/cjs/serialization/resources/apiKeys/types/ApiKeyPermissions.d.ts +1 -0
  59. package/dist/cjs/serialization/resources/apiKeys/types/ApiKeyPermissions.js +1 -0
  60. package/dist/cjs/version.d.ts +1 -1
  61. package/dist/cjs/version.js +1 -1
  62. package/dist/esm/BaseClient.mjs +2 -2
  63. package/dist/esm/api/resources/accounts/client/Client.d.mts +38 -1
  64. package/dist/esm/api/resources/accounts/client/Client.mjs +111 -1
  65. package/dist/esm/api/resources/accounts/types/Account.d.mts +4 -0
  66. package/dist/esm/api/resources/accounts/types/AccountStatus.d.mts +8 -0
  67. package/dist/esm/api/resources/accounts/types/AccountStatus.mjs +8 -0
  68. package/dist/esm/api/resources/accounts/types/UpdateAccountRequest.d.mts +9 -0
  69. package/dist/esm/api/resources/accounts/types/UpdateAccountRequest.mjs +2 -0
  70. package/dist/esm/api/resources/accounts/types/UpdateAccountStatus.d.mts +10 -0
  71. package/dist/esm/api/resources/accounts/types/UpdateAccountStatus.mjs +10 -0
  72. package/dist/esm/api/resources/accounts/types/index.d.mts +3 -0
  73. package/dist/esm/api/resources/accounts/types/index.mjs +3 -0
  74. package/dist/esm/api/resources/apiKeys/types/ApiKeyPermissions.d.mts +5 -0
  75. package/dist/esm/api/resources/inboxes/client/Client.d.mts +3 -0
  76. package/dist/esm/api/resources/inboxes/client/Client.mjs +5 -0
  77. package/dist/esm/api/resources/inboxes/resources/accounts/client/Client.d.mts +42 -0
  78. package/dist/esm/api/resources/inboxes/resources/accounts/client/Client.mjs +160 -0
  79. package/dist/esm/api/resources/inboxes/resources/accounts/client/index.d.mts +1 -0
  80. package/dist/esm/api/resources/inboxes/resources/accounts/client/index.mjs +1 -0
  81. package/dist/esm/api/resources/inboxes/resources/accounts/client/requests/ListAccountsRequest.d.mts +10 -0
  82. package/dist/esm/api/resources/inboxes/resources/accounts/client/requests/ListAccountsRequest.mjs +2 -0
  83. package/dist/esm/api/resources/inboxes/resources/accounts/client/requests/index.d.mts +1 -0
  84. package/dist/esm/api/resources/inboxes/resources/accounts/client/requests/index.mjs +1 -0
  85. package/dist/esm/api/resources/inboxes/resources/accounts/exports.d.mts +2 -0
  86. package/dist/esm/api/resources/inboxes/resources/accounts/exports.mjs +3 -0
  87. package/dist/esm/api/resources/inboxes/resources/accounts/index.d.mts +1 -0
  88. package/dist/esm/api/resources/inboxes/resources/accounts/index.mjs +1 -0
  89. package/dist/esm/api/resources/inboxes/resources/index.d.mts +2 -0
  90. package/dist/esm/api/resources/inboxes/resources/index.mjs +2 -0
  91. package/dist/esm/api/resources/pods/client/Client.d.mts +3 -0
  92. package/dist/esm/api/resources/pods/client/Client.mjs +5 -0
  93. package/dist/esm/api/resources/pods/resources/accounts/client/Client.d.mts +42 -0
  94. package/dist/esm/api/resources/pods/resources/accounts/client/Client.mjs +160 -0
  95. package/dist/esm/api/resources/pods/resources/accounts/client/index.d.mts +1 -0
  96. package/dist/esm/api/resources/pods/resources/accounts/client/index.mjs +1 -0
  97. package/dist/esm/api/resources/pods/resources/accounts/client/requests/ListAccountsRequest.d.mts +10 -0
  98. package/dist/esm/api/resources/pods/resources/accounts/client/requests/ListAccountsRequest.mjs +2 -0
  99. package/dist/esm/api/resources/pods/resources/accounts/client/requests/index.d.mts +1 -0
  100. package/dist/esm/api/resources/pods/resources/accounts/client/requests/index.mjs +1 -0
  101. package/dist/esm/api/resources/pods/resources/accounts/exports.d.mts +2 -0
  102. package/dist/esm/api/resources/pods/resources/accounts/exports.mjs +3 -0
  103. package/dist/esm/api/resources/pods/resources/accounts/index.d.mts +1 -0
  104. package/dist/esm/api/resources/pods/resources/accounts/index.mjs +1 -0
  105. package/dist/esm/api/resources/pods/resources/index.d.mts +2 -0
  106. package/dist/esm/api/resources/pods/resources/index.mjs +2 -0
  107. package/dist/esm/api/resources/webhooks/types/CreateWebhookRequest.d.mts +4 -0
  108. package/dist/esm/api/resources/webhooks/types/UpdatePodWebhookRequest.d.mts +5 -1
  109. package/dist/esm/serialization/resources/accounts/types/Account.d.mts +3 -0
  110. package/dist/esm/serialization/resources/accounts/types/Account.mjs +3 -0
  111. package/dist/esm/serialization/resources/accounts/types/AccountStatus.d.mts +7 -0
  112. package/dist/esm/serialization/resources/accounts/types/AccountStatus.mjs +3 -0
  113. package/dist/esm/serialization/resources/accounts/types/UpdateAccountRequest.d.mts +10 -0
  114. package/dist/esm/serialization/resources/accounts/types/UpdateAccountRequest.mjs +6 -0
  115. package/dist/esm/serialization/resources/accounts/types/UpdateAccountStatus.d.mts +7 -0
  116. package/dist/esm/serialization/resources/accounts/types/UpdateAccountStatus.mjs +3 -0
  117. package/dist/esm/serialization/resources/accounts/types/index.d.mts +3 -0
  118. package/dist/esm/serialization/resources/accounts/types/index.mjs +3 -0
  119. package/dist/esm/serialization/resources/apiKeys/types/ApiKeyPermissions.d.mts +1 -0
  120. package/dist/esm/serialization/resources/apiKeys/types/ApiKeyPermissions.mjs +1 -0
  121. package/dist/esm/version.d.mts +1 -1
  122. package/dist/esm/version.mjs +1 -1
  123. package/dist/llms.txt +8 -2
  124. package/package.json +23 -1
  125. package/reference.md +393 -1
@@ -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.AccountStatus = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ exports.AccountStatus = core.serialization.enum_(["disabled"]);
@@ -0,0 +1,10 @@
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 { UpdateAccountStatus } from "./UpdateAccountStatus.js";
5
+ export declare const UpdateAccountRequest: core.serialization.ObjectSchema<serializers.UpdateAccountRequest.Raw, AgentMail.UpdateAccountRequest>;
6
+ export declare namespace UpdateAccountRequest {
7
+ interface Raw {
8
+ status?: UpdateAccountStatus.Raw | null;
9
+ }
10
+ }
@@ -0,0 +1,42 @@
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.UpdateAccountRequest = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ const UpdateAccountStatus_js_1 = require("./UpdateAccountStatus.js");
40
+ exports.UpdateAccountRequest = core.serialization.object({
41
+ status: UpdateAccountStatus_js_1.UpdateAccountStatus.optional(),
42
+ });
@@ -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 UpdateAccountStatus: core.serialization.Schema<serializers.UpdateAccountStatus.Raw, AgentMail.UpdateAccountStatus>;
5
+ export declare namespace UpdateAccountStatus {
6
+ type Raw = "enabled" | "disabled";
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.UpdateAccountStatus = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ exports.UpdateAccountStatus = core.serialization.enum_(["enabled", "disabled"]);
@@ -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);
@@ -39,6 +39,7 @@ export declare namespace ApiKeyPermissions {
39
39
  api_key_delete?: boolean | null;
40
40
  provider_connect?: boolean | null;
41
41
  provider_share_owner?: boolean | null;
42
+ account_update?: boolean | null;
42
43
  pod_read?: boolean | null;
43
44
  pod_create?: boolean | null;
44
45
  pod_delete?: boolean | null;
@@ -72,6 +72,7 @@ exports.ApiKeyPermissions = core.serialization.object({
72
72
  apiKeyDelete: core.serialization.property("api_key_delete", core.serialization.boolean().optional()),
73
73
  providerConnect: core.serialization.property("provider_connect", core.serialization.boolean().optional()),
74
74
  providerShareOwner: core.serialization.property("provider_share_owner", core.serialization.boolean().optional()),
75
+ accountUpdate: core.serialization.property("account_update", core.serialization.boolean().optional()),
75
76
  podRead: core.serialization.property("pod_read", core.serialization.boolean().optional()),
76
77
  podCreate: core.serialization.property("pod_create", core.serialization.boolean().optional()),
77
78
  podDelete: core.serialization.property("pod_delete", core.serialization.boolean().optional()),
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.5.27";
1
+ export declare const SDK_VERSION = "0.5.28";
@@ -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.5.27";
4
+ exports.SDK_VERSION = "0.5.28";
@@ -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.27",
10
- "User-Agent": "agentmail/0.5.27",
9
+ "X-Fern-SDK-Version": "0.5.28",
10
+ "User-Agent": "agentmail/0.5.28",
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);
@@ -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
  }
@@ -21,7 +21,9 @@ export class AccountsClient {
21
21
  this._options = normalizeClientOptionsWithAuth(options);
22
22
  }
23
23
  /**
24
- * Lists accounts across all providers.
24
+ * Lists accounts across all providers, scoped to the API key: an
25
+ * organization key sees every account, a pod key its pod's, an inbox key
26
+ * its inbox's. Requires `inbox_read`.
25
27
  *
26
28
  * @param {AgentMail.ListAccountsRequest} request
27
29
  * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -91,6 +93,9 @@ export class AccountsClient {
91
93
  });
92
94
  }
93
95
  /**
96
+ * Returns one account by ID. An account outside the key's scope is a 404.
97
+ * Requires `inbox_read`.
98
+ *
94
99
  * @param {AgentMail.AccountId} account_id
95
100
  * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
96
101
  *
@@ -152,4 +157,109 @@ export class AccountsClient {
152
157
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/accounts/{account_id}");
153
158
  });
154
159
  }
160
+ /**
161
+ * Updates one account. Set `status` to `disabled` to stop the inbox from
162
+ * signing in at the provider again, or to `enabled` to re-enable it.
163
+ * Idempotent: disabling an already disabled account keeps its original
164
+ * `disabled_at`, and enabling an enabled account is a no-op.
165
+ *
166
+ * Find the `account_id` with List Accounts. An account exists only after an
167
+ * inbox's first sign-in at a provider, so it cannot be disabled in advance.
168
+ * A disable applies to that inbox at that provider whichever sign-in key is
169
+ * used: the provider's next authorization ends in `access_denied`, and a code
170
+ * issued earlier is refused with `invalid_grant`. Access tokens already
171
+ * issued stay valid until they expire, and the provider's own session is
172
+ * unaffected.
173
+ *
174
+ * Requires `account_update`, which sign-in keys (`type: public_key`) cannot
175
+ * hold, so call this with a bearer API key. An account outside the key's
176
+ * scope is a 404. A 409 means the account changed during the write; read it
177
+ * again and retry.
178
+ *
179
+ * @param {AgentMail.AccountId} account_id
180
+ * @param {AgentMail.UpdateAccountRequest} request
181
+ * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
182
+ *
183
+ * @throws {@link AgentMail.ValidationError}
184
+ * @throws {@link AgentMail.NotFoundError}
185
+ * @throws {@link AgentMail.ConflictError}
186
+ *
187
+ * @example
188
+ * await client.accounts.update("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", {})
189
+ */
190
+ update(account_id, request, requestOptions) {
191
+ return core.HttpResponsePromise.fromPromise(this.__update(account_id, request, requestOptions));
192
+ }
193
+ __update(account_id, request, requestOptions) {
194
+ return __awaiter(this, void 0, void 0, function* () {
195
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
196
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
197
+ 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);
198
+ const _response = yield core.fetcher({
199
+ 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)
200
+ .http, `/v0/accounts/${core.url.encodePathParam(serializers.AccountId.jsonOrThrow(account_id, { omitUndefined: true }))}/update`),
201
+ method: "PATCH",
202
+ headers: _headers,
203
+ contentType: "application/json",
204
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
205
+ requestType: "json",
206
+ body: serializers.UpdateAccountRequest.jsonOrThrow(request, {
207
+ unrecognizedObjectKeys: "strip",
208
+ omitUndefined: true,
209
+ }),
210
+ 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,
211
+ 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,
212
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
213
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
214
+ logging: this._options.logging,
215
+ });
216
+ if (_response.ok) {
217
+ return {
218
+ data: serializers.Account.parseOrThrow(_response.body, {
219
+ unrecognizedObjectKeys: "passthrough",
220
+ allowUnrecognizedUnionMembers: true,
221
+ allowUnrecognizedEnumValues: true,
222
+ skipValidation: true,
223
+ breadcrumbsPrefix: ["response"],
224
+ }),
225
+ rawResponse: _response.rawResponse,
226
+ };
227
+ }
228
+ if (_response.error.reason === "status-code") {
229
+ switch (_response.error.statusCode) {
230
+ case 400:
231
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
232
+ unrecognizedObjectKeys: "passthrough",
233
+ allowUnrecognizedUnionMembers: true,
234
+ allowUnrecognizedEnumValues: true,
235
+ skipValidation: true,
236
+ breadcrumbsPrefix: ["response"],
237
+ }), _response.rawResponse);
238
+ case 404:
239
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
240
+ unrecognizedObjectKeys: "passthrough",
241
+ allowUnrecognizedUnionMembers: true,
242
+ allowUnrecognizedEnumValues: true,
243
+ skipValidation: true,
244
+ breadcrumbsPrefix: ["response"],
245
+ }), _response.rawResponse);
246
+ case 409:
247
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
248
+ unrecognizedObjectKeys: "passthrough",
249
+ allowUnrecognizedUnionMembers: true,
250
+ allowUnrecognizedEnumValues: true,
251
+ skipValidation: true,
252
+ breadcrumbsPrefix: ["response"],
253
+ }), _response.rawResponse);
254
+ default:
255
+ throw new errors.AgentMailError({
256
+ statusCode: _response.error.statusCode,
257
+ body: _response.error.body,
258
+ rawResponse: _response.rawResponse,
259
+ });
260
+ }
261
+ }
262
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/accounts/{account_id}/update");
263
+ });
264
+ }
155
265
  }
@@ -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,8 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /**
3
+ * `disabled` refuses every new sign-in for the account until it is
4
+ * re-enabled. Access tokens already issued are not revoked.
5
+ */
6
+ export const AccountStatus = {
7
+ Disabled: "disabled",
8
+ };
@@ -0,0 +1,9 @@
1
+ import type * as AgentMail from "../../../index.mjs";
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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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,10 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /**
3
+ * Status to set. `disabled` stops the inbox from signing in at the
4
+ * provider; `enabled` re-enables it. An enabled account reads back with no
5
+ * `status`.
6
+ */
7
+ export const UpdateAccountStatus = {
8
+ Enabled: "enabled",
9
+ Disabled: "disabled",
10
+ };
@@ -1,4 +1,7 @@
1
1
  export * from "./Account.mjs";
2
2
  export * from "./AccountId.mjs";
3
+ export * from "./AccountStatus.mjs";
3
4
  export * from "./ListAccountsResponse.mjs";
4
5
  export * from "./ProviderId.mjs";
6
+ export * from "./UpdateAccountRequest.mjs";
7
+ export * from "./UpdateAccountStatus.mjs";
@@ -1,4 +1,7 @@
1
1
  export * from "./Account.mjs";
2
2
  export * from "./AccountId.mjs";
3
+ export * from "./AccountStatus.mjs";
3
4
  export * from "./ListAccountsResponse.mjs";
4
5
  export * from "./ProviderId.mjs";
6
+ export * from "./UpdateAccountRequest.mjs";
7
+ export * from "./UpdateAccountStatus.mjs";
@@ -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. */
@@ -2,6 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClie
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
3
  import * as core from "../../../../core/index.mjs";
4
4
  import * as AgentMail from "../../../index.mjs";
5
+ import { AccountsClient } from "../resources/accounts/client/Client.mjs";
5
6
  import { ApiKeysClient } from "../resources/apiKeys/client/Client.mjs";
6
7
  import { DraftsClient } from "../resources/drafts/client/Client.mjs";
7
8
  import { EventsClient } from "../resources/events/client/Client.mjs";
@@ -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
@@ -16,6 +16,7 @@ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCode
16
16
  import * as errors from "../../../../errors/index.mjs";
17
17
  import * as serializers from "../../../../serialization/index.mjs";
18
18
  import * as AgentMail from "../../../index.mjs";
19
+ import { AccountsClient } from "../resources/accounts/client/Client.mjs";
19
20
  import { ApiKeysClient } from "../resources/apiKeys/client/Client.mjs";
20
21
  import { DraftsClient } from "../resources/drafts/client/Client.mjs";
21
22
  import { EventsClient } from "../resources/events/client/Client.mjs";
@@ -60,6 +61,10 @@ export class InboxesClient {
60
61
  var _a;
61
62
  return ((_a = this._apiKeys) !== null && _a !== void 0 ? _a : (this._apiKeys = new ApiKeysClient(this._options)));
62
63
  }
64
+ get accounts() {
65
+ var _a;
66
+ return ((_a = this._accounts) !== null && _a !== void 0 ? _a : (this._accounts = new AccountsClient(this._options)));
67
+ }
63
68
  /**
64
69
  * **CLI:**
65
70
  * ```bash
@@ -0,0 +1,42 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
3
+ import * as core from "../../../../../../core/index.mjs";
4
+ import * as AgentMail from "../../../../../index.mjs";
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
+ }