agentmail 0.4.1 → 0.4.2

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 (24) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.d.ts +4 -1
  3. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +12 -5
  4. package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/DeleteThreadRequest.d.ts +8 -0
  5. package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/DeleteThreadRequest.js +3 -0
  6. package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/threads/client/Client.js +2 -1
  8. package/dist/cjs/api/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
  9. package/dist/cjs/version.d.ts +1 -1
  10. package/dist/cjs/version.js +1 -1
  11. package/dist/esm/BaseClient.mjs +2 -2
  12. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.d.mts +4 -1
  13. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +12 -5
  14. package/dist/esm/api/resources/inboxes/resources/threads/client/requests/DeleteThreadRequest.d.mts +8 -0
  15. package/dist/esm/api/resources/inboxes/resources/threads/client/requests/DeleteThreadRequest.mjs +2 -0
  16. package/dist/esm/api/resources/inboxes/resources/threads/client/requests/index.d.mts +1 -0
  17. package/dist/esm/api/resources/threads/client/Client.mjs +2 -1
  18. package/dist/esm/api/resources/threads/client/requests/ListThreadsRequest.d.mts +1 -0
  19. package/dist/esm/version.d.mts +1 -1
  20. package/dist/esm/version.mjs +1 -1
  21. package/dist/llms-full.txt +856 -32
  22. package/dist/llms.txt +3 -0
  23. package/package.json +1 -1
  24. package/reference.md +23 -1
@@ -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.1",
47
- "User-Agent": "agentmail/0.4.1",
46
+ "X-Fern-SDK-Version": "0.4.2",
47
+ "User-Agent": "agentmail/0.4.2",
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);
@@ -48,8 +48,11 @@ export declare class ThreadsClient {
48
48
  getAttachment(inbox_id: AgentMail.inboxes.InboxId, thread_id: AgentMail.ThreadId, attachment_id: AgentMail.AttachmentId, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
49
49
  private __getAttachment;
50
50
  /**
51
+ * 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.
52
+ *
51
53
  * @param {AgentMail.inboxes.InboxId} inbox_id
52
54
  * @param {AgentMail.ThreadId} thread_id
55
+ * @param {AgentMail.inboxes.DeleteThreadRequest} request
53
56
  * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
54
57
  *
55
58
  * @throws {@link AgentMail.NotFoundError}
@@ -57,6 +60,6 @@ export declare class ThreadsClient {
57
60
  * @example
58
61
  * await client.inboxes.threads.delete("inbox_id", "thread_id")
59
62
  */
60
- delete(inbox_id: AgentMail.inboxes.InboxId, thread_id: AgentMail.ThreadId, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<void>;
63
+ delete(inbox_id: AgentMail.inboxes.InboxId, thread_id: AgentMail.ThreadId, request?: AgentMail.inboxes.DeleteThreadRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<void>;
61
64
  private __delete;
62
65
  }
@@ -269,8 +269,11 @@ class ThreadsClient {
269
269
  });
270
270
  }
271
271
  /**
272
+ * 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.
273
+ *
272
274
  * @param {AgentMail.inboxes.InboxId} inbox_id
273
275
  * @param {AgentMail.ThreadId} thread_id
276
+ * @param {AgentMail.inboxes.DeleteThreadRequest} request
274
277
  * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
275
278
  *
276
279
  * @throws {@link AgentMail.NotFoundError}
@@ -278,12 +281,16 @@ class ThreadsClient {
278
281
  * @example
279
282
  * await client.inboxes.threads.delete("inbox_id", "thread_id")
280
283
  */
281
- delete(inbox_id, thread_id, requestOptions) {
282
- return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, thread_id, requestOptions));
284
+ delete(inbox_id, thread_id, request = {}, requestOptions) {
285
+ return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, thread_id, request, requestOptions));
283
286
  }
284
- __delete(inbox_id, thread_id, requestOptions) {
285
- return __awaiter(this, void 0, void 0, function* () {
287
+ __delete(inbox_id_1, thread_id_1) {
288
+ return __awaiter(this, arguments, void 0, function* (inbox_id, thread_id, request = {}, requestOptions) {
286
289
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
290
+ const { permanent } = request;
291
+ const _queryParams = {
292
+ permanent,
293
+ };
287
294
  const _authRequest = yield this._options.authProvider.getAuthRequest();
288
295
  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);
289
296
  const _response = yield core.fetcher({
@@ -291,7 +298,7 @@ class ThreadsClient {
291
298
  .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/threads/${core.url.encodePathParam(serializers.ThreadId.jsonOrThrow(thread_id, { omitUndefined: true }))}`),
292
299
  method: "DELETE",
293
300
  headers: _headers,
294
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
301
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
295
302
  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,
296
303
  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,
297
304
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface DeleteThreadRequest {
6
+ /** If true, permanently delete the thread instead of moving to trash. */
7
+ permanent?: boolean;
8
+ }
@@ -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 });
@@ -1 +1,2 @@
1
+ export type { DeleteThreadRequest } from "./DeleteThreadRequest.js";
1
2
  export type { ListThreadsRequest } from "./ListThreadsRequest.js";
@@ -72,7 +72,7 @@ class ThreadsClient {
72
72
  __list() {
73
73
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
74
74
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
75
- const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked } = request;
75
+ const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeTrash } = request;
76
76
  const _queryParams = {
77
77
  limit,
78
78
  page_token: pageToken,
@@ -91,6 +91,7 @@ class ThreadsClient {
91
91
  ascending,
92
92
  include_spam: includeSpam,
93
93
  include_blocked: includeBlocked,
94
+ include_trash: includeTrash,
94
95
  };
95
96
  const _authRequest = yield this._options.authProvider.getAuthRequest();
96
97
  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);
@@ -12,4 +12,5 @@ export interface ListThreadsRequest {
12
12
  ascending?: AgentMail.Ascending;
13
13
  includeSpam?: AgentMail.IncludeSpam;
14
14
  includeBlocked?: AgentMail.IncludeBlocked;
15
+ includeTrash?: AgentMail.IncludeTrash;
15
16
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.4.1";
1
+ export declare const SDK_VERSION = "0.4.2";
@@ -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.1";
4
+ exports.SDK_VERSION = "0.4.2";
@@ -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.1",
10
- "User-Agent": "agentmail/0.4.1",
9
+ "X-Fern-SDK-Version": "0.4.2",
10
+ "User-Agent": "agentmail/0.4.2",
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);
@@ -48,8 +48,11 @@ export declare class ThreadsClient {
48
48
  getAttachment(inbox_id: AgentMail.inboxes.InboxId, thread_id: AgentMail.ThreadId, attachment_id: AgentMail.AttachmentId, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
49
49
  private __getAttachment;
50
50
  /**
51
+ * 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.
52
+ *
51
53
  * @param {AgentMail.inboxes.InboxId} inbox_id
52
54
  * @param {AgentMail.ThreadId} thread_id
55
+ * @param {AgentMail.inboxes.DeleteThreadRequest} request
53
56
  * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
54
57
  *
55
58
  * @throws {@link AgentMail.NotFoundError}
@@ -57,6 +60,6 @@ export declare class ThreadsClient {
57
60
  * @example
58
61
  * await client.inboxes.threads.delete("inbox_id", "thread_id")
59
62
  */
60
- delete(inbox_id: AgentMail.inboxes.InboxId, thread_id: AgentMail.ThreadId, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<void>;
63
+ delete(inbox_id: AgentMail.inboxes.InboxId, thread_id: AgentMail.ThreadId, request?: AgentMail.inboxes.DeleteThreadRequest, requestOptions?: ThreadsClient.RequestOptions): core.HttpResponsePromise<void>;
61
64
  private __delete;
62
65
  }
@@ -233,8 +233,11 @@ export class ThreadsClient {
233
233
  });
234
234
  }
235
235
  /**
236
+ * 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.
237
+ *
236
238
  * @param {AgentMail.inboxes.InboxId} inbox_id
237
239
  * @param {AgentMail.ThreadId} thread_id
240
+ * @param {AgentMail.inboxes.DeleteThreadRequest} request
238
241
  * @param {ThreadsClient.RequestOptions} requestOptions - Request-specific configuration.
239
242
  *
240
243
  * @throws {@link AgentMail.NotFoundError}
@@ -242,12 +245,16 @@ export class ThreadsClient {
242
245
  * @example
243
246
  * await client.inboxes.threads.delete("inbox_id", "thread_id")
244
247
  */
245
- delete(inbox_id, thread_id, requestOptions) {
246
- return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, thread_id, requestOptions));
248
+ delete(inbox_id, thread_id, request = {}, requestOptions) {
249
+ return core.HttpResponsePromise.fromPromise(this.__delete(inbox_id, thread_id, request, requestOptions));
247
250
  }
248
- __delete(inbox_id, thread_id, requestOptions) {
249
- return __awaiter(this, void 0, void 0, function* () {
251
+ __delete(inbox_id_1, thread_id_1) {
252
+ return __awaiter(this, arguments, void 0, function* (inbox_id, thread_id, request = {}, requestOptions) {
250
253
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
254
+ const { permanent } = request;
255
+ const _queryParams = {
256
+ permanent,
257
+ };
251
258
  const _authRequest = yield this._options.authProvider.getAuthRequest();
252
259
  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);
253
260
  const _response = yield core.fetcher({
@@ -255,7 +262,7 @@ export class ThreadsClient {
255
262
  .http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/threads/${core.url.encodePathParam(serializers.ThreadId.jsonOrThrow(thread_id, { omitUndefined: true }))}`),
256
263
  method: "DELETE",
257
264
  headers: _headers,
258
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
265
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
259
266
  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,
260
267
  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,
261
268
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface DeleteThreadRequest {
6
+ /** If true, permanently delete the thread instead of moving to trash. */
7
+ permanent?: boolean;
8
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1 +1,2 @@
1
+ export type { DeleteThreadRequest } from "./DeleteThreadRequest.mjs";
1
2
  export type { ListThreadsRequest } from "./ListThreadsRequest.mjs";
@@ -36,7 +36,7 @@ export class ThreadsClient {
36
36
  __list() {
37
37
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
38
38
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
39
- const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked } = request;
39
+ const { limit, pageToken, labels, before, after, ascending, includeSpam, includeBlocked, includeTrash } = request;
40
40
  const _queryParams = {
41
41
  limit,
42
42
  page_token: pageToken,
@@ -55,6 +55,7 @@ export class ThreadsClient {
55
55
  ascending,
56
56
  include_spam: includeSpam,
57
57
  include_blocked: includeBlocked,
58
+ include_trash: includeTrash,
58
59
  };
59
60
  const _authRequest = yield this._options.authProvider.getAuthRequest();
60
61
  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);
@@ -12,4 +12,5 @@ export interface ListThreadsRequest {
12
12
  ascending?: AgentMail.Ascending;
13
13
  includeSpam?: AgentMail.IncludeSpam;
14
14
  includeBlocked?: AgentMail.IncludeBlocked;
15
+ includeTrash?: AgentMail.IncludeTrash;
15
16
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.4.1";
1
+ export declare const SDK_VERSION = "0.4.2";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.4.1";
1
+ export const SDK_VERSION = "0.4.2";