agentmail 0.4.6 → 0.4.8

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 (54) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +3 -0
  3. package/dist/cjs/api/resources/inboxes/client/Client.js +11 -6
  4. package/dist/cjs/api/resources/inboxes/resources/index.d.ts +2 -0
  5. package/dist/cjs/api/resources/inboxes/resources/index.js +3 -1
  6. package/dist/cjs/api/resources/inboxes/resources/lists/client/Client.d.ts +69 -0
  7. package/dist/cjs/api/resources/inboxes/resources/lists/client/Client.js +311 -0
  8. package/dist/cjs/api/resources/inboxes/resources/lists/client/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/inboxes/resources/lists/client/index.js +17 -0
  10. package/dist/cjs/api/resources/inboxes/resources/lists/client/requests/InboxListListEntriesRequest.d.ts +9 -0
  11. package/dist/cjs/api/resources/inboxes/resources/lists/client/requests/InboxListListEntriesRequest.js +3 -0
  12. package/dist/cjs/api/resources/inboxes/resources/lists/client/requests/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/inboxes/resources/lists/client/requests/index.js +2 -0
  14. package/dist/cjs/api/resources/inboxes/resources/lists/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/inboxes/resources/lists/index.js +17 -0
  16. package/dist/cjs/api/resources/lists/types/Direction.d.ts +1 -0
  17. package/dist/cjs/api/resources/lists/types/Direction.js +1 -0
  18. package/dist/cjs/serialization/resources/lists/types/Direction.d.ts +1 -1
  19. package/dist/cjs/serialization/resources/lists/types/Direction.js +1 -1
  20. package/dist/cjs/version.d.ts +1 -1
  21. package/dist/cjs/version.js +1 -1
  22. package/dist/cjs/wrapper/mppx.d.ts +1 -0
  23. package/dist/cjs/wrapper/mppx.js +1 -1
  24. package/dist/cjs/wrapper/util.d.ts +1 -1
  25. package/dist/cjs/wrapper/util.js +3 -3
  26. package/dist/esm/BaseClient.mjs +2 -2
  27. package/dist/esm/api/resources/inboxes/client/Client.d.mts +3 -0
  28. package/dist/esm/api/resources/inboxes/client/Client.mjs +5 -0
  29. package/dist/esm/api/resources/inboxes/resources/index.d.mts +2 -0
  30. package/dist/esm/api/resources/inboxes/resources/index.mjs +2 -0
  31. package/dist/esm/api/resources/inboxes/resources/lists/client/Client.d.mts +69 -0
  32. package/dist/esm/api/resources/inboxes/resources/lists/client/Client.mjs +274 -0
  33. package/dist/esm/api/resources/inboxes/resources/lists/client/index.d.mts +1 -0
  34. package/dist/esm/api/resources/inboxes/resources/lists/client/index.mjs +1 -0
  35. package/dist/esm/api/resources/inboxes/resources/lists/client/requests/InboxListListEntriesRequest.d.mts +9 -0
  36. package/dist/esm/api/resources/inboxes/resources/lists/client/requests/InboxListListEntriesRequest.mjs +2 -0
  37. package/dist/esm/api/resources/inboxes/resources/lists/client/requests/index.d.mts +1 -0
  38. package/dist/esm/api/resources/inboxes/resources/lists/client/requests/index.mjs +1 -0
  39. package/dist/esm/api/resources/inboxes/resources/lists/index.d.mts +1 -0
  40. package/dist/esm/api/resources/inboxes/resources/lists/index.mjs +1 -0
  41. package/dist/esm/api/resources/lists/types/Direction.d.mts +1 -0
  42. package/dist/esm/api/resources/lists/types/Direction.mjs +1 -0
  43. package/dist/esm/serialization/resources/lists/types/Direction.d.mts +1 -1
  44. package/dist/esm/serialization/resources/lists/types/Direction.mjs +1 -1
  45. package/dist/esm/version.d.mts +1 -1
  46. package/dist/esm/version.mjs +1 -1
  47. package/dist/esm/wrapper/mppx.d.mts +1 -0
  48. package/dist/esm/wrapper/mppx.mjs +1 -1
  49. package/dist/esm/wrapper/util.d.mts +1 -1
  50. package/dist/esm/wrapper/util.mjs +3 -3
  51. package/dist/llms-full.txt +1769 -455
  52. package/dist/llms.txt +4 -0
  53. package/package.json +1 -1
  54. package/reference.md +295 -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.4.6",
47
- "User-Agent": "agentmail/0.4.6",
46
+ "X-Fern-SDK-Version": "0.4.8",
47
+ "User-Agent": "agentmail/0.4.8",
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);
@@ -3,6 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"
3
3
  import * as core from "../../../../core/index.js";
4
4
  import * as AgentMail from "../../../index.js";
5
5
  import { DraftsClient } from "../resources/drafts/client/Client.js";
6
+ import { ListsClient } from "../resources/lists/client/Client.js";
6
7
  import { MessagesClient } from "../resources/messages/client/Client.js";
7
8
  import { MetricsClient } from "../resources/metrics/client/Client.js";
8
9
  import { ThreadsClient } from "../resources/threads/client/Client.js";
@@ -16,11 +17,13 @@ export declare class InboxesClient {
16
17
  protected _threads: ThreadsClient | undefined;
17
18
  protected _messages: MessagesClient | undefined;
18
19
  protected _drafts: DraftsClient | undefined;
20
+ protected _lists: ListsClient | undefined;
19
21
  protected _metrics: MetricsClient | undefined;
20
22
  constructor(options?: InboxesClient.Options);
21
23
  get threads(): ThreadsClient;
22
24
  get messages(): MessagesClient;
23
25
  get drafts(): DraftsClient;
26
+ get lists(): ListsClient;
24
27
  get metrics(): MetricsClient;
25
28
  /**
26
29
  * @param {AgentMail.inboxes.ListInboxesRequest} request
@@ -53,28 +53,33 @@ const errors = __importStar(require("../../../../errors/index.js"));
53
53
  const serializers = __importStar(require("../../../../serialization/index.js"));
54
54
  const AgentMail = __importStar(require("../../../index.js"));
55
55
  const Client_js_1 = require("../resources/drafts/client/Client.js");
56
- const Client_js_2 = require("../resources/messages/client/Client.js");
57
- const Client_js_3 = require("../resources/metrics/client/Client.js");
58
- const Client_js_4 = require("../resources/threads/client/Client.js");
56
+ const Client_js_2 = require("../resources/lists/client/Client.js");
57
+ const Client_js_3 = require("../resources/messages/client/Client.js");
58
+ const Client_js_4 = require("../resources/metrics/client/Client.js");
59
+ const Client_js_5 = require("../resources/threads/client/Client.js");
59
60
  class InboxesClient {
60
61
  constructor(options = {}) {
61
62
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
62
63
  }
63
64
  get threads() {
64
65
  var _a;
65
- return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new Client_js_4.ThreadsClient(this._options)));
66
+ return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new Client_js_5.ThreadsClient(this._options)));
66
67
  }
67
68
  get messages() {
68
69
  var _a;
69
- return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_js_2.MessagesClient(this._options)));
70
+ return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_js_3.MessagesClient(this._options)));
70
71
  }
71
72
  get drafts() {
72
73
  var _a;
73
74
  return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new Client_js_1.DraftsClient(this._options)));
74
75
  }
76
+ get lists() {
77
+ var _a;
78
+ return ((_a = this._lists) !== null && _a !== void 0 ? _a : (this._lists = new Client_js_2.ListsClient(this._options)));
79
+ }
75
80
  get metrics() {
76
81
  var _a;
77
- return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_js_3.MetricsClient(this._options)));
82
+ return ((_a = this._metrics) !== null && _a !== void 0 ? _a : (this._metrics = new Client_js_4.MetricsClient(this._options)));
78
83
  }
79
84
  /**
80
85
  * @param {AgentMail.inboxes.ListInboxesRequest} request
@@ -1,5 +1,7 @@
1
1
  export * from "./drafts/client/requests/index.js";
2
2
  export * as drafts from "./drafts/index.js";
3
+ export * from "./lists/client/requests/index.js";
4
+ export * as lists from "./lists/index.js";
3
5
  export * from "./messages/client/requests/index.js";
4
6
  export * as messages from "./messages/index.js";
5
7
  export * from "./metrics/client/requests/index.js";
@@ -36,9 +36,11 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.threads = exports.metrics = exports.messages = exports.drafts = void 0;
39
+ exports.threads = exports.metrics = exports.messages = exports.lists = exports.drafts = void 0;
40
40
  __exportStar(require("./drafts/client/requests/index.js"), exports);
41
41
  exports.drafts = __importStar(require("./drafts/index.js"));
42
+ __exportStar(require("./lists/client/requests/index.js"), exports);
43
+ exports.lists = __importStar(require("./lists/index.js"));
42
44
  __exportStar(require("./messages/client/requests/index.js"), exports);
43
45
  exports.messages = __importStar(require("./messages/index.js"));
44
46
  __exportStar(require("./metrics/client/requests/index.js"), exports);
@@ -0,0 +1,69 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
3
+ import * as core from "../../../../../../core/index.js";
4
+ import * as AgentMail from "../../../../../index.js";
5
+ export declare namespace ListsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class ListsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<ListsClient.Options>;
12
+ constructor(options?: ListsClient.Options);
13
+ /**
14
+ * @param {AgentMail.inboxes.InboxId} inbox_id
15
+ * @param {AgentMail.Direction} direction
16
+ * @param {AgentMail.ListType} type
17
+ * @param {AgentMail.inboxes.InboxListListEntriesRequest} request
18
+ * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
19
+ *
20
+ * @example
21
+ * await client.inboxes.lists.list("inbox_id", "send", "allow")
22
+ */
23
+ list(inbox_id: AgentMail.inboxes.InboxId, direction: AgentMail.Direction, type: AgentMail.ListType, request?: AgentMail.inboxes.InboxListListEntriesRequest, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.PodListListEntriesResponse>;
24
+ private __list;
25
+ /**
26
+ * @param {AgentMail.inboxes.InboxId} inbox_id
27
+ * @param {AgentMail.Direction} direction
28
+ * @param {AgentMail.ListType} type
29
+ * @param {string} entry - Email address or domain.
30
+ * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
31
+ *
32
+ * @throws {@link AgentMail.NotFoundError}
33
+ *
34
+ * @example
35
+ * await client.inboxes.lists.get("inbox_id", "send", "allow", "entry")
36
+ */
37
+ get(inbox_id: AgentMail.inboxes.InboxId, direction: AgentMail.Direction, type: AgentMail.ListType, entry: string, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.PodListEntry>;
38
+ private __get;
39
+ /**
40
+ * @param {AgentMail.inboxes.InboxId} inbox_id
41
+ * @param {AgentMail.Direction} direction
42
+ * @param {AgentMail.ListType} type
43
+ * @param {AgentMail.CreateListEntryRequest} request
44
+ * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
45
+ *
46
+ * @throws {@link AgentMail.ValidationError}
47
+ *
48
+ * @example
49
+ * await client.inboxes.lists.create("inbox_id", "send", "allow", {
50
+ * entry: "entry"
51
+ * })
52
+ */
53
+ create(inbox_id: AgentMail.inboxes.InboxId, direction: AgentMail.Direction, type: AgentMail.ListType, request: AgentMail.CreateListEntryRequest, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<AgentMail.PodListEntry>;
54
+ private __create;
55
+ /**
56
+ * @param {AgentMail.inboxes.InboxId} inbox_id
57
+ * @param {AgentMail.Direction} direction
58
+ * @param {AgentMail.ListType} type
59
+ * @param {string} entry - Email address or domain.
60
+ * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @throws {@link AgentMail.NotFoundError}
63
+ *
64
+ * @example
65
+ * await client.inboxes.lists.delete("inbox_id", "send", "allow", "entry")
66
+ */
67
+ delete(inbox_id: AgentMail.inboxes.InboxId, direction: AgentMail.Direction, type: AgentMail.ListType, entry: string, requestOptions?: ListsClient.RequestOptions): core.HttpResponsePromise<void>;
68
+ private __delete;
69
+ }
@@ -0,0 +1,311 @@
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.ListsClient = 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 ListsClient {
56
+ constructor(options = {}) {
57
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
58
+ }
59
+ /**
60
+ * @param {AgentMail.inboxes.InboxId} inbox_id
61
+ * @param {AgentMail.Direction} direction
62
+ * @param {AgentMail.ListType} type
63
+ * @param {AgentMail.inboxes.InboxListListEntriesRequest} request
64
+ * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
65
+ *
66
+ * @example
67
+ * await client.inboxes.lists.list("inbox_id", "send", "allow")
68
+ */
69
+ list(inbox_id, direction, type, request = {}, requestOptions) {
70
+ return core.HttpResponsePromise.fromPromise(this.__list(inbox_id, direction, type, request, requestOptions));
71
+ }
72
+ __list(inbox_id_1, direction_1, type_1) {
73
+ return __awaiter(this, arguments, void 0, function* (inbox_id, direction, type, request = {}, requestOptions) {
74
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
75
+ const { limit, pageToken } = request;
76
+ const _queryParams = {
77
+ limit,
78
+ page_token: pageToken,
79
+ };
80
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
81
+ 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);
82
+ const _response = yield core.fetcher({
83
+ 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)
84
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}`),
85
+ method: "GET",
86
+ headers: _headers,
87
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
88
+ 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,
89
+ 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,
90
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
91
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
92
+ logging: this._options.logging,
93
+ });
94
+ if (_response.ok) {
95
+ return {
96
+ data: serializers.PodListListEntriesResponse.parseOrThrow(_response.body, {
97
+ unrecognizedObjectKeys: "passthrough",
98
+ allowUnrecognizedUnionMembers: true,
99
+ allowUnrecognizedEnumValues: true,
100
+ skipValidation: true,
101
+ breadcrumbsPrefix: ["response"],
102
+ }),
103
+ rawResponse: _response.rawResponse,
104
+ };
105
+ }
106
+ if (_response.error.reason === "status-code") {
107
+ throw new errors.AgentMailError({
108
+ statusCode: _response.error.statusCode,
109
+ body: _response.error.body,
110
+ rawResponse: _response.rawResponse,
111
+ });
112
+ }
113
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/lists/{direction}/{type}");
114
+ });
115
+ }
116
+ /**
117
+ * @param {AgentMail.inboxes.InboxId} inbox_id
118
+ * @param {AgentMail.Direction} direction
119
+ * @param {AgentMail.ListType} type
120
+ * @param {string} entry - Email address or domain.
121
+ * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
122
+ *
123
+ * @throws {@link AgentMail.NotFoundError}
124
+ *
125
+ * @example
126
+ * await client.inboxes.lists.get("inbox_id", "send", "allow", "entry")
127
+ */
128
+ get(inbox_id, direction, type, entry, requestOptions) {
129
+ return core.HttpResponsePromise.fromPromise(this.__get(inbox_id, direction, type, entry, requestOptions));
130
+ }
131
+ __get(inbox_id, direction, type, entry, requestOptions) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
134
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
135
+ 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);
136
+ const _response = yield core.fetcher({
137
+ 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)
138
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}/${core.url.encodePathParam(entry)}`),
139
+ method: "GET",
140
+ headers: _headers,
141
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
142
+ 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,
143
+ 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,
144
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
145
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
146
+ logging: this._options.logging,
147
+ });
148
+ if (_response.ok) {
149
+ return {
150
+ data: serializers.PodListEntry.parseOrThrow(_response.body, {
151
+ unrecognizedObjectKeys: "passthrough",
152
+ allowUnrecognizedUnionMembers: true,
153
+ allowUnrecognizedEnumValues: true,
154
+ skipValidation: true,
155
+ breadcrumbsPrefix: ["response"],
156
+ }),
157
+ rawResponse: _response.rawResponse,
158
+ };
159
+ }
160
+ if (_response.error.reason === "status-code") {
161
+ switch (_response.error.statusCode) {
162
+ case 404:
163
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
164
+ unrecognizedObjectKeys: "passthrough",
165
+ allowUnrecognizedUnionMembers: true,
166
+ allowUnrecognizedEnumValues: true,
167
+ skipValidation: true,
168
+ breadcrumbsPrefix: ["response"],
169
+ }), _response.rawResponse);
170
+ default:
171
+ throw new errors.AgentMailError({
172
+ statusCode: _response.error.statusCode,
173
+ body: _response.error.body,
174
+ rawResponse: _response.rawResponse,
175
+ });
176
+ }
177
+ }
178
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/lists/{direction}/{type}/{entry}");
179
+ });
180
+ }
181
+ /**
182
+ * @param {AgentMail.inboxes.InboxId} inbox_id
183
+ * @param {AgentMail.Direction} direction
184
+ * @param {AgentMail.ListType} type
185
+ * @param {AgentMail.CreateListEntryRequest} request
186
+ * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
187
+ *
188
+ * @throws {@link AgentMail.ValidationError}
189
+ *
190
+ * @example
191
+ * await client.inboxes.lists.create("inbox_id", "send", "allow", {
192
+ * entry: "entry"
193
+ * })
194
+ */
195
+ create(inbox_id, direction, type, request, requestOptions) {
196
+ return core.HttpResponsePromise.fromPromise(this.__create(inbox_id, direction, type, request, requestOptions));
197
+ }
198
+ __create(inbox_id, direction, type, request, requestOptions) {
199
+ return __awaiter(this, void 0, void 0, function* () {
200
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
201
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
202
+ 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);
203
+ const _response = yield core.fetcher({
204
+ 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)
205
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}`),
206
+ method: "POST",
207
+ headers: _headers,
208
+ contentType: "application/json",
209
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
210
+ requestType: "json",
211
+ body: serializers.CreateListEntryRequest.jsonOrThrow(request, {
212
+ unrecognizedObjectKeys: "strip",
213
+ omitUndefined: true,
214
+ }),
215
+ 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,
216
+ 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,
217
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
218
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
219
+ logging: this._options.logging,
220
+ });
221
+ if (_response.ok) {
222
+ return {
223
+ data: serializers.PodListEntry.parseOrThrow(_response.body, {
224
+ unrecognizedObjectKeys: "passthrough",
225
+ allowUnrecognizedUnionMembers: true,
226
+ allowUnrecognizedEnumValues: true,
227
+ skipValidation: true,
228
+ breadcrumbsPrefix: ["response"],
229
+ }),
230
+ rawResponse: _response.rawResponse,
231
+ };
232
+ }
233
+ if (_response.error.reason === "status-code") {
234
+ switch (_response.error.statusCode) {
235
+ case 400:
236
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
237
+ unrecognizedObjectKeys: "passthrough",
238
+ allowUnrecognizedUnionMembers: true,
239
+ allowUnrecognizedEnumValues: true,
240
+ skipValidation: true,
241
+ breadcrumbsPrefix: ["response"],
242
+ }), _response.rawResponse);
243
+ default:
244
+ throw new errors.AgentMailError({
245
+ statusCode: _response.error.statusCode,
246
+ body: _response.error.body,
247
+ rawResponse: _response.rawResponse,
248
+ });
249
+ }
250
+ }
251
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/inboxes/{inbox_id}/lists/{direction}/{type}");
252
+ });
253
+ }
254
+ /**
255
+ * @param {AgentMail.inboxes.InboxId} inbox_id
256
+ * @param {AgentMail.Direction} direction
257
+ * @param {AgentMail.ListType} type
258
+ * @param {string} entry - Email address or domain.
259
+ * @param {ListsClient.RequestOptions} requestOptions - Request-specific configuration.
260
+ *
261
+ * @throws {@link AgentMail.NotFoundError}
262
+ *
263
+ * @example
264
+ * await client.inboxes.lists.delete("inbox_id", "send", "allow", "entry")
265
+ */
266
+ delete(inbox_id, direction, type, entry, requestOptions) {
267
+ return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, direction, type, entry, requestOptions));
268
+ }
269
+ __delete(inbox_id, direction, type, entry, requestOptions) {
270
+ return __awaiter(this, void 0, void 0, function* () {
271
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
272
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
273
+ 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);
274
+ const _response = yield core.fetcher({
275
+ 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)
276
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/lists/${core.url.encodePathParam(serializers.Direction.jsonOrThrow(direction, { omitUndefined: true }))}/${core.url.encodePathParam(serializers.ListType.jsonOrThrow(type, { omitUndefined: true }))}/${core.url.encodePathParam(entry)}`),
277
+ method: "DELETE",
278
+ headers: _headers,
279
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
280
+ 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,
281
+ 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,
282
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
283
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
284
+ logging: this._options.logging,
285
+ });
286
+ if (_response.ok) {
287
+ return { data: undefined, rawResponse: _response.rawResponse };
288
+ }
289
+ if (_response.error.reason === "status-code") {
290
+ switch (_response.error.statusCode) {
291
+ case 404:
292
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
293
+ unrecognizedObjectKeys: "passthrough",
294
+ allowUnrecognizedUnionMembers: true,
295
+ allowUnrecognizedEnumValues: true,
296
+ skipValidation: true,
297
+ breadcrumbsPrefix: ["response"],
298
+ }), _response.rawResponse);
299
+ default:
300
+ throw new errors.AgentMailError({
301
+ statusCode: _response.error.statusCode,
302
+ body: _response.error.body,
303
+ rawResponse: _response.rawResponse,
304
+ });
305
+ }
306
+ }
307
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v0/inboxes/{inbox_id}/lists/{direction}/{type}/{entry}");
308
+ });
309
+ }
310
+ }
311
+ exports.ListsClient = ListsClient;
@@ -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,9 @@
1
+ import type * as AgentMail from "../../../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface InboxListListEntriesRequest {
7
+ limit?: AgentMail.Limit;
8
+ pageToken?: AgentMail.PageToken;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type { InboxListListEntriesRequest } from "./InboxListListEntriesRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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);
@@ -2,5 +2,6 @@
2
2
  export declare const Direction: {
3
3
  readonly Send: "send";
4
4
  readonly Receive: "receive";
5
+ readonly Reply: "reply";
5
6
  };
6
7
  export type Direction = (typeof Direction)[keyof typeof Direction];
@@ -6,4 +6,5 @@ exports.Direction = void 0;
6
6
  exports.Direction = {
7
7
  Send: "send",
8
8
  Receive: "receive",
9
+ Reply: "reply",
9
10
  };
@@ -3,5 +3,5 @@ import * as core from "../../../../core/index.js";
3
3
  import type * as serializers from "../../../index.js";
4
4
  export declare const Direction: core.serialization.Schema<serializers.Direction.Raw, AgentMail.Direction>;
5
5
  export declare namespace Direction {
6
- type Raw = "send" | "receive";
6
+ type Raw = "send" | "receive" | "reply";
7
7
  }
@@ -36,4 +36,4 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.Direction = void 0;
38
38
  const core = __importStar(require("../../../../core/index.js"));
39
- exports.Direction = core.serialization.enum_(["send", "receive"]);
39
+ exports.Direction = core.serialization.enum_(["send", "receive", "reply"]);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.4.6";
1
+ export declare const SDK_VERSION = "0.4.8";
@@ -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.4.6";
4
+ exports.SDK_VERSION = "0.4.8";
@@ -1,5 +1,6 @@
1
1
  export interface MppxClient {
2
2
  fetch: typeof globalThis.fetch;
3
+ rawFetch: typeof globalThis.fetch;
3
4
  transport: {
4
5
  setCredential(request: Request, credential: string): RequestInit;
5
6
  };
@@ -13,7 +13,7 @@ exports.getPaymentCredentials = getPaymentCredentials;
13
13
  const util_js_1 = require("./util.js");
14
14
  function getPaymentCredentials(wsUrl, mppx) {
15
15
  return __awaiter(this, void 0, void 0, function* () {
16
- const response = yield (0, util_js_1.probe402)(wsUrl);
16
+ const response = yield (0, util_js_1.probe402)(wsUrl, mppx.rawFetch);
17
17
  const credential = yield mppx.createCredential(response);
18
18
  const signed = mppx.transport.setCredential(new Request((0, util_js_1.wsToHttp)(wsUrl)), credential);
19
19
  const headers = {};
@@ -1,2 +1,2 @@
1
1
  export declare function wsToHttp(wsUrl: string): string;
2
- export declare function probe402(wsUrl: string): Promise<Response>;
2
+ export declare function probe402(wsUrl: string, fetchFn?: typeof fetch): Promise<Response>;
@@ -14,10 +14,10 @@ exports.probe402 = probe402;
14
14
  function wsToHttp(wsUrl) {
15
15
  return wsUrl.replace(/^wss:\/\//, "https://").replace(/^ws:\/\//, "http://");
16
16
  }
17
- function probe402(wsUrl) {
18
- return __awaiter(this, void 0, void 0, function* () {
17
+ function probe402(wsUrl_1) {
18
+ return __awaiter(this, arguments, void 0, function* (wsUrl, fetchFn = fetch) {
19
19
  const httpUrl = wsToHttp(wsUrl);
20
- const response = yield fetch(httpUrl);
20
+ const response = yield fetchFn(httpUrl);
21
21
  if (response.status !== 402) {
22
22
  throw new Error(`Expected 402 from ${httpUrl} but got ${response.status}`);
23
23
  }