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
@@ -0,0 +1,197 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.AccountsClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
52
+ const errors = __importStar(require("../../../../../../errors/index.js"));
53
+ const serializers = __importStar(require("../../../../../../serialization/index.js"));
54
+ const AgentMail = __importStar(require("../../../../../index.js"));
55
+ class AccountsClient {
56
+ constructor(options = {}) {
57
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
58
+ }
59
+ /**
60
+ * Lists accounts held by inboxes in the pod, across all providers. Requires `inbox_read`.
61
+ *
62
+ * @param {AgentMail.pods.PodId} pod_id
63
+ * @param {AgentMail.pods.ListAccountsRequest} request
64
+ * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
65
+ *
66
+ * @throws {@link AgentMail.ValidationError}
67
+ *
68
+ * @example
69
+ * await client.pods.accounts.list("pod_id")
70
+ */
71
+ list(pod_id, request = {}, requestOptions) {
72
+ return core.HttpResponsePromise.fromPromise(this.__list(pod_id, request, requestOptions));
73
+ }
74
+ __list(pod_id_1) {
75
+ return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
76
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
77
+ const { limit, pageToken, ascending } = request;
78
+ const _queryParams = {
79
+ limit,
80
+ page_token: pageToken,
81
+ ascending,
82
+ };
83
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
84
+ 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);
85
+ const _response = yield core.fetcher({
86
+ 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)
87
+ .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/accounts`),
88
+ method: "GET",
89
+ headers: _headers,
90
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
91
+ 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,
92
+ 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,
93
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
94
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
95
+ logging: this._options.logging,
96
+ });
97
+ if (_response.ok) {
98
+ return {
99
+ data: serializers.ListAccountsResponse.parseOrThrow(_response.body, {
100
+ unrecognizedObjectKeys: "passthrough",
101
+ allowUnrecognizedUnionMembers: true,
102
+ allowUnrecognizedEnumValues: true,
103
+ skipValidation: true,
104
+ breadcrumbsPrefix: ["response"],
105
+ }),
106
+ rawResponse: _response.rawResponse,
107
+ };
108
+ }
109
+ if (_response.error.reason === "status-code") {
110
+ switch (_response.error.statusCode) {
111
+ case 400:
112
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
113
+ unrecognizedObjectKeys: "passthrough",
114
+ allowUnrecognizedUnionMembers: true,
115
+ allowUnrecognizedEnumValues: true,
116
+ skipValidation: true,
117
+ breadcrumbsPrefix: ["response"],
118
+ }), _response.rawResponse);
119
+ default:
120
+ throw new errors.AgentMailError({
121
+ statusCode: _response.error.statusCode,
122
+ body: _response.error.body,
123
+ rawResponse: _response.rawResponse,
124
+ });
125
+ }
126
+ }
127
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/accounts");
128
+ });
129
+ }
130
+ /**
131
+ * Returns one account held by inboxes in the pod. An account elsewhere is a 404. Requires
132
+ * `inbox_read`.
133
+ *
134
+ * @param {AgentMail.pods.PodId} pod_id
135
+ * @param {AgentMail.AccountId} account_id
136
+ * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration.
137
+ *
138
+ * @throws {@link AgentMail.NotFoundError}
139
+ *
140
+ * @example
141
+ * await client.pods.accounts.get("pod_id", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
142
+ */
143
+ get(pod_id, account_id, requestOptions) {
144
+ return core.HttpResponsePromise.fromPromise(this.__get(pod_id, account_id, requestOptions));
145
+ }
146
+ __get(pod_id, account_id, requestOptions) {
147
+ return __awaiter(this, void 0, void 0, function* () {
148
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
149
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
150
+ 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);
151
+ const _response = yield core.fetcher({
152
+ 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)
153
+ .http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/accounts/${core.url.encodePathParam(serializers.AccountId.jsonOrThrow(account_id, { omitUndefined: true }))}`),
154
+ method: "GET",
155
+ headers: _headers,
156
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
157
+ 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,
158
+ 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,
159
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
160
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
161
+ logging: this._options.logging,
162
+ });
163
+ if (_response.ok) {
164
+ return {
165
+ data: serializers.Account.parseOrThrow(_response.body, {
166
+ unrecognizedObjectKeys: "passthrough",
167
+ allowUnrecognizedUnionMembers: true,
168
+ allowUnrecognizedEnumValues: true,
169
+ skipValidation: true,
170
+ breadcrumbsPrefix: ["response"],
171
+ }),
172
+ rawResponse: _response.rawResponse,
173
+ };
174
+ }
175
+ if (_response.error.reason === "status-code") {
176
+ switch (_response.error.statusCode) {
177
+ case 404:
178
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
179
+ unrecognizedObjectKeys: "passthrough",
180
+ allowUnrecognizedUnionMembers: true,
181
+ allowUnrecognizedEnumValues: true,
182
+ skipValidation: true,
183
+ breadcrumbsPrefix: ["response"],
184
+ }), _response.rawResponse);
185
+ default:
186
+ throw new errors.AgentMailError({
187
+ statusCode: _response.error.statusCode,
188
+ body: _response.error.body,
189
+ rawResponse: _response.rawResponse,
190
+ });
191
+ }
192
+ }
193
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/accounts/{account_id}");
194
+ });
195
+ }
196
+ }
197
+ exports.AccountsClient = AccountsClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,10 @@
1
+ import type * as AgentMail from "../../../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface ListAccountsRequest {
7
+ limit?: AgentMail.Limit;
8
+ pageToken?: AgentMail.PageToken;
9
+ ascending?: AgentMail.Ascending;
10
+ }
@@ -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 @@
1
+ export type { ListAccountsRequest } from "./ListAccountsRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { AccountsClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.AccountsClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "AccountsClient", { enumerable: true, get: function () { return Client_js_1.AccountsClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -1,3 +1,5 @@
1
+ export * from "./accounts/client/requests/index.js";
2
+ export * as accounts from "./accounts/index.js";
1
3
  export * from "./apiKeys/client/requests/index.js";
2
4
  export * as apiKeys from "./apiKeys/index.js";
3
5
  export * from "./domains/client/requests/index.js";
@@ -36,7 +36,9 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.webhooks = exports.threads = exports.metrics = exports.lists = exports.inboxes = exports.drafts = exports.domains = exports.apiKeys = void 0;
39
+ exports.webhooks = exports.threads = exports.metrics = exports.lists = exports.inboxes = exports.drafts = exports.domains = exports.apiKeys = exports.accounts = void 0;
40
+ __exportStar(require("./accounts/client/requests/index.js"), exports);
41
+ exports.accounts = __importStar(require("./accounts/index.js"));
40
42
  __exportStar(require("./apiKeys/client/requests/index.js"), exports);
41
43
  exports.apiKeys = __importStar(require("./apiKeys/index.js"));
42
44
  __exportStar(require("./domains/client/requests/index.js"), exports);
@@ -1,4 +1,8 @@
1
1
  import type * as AgentMail from "../../../index.js";
2
2
  export interface CreateWebhookRequest extends AgentMail.webhooks.CreatePodWebhookRequest {
3
+ /**
4
+ * Pods for which to send events. Maximum 10 per webhook. The webhook receives an event that matches
5
+ * any listed pod or inbox, so a listed pod already covers every inbox in it.
6
+ */
3
7
  podIds?: AgentMail.PodIds;
4
8
  }
@@ -4,7 +4,11 @@ import type * as AgentMail from "../../../index.js";
4
4
  * its `event_types`, but not the pod scope itself.
5
5
  */
6
6
  export interface UpdatePodWebhookRequest extends AgentMail.webhooks.UpdateInboxWebhookRequest {
7
- /** Inbox IDs to subscribe to the webhook. */
7
+ /**
8
+ * Inbox IDs to subscribe to the webhook. This only adds to what the webhook receives: on a webhook
9
+ * that covers its whole pod, it changes nothing. To receive only specific inboxes, create a webhook
10
+ * with `inbox_ids` instead.
11
+ */
8
12
  addInboxIds?: AgentMail.InboxIds;
9
13
  /** Inbox IDs to unsubscribe from the webhook. */
10
14
  removeInboxIds?: AgentMail.InboxIds;
@@ -5,6 +5,17 @@ export interface Webhook {
5
5
  eventTypes?: AgentMail.EventTypes;
6
6
  podIds?: AgentMail.PodIds;
7
7
  inboxIds?: AgentMail.InboxIds;
8
+ /**
9
+ * ID of the pod the webhook belongs to: the pod it was created in, or the pod of the inbox it
10
+ * belongs to. Absent for an organization webhook and on some inbox webhooks. This is not the
11
+ * list of pods it receives events for; see `pod_ids`.
12
+ */
13
+ podId?: string;
14
+ /**
15
+ * ID of the inbox the webhook belongs to, if it was created for an inbox. This is not the list
16
+ * of inboxes it receives events for; see `inbox_ids`.
17
+ */
18
+ inboxId?: string;
8
19
  /** Secret for webhook signature verification. */
9
20
  secret: string;
10
21
  /** Webhook is enabled. */
@@ -5,6 +5,7 @@ import { OrganizationId } from "../../../types/OrganizationId.js";
5
5
  import { InboxId } from "../../inboxes/types/InboxId.js";
6
6
  import { PodId } from "../../pods/types/PodId.js";
7
7
  import { AccountId } from "./AccountId.js";
8
+ import { AccountStatus } from "./AccountStatus.js";
8
9
  import { ProviderId } from "./ProviderId.js";
9
10
  export declare const Account: core.serialization.ObjectSchema<serializers.Account.Raw, AgentMail.Account>;
10
11
  export declare namespace Account {
@@ -18,5 +19,7 @@ export declare namespace Account {
18
19
  first_signed_in_at: string;
19
20
  last_signed_in_at: string;
20
21
  sign_in_count: number;
22
+ status?: AccountStatus.Raw | null;
23
+ disabled_at?: string | null;
21
24
  }
22
25
  }
@@ -40,6 +40,7 @@ const OrganizationId_js_1 = require("../../../types/OrganizationId.js");
40
40
  const InboxId_js_1 = require("../../inboxes/types/InboxId.js");
41
41
  const PodId_js_1 = require("../../pods/types/PodId.js");
42
42
  const AccountId_js_1 = require("./AccountId.js");
43
+ const AccountStatus_js_1 = require("./AccountStatus.js");
43
44
  const ProviderId_js_1 = require("./ProviderId.js");
44
45
  exports.Account = core.serialization.object({
45
46
  accountId: core.serialization.property("account_id", AccountId_js_1.AccountId),
@@ -51,4 +52,6 @@ exports.Account = core.serialization.object({
51
52
  firstSignedInAt: core.serialization.property("first_signed_in_at", core.serialization.date()),
52
53
  lastSignedInAt: core.serialization.property("last_signed_in_at", core.serialization.date()),
53
54
  signInCount: core.serialization.property("sign_in_count", core.serialization.number()),
55
+ status: AccountStatus_js_1.AccountStatus.optional(),
56
+ disabledAt: core.serialization.property("disabled_at", core.serialization.date().optional()),
54
57
  });
@@ -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 AccountStatus: core.serialization.Schema<serializers.AccountStatus.Raw, AgentMail.AccountStatus>;
5
+ export declare namespace AccountStatus {
6
+ type Raw = "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.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()),
@@ -17,6 +17,7 @@ export declare namespace AttachmentResponse {
17
17
  content_disposition?: AttachmentContentDisposition.Raw | null;
18
18
  content_id?: AttachmentContentId.Raw | null;
19
19
  download_url: string;
20
+ text_url?: string | null;
20
21
  expires_at: string;
21
22
  }
22
23
  }
@@ -50,5 +50,6 @@ exports.AttachmentResponse = core.serialization.object({
50
50
  contentDisposition: core.serialization.property("content_disposition", AttachmentContentDisposition_js_1.AttachmentContentDisposition.optional()),
51
51
  contentId: core.serialization.property("content_id", AttachmentContentId_js_1.AttachmentContentId.optional()),
52
52
  downloadUrl: core.serialization.property("download_url", core.serialization.string()),
53
+ textUrl: core.serialization.property("text_url", core.serialization.string().optional()),
53
54
  expiresAt: core.serialization.property("expires_at", core.serialization.date()),
54
55
  });
@@ -15,6 +15,8 @@ export declare namespace Webhook {
15
15
  event_types?: EventTypes.Raw | null;
16
16
  pod_ids?: PodIds.Raw | null;
17
17
  inbox_ids?: InboxIds.Raw | null;
18
+ pod_id?: string | null;
19
+ inbox_id?: string | null;
18
20
  secret: string;
19
21
  enabled: boolean;
20
22
  updated_at: string;
@@ -48,6 +48,8 @@ exports.Webhook = core.serialization.object({
48
48
  eventTypes: core.serialization.property("event_types", EventTypes_js_1.EventTypes.optional()),
49
49
  podIds: core.serialization.property("pod_ids", PodIds_js_1.PodIds.optional()),
50
50
  inboxIds: core.serialization.property("inbox_ids", InboxIds_js_1.InboxIds.optional()),
51
+ podId: core.serialization.property("pod_id", core.serialization.string().optional()),
52
+ inboxId: core.serialization.property("inbox_id", core.serialization.string().optional()),
51
53
  secret: core.serialization.string(),
52
54
  enabled: core.serialization.boolean(),
53
55
  updatedAt: core.serialization.property("updated_at", core.serialization.date()),
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.5.27";
1
+ export declare const SDK_VERSION = "0.5.29";
@@ -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.29";