agentmail 0.4.16 → 0.4.17

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.
@@ -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.16",
47
- "User-Agent": "agentmail/0.4.16",
46
+ "X-Fern-SDK-Version": "0.4.17",
47
+ "User-Agent": "agentmail/0.4.17",
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);
@@ -98,6 +98,25 @@ export declare class MessagesClient {
98
98
  */
99
99
  update(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.UpdateMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.UpdateMessageResponse>;
100
100
  private __update;
101
+ /**
102
+ * Permanently deletes a message.
103
+ *
104
+ * **CLI:**
105
+ * ```bash
106
+ * agentmail inboxes:messages delete --inbox-id <inbox_id> --message-id <message_id>
107
+ * ```
108
+ *
109
+ * @param {AgentMail.inboxes.InboxId} inbox_id
110
+ * @param {AgentMail.MessageId} message_id
111
+ * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
112
+ *
113
+ * @throws {@link AgentMail.NotFoundError}
114
+ *
115
+ * @example
116
+ * await client.inboxes.messages.delete("inbox_id", "message_id")
117
+ */
118
+ delete(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<void>;
119
+ private __delete;
101
120
  /**
102
121
  * **CLI:**
103
122
  * ```bash
@@ -435,6 +435,67 @@ class MessagesClient {
435
435
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/inboxes/{inbox_id}/messages/{message_id}");
436
436
  });
437
437
  }
438
+ /**
439
+ * Permanently deletes a message.
440
+ *
441
+ * **CLI:**
442
+ * ```bash
443
+ * agentmail inboxes:messages delete --inbox-id <inbox_id> --message-id <message_id>
444
+ * ```
445
+ *
446
+ * @param {AgentMail.inboxes.InboxId} inbox_id
447
+ * @param {AgentMail.MessageId} message_id
448
+ * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
449
+ *
450
+ * @throws {@link AgentMail.NotFoundError}
451
+ *
452
+ * @example
453
+ * await client.inboxes.messages.delete("inbox_id", "message_id")
454
+ */
455
+ delete(inbox_id, message_id, requestOptions) {
456
+ return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, message_id, requestOptions));
457
+ }
458
+ __delete(inbox_id, message_id, requestOptions) {
459
+ return __awaiter(this, void 0, void 0, function* () {
460
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
461
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
462
+ 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);
463
+ const _response = yield core.fetcher({
464
+ 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)
465
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}`),
466
+ method: "DELETE",
467
+ headers: _headers,
468
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
469
+ 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,
470
+ 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,
471
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
472
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
473
+ logging: this._options.logging,
474
+ });
475
+ if (_response.ok) {
476
+ return { data: undefined, rawResponse: _response.rawResponse };
477
+ }
478
+ if (_response.error.reason === "status-code") {
479
+ switch (_response.error.statusCode) {
480
+ case 404:
481
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
482
+ unrecognizedObjectKeys: "passthrough",
483
+ allowUnrecognizedUnionMembers: true,
484
+ allowUnrecognizedEnumValues: true,
485
+ skipValidation: true,
486
+ breadcrumbsPrefix: ["response"],
487
+ }), _response.rawResponse);
488
+ default:
489
+ throw new errors.AgentMailError({
490
+ statusCode: _response.error.statusCode,
491
+ body: _response.error.body,
492
+ rawResponse: _response.rawResponse,
493
+ });
494
+ }
495
+ }
496
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v0/inboxes/{inbox_id}/messages/{message_id}");
497
+ });
498
+ }
438
499
  /**
439
500
  * **CLI:**
440
501
  * ```bash
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.4.16";
1
+ export declare const SDK_VERSION = "0.4.17";
@@ -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.16";
4
+ exports.SDK_VERSION = "0.4.17";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "agentmail",
9
- "X-Fern-SDK-Version": "0.4.16",
10
- "User-Agent": "agentmail/0.4.16",
9
+ "X-Fern-SDK-Version": "0.4.17",
10
+ "User-Agent": "agentmail/0.4.17",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -98,6 +98,25 @@ export declare class MessagesClient {
98
98
  */
99
99
  update(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, request: AgentMail.UpdateMessageRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentMail.UpdateMessageResponse>;
100
100
  private __update;
101
+ /**
102
+ * Permanently deletes a message.
103
+ *
104
+ * **CLI:**
105
+ * ```bash
106
+ * agentmail inboxes:messages delete --inbox-id <inbox_id> --message-id <message_id>
107
+ * ```
108
+ *
109
+ * @param {AgentMail.inboxes.InboxId} inbox_id
110
+ * @param {AgentMail.MessageId} message_id
111
+ * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
112
+ *
113
+ * @throws {@link AgentMail.NotFoundError}
114
+ *
115
+ * @example
116
+ * await client.inboxes.messages.delete("inbox_id", "message_id")
117
+ */
118
+ delete(inbox_id: AgentMail.inboxes.InboxId, message_id: AgentMail.MessageId, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<void>;
119
+ private __delete;
101
120
  /**
102
121
  * **CLI:**
103
122
  * ```bash
@@ -399,6 +399,67 @@ export class MessagesClient {
399
399
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/inboxes/{inbox_id}/messages/{message_id}");
400
400
  });
401
401
  }
402
+ /**
403
+ * Permanently deletes a message.
404
+ *
405
+ * **CLI:**
406
+ * ```bash
407
+ * agentmail inboxes:messages delete --inbox-id <inbox_id> --message-id <message_id>
408
+ * ```
409
+ *
410
+ * @param {AgentMail.inboxes.InboxId} inbox_id
411
+ * @param {AgentMail.MessageId} message_id
412
+ * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
413
+ *
414
+ * @throws {@link AgentMail.NotFoundError}
415
+ *
416
+ * @example
417
+ * await client.inboxes.messages.delete("inbox_id", "message_id")
418
+ */
419
+ delete(inbox_id, message_id, requestOptions) {
420
+ return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, message_id, requestOptions));
421
+ }
422
+ __delete(inbox_id, message_id, requestOptions) {
423
+ return __awaiter(this, void 0, void 0, function* () {
424
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
425
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
426
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
427
+ const _response = yield core.fetcher({
428
+ 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)
429
+ .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/messages/${core.url.encodePathParam(serializers.MessageId.jsonOrThrow(message_id, { omitUndefined: true }))}`),
430
+ method: "DELETE",
431
+ headers: _headers,
432
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
433
+ 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,
434
+ 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,
435
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
436
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
437
+ logging: this._options.logging,
438
+ });
439
+ if (_response.ok) {
440
+ return { data: undefined, rawResponse: _response.rawResponse };
441
+ }
442
+ if (_response.error.reason === "status-code") {
443
+ switch (_response.error.statusCode) {
444
+ case 404:
445
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
446
+ unrecognizedObjectKeys: "passthrough",
447
+ allowUnrecognizedUnionMembers: true,
448
+ allowUnrecognizedEnumValues: true,
449
+ skipValidation: true,
450
+ breadcrumbsPrefix: ["response"],
451
+ }), _response.rawResponse);
452
+ default:
453
+ throw new errors.AgentMailError({
454
+ statusCode: _response.error.statusCode,
455
+ body: _response.error.body,
456
+ rawResponse: _response.rawResponse,
457
+ });
458
+ }
459
+ }
460
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/inboxes/{inbox_id}/messages/{message_id}");
461
+ });
462
+ }
402
463
  /**
403
464
  * **CLI:**
404
465
  * ```bash
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.4.16";
1
+ export declare const SDK_VERSION = "0.4.17";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.4.16";
1
+ export const SDK_VERSION = "0.4.17";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentmail",
3
- "version": "0.4.16",
3
+ "version": "0.4.17",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -3491,6 +3491,82 @@ await client.inboxes.messages.update("inbox_id", "message_id", {});
3491
3491
  </dl>
3492
3492
 
3493
3493
 
3494
+ </dd>
3495
+ </dl>
3496
+ </details>
3497
+
3498
+ <details><summary><code>client.inboxes.messages.<a href="/src/api/resources/inboxes/resources/messages/client/Client.ts">delete</a>(inbox_id, message_id) -> void</code></summary>
3499
+ <dl>
3500
+ <dd>
3501
+
3502
+ #### 📝 Description
3503
+
3504
+ <dl>
3505
+ <dd>
3506
+
3507
+ <dl>
3508
+ <dd>
3509
+
3510
+ Permanently deletes a message.
3511
+
3512
+ **CLI:**
3513
+ ```bash
3514
+ agentmail inboxes:messages delete --inbox-id <inbox_id> --message-id <message_id>
3515
+ ```
3516
+ </dd>
3517
+ </dl>
3518
+ </dd>
3519
+ </dl>
3520
+
3521
+ #### 🔌 Usage
3522
+
3523
+ <dl>
3524
+ <dd>
3525
+
3526
+ <dl>
3527
+ <dd>
3528
+
3529
+ ```typescript
3530
+ await client.inboxes.messages.delete("inbox_id", "message_id");
3531
+
3532
+ ```
3533
+ </dd>
3534
+ </dl>
3535
+ </dd>
3536
+ </dl>
3537
+
3538
+ #### ⚙️ Parameters
3539
+
3540
+ <dl>
3541
+ <dd>
3542
+
3543
+ <dl>
3544
+ <dd>
3545
+
3546
+ **inbox_id:** `AgentMail.InboxId`
3547
+
3548
+ </dd>
3549
+ </dl>
3550
+
3551
+ <dl>
3552
+ <dd>
3553
+
3554
+ **message_id:** `AgentMail.MessageId`
3555
+
3556
+ </dd>
3557
+ </dl>
3558
+
3559
+ <dl>
3560
+ <dd>
3561
+
3562
+ **requestOptions:** `MessagesClient.RequestOptions`
3563
+
3564
+ </dd>
3565
+ </dl>
3566
+ </dd>
3567
+ </dl>
3568
+
3569
+
3494
3570
  </dd>
3495
3571
  </dl>
3496
3572
  </details>