agentmail 0.5.34 → 0.5.36

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 (84) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/apps/client/Client.js +7 -1
  3. package/dist/cjs/api/resources/apps/client/requests/ListAppsRequest.d.ts +2 -0
  4. package/dist/cjs/api/resources/apps/types/App.d.ts +2 -0
  5. package/dist/cjs/api/resources/apps/types/AppCategory.d.ts +20 -0
  6. package/dist/cjs/api/resources/apps/types/AppCategory.js +23 -0
  7. package/dist/cjs/api/resources/apps/types/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/apps/types/index.js +1 -0
  9. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +4 -0
  10. package/dist/cjs/api/resources/inboxes/client/Client.js +12 -0
  11. package/dist/cjs/api/resources/inboxes/types/CreateInboxRequest.d.ts +2 -0
  12. package/dist/cjs/api/resources/inboxes/types/Inbox.d.ts +6 -0
  13. package/dist/cjs/api/resources/inboxes/types/InboxStatus.d.ts +11 -0
  14. package/dist/cjs/api/resources/inboxes/types/InboxStatus.js +14 -0
  15. package/dist/cjs/api/resources/inboxes/types/UpdateInboxRequest.d.ts +8 -2
  16. package/dist/cjs/api/resources/inboxes/types/index.d.ts +1 -0
  17. package/dist/cjs/api/resources/inboxes/types/index.js +1 -0
  18. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.d.ts +1 -0
  19. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +9 -0
  20. package/dist/cjs/serialization/resources/apps/types/App.d.ts +2 -0
  21. package/dist/cjs/serialization/resources/apps/types/App.js +2 -0
  22. package/dist/cjs/serialization/resources/apps/types/AppCategory.d.ts +7 -0
  23. package/dist/cjs/serialization/resources/apps/types/AppCategory.js +56 -0
  24. package/dist/cjs/serialization/resources/apps/types/index.d.ts +1 -0
  25. package/dist/cjs/serialization/resources/apps/types/index.js +1 -0
  26. package/dist/cjs/serialization/resources/inboxes/types/CreateInboxRequest.d.ts +2 -0
  27. package/dist/cjs/serialization/resources/inboxes/types/CreateInboxRequest.js +2 -0
  28. package/dist/cjs/serialization/resources/inboxes/types/Inbox.d.ts +2 -0
  29. package/dist/cjs/serialization/resources/inboxes/types/Inbox.js +2 -0
  30. package/dist/cjs/serialization/resources/inboxes/types/InboxStatus.d.ts +7 -0
  31. package/dist/cjs/serialization/resources/inboxes/types/InboxStatus.js +39 -0
  32. package/dist/cjs/serialization/resources/inboxes/types/UpdateInboxRequest.d.ts +2 -0
  33. package/dist/cjs/serialization/resources/inboxes/types/UpdateInboxRequest.js +2 -0
  34. package/dist/cjs/serialization/resources/inboxes/types/index.d.ts +1 -0
  35. package/dist/cjs/serialization/resources/inboxes/types/index.js +1 -0
  36. package/dist/cjs/version.d.ts +1 -1
  37. package/dist/cjs/version.js +1 -1
  38. package/dist/cjs/wrapper/WebsocketsClient.d.ts +15 -1
  39. package/dist/cjs/wrapper/WebsocketsClient.js +26 -8
  40. package/dist/cjs/wrapper/reconnect.d.ts +22 -0
  41. package/dist/cjs/wrapper/reconnect.js +246 -0
  42. package/dist/esm/BaseClient.mjs +2 -2
  43. package/dist/esm/api/resources/apps/client/Client.mjs +7 -1
  44. package/dist/esm/api/resources/apps/client/requests/ListAppsRequest.d.mts +2 -0
  45. package/dist/esm/api/resources/apps/types/App.d.mts +2 -0
  46. package/dist/esm/api/resources/apps/types/AppCategory.d.mts +20 -0
  47. package/dist/esm/api/resources/apps/types/AppCategory.mjs +20 -0
  48. package/dist/esm/api/resources/apps/types/index.d.mts +1 -0
  49. package/dist/esm/api/resources/apps/types/index.mjs +1 -0
  50. package/dist/esm/api/resources/inboxes/client/Client.d.mts +4 -0
  51. package/dist/esm/api/resources/inboxes/client/Client.mjs +12 -0
  52. package/dist/esm/api/resources/inboxes/types/CreateInboxRequest.d.mts +2 -0
  53. package/dist/esm/api/resources/inboxes/types/Inbox.d.mts +6 -0
  54. package/dist/esm/api/resources/inboxes/types/InboxStatus.d.mts +11 -0
  55. package/dist/esm/api/resources/inboxes/types/InboxStatus.mjs +11 -0
  56. package/dist/esm/api/resources/inboxes/types/UpdateInboxRequest.d.mts +8 -2
  57. package/dist/esm/api/resources/inboxes/types/index.d.mts +1 -0
  58. package/dist/esm/api/resources/inboxes/types/index.mjs +1 -0
  59. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.d.mts +1 -0
  60. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +9 -0
  61. package/dist/esm/serialization/resources/apps/types/App.d.mts +2 -0
  62. package/dist/esm/serialization/resources/apps/types/App.mjs +2 -0
  63. package/dist/esm/serialization/resources/apps/types/AppCategory.d.mts +7 -0
  64. package/dist/esm/serialization/resources/apps/types/AppCategory.mjs +20 -0
  65. package/dist/esm/serialization/resources/apps/types/index.d.mts +1 -0
  66. package/dist/esm/serialization/resources/apps/types/index.mjs +1 -0
  67. package/dist/esm/serialization/resources/inboxes/types/CreateInboxRequest.d.mts +2 -0
  68. package/dist/esm/serialization/resources/inboxes/types/CreateInboxRequest.mjs +2 -0
  69. package/dist/esm/serialization/resources/inboxes/types/Inbox.d.mts +2 -0
  70. package/dist/esm/serialization/resources/inboxes/types/Inbox.mjs +2 -0
  71. package/dist/esm/serialization/resources/inboxes/types/InboxStatus.d.mts +7 -0
  72. package/dist/esm/serialization/resources/inboxes/types/InboxStatus.mjs +3 -0
  73. package/dist/esm/serialization/resources/inboxes/types/UpdateInboxRequest.d.mts +2 -0
  74. package/dist/esm/serialization/resources/inboxes/types/UpdateInboxRequest.mjs +2 -0
  75. package/dist/esm/serialization/resources/inboxes/types/index.d.mts +1 -0
  76. package/dist/esm/serialization/resources/inboxes/types/index.mjs +1 -0
  77. package/dist/esm/version.d.mts +1 -1
  78. package/dist/esm/version.mjs +1 -1
  79. package/dist/esm/wrapper/WebsocketsClient.d.mts +15 -1
  80. package/dist/esm/wrapper/WebsocketsClient.mjs +26 -8
  81. package/dist/esm/wrapper/reconnect.d.mts +22 -0
  82. package/dist/esm/wrapper/reconnect.mjs +208 -0
  83. package/package.json +1 -1
  84. package/reference.md +3 -0
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "agentmail",
46
- "X-Fern-SDK-Version": "0.5.34",
47
- "User-Agent": "agentmail/0.5.34",
46
+ "X-Fern-SDK-Version": "0.5.36",
47
+ "User-Agent": "agentmail/0.5.36",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -73,10 +73,16 @@ class AppsClient {
73
73
  __list() {
74
74
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
75
75
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
76
- const { limit, pageToken } = request;
76
+ const { limit, pageToken, category } = request;
77
77
  const _queryParams = {
78
78
  limit,
79
79
  page_token: pageToken,
80
+ category: category != null
81
+ ? serializers.AppCategory.jsonOrThrow(category, {
82
+ unrecognizedObjectKeys: "strip",
83
+ omitUndefined: true,
84
+ })
85
+ : undefined,
80
86
  };
81
87
  const _authRequest = yield this._options.authProvider.getAuthRequest();
82
88
  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);
@@ -6,4 +6,6 @@ import type * as AgentMail from "../../../../index.js";
6
6
  export interface ListAppsRequest {
7
7
  limit?: AgentMail.Limit;
8
8
  pageToken?: AgentMail.PageToken;
9
+ /** Only apps in this category. A filtered page can hold fewer than `limit` apps while more remain, so page until `next_page_token` is absent. A `page_token` works only with the `category` it was returned for. */
10
+ category?: AgentMail.AppCategory;
9
11
  }
@@ -11,6 +11,8 @@ export interface App {
11
11
  logoUrl?: string;
12
12
  termsUrl?: string;
13
13
  privacyUrl?: string;
14
+ /** Kinds of app, up to 3. Omitted when the app sets none. */
15
+ categories?: AgentMail.AppCategory[];
14
16
  /** Maximum number of accounts your organization may sign up at this app. Omitted when the app sets no limit. 0 means the app has paused new sign-ups; existing accounts keep signing in. */
15
17
  ownerSignupLimit?: number;
16
18
  }
@@ -0,0 +1,20 @@
1
+ /** Kind of app. */
2
+ export declare const AppCategory: {
3
+ readonly Ai: "ai";
4
+ readonly Search: "search";
5
+ readonly Scraping: "scraping";
6
+ readonly Browser: "browser";
7
+ readonly Data: "data";
8
+ readonly DeveloperTools: "developer-tools";
9
+ readonly Communication: "communication";
10
+ readonly Productivity: "productivity";
11
+ readonly Payments: "payments";
12
+ readonly Finance: "finance";
13
+ readonly Commerce: "commerce";
14
+ readonly Marketing: "marketing";
15
+ readonly Analytics: "analytics";
16
+ readonly Security: "security";
17
+ readonly Infrastructure: "infrastructure";
18
+ readonly Other: "other";
19
+ };
20
+ export type AppCategory = (typeof AppCategory)[keyof typeof AppCategory];
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AppCategory = void 0;
5
+ /** Kind of app. */
6
+ exports.AppCategory = {
7
+ Ai: "ai",
8
+ Search: "search",
9
+ Scraping: "scraping",
10
+ Browser: "browser",
11
+ Data: "data",
12
+ DeveloperTools: "developer-tools",
13
+ Communication: "communication",
14
+ Productivity: "productivity",
15
+ Payments: "payments",
16
+ Finance: "finance",
17
+ Commerce: "commerce",
18
+ Marketing: "marketing",
19
+ Analytics: "analytics",
20
+ Security: "security",
21
+ Infrastructure: "infrastructure",
22
+ Other: "other",
23
+ };
@@ -1,4 +1,5 @@
1
1
  export * from "./App.js";
2
+ export * from "./AppCategory.js";
2
3
  export * from "./AppId.js";
3
4
  export * from "./ConnectAccepted.js";
4
5
  export * from "./ConnectAppBody.js";
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./App.js"), exports);
18
+ __exportStar(require("./AppCategory.js"), exports);
18
19
  __exportStar(require("./AppId.js"), exports);
19
20
  __exportStar(require("./ConnectAccepted.js"), exports);
20
21
  __exportStar(require("./ConnectAppBody.js"), exports);
@@ -110,12 +110,16 @@ export declare class InboxesClient {
110
110
  * agentmail inboxes update --inbox-id <inbox_id> --display-name "Updated Name"
111
111
  * ```
112
112
  *
113
+ * To pause an inbox, set `status` to `paused`; set it back to `active` to
114
+ * resume. See [Pausing an inbox](/inboxes#pausing-an-inbox).
115
+ *
113
116
  * @param {AgentMail.inboxes.InboxId} inbox_id
114
117
  * @param {AgentMail.inboxes.UpdateInboxRequest} request
115
118
  * @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
116
119
  *
117
120
  * @throws {@link AgentMail.NotFoundError}
118
121
  * @throws {@link AgentMail.ValidationError}
122
+ * @throws {@link AgentMail.ConflictError}
119
123
  *
120
124
  * @example
121
125
  * await client.inboxes.update("inbox_id", {})
@@ -393,12 +393,16 @@ class InboxesClient {
393
393
  * agentmail inboxes update --inbox-id <inbox_id> --display-name "Updated Name"
394
394
  * ```
395
395
  *
396
+ * To pause an inbox, set `status` to `paused`; set it back to `active` to
397
+ * resume. See [Pausing an inbox](/inboxes#pausing-an-inbox).
398
+ *
396
399
  * @param {AgentMail.inboxes.InboxId} inbox_id
397
400
  * @param {AgentMail.inboxes.UpdateInboxRequest} request
398
401
  * @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
399
402
  *
400
403
  * @throws {@link AgentMail.NotFoundError}
401
404
  * @throws {@link AgentMail.ValidationError}
405
+ * @throws {@link AgentMail.ConflictError}
402
406
  *
403
407
  * @example
404
408
  * await client.inboxes.update("inbox_id", {})
@@ -459,6 +463,14 @@ class InboxesClient {
459
463
  skipValidation: true,
460
464
  breadcrumbsPrefix: ["response"],
461
465
  }), _response.rawResponse);
466
+ case 409:
467
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
468
+ unrecognizedObjectKeys: "passthrough",
469
+ allowUnrecognizedUnionMembers: true,
470
+ allowUnrecognizedEnumValues: true,
471
+ skipValidation: true,
472
+ breadcrumbsPrefix: ["response"],
473
+ }), _response.rawResponse);
462
474
  default:
463
475
  throw new errors.AgentMailError({
464
476
  statusCode: _response.error.statusCode,
@@ -10,6 +10,8 @@ export interface CreateInboxRequest {
10
10
  domain?: string;
11
11
  displayName?: AgentMail.inboxes.DisplayName;
12
12
  clientId?: AgentMail.inboxes.ClientId;
13
+ /** Set `paused` to create the inbox paused. */
14
+ status?: AgentMail.inboxes.InboxStatus;
13
15
  /** Custom metadata to attach to the inbox. */
14
16
  metadata?: AgentMail.inboxes.Metadata;
15
17
  }
@@ -5,6 +5,12 @@ export interface Inbox {
5
5
  email: AgentMail.inboxes.Email;
6
6
  displayName?: AgentMail.inboxes.DisplayName;
7
7
  clientId?: AgentMail.inboxes.ClientId;
8
+ /**
9
+ * `paused` when the inbox is paused. Omitted when the inbox is active.
10
+ * Treat any value other than `paused` as an inbox that sends and
11
+ * receives normally.
12
+ */
13
+ status?: AgentMail.inboxes.InboxStatus;
8
14
  /** Custom metadata attached to the inbox. */
9
15
  metadata?: AgentMail.inboxes.Metadata;
10
16
  /** Time at which inbox was last updated. */
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Whether the inbox sends and receives mail. `paused` stops both: sends
3
+ * return `403` with code `inbox_paused`, and incoming mail is not
4
+ * delivered and not bounced, then or on resume. Mail already in the inbox,
5
+ * its drafts, and its API keys are kept. Set `active` to resume.
6
+ */
7
+ export declare const InboxStatus: {
8
+ readonly Active: "active";
9
+ readonly Paused: "paused";
10
+ };
11
+ export type InboxStatus = (typeof InboxStatus)[keyof typeof InboxStatus];
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.InboxStatus = void 0;
5
+ /**
6
+ * Whether the inbox sends and receives mail. `paused` stops both: sends
7
+ * return `403` with code `inbox_paused`, and incoming mail is not
8
+ * delivered and not bounced, then or on resume. Mail already in the inbox,
9
+ * its drafts, and its API keys are kept. Set `active` to resume.
10
+ */
11
+ exports.InboxStatus = {
12
+ Active: "active",
13
+ Paused: "paused",
14
+ };
@@ -1,13 +1,19 @@
1
1
  import type * as AgentMail from "../../../index.js";
2
2
  export interface UpdateInboxRequest {
3
3
  displayName?: AgentMail.inboxes.DisplayName;
4
+ /**
5
+ * `paused` stops the inbox sending and receiving mail; `active` resumes
6
+ * it. Mail that arrived while the inbox was paused is not delivered on
7
+ * resume.
8
+ */
9
+ status?: AgentMail.inboxes.InboxStatus;
4
10
  /**
5
11
  * Metadata to merge into the inbox's existing metadata. Keys you include
6
12
  * are added or overwritten; keys you omit are left unchanged. To remove a
7
13
  * single key, send it with a null value. To clear all metadata, send
8
14
  * `metadata` as null. Sending an empty object is rejected; use null to
9
- * clear. Each update must include at least one of `display_name` or
10
- * `metadata`.
15
+ * clear. Each update must include at least one of `display_name`,
16
+ * `status`, or `metadata`.
11
17
  */
12
18
  metadata?: AgentMail.inboxes.UpdateMetadata | null;
13
19
  }
@@ -6,6 +6,7 @@ export * from "./DisplayName.js";
6
6
  export * from "./Email.js";
7
7
  export * from "./Inbox.js";
8
8
  export * from "./InboxId.js";
9
+ export * from "./InboxStatus.js";
9
10
  export * from "./ListInboxesResponse.js";
10
11
  export * from "./Metadata.js";
11
12
  export * from "./MetadataValue.js";
@@ -22,6 +22,7 @@ __exportStar(require("./DisplayName.js"), exports);
22
22
  __exportStar(require("./Email.js"), exports);
23
23
  __exportStar(require("./Inbox.js"), exports);
24
24
  __exportStar(require("./InboxId.js"), exports);
25
+ __exportStar(require("./InboxStatus.js"), exports);
25
26
  __exportStar(require("./ListInboxesResponse.js"), exports);
26
27
  __exportStar(require("./Metadata.js"), exports);
27
28
  __exportStar(require("./MetadataValue.js"), exports);
@@ -96,6 +96,7 @@ export declare class InboxesClient {
96
96
  * @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
97
97
  *
98
98
  * @throws {@link AgentMail.NotFoundError}
99
+ * @throws {@link AgentMail.ConflictError}
99
100
  *
100
101
  * @example
101
102
  * await client.pods.inboxes.update("pod_id", "inbox_id", {})
@@ -380,6 +380,7 @@ class InboxesClient {
380
380
  * @param {InboxesClient.RequestOptions} requestOptions - Request-specific configuration.
381
381
  *
382
382
  * @throws {@link AgentMail.NotFoundError}
383
+ * @throws {@link AgentMail.ConflictError}
383
384
  *
384
385
  * @example
385
386
  * await client.pods.inboxes.update("pod_id", "inbox_id", {})
@@ -432,6 +433,14 @@ class InboxesClient {
432
433
  skipValidation: true,
433
434
  breadcrumbsPrefix: ["response"],
434
435
  }), _response.rawResponse);
436
+ case 409:
437
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
438
+ unrecognizedObjectKeys: "passthrough",
439
+ allowUnrecognizedUnionMembers: true,
440
+ allowUnrecognizedEnumValues: true,
441
+ skipValidation: true,
442
+ breadcrumbsPrefix: ["response"],
443
+ }), _response.rawResponse);
435
444
  default:
436
445
  throw new errors.AgentMailError({
437
446
  statusCode: _response.error.statusCode,
@@ -1,6 +1,7 @@
1
1
  import type * as AgentMail from "../../../../api/index.js";
2
2
  import * as core from "../../../../core/index.js";
3
3
  import type * as serializers from "../../../index.js";
4
+ import { AppCategory } from "./AppCategory.js";
4
5
  import { AppId } from "./AppId.js";
5
6
  export declare const App: core.serialization.ObjectSchema<serializers.App.Raw, AgentMail.App>;
6
7
  export declare namespace App {
@@ -12,6 +13,7 @@ export declare namespace App {
12
13
  logo_url?: string | null;
13
14
  terms_url?: string | null;
14
15
  privacy_url?: string | null;
16
+ categories?: AppCategory.Raw[] | null;
15
17
  owner_signup_limit?: number | null;
16
18
  }
17
19
  }
@@ -36,6 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.App = void 0;
38
38
  const core = __importStar(require("../../../../core/index.js"));
39
+ const AppCategory_js_1 = require("./AppCategory.js");
39
40
  const AppId_js_1 = require("./AppId.js");
40
41
  exports.App = core.serialization.object({
41
42
  appId: core.serialization.property("app_id", AppId_js_1.AppId),
@@ -45,5 +46,6 @@ exports.App = core.serialization.object({
45
46
  logoUrl: core.serialization.property("logo_url", core.serialization.string().optional()),
46
47
  termsUrl: core.serialization.property("terms_url", core.serialization.string().optional()),
47
48
  privacyUrl: core.serialization.property("privacy_url", core.serialization.string().optional()),
49
+ categories: core.serialization.list(AppCategory_js_1.AppCategory).optional(),
48
50
  ownerSignupLimit: core.serialization.property("owner_signup_limit", core.serialization.number().optional()),
49
51
  });
@@ -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 AppCategory: core.serialization.Schema<serializers.AppCategory.Raw, AgentMail.AppCategory>;
5
+ export declare namespace AppCategory {
6
+ type Raw = "ai" | "search" | "scraping" | "browser" | "data" | "developer-tools" | "communication" | "productivity" | "payments" | "finance" | "commerce" | "marketing" | "analytics" | "security" | "infrastructure" | "other";
7
+ }
@@ -0,0 +1,56 @@
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.AppCategory = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ exports.AppCategory = core.serialization.enum_([
40
+ "ai",
41
+ "search",
42
+ "scraping",
43
+ "browser",
44
+ "data",
45
+ "developer-tools",
46
+ "communication",
47
+ "productivity",
48
+ "payments",
49
+ "finance",
50
+ "commerce",
51
+ "marketing",
52
+ "analytics",
53
+ "security",
54
+ "infrastructure",
55
+ "other",
56
+ ]);
@@ -1,4 +1,5 @@
1
1
  export * from "./App.js";
2
+ export * from "./AppCategory.js";
2
3
  export * from "./AppId.js";
3
4
  export * from "./ConnectAccepted.js";
4
5
  export * from "./ConnectAppBody.js";
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./App.js"), exports);
18
+ __exportStar(require("./AppCategory.js"), exports);
18
19
  __exportStar(require("./AppId.js"), exports);
19
20
  __exportStar(require("./ConnectAccepted.js"), exports);
20
21
  __exportStar(require("./ConnectAppBody.js"), exports);
@@ -3,6 +3,7 @@ import * as core from "../../../../core/index.js";
3
3
  import type * as serializers from "../../../index.js";
4
4
  import { ClientId } from "./ClientId.js";
5
5
  import { DisplayName } from "./DisplayName.js";
6
+ import { InboxStatus } from "./InboxStatus.js";
6
7
  import { Metadata } from "./Metadata.js";
7
8
  export declare const CreateInboxRequest: core.serialization.ObjectSchema<serializers.inboxes.CreateInboxRequest.Raw, AgentMail.inboxes.CreateInboxRequest>;
8
9
  export declare namespace CreateInboxRequest {
@@ -11,6 +12,7 @@ export declare namespace CreateInboxRequest {
11
12
  domain?: string | null;
12
13
  display_name?: DisplayName.Raw | null;
13
14
  client_id?: ClientId.Raw | null;
15
+ status?: InboxStatus.Raw | null;
14
16
  metadata?: Metadata.Raw | null;
15
17
  }
16
18
  }
@@ -38,11 +38,13 @@ exports.CreateInboxRequest = void 0;
38
38
  const core = __importStar(require("../../../../core/index.js"));
39
39
  const ClientId_js_1 = require("./ClientId.js");
40
40
  const DisplayName_js_1 = require("./DisplayName.js");
41
+ const InboxStatus_js_1 = require("./InboxStatus.js");
41
42
  const Metadata_js_1 = require("./Metadata.js");
42
43
  exports.CreateInboxRequest = core.serialization.object({
43
44
  username: core.serialization.string().optional(),
44
45
  domain: core.serialization.string().optional(),
45
46
  displayName: core.serialization.property("display_name", DisplayName_js_1.DisplayName.optional()),
46
47
  clientId: core.serialization.property("client_id", ClientId_js_1.ClientId.optional()),
48
+ status: InboxStatus_js_1.InboxStatus.optional(),
47
49
  metadata: Metadata_js_1.Metadata.optional(),
48
50
  });
@@ -6,6 +6,7 @@ import { ClientId } from "./ClientId.js";
6
6
  import { DisplayName } from "./DisplayName.js";
7
7
  import { Email } from "./Email.js";
8
8
  import { InboxId } from "./InboxId.js";
9
+ import { InboxStatus } from "./InboxStatus.js";
9
10
  import { Metadata } from "./Metadata.js";
10
11
  export declare const Inbox: core.serialization.ObjectSchema<serializers.inboxes.Inbox.Raw, AgentMail.inboxes.Inbox>;
11
12
  export declare namespace Inbox {
@@ -15,6 +16,7 @@ export declare namespace Inbox {
15
16
  email: Email.Raw;
16
17
  display_name?: DisplayName.Raw | null;
17
18
  client_id?: ClientId.Raw | null;
19
+ status?: InboxStatus.Raw | null;
18
20
  metadata?: Metadata.Raw | null;
19
21
  updated_at: string;
20
22
  created_at: string;
@@ -41,6 +41,7 @@ const ClientId_js_1 = require("./ClientId.js");
41
41
  const DisplayName_js_1 = require("./DisplayName.js");
42
42
  const Email_js_1 = require("./Email.js");
43
43
  const InboxId_js_1 = require("./InboxId.js");
44
+ const InboxStatus_js_1 = require("./InboxStatus.js");
44
45
  const Metadata_js_1 = require("./Metadata.js");
45
46
  exports.Inbox = core.serialization.object({
46
47
  podId: core.serialization.property("pod_id", PodId_js_1.PodId),
@@ -48,6 +49,7 @@ exports.Inbox = core.serialization.object({
48
49
  email: Email_js_1.Email,
49
50
  displayName: core.serialization.property("display_name", DisplayName_js_1.DisplayName.optional()),
50
51
  clientId: core.serialization.property("client_id", ClientId_js_1.ClientId.optional()),
52
+ status: InboxStatus_js_1.InboxStatus.optional(),
51
53
  metadata: Metadata_js_1.Metadata.optional(),
52
54
  updatedAt: core.serialization.property("updated_at", core.serialization.date()),
53
55
  createdAt: core.serialization.property("created_at", core.serialization.date()),
@@ -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 InboxStatus: core.serialization.Schema<serializers.inboxes.InboxStatus.Raw, AgentMail.inboxes.InboxStatus>;
5
+ export declare namespace InboxStatus {
6
+ type Raw = "active" | "paused";
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.InboxStatus = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ exports.InboxStatus = core.serialization.enum_(["active", "paused"]);
@@ -2,11 +2,13 @@ import type * as AgentMail from "../../../../api/index.js";
2
2
  import * as core from "../../../../core/index.js";
3
3
  import type * as serializers from "../../../index.js";
4
4
  import { DisplayName } from "./DisplayName.js";
5
+ import { InboxStatus } from "./InboxStatus.js";
5
6
  import { UpdateMetadata } from "./UpdateMetadata.js";
6
7
  export declare const UpdateInboxRequest: core.serialization.ObjectSchema<serializers.inboxes.UpdateInboxRequest.Raw, AgentMail.inboxes.UpdateInboxRequest>;
7
8
  export declare namespace UpdateInboxRequest {
8
9
  interface Raw {
9
10
  display_name?: DisplayName.Raw | null;
11
+ status?: InboxStatus.Raw | null;
10
12
  metadata?: (UpdateMetadata.Raw | null | undefined) | null;
11
13
  }
12
14
  }
@@ -37,8 +37,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.UpdateInboxRequest = void 0;
38
38
  const core = __importStar(require("../../../../core/index.js"));
39
39
  const DisplayName_js_1 = require("./DisplayName.js");
40
+ const InboxStatus_js_1 = require("./InboxStatus.js");
40
41
  const UpdateMetadata_js_1 = require("./UpdateMetadata.js");
41
42
  exports.UpdateInboxRequest = core.serialization.object({
42
43
  displayName: core.serialization.property("display_name", DisplayName_js_1.DisplayName.optional()),
44
+ status: InboxStatus_js_1.InboxStatus.optional(),
43
45
  metadata: UpdateMetadata_js_1.UpdateMetadata.optionalNullable(),
44
46
  });
@@ -6,6 +6,7 @@ export * from "./DisplayName.js";
6
6
  export * from "./Email.js";
7
7
  export * from "./Inbox.js";
8
8
  export * from "./InboxId.js";
9
+ export * from "./InboxStatus.js";
9
10
  export * from "./ListInboxesResponse.js";
10
11
  export * from "./Metadata.js";
11
12
  export * from "./MetadataValue.js";
@@ -22,6 +22,7 @@ __exportStar(require("./DisplayName.js"), exports);
22
22
  __exportStar(require("./Email.js"), exports);
23
23
  __exportStar(require("./Inbox.js"), exports);
24
24
  __exportStar(require("./InboxId.js"), exports);
25
+ __exportStar(require("./InboxStatus.js"), exports);
25
26
  __exportStar(require("./ListInboxesResponse.js"), exports);
26
27
  __exportStar(require("./Metadata.js"), exports);
27
28
  __exportStar(require("./MetadataValue.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.5.34";
1
+ export declare const SDK_VERSION = "0.5.36";
@@ -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.34";
4
+ exports.SDK_VERSION = "0.5.36";
@@ -1,10 +1,24 @@
1
1
  import { WebsocketsClient as FernWebsocketsClient } from "../api/resources/websockets/client/Client.js";
2
2
  import type { WebsocketsSocket } from "../api/resources/websockets/client/Socket.js";
3
+ import { type ReconnectPolicy } from "./reconnect.js";
3
4
  export type GetPaymentCredentials = (wsUrl: string) => Promise<Record<string, string>>;
4
5
  export declare class WebsocketsClient extends FernWebsocketsClient {
5
6
  private readonly _getPaymentCredentials;
6
- constructor(options: FernWebsocketsClient.Options, getPaymentCredentials?: GetPaymentCredentials);
7
+ private readonly _reconnectPolicy;
8
+ constructor(options: FernWebsocketsClient.Options, getPaymentCredentials?: GetPaymentCredentials, reconnectPolicy?: ReconnectPolicy);
7
9
  connect(args?: FernWebsocketsClient.ConnectArgs & {
10
+ /** Resolve only once the connection is open. Defaults to true. */
8
11
  waitForOpen?: boolean;
12
+ /**
13
+ * Keep the socket connected and subscribed. Whenever the connection drops, reconnect with
14
+ * exponential backoff (full jitter, 1 s doubling up to 60 s) and re-send every subscription
15
+ * sent through `sendSubscribe` on the new connection; `reconnectAttempts` then only bounds
16
+ * the generated socket's own quick retries, not the total. Stops on `close()`, on
17
+ * `abortSignal`, or when the server refuses the handshake with 401, 402 or 403, which is
18
+ * reported to the `error` handler. x402/MPP sockets reuse the payment credential minted by
19
+ * this call on every reconnect. Defaults to true. `false` (or `reconnectAttempts: 0`) keeps
20
+ * only the generated socket's own limited retries and does not re-subscribe.
21
+ */
22
+ autoReconnect?: boolean;
9
23
  }): Promise<WebsocketsSocket>;
10
24
  }