agentmail 0.1.2 → 0.1.4

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 (30) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +14 -0
  3. package/dist/cjs/api/resources/inboxes/client/Client.js +81 -0
  4. package/dist/cjs/api/resources/inboxes/types/UpdateInboxRequest.d.ts +4 -0
  5. package/dist/cjs/api/resources/inboxes/types/UpdateInboxRequest.js +3 -0
  6. package/dist/cjs/api/resources/inboxes/types/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/inboxes/types/index.js +1 -0
  8. package/dist/cjs/serialization/resources/inboxes/types/UpdateInboxRequest.d.ts +10 -0
  9. package/dist/cjs/serialization/resources/inboxes/types/UpdateInboxRequest.js +42 -0
  10. package/dist/cjs/serialization/resources/inboxes/types/index.d.ts +1 -0
  11. package/dist/cjs/serialization/resources/inboxes/types/index.js +1 -0
  12. package/dist/cjs/version.d.ts +1 -1
  13. package/dist/cjs/version.js +1 -1
  14. package/dist/esm/Client.mjs +2 -2
  15. package/dist/esm/api/resources/inboxes/client/Client.d.mts +14 -0
  16. package/dist/esm/api/resources/inboxes/client/Client.mjs +81 -0
  17. package/dist/esm/api/resources/inboxes/types/UpdateInboxRequest.d.mts +4 -0
  18. package/dist/esm/api/resources/inboxes/types/UpdateInboxRequest.mjs +2 -0
  19. package/dist/esm/api/resources/inboxes/types/index.d.mts +1 -0
  20. package/dist/esm/api/resources/inboxes/types/index.mjs +1 -0
  21. package/dist/esm/serialization/resources/inboxes/types/UpdateInboxRequest.d.mts +10 -0
  22. package/dist/esm/serialization/resources/inboxes/types/UpdateInboxRequest.mjs +6 -0
  23. package/dist/esm/serialization/resources/inboxes/types/index.d.mts +1 -0
  24. package/dist/esm/serialization/resources/inboxes/types/index.mjs +1 -0
  25. package/dist/esm/version.d.mts +1 -1
  26. package/dist/esm/version.mjs +1 -1
  27. package/dist/llms-full.txt +21118 -0
  28. package/dist/llms.txt +101 -0
  29. package/package.json +2 -2
  30. package/reference.md +59 -0
@@ -51,8 +51,8 @@ class AgentMailClient {
51
51
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
52
52
  "X-Fern-Language": "JavaScript",
53
53
  "X-Fern-SDK-Name": "agentmail",
54
- "X-Fern-SDK-Version": "0.1.2",
55
- "User-Agent": "agentmail/0.1.2",
54
+ "X-Fern-SDK-Version": "0.1.4",
55
+ "User-Agent": "agentmail/0.1.4",
56
56
  "X-Fern-Runtime": core.RUNTIME.type,
57
57
  "X-Fern-Runtime-Version": core.RUNTIME.version,
58
58
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -53,6 +53,20 @@ export declare class Inboxes {
53
53
  */
54
54
  create(request: AgentMail.inboxes.CreateInboxRequest, requestOptions?: Inboxes.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.Inbox>;
55
55
  private __create;
56
+ /**
57
+ * @param {AgentMail.inboxes.InboxId} inboxId
58
+ * @param {AgentMail.inboxes.UpdateInboxRequest} request
59
+ * @param {Inboxes.RequestOptions} requestOptions - Request-specific configuration.
60
+ *
61
+ * @throws {@link AgentMail.NotFoundError}
62
+ *
63
+ * @example
64
+ * await client.inboxes.update("inbox_id", {
65
+ * displayName: "display_name"
66
+ * })
67
+ */
68
+ update(inboxId: AgentMail.inboxes.InboxId, request: AgentMail.inboxes.UpdateInboxRequest, requestOptions?: Inboxes.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.Inbox>;
69
+ private __update;
56
70
  /**
57
71
  * @param {AgentMail.inboxes.InboxId} inboxId
58
72
  * @param {Inboxes.RequestOptions} requestOptions - Request-specific configuration.
@@ -291,6 +291,87 @@ class Inboxes {
291
291
  }
292
292
  });
293
293
  }
294
+ /**
295
+ * @param {AgentMail.inboxes.InboxId} inboxId
296
+ * @param {AgentMail.inboxes.UpdateInboxRequest} request
297
+ * @param {Inboxes.RequestOptions} requestOptions - Request-specific configuration.
298
+ *
299
+ * @throws {@link AgentMail.NotFoundError}
300
+ *
301
+ * @example
302
+ * await client.inboxes.update("inbox_id", {
303
+ * displayName: "display_name"
304
+ * })
305
+ */
306
+ update(inboxId, request, requestOptions) {
307
+ return core.HttpResponsePromise.fromPromise(this.__update(inboxId, request, requestOptions));
308
+ }
309
+ __update(inboxId, request, requestOptions) {
310
+ return __awaiter(this, void 0, void 0, function* () {
311
+ var _a, _b, _c, _d, _e, _f, _g, _h;
312
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
313
+ const _response = yield core.fetcher({
314
+ 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.Production).http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}`),
315
+ method: "PATCH",
316
+ headers: _headers,
317
+ contentType: "application/json",
318
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
319
+ requestType: "json",
320
+ body: serializers.inboxes.UpdateInboxRequest.jsonOrThrow(request, {
321
+ unrecognizedObjectKeys: "strip",
322
+ omitUndefined: true,
323
+ }),
324
+ 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,
325
+ 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,
326
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
327
+ });
328
+ if (_response.ok) {
329
+ return {
330
+ data: serializers.inboxes.Inbox.parseOrThrow(_response.body, {
331
+ unrecognizedObjectKeys: "passthrough",
332
+ allowUnrecognizedUnionMembers: true,
333
+ allowUnrecognizedEnumValues: true,
334
+ skipValidation: true,
335
+ breadcrumbsPrefix: ["response"],
336
+ }),
337
+ rawResponse: _response.rawResponse,
338
+ };
339
+ }
340
+ if (_response.error.reason === "status-code") {
341
+ switch (_response.error.statusCode) {
342
+ case 404:
343
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
344
+ unrecognizedObjectKeys: "passthrough",
345
+ allowUnrecognizedUnionMembers: true,
346
+ allowUnrecognizedEnumValues: true,
347
+ skipValidation: true,
348
+ breadcrumbsPrefix: ["response"],
349
+ }), _response.rawResponse);
350
+ default:
351
+ throw new errors.AgentMailError({
352
+ statusCode: _response.error.statusCode,
353
+ body: _response.error.body,
354
+ rawResponse: _response.rawResponse,
355
+ });
356
+ }
357
+ }
358
+ switch (_response.error.reason) {
359
+ case "non-json":
360
+ throw new errors.AgentMailError({
361
+ statusCode: _response.error.statusCode,
362
+ body: _response.error.rawBody,
363
+ rawResponse: _response.rawResponse,
364
+ });
365
+ case "timeout":
366
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling PATCH /v0/inboxes/{inbox_id}.");
367
+ case "unknown":
368
+ throw new errors.AgentMailError({
369
+ message: _response.error.errorMessage,
370
+ rawResponse: _response.rawResponse,
371
+ });
372
+ }
373
+ });
374
+ }
294
375
  /**
295
376
  * @param {AgentMail.inboxes.InboxId} inboxId
296
377
  * @param {Inboxes.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,4 @@
1
+ import type * as AgentMail from "../../../index.js";
2
+ export interface UpdateInboxRequest {
3
+ displayName: AgentMail.inboxes.DisplayName;
4
+ }
@@ -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 });
@@ -4,3 +4,4 @@ export * from "./DisplayName.js";
4
4
  export * from "./Inbox.js";
5
5
  export * from "./InboxId.js";
6
6
  export * from "./ListInboxesResponse.js";
7
+ export * from "./UpdateInboxRequest.js";
@@ -20,3 +20,4 @@ __exportStar(require("./DisplayName.js"), exports);
20
20
  __exportStar(require("./Inbox.js"), exports);
21
21
  __exportStar(require("./InboxId.js"), exports);
22
22
  __exportStar(require("./ListInboxesResponse.js"), exports);
23
+ __exportStar(require("./UpdateInboxRequest.js"), exports);
@@ -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 { DisplayName } from "./DisplayName.js";
5
+ export declare const UpdateInboxRequest: core.serialization.ObjectSchema<serializers.inboxes.UpdateInboxRequest.Raw, AgentMail.inboxes.UpdateInboxRequest>;
6
+ export declare namespace UpdateInboxRequest {
7
+ interface Raw {
8
+ display_name: DisplayName.Raw;
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.UpdateInboxRequest = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ const DisplayName_js_1 = require("./DisplayName.js");
40
+ exports.UpdateInboxRequest = core.serialization.object({
41
+ displayName: core.serialization.property("display_name", DisplayName_js_1.DisplayName),
42
+ });
@@ -4,3 +4,4 @@ export * from "./DisplayName.js";
4
4
  export * from "./Inbox.js";
5
5
  export * from "./InboxId.js";
6
6
  export * from "./ListInboxesResponse.js";
7
+ export * from "./UpdateInboxRequest.js";
@@ -20,3 +20,4 @@ __exportStar(require("./DisplayName.js"), exports);
20
20
  __exportStar(require("./Inbox.js"), exports);
21
21
  __exportStar(require("./InboxId.js"), exports);
22
22
  __exportStar(require("./ListInboxesResponse.js"), exports);
23
+ __exportStar(require("./UpdateInboxRequest.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.2";
1
+ export declare const SDK_VERSION = "0.1.4";
@@ -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.1.2";
4
+ exports.SDK_VERSION = "0.1.4";
@@ -15,8 +15,8 @@ export class AgentMailClient {
15
15
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
16
16
  "X-Fern-Language": "JavaScript",
17
17
  "X-Fern-SDK-Name": "agentmail",
18
- "X-Fern-SDK-Version": "0.1.2",
19
- "User-Agent": "agentmail/0.1.2",
18
+ "X-Fern-SDK-Version": "0.1.4",
19
+ "User-Agent": "agentmail/0.1.4",
20
20
  "X-Fern-Runtime": core.RUNTIME.type,
21
21
  "X-Fern-Runtime-Version": core.RUNTIME.version,
22
22
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -53,6 +53,20 @@ export declare class Inboxes {
53
53
  */
54
54
  create(request: AgentMail.inboxes.CreateInboxRequest, requestOptions?: Inboxes.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.Inbox>;
55
55
  private __create;
56
+ /**
57
+ * @param {AgentMail.inboxes.InboxId} inboxId
58
+ * @param {AgentMail.inboxes.UpdateInboxRequest} request
59
+ * @param {Inboxes.RequestOptions} requestOptions - Request-specific configuration.
60
+ *
61
+ * @throws {@link AgentMail.NotFoundError}
62
+ *
63
+ * @example
64
+ * await client.inboxes.update("inbox_id", {
65
+ * displayName: "display_name"
66
+ * })
67
+ */
68
+ update(inboxId: AgentMail.inboxes.InboxId, request: AgentMail.inboxes.UpdateInboxRequest, requestOptions?: Inboxes.RequestOptions): core.HttpResponsePromise<AgentMail.inboxes.Inbox>;
69
+ private __update;
56
70
  /**
57
71
  * @param {AgentMail.inboxes.InboxId} inboxId
58
72
  * @param {Inboxes.RequestOptions} requestOptions - Request-specific configuration.
@@ -255,6 +255,87 @@ export class Inboxes {
255
255
  }
256
256
  });
257
257
  }
258
+ /**
259
+ * @param {AgentMail.inboxes.InboxId} inboxId
260
+ * @param {AgentMail.inboxes.UpdateInboxRequest} request
261
+ * @param {Inboxes.RequestOptions} requestOptions - Request-specific configuration.
262
+ *
263
+ * @throws {@link AgentMail.NotFoundError}
264
+ *
265
+ * @example
266
+ * await client.inboxes.update("inbox_id", {
267
+ * displayName: "display_name"
268
+ * })
269
+ */
270
+ update(inboxId, request, requestOptions) {
271
+ return core.HttpResponsePromise.fromPromise(this.__update(inboxId, request, requestOptions));
272
+ }
273
+ __update(inboxId, request, requestOptions) {
274
+ return __awaiter(this, void 0, void 0, function* () {
275
+ var _a, _b, _c, _d, _e, _f, _g, _h;
276
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
277
+ const _response = yield core.fetcher({
278
+ 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.Production).http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inboxId, { omitUndefined: true }))}`),
279
+ method: "PATCH",
280
+ headers: _headers,
281
+ contentType: "application/json",
282
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
283
+ requestType: "json",
284
+ body: serializers.inboxes.UpdateInboxRequest.jsonOrThrow(request, {
285
+ unrecognizedObjectKeys: "strip",
286
+ omitUndefined: true,
287
+ }),
288
+ 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,
289
+ 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,
290
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
291
+ });
292
+ if (_response.ok) {
293
+ return {
294
+ data: serializers.inboxes.Inbox.parseOrThrow(_response.body, {
295
+ unrecognizedObjectKeys: "passthrough",
296
+ allowUnrecognizedUnionMembers: true,
297
+ allowUnrecognizedEnumValues: true,
298
+ skipValidation: true,
299
+ breadcrumbsPrefix: ["response"],
300
+ }),
301
+ rawResponse: _response.rawResponse,
302
+ };
303
+ }
304
+ if (_response.error.reason === "status-code") {
305
+ switch (_response.error.statusCode) {
306
+ case 404:
307
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
308
+ unrecognizedObjectKeys: "passthrough",
309
+ allowUnrecognizedUnionMembers: true,
310
+ allowUnrecognizedEnumValues: true,
311
+ skipValidation: true,
312
+ breadcrumbsPrefix: ["response"],
313
+ }), _response.rawResponse);
314
+ default:
315
+ throw new errors.AgentMailError({
316
+ statusCode: _response.error.statusCode,
317
+ body: _response.error.body,
318
+ rawResponse: _response.rawResponse,
319
+ });
320
+ }
321
+ }
322
+ switch (_response.error.reason) {
323
+ case "non-json":
324
+ throw new errors.AgentMailError({
325
+ statusCode: _response.error.statusCode,
326
+ body: _response.error.rawBody,
327
+ rawResponse: _response.rawResponse,
328
+ });
329
+ case "timeout":
330
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling PATCH /v0/inboxes/{inbox_id}.");
331
+ case "unknown":
332
+ throw new errors.AgentMailError({
333
+ message: _response.error.errorMessage,
334
+ rawResponse: _response.rawResponse,
335
+ });
336
+ }
337
+ });
338
+ }
258
339
  /**
259
340
  * @param {AgentMail.inboxes.InboxId} inboxId
260
341
  * @param {Inboxes.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,4 @@
1
+ import type * as AgentMail from "../../../index.mjs";
2
+ export interface UpdateInboxRequest {
3
+ displayName: AgentMail.inboxes.DisplayName;
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -4,3 +4,4 @@ export * from "./DisplayName.mjs";
4
4
  export * from "./Inbox.mjs";
5
5
  export * from "./InboxId.mjs";
6
6
  export * from "./ListInboxesResponse.mjs";
7
+ export * from "./UpdateInboxRequest.mjs";
@@ -4,3 +4,4 @@ export * from "./DisplayName.mjs";
4
4
  export * from "./Inbox.mjs";
5
5
  export * from "./InboxId.mjs";
6
6
  export * from "./ListInboxesResponse.mjs";
7
+ export * from "./UpdateInboxRequest.mjs";
@@ -0,0 +1,10 @@
1
+ import type * as AgentMail from "../../../../api/index.mjs";
2
+ import * as core from "../../../../core/index.mjs";
3
+ import type * as serializers from "../../../index.mjs";
4
+ import { DisplayName } from "./DisplayName.mjs";
5
+ export declare const UpdateInboxRequest: core.serialization.ObjectSchema<serializers.inboxes.UpdateInboxRequest.Raw, AgentMail.inboxes.UpdateInboxRequest>;
6
+ export declare namespace UpdateInboxRequest {
7
+ interface Raw {
8
+ display_name: DisplayName.Raw;
9
+ }
10
+ }
@@ -0,0 +1,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../../../core/index.mjs";
3
+ import { DisplayName } from "./DisplayName.mjs";
4
+ export const UpdateInboxRequest = core.serialization.object({
5
+ displayName: core.serialization.property("display_name", DisplayName),
6
+ });
@@ -4,3 +4,4 @@ export * from "./DisplayName.mjs";
4
4
  export * from "./Inbox.mjs";
5
5
  export * from "./InboxId.mjs";
6
6
  export * from "./ListInboxesResponse.mjs";
7
+ export * from "./UpdateInboxRequest.mjs";
@@ -4,3 +4,4 @@ export * from "./DisplayName.mjs";
4
4
  export * from "./Inbox.mjs";
5
5
  export * from "./InboxId.mjs";
6
6
  export * from "./ListInboxesResponse.mjs";
7
+ export * from "./UpdateInboxRequest.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.2";
1
+ export declare const SDK_VERSION = "0.1.4";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.1.2";
1
+ export const SDK_VERSION = "0.1.4";