Skip to content

Commit 02d10ac

Browse files
Release 0.4.2
1 parent da05104 commit 02d10ac

10 files changed

Lines changed: 54 additions & 9 deletions

File tree

.fern/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
}
1414
}
1515
},
16-
"sdkVersion": "0.4.1"
16+
"sdkVersion": "0.4.2"
1717
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "agentmail",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"private": false,
55
"repository": {
66
"type": "git",

reference.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2532,10 +2532,24 @@ await client.inboxes.threads.getAttachment("inbox_id", "thread_id", "attachment_
25322532
</dl>
25332533
</details>
25342534

2535-
<details><summary><code>client.inboxes.threads.<a href="/src/api/resources/inboxes/resources/threads/client/Client.ts">delete</a>(inbox_id, thread_id) -> void</code></summary>
2535+
<details><summary><code>client.inboxes.threads.<a href="/src/api/resources/inboxes/resources/threads/client/Client.ts">delete</a>(inbox_id, thread_id, { ...params }) -> void</code></summary>
25362536
<dl>
25372537
<dd>
25382538

2539+
#### 📝 Description
2540+
2541+
<dl>
2542+
<dd>
2543+
2544+
<dl>
2545+
<dd>
2546+
2547+
Moves the thread to trash by adding a trash label to all messages. If the thread is already in trash, it will be permanently deleted. Use `permanent=true` to force permanent deletion.
2548+
</dd>
2549+
</dl>
2550+
</dd>
2551+
</dl>
2552+
25392553
#### 🔌 Usage
25402554

25412555
<dl>
@@ -2577,6 +2591,14 @@ await client.inboxes.threads.delete("inbox_id", "thread_id");
25772591
<dl>
25782592
<dd>
25792593

2594+
**request:** `AgentMail.inboxes.DeleteThreadRequest`
2595+
2596+
</dd>
2597+
</dl>
2598+
2599+
<dl>
2600+
<dd>
2601+
25802602
**requestOptions:** `ThreadsClient.RequestOptions`
25812603

25822604
</dd>

src/BaseClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export function normalizeClientOptions<T extends BaseClientOptions = BaseClientO
5151
{
5252
"X-Fern-Language": "JavaScript",
5353
"X-Fern-SDK-Name": "agentmail",
54-
"X-Fern-SDK-Version": "0.4.1",
55-
"User-Agent": "agentmail/0.4.1",
54+
"X-Fern-SDK-Version": "0.4.2",
55+
"User-Agent": "agentmail/0.4.2",
5656
"X-Fern-Runtime": core.RUNTIME.type,
5757
"X-Fern-Runtime-Version": core.RUNTIME.version,
5858
},

src/api/resources/inboxes/resources/threads/client/Client.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,11 @@ export class ThreadsClient {
321321
}
322322

323323
/**
324+
* Moves the thread to trash by adding a trash label to all messages. If the thread is already in trash, it will be permanently deleted. Use `permanent=true` to force permanent deletion.
325+
*
324326
* @param {AgentMail.inboxes.InboxId} inbox_id
325327
* @param {AgentMail.ThreadId} thread_id
328+
* @param {AgentMail.inboxes.DeleteThreadRequest} request
326329
* @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
327330
*
328331
* @throws {@link AgentMail.NotFoundError}
@@ -333,16 +336,22 @@ export class ThreadsClient {
333336
public delete(
334337
inbox_id: AgentMail.inboxes.InboxId,
335338
thread_id: AgentMail.ThreadId,
339+
request: AgentMail.inboxes.DeleteThreadRequest = {},
336340
requestOptions?: ThreadsClient.RequestOptions,
337341
): core.HttpResponsePromise<void> {
338-
return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, thread_id, requestOptions));
342+
return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, thread_id, request, requestOptions));
339343
}
340344

341345
private async __delete(
342346
inbox_id: AgentMail.inboxes.InboxId,
343347
thread_id: AgentMail.ThreadId,
348+
request: AgentMail.inboxes.DeleteThreadRequest = {},
344349
requestOptions?: ThreadsClient.RequestOptions,
345350
): Promise<core.WithRawResponse<void>> {
351+
const { permanent } = request;
352+
const _queryParams: Record<string, unknown> = {
353+
permanent,
354+
};
346355
const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
347356
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
348357
_authRequest.headers,
@@ -358,7 +367,7 @@ export class ThreadsClient {
358367
),
359368
method: "DELETE",
360369
headers: _headers,
361-
queryParameters: requestOptions?.queryParams,
370+
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
362371
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
363372
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
364373
abortSignal: requestOptions?.abortSignal,
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This file was auto-generated by Fern from our API Definition.
2+
3+
/**
4+
* @example
5+
* {}
6+
*/
7+
export interface DeleteThreadRequest {
8+
/** If true, permanently delete the thread instead of moving to trash. */
9+
permanent?: boolean;
10+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export type { DeleteThreadRequest } from "./DeleteThreadRequest.js";
12
export type { ListThreadsRequest } from "./ListThreadsRequest.js";

src/api/resources/threads/client/Client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export class ThreadsClient {
4444
request: AgentMail.ListThreadsRequest = {},
4545
requestOptions?: ThreadsClient.RequestOptions,
4646
): Promise<core.WithRawResponse<AgentMail.ListThreadsResponse>> {
47-
const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked } = request;
47+
const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeTrash } =
48+
request;
4849
const _queryParams: Record<string, unknown> = {
4950
limit,
5051
page_token: pageToken,
@@ -68,6 +69,7 @@ export class ThreadsClient {
6869
ascending,
6970
include_spam: includeSpam,
7071
include_blocked: includeBlocked,
72+
include_trash: includeTrash,
7173
};
7274
const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
7375
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(

src/api/resources/threads/client/requests/ListThreadsRequest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ export interface ListThreadsRequest {
1515
ascending?: AgentMail.Ascending;
1616
includeSpam?: AgentMail.IncludeSpam;
1717
includeBlocked?: AgentMail.IncludeBlocked;
18+
includeTrash?: AgentMail.IncludeTrash;
1819
}

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const SDK_VERSION = "0.4.1";
1+
export const SDK_VERSION = "0.4.2";

0 commit comments

Comments
 (0)