@remit/api-http-client 0.0.1

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.
package/sdk.gen.ts ADDED
@@ -0,0 +1,485 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import { client } from './client.gen.js';
4
+ import type { Client, Options as Options2, TDataShape } from './client/index.js';
5
+ import type { AccountDetailOperationsDeleteAccountData, AccountDetailOperationsDeleteAccountResponses, AccountDetailOperationsUpdateAccountData, AccountDetailOperationsUpdateAccountResponses, AccountOperationsCreateAccountData, AccountOperationsCreateAccountResponses, AccountOperationsTestConnectionData, AccountOperationsTestConnectionResponses, AddressDetailOperationsUpdateAddressData, AddressDetailOperationsUpdateAddressResponses, AddressOperationsSearchAddressesData, AddressOperationsSearchAddressesResponses, ConfigOperationsGetConfigData, ConfigOperationsGetConfigResponses, FilterDetailOperationsDeleteFilterData, FilterDetailOperationsDeleteFilterResponses, FilterDetailOperationsGetFilterData, FilterDetailOperationsGetFilterResponses, FilterDetailOperationsUpdateFilterData, FilterDetailOperationsUpdateFilterResponses, FilterOperationsCreateFilterData, FilterOperationsCreateFilterResponses, FilterOperationsListFiltersData, FilterOperationsListFiltersResponses, FolderRoleOperationsAppointFolderRoleData, FolderRoleOperationsAppointFolderRoleResponses, MailboxDetailOperationsDeleteMailboxData, MailboxDetailOperationsDeleteMailboxResponses, MailboxDetailOperationsGetMailboxData, MailboxDetailOperationsGetMailboxResponses, MailboxDetailOperationsRenameMailboxData, MailboxDetailOperationsRenameMailboxResponses, MailboxOperationsCreateMailboxData, MailboxOperationsCreateMailboxResponses, MailboxOperationsListMailboxesData, MailboxOperationsListMailboxesResponses, MeOperationsCreateExportData, MeOperationsCreateExportResponses, MeOperationsDeleteMeData, MeOperationsDeleteMeErrors, MeOperationsDeleteMeResponses, MeOperationsGetExportData, MeOperationsGetExportResponses, MeOperationsListVipSuggestionsData, MeOperationsListVipSuggestionsResponses, MessageBulkOperationsCopyMessagesData, MessageBulkOperationsCopyMessagesResponses, MessageBulkOperationsDeleteMessagesData, MessageBulkOperationsDeleteMessagesResponses, MessageBulkOperationsMoveMessagesData, MessageBulkOperationsMoveMessagesResponses, MessageBulkOperationsUpdateFlagsData, MessageBulkOperationsUpdateFlagsResponses, MessageOperationsDescribeMessageData, MessageOperationsDescribeMessageResponses, MessageOperationsGetRawMessageData, MessageOperationsGetRawMessageResponses, MessageOperationsUpdateMessageFlagsData, MessageOperationsUpdateMessageFlagsResponses, MicrosoftOAuthOperationsMicrosoftOAuthCallbackData, MicrosoftOAuthOperationsMicrosoftOAuthStartData, MicrosoftOAuthOperationsMicrosoftOAuthStartResponses, OrganizeJobDetailOperationsGetOrganizeJobData, OrganizeJobDetailOperationsGetOrganizeJobResponses, OrganizeOperationsCreateOrganizeJobData, OrganizeOperationsCreateOrganizeJobResponses, OrganizeOperationsPreviewOrganizeData, OrganizeOperationsPreviewOrganizeResponses, OutboxDetailOperationsDeleteOutboxMessageData, OutboxDetailOperationsDeleteOutboxMessageResponses, OutboxDetailOperationsGetOutboxMessageData, OutboxDetailOperationsGetOutboxMessageResponses, OutboxDetailOperationsSendOutboxMessageData, OutboxDetailOperationsSendOutboxMessageResponses, OutboxDetailOperationsUpdateOutboxMessageData, OutboxDetailOperationsUpdateOutboxMessageResponses, OutboxOperationsCreateOutboxMessageData, OutboxOperationsCreateOutboxMessageResponses, OutboxOperationsListOutboxMessagesData, OutboxOperationsListOutboxMessagesResponses, SemanticSearchOperationsSemanticSearchData, SemanticSearchOperationsSemanticSearchResponses, SyncOperationsGetSyncStatusData, SyncOperationsGetSyncStatusResponses, SyncOperationsTriggerSyncData, SyncOperationsTriggerSyncResponses, ThreadDetailOperationsListThreadMessagesData, ThreadDetailOperationsListThreadMessagesResponses, ThreadOperationsListThreadsData, ThreadOperationsListThreadsResponses, ThreadOperationsSearchThreadsData, ThreadOperationsSearchThreadsResponses, TrashOperationsEmptyTrashData, TrashOperationsEmptyTrashResponses, UnifiedThreadOperationsListAllThreadsData, UnifiedThreadOperationsListAllThreadsResponses } from './types.gen.js';
6
+
7
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
8
+ /**
9
+ * You can provide a client instance returned by `createClient()` instead of
10
+ * individual options. This might be also useful if you want to implement a
11
+ * custom client.
12
+ */
13
+ client?: Client;
14
+ /**
15
+ * You can pass arbitrary values through the `meta` object. This can be
16
+ * used to access values that aren't defined as part of the SDK function.
17
+ */
18
+ meta?: Record<string, unknown>;
19
+ };
20
+
21
+ /**
22
+ * Create a new email account
23
+ */
24
+ export const accountOperationsCreateAccount = <ThrowOnError extends boolean = false>(options: Options<AccountOperationsCreateAccountData, ThrowOnError>) => (options.client ?? client).post<AccountOperationsCreateAccountResponses, unknown, ThrowOnError>({
25
+ security: [{ name: 'Authorization', type: 'apiKey' }],
26
+ url: '/accounts',
27
+ ...options,
28
+ headers: {
29
+ 'Content-Type': 'application/json',
30
+ ...options.headers
31
+ }
32
+ });
33
+
34
+ /**
35
+ * Microsoft OAuth2 callback endpoint — receives the authorization code from Microsoft and exchanges it for tokens. This endpoint is intentionally unauthenticated: the browser is redirected here by Microsoft after the user grants consent, before any Cognito session is available. CSRF is prevented by an HMAC-signed state parameter.
36
+ */
37
+ export const microsoftOAuthOperationsMicrosoftOAuthCallback = <ThrowOnError extends boolean = false>(options?: Options<MicrosoftOAuthOperationsMicrosoftOAuthCallbackData, ThrowOnError>) => (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ url: '/accounts/oauth/microsoft/callback', ...options });
38
+
39
+ /**
40
+ * Start Microsoft OAuth2 authorization flow
41
+ */
42
+ export const microsoftOAuthOperationsMicrosoftOAuthStart = <ThrowOnError extends boolean = false>(options: Options<MicrosoftOAuthOperationsMicrosoftOAuthStartData, ThrowOnError>) => (options.client ?? client).post<MicrosoftOAuthOperationsMicrosoftOAuthStartResponses, unknown, ThrowOnError>({
43
+ security: [{ name: 'Authorization', type: 'apiKey' }],
44
+ url: '/accounts/oauth/microsoft/start',
45
+ ...options,
46
+ headers: {
47
+ 'Content-Type': 'application/json',
48
+ ...options.headers
49
+ }
50
+ });
51
+
52
+ /**
53
+ * Test IMAP/SMTP connection without saving
54
+ */
55
+ export const accountOperationsTestConnection = <ThrowOnError extends boolean = false>(options: Options<AccountOperationsTestConnectionData, ThrowOnError>) => (options.client ?? client).post<AccountOperationsTestConnectionResponses, unknown, ThrowOnError>({
56
+ security: [{ name: 'Authorization', type: 'apiKey' }],
57
+ url: '/accounts/test-connection',
58
+ ...options,
59
+ headers: {
60
+ 'Content-Type': 'application/json',
61
+ ...options.headers
62
+ }
63
+ });
64
+
65
+ /**
66
+ * Delete an account and all associated data
67
+ */
68
+ export const accountDetailOperationsDeleteAccount = <ThrowOnError extends boolean = false>(options: Options<AccountDetailOperationsDeleteAccountData, ThrowOnError>) => (options.client ?? client).delete<AccountDetailOperationsDeleteAccountResponses, unknown, ThrowOnError>({
69
+ security: [{ name: 'Authorization', type: 'apiKey' }],
70
+ url: '/accounts/{accountId}',
71
+ ...options
72
+ });
73
+
74
+ /**
75
+ * Update an existing account
76
+ */
77
+ export const accountDetailOperationsUpdateAccount = <ThrowOnError extends boolean = false>(options: Options<AccountDetailOperationsUpdateAccountData, ThrowOnError>) => (options.client ?? client).patch<AccountDetailOperationsUpdateAccountResponses, unknown, ThrowOnError>({
78
+ security: [{ name: 'Authorization', type: 'apiKey' }],
79
+ url: '/accounts/{accountId}',
80
+ ...options,
81
+ headers: {
82
+ 'Content-Type': 'application/json',
83
+ ...options.headers
84
+ }
85
+ });
86
+
87
+ export const filterOperationsListFilters = <ThrowOnError extends boolean = false>(options: Options<FilterOperationsListFiltersData, ThrowOnError>) => (options.client ?? client).get<FilterOperationsListFiltersResponses, unknown, ThrowOnError>({
88
+ security: [{ name: 'Authorization', type: 'apiKey' }],
89
+ url: '/accounts/{accountId}/filters',
90
+ ...options
91
+ });
92
+
93
+ export const filterOperationsCreateFilter = <ThrowOnError extends boolean = false>(options: Options<FilterOperationsCreateFilterData, ThrowOnError>) => (options.client ?? client).post<FilterOperationsCreateFilterResponses, unknown, ThrowOnError>({
94
+ security: [{ name: 'Authorization', type: 'apiKey' }],
95
+ url: '/accounts/{accountId}/filters',
96
+ ...options,
97
+ headers: {
98
+ 'Content-Type': 'application/json',
99
+ ...options.headers
100
+ }
101
+ });
102
+
103
+ export const filterDetailOperationsDeleteFilter = <ThrowOnError extends boolean = false>(options: Options<FilterDetailOperationsDeleteFilterData, ThrowOnError>) => (options.client ?? client).delete<FilterDetailOperationsDeleteFilterResponses, unknown, ThrowOnError>({
104
+ security: [{ name: 'Authorization', type: 'apiKey' }],
105
+ url: '/accounts/{accountId}/filters/{filterId}',
106
+ ...options
107
+ });
108
+
109
+ export const filterDetailOperationsGetFilter = <ThrowOnError extends boolean = false>(options: Options<FilterDetailOperationsGetFilterData, ThrowOnError>) => (options.client ?? client).get<FilterDetailOperationsGetFilterResponses, unknown, ThrowOnError>({
110
+ security: [{ name: 'Authorization', type: 'apiKey' }],
111
+ url: '/accounts/{accountId}/filters/{filterId}',
112
+ ...options
113
+ });
114
+
115
+ export const filterDetailOperationsUpdateFilter = <ThrowOnError extends boolean = false>(options: Options<FilterDetailOperationsUpdateFilterData, ThrowOnError>) => (options.client ?? client).patch<FilterDetailOperationsUpdateFilterResponses, unknown, ThrowOnError>({
116
+ security: [{ name: 'Authorization', type: 'apiKey' }],
117
+ url: '/accounts/{accountId}/filters/{filterId}',
118
+ ...options,
119
+ headers: {
120
+ 'Content-Type': 'application/json',
121
+ ...options.headers
122
+ }
123
+ });
124
+
125
+ /**
126
+ * Appoint a canonical role to a mailbox, or clear it. Exclusive by construction: the role always resolves to exactly one mailbox, so appointing a new one silently replaces whichever mailbox previously held it — there is no second place a duplicate appointment could live. Returns the account with its refreshed folderAppointments.
127
+ */
128
+ export const folderRoleOperationsAppointFolderRole = <ThrowOnError extends boolean = false>(options: Options<FolderRoleOperationsAppointFolderRoleData, ThrowOnError>) => (options.client ?? client).put<FolderRoleOperationsAppointFolderRoleResponses, unknown, ThrowOnError>({
129
+ security: [{ name: 'Authorization', type: 'apiKey' }],
130
+ url: '/accounts/{accountId}/folder-roles/{role}',
131
+ ...options,
132
+ headers: {
133
+ 'Content-Type': 'application/json',
134
+ ...options.headers
135
+ }
136
+ });
137
+
138
+ export const mailboxOperationsListMailboxes = <ThrowOnError extends boolean = false>(options: Options<MailboxOperationsListMailboxesData, ThrowOnError>) => (options.client ?? client).get<MailboxOperationsListMailboxesResponses, unknown, ThrowOnError>({
139
+ security: [{ name: 'Authorization', type: 'apiKey' }],
140
+ url: '/accounts/{accountId}/mailboxes',
141
+ ...options
142
+ });
143
+
144
+ export const mailboxOperationsCreateMailbox = <ThrowOnError extends boolean = false>(options: Options<MailboxOperationsCreateMailboxData, ThrowOnError>) => (options.client ?? client).post<MailboxOperationsCreateMailboxResponses, unknown, ThrowOnError>({
145
+ security: [{ name: 'Authorization', type: 'apiKey' }],
146
+ url: '/accounts/{accountId}/mailboxes',
147
+ ...options,
148
+ headers: {
149
+ 'Content-Type': 'application/json',
150
+ ...options.headers
151
+ }
152
+ });
153
+
154
+ export const mailboxDetailOperationsDeleteMailbox = <ThrowOnError extends boolean = false>(options: Options<MailboxDetailOperationsDeleteMailboxData, ThrowOnError>) => (options.client ?? client).delete<MailboxDetailOperationsDeleteMailboxResponses, unknown, ThrowOnError>({
155
+ security: [{ name: 'Authorization', type: 'apiKey' }],
156
+ url: '/accounts/{accountId}/mailboxes/{mailboxId}',
157
+ ...options
158
+ });
159
+
160
+ export const mailboxDetailOperationsGetMailbox = <ThrowOnError extends boolean = false>(options: Options<MailboxDetailOperationsGetMailboxData, ThrowOnError>) => (options.client ?? client).get<MailboxDetailOperationsGetMailboxResponses, unknown, ThrowOnError>({
161
+ security: [{ name: 'Authorization', type: 'apiKey' }],
162
+ url: '/accounts/{accountId}/mailboxes/{mailboxId}',
163
+ ...options
164
+ });
165
+
166
+ export const mailboxDetailOperationsRenameMailbox = <ThrowOnError extends boolean = false>(options: Options<MailboxDetailOperationsRenameMailboxData, ThrowOnError>) => (options.client ?? client).patch<MailboxDetailOperationsRenameMailboxResponses, unknown, ThrowOnError>({
167
+ security: [{ name: 'Authorization', type: 'apiKey' }],
168
+ url: '/accounts/{accountId}/mailboxes/{mailboxId}',
169
+ ...options,
170
+ headers: {
171
+ 'Content-Type': 'application/json',
172
+ ...options.headers
173
+ }
174
+ });
175
+
176
+ /**
177
+ * Start a one-time "all like these" back-apply: match the corpus against the given predicate and apply the action to every match, in one pass. Returns immediately with an organizeJobId; poll GET /accounts/{accountId}/organize/{organizeJobId} for state and counts. Never creates a Filter or FilterAnchor row (RFC 034 recap).
178
+ */
179
+ export const organizeOperationsCreateOrganizeJob = <ThrowOnError extends boolean = false>(options: Options<OrganizeOperationsCreateOrganizeJobData, ThrowOnError>) => (options.client ?? client).post<OrganizeOperationsCreateOrganizeJobResponses, unknown, ThrowOnError>({
180
+ security: [{ name: 'Authorization', type: 'apiKey' }],
181
+ url: '/accounts/{accountId}/organize',
182
+ ...options,
183
+ headers: {
184
+ 'Content-Type': 'application/json',
185
+ ...options.headers
186
+ }
187
+ });
188
+
189
+ /**
190
+ * Preview an "all like these" back-apply: run the exact same matcher read-only and return the messages the action would be applied to, without applying it. The previewed set equals the set a job with the same input would apply to.
191
+ */
192
+ export const organizeOperationsPreviewOrganize = <ThrowOnError extends boolean = false>(options: Options<OrganizeOperationsPreviewOrganizeData, ThrowOnError>) => (options.client ?? client).post<OrganizeOperationsPreviewOrganizeResponses, unknown, ThrowOnError>({
193
+ security: [{ name: 'Authorization', type: 'apiKey' }],
194
+ url: '/accounts/{accountId}/organize/preview',
195
+ ...options,
196
+ headers: {
197
+ 'Content-Type': 'application/json',
198
+ ...options.headers
199
+ }
200
+ });
201
+
202
+ /**
203
+ * Get the status of a back-apply job, including matched/applied/failed counts. Terminal states are Complete and Failed.
204
+ */
205
+ export const organizeJobDetailOperationsGetOrganizeJob = <ThrowOnError extends boolean = false>(options: Options<OrganizeJobDetailOperationsGetOrganizeJobData, ThrowOnError>) => (options.client ?? client).get<OrganizeJobDetailOperationsGetOrganizeJobResponses, unknown, ThrowOnError>({
206
+ security: [{ name: 'Authorization', type: 'apiKey' }],
207
+ url: '/accounts/{accountId}/organize/{organizeJobId}',
208
+ ...options
209
+ });
210
+
211
+ export const syncOperationsTriggerSync = <ThrowOnError extends boolean = false>(options: Options<SyncOperationsTriggerSyncData, ThrowOnError>) => (options.client ?? client).post<SyncOperationsTriggerSyncResponses, unknown, ThrowOnError>({
212
+ security: [{ name: 'Authorization', type: 'apiKey' }],
213
+ url: '/accounts/{accountId}/sync',
214
+ ...options
215
+ });
216
+
217
+ /**
218
+ * Get the current sync status for an account, including per-mailbox progress computed from watermarks. Read-only — does not write or contend with the mailbox sync lock (RFC 023).
219
+ */
220
+ export const syncOperationsGetSyncStatus = <ThrowOnError extends boolean = false>(options: Options<SyncOperationsGetSyncStatusData, ThrowOnError>) => (options.client ?? client).get<SyncOperationsGetSyncStatusResponses, unknown, ThrowOnError>({
221
+ security: [{ name: 'Authorization', type: 'apiKey' }],
222
+ url: '/accounts/{accountId}/sync/status',
223
+ ...options
224
+ });
225
+
226
+ /**
227
+ * Permanently delete all messages in the Trash mailbox
228
+ */
229
+ export const trashOperationsEmptyTrash = <ThrowOnError extends boolean = false>(options: Options<TrashOperationsEmptyTrashData, ThrowOnError>) => (options.client ?? client).post<TrashOperationsEmptyTrashResponses, unknown, ThrowOnError>({
230
+ security: [{ name: 'Authorization', type: 'apiKey' }],
231
+ url: '/accounts/{accountId}/trash/empty',
232
+ ...options
233
+ });
234
+
235
+ /**
236
+ * Search addresses for autocomplete
237
+ */
238
+ export const addressOperationsSearchAddresses = <ThrowOnError extends boolean = false>(options: Options<AddressOperationsSearchAddressesData, ThrowOnError>) => (options.client ?? client).get<AddressOperationsSearchAddressesResponses, unknown, ThrowOnError>({
239
+ security: [{ name: 'Authorization', type: 'apiKey' }],
240
+ url: '/addresses/search',
241
+ ...options
242
+ });
243
+
244
+ /**
245
+ * Update an address (currently: per-sender flags). Pass `flags: { <name>: null }` to remove a flag. Other flags are untouched.
246
+ */
247
+ export const addressDetailOperationsUpdateAddress = <ThrowOnError extends boolean = false>(options: Options<AddressDetailOperationsUpdateAddressData, ThrowOnError>) => (options.client ?? client).patch<AddressDetailOperationsUpdateAddressResponses, unknown, ThrowOnError>({
248
+ security: [{ name: 'Authorization', type: 'apiKey' }],
249
+ url: '/addresses/{addressId}',
250
+ ...options,
251
+ headers: {
252
+ 'Content-Type': 'application/json',
253
+ ...options.headers
254
+ }
255
+ });
256
+
257
+ /**
258
+ * Get the current user's configuration including accounts and addresses
259
+ */
260
+ export const configOperationsGetConfig = <ThrowOnError extends boolean = false>(options?: Options<ConfigOperationsGetConfigData, ThrowOnError>) => (options?.client ?? client).get<ConfigOperationsGetConfigResponses, unknown, ThrowOnError>({
261
+ security: [{ name: 'Authorization', type: 'apiKey' }],
262
+ url: '/config',
263
+ ...options
264
+ });
265
+
266
+ export const threadOperationsListThreads = <ThrowOnError extends boolean = false>(options: Options<ThreadOperationsListThreadsData, ThrowOnError>) => (options.client ?? client).get<ThreadOperationsListThreadsResponses, unknown, ThrowOnError>({
267
+ security: [{ name: 'Authorization', type: 'apiKey' }],
268
+ url: '/mailboxes/{mailboxId}/threads',
269
+ ...options
270
+ });
271
+
272
+ export const threadOperationsSearchThreads = <ThrowOnError extends boolean = false>(options: Options<ThreadOperationsSearchThreadsData, ThrowOnError>) => (options.client ?? client).get<ThreadOperationsSearchThreadsResponses, unknown, ThrowOnError>({
273
+ security: [{ name: 'Authorization', type: 'apiKey' }],
274
+ url: '/mailboxes/{mailboxId}/threads/search',
275
+ ...options
276
+ });
277
+
278
+ /**
279
+ * Request full erasure of the current user's account and all associated data
280
+ */
281
+ export const meOperationsDeleteMe = <ThrowOnError extends boolean = false>(options: Options<MeOperationsDeleteMeData, ThrowOnError>) => (options.client ?? client).delete<MeOperationsDeleteMeResponses, MeOperationsDeleteMeErrors, ThrowOnError>({
282
+ security: [{ name: 'Authorization', type: 'apiKey' }],
283
+ url: '/me',
284
+ ...options,
285
+ headers: {
286
+ 'Content-Type': 'application/json',
287
+ ...options.headers
288
+ }
289
+ });
290
+
291
+ /**
292
+ * Request an export of all account data as a ZIP archive of .eml files. Returns immediately with an exportId; check GET /me/export/{exportId} for status and downloadUrl.
293
+ */
294
+ export const meOperationsCreateExport = <ThrowOnError extends boolean = false>(options?: Options<MeOperationsCreateExportData, ThrowOnError>) => (options?.client ?? client).post<MeOperationsCreateExportResponses, unknown, ThrowOnError>({
295
+ security: [{ name: 'Authorization', type: 'apiKey' }],
296
+ url: '/me/export',
297
+ ...options
298
+ });
299
+
300
+ /**
301
+ * Get the status of a previously requested data export. When state is Ready, downloadUrl holds a 30-day presigned S3 URL.
302
+ */
303
+ export const meOperationsGetExport = <ThrowOnError extends boolean = false>(options: Options<MeOperationsGetExportData, ThrowOnError>) => (options.client ?? client).get<MeOperationsGetExportResponses, unknown, ThrowOnError>({
304
+ security: [{ name: 'Authorization', type: 'apiKey' }],
305
+ url: '/me/export/{exportId}',
306
+ ...options
307
+ });
308
+
309
+ /**
310
+ * List wellknown senders the user has not yet promoted to VIP. Ranked by `replyCount + inboundCount` desc with `lastInboundAt` desc as the tie-breaker. Capped at 10.
311
+ */
312
+ export const meOperationsListVipSuggestions = <ThrowOnError extends boolean = false>(options?: Options<MeOperationsListVipSuggestionsData, ThrowOnError>) => (options?.client ?? client).get<MeOperationsListVipSuggestionsResponses, unknown, ThrowOnError>({
313
+ security: [{ name: 'Authorization', type: 'apiKey' }],
314
+ url: '/me/vip-suggestions',
315
+ ...options
316
+ });
317
+
318
+ /**
319
+ * Copy messages to a destination mailbox
320
+ */
321
+ export const messageBulkOperationsCopyMessages = <ThrowOnError extends boolean = false>(options: Options<MessageBulkOperationsCopyMessagesData, ThrowOnError>) => (options.client ?? client).post<MessageBulkOperationsCopyMessagesResponses, unknown, ThrowOnError>({
322
+ security: [{ name: 'Authorization', type: 'apiKey' }],
323
+ url: '/messages/copy',
324
+ ...options,
325
+ headers: {
326
+ 'Content-Type': 'application/json',
327
+ ...options.headers
328
+ }
329
+ });
330
+
331
+ /**
332
+ * Delete messages (move to Trash or permanent delete)
333
+ */
334
+ export const messageBulkOperationsDeleteMessages = <ThrowOnError extends boolean = false>(options: Options<MessageBulkOperationsDeleteMessagesData, ThrowOnError>) => (options.client ?? client).post<MessageBulkOperationsDeleteMessagesResponses, unknown, ThrowOnError>({
335
+ security: [{ name: 'Authorization', type: 'apiKey' }],
336
+ url: '/messages/delete',
337
+ ...options,
338
+ headers: {
339
+ 'Content-Type': 'application/json',
340
+ ...options.headers
341
+ }
342
+ });
343
+
344
+ /**
345
+ * Update flags on multiple messages
346
+ */
347
+ export const messageBulkOperationsUpdateFlags = <ThrowOnError extends boolean = false>(options: Options<MessageBulkOperationsUpdateFlagsData, ThrowOnError>) => (options.client ?? client).post<MessageBulkOperationsUpdateFlagsResponses, unknown, ThrowOnError>({
348
+ security: [{ name: 'Authorization', type: 'apiKey' }],
349
+ url: '/messages/flags',
350
+ ...options,
351
+ headers: {
352
+ 'Content-Type': 'application/json',
353
+ ...options.headers
354
+ }
355
+ });
356
+
357
+ export const messageBulkOperationsMoveMessages = <ThrowOnError extends boolean = false>(options: Options<MessageBulkOperationsMoveMessagesData, ThrowOnError>) => (options.client ?? client).post<MessageBulkOperationsMoveMessagesResponses, unknown, ThrowOnError>({
358
+ security: [{ name: 'Authorization', type: 'apiKey' }],
359
+ url: '/messages/move',
360
+ ...options,
361
+ headers: {
362
+ 'Content-Type': 'application/json',
363
+ ...options.headers
364
+ }
365
+ });
366
+
367
+ export const messageOperationsDescribeMessage = <ThrowOnError extends boolean = false>(options: Options<MessageOperationsDescribeMessageData, ThrowOnError>) => (options.client ?? client).get<MessageOperationsDescribeMessageResponses, unknown, ThrowOnError>({
368
+ security: [{ name: 'Authorization', type: 'apiKey' }],
369
+ url: '/messages/{messageId}',
370
+ ...options
371
+ });
372
+
373
+ export const messageOperationsUpdateMessageFlags = <ThrowOnError extends boolean = false>(options: Options<MessageOperationsUpdateMessageFlagsData, ThrowOnError>) => (options.client ?? client).patch<MessageOperationsUpdateMessageFlagsResponses, unknown, ThrowOnError>({
374
+ security: [{ name: 'Authorization', type: 'apiKey' }],
375
+ url: '/messages/{messageId}/flags',
376
+ ...options,
377
+ headers: {
378
+ 'Content-Type': 'application/json',
379
+ ...options.headers
380
+ }
381
+ });
382
+
383
+ /**
384
+ * Get the raw RFC822/MIME source of a message (headers and body) for inspection.
385
+ */
386
+ export const messageOperationsGetRawMessage = <ThrowOnError extends boolean = false>(options: Options<MessageOperationsGetRawMessageData, ThrowOnError>) => (options.client ?? client).get<MessageOperationsGetRawMessageResponses, unknown, ThrowOnError>({
387
+ security: [{ name: 'Authorization', type: 'apiKey' }],
388
+ url: '/messages/{messageId}/raw',
389
+ ...options
390
+ });
391
+
392
+ /**
393
+ * List outbox messages for the current account
394
+ */
395
+ export const outboxOperationsListOutboxMessages = <ThrowOnError extends boolean = false>(options?: Options<OutboxOperationsListOutboxMessagesData, ThrowOnError>) => (options?.client ?? client).get<OutboxOperationsListOutboxMessagesResponses, unknown, ThrowOnError>({
396
+ security: [{ name: 'Authorization', type: 'apiKey' }],
397
+ url: '/outbox',
398
+ ...options
399
+ });
400
+
401
+ /**
402
+ * Create a new outbox message (draft or send immediately)
403
+ */
404
+ export const outboxOperationsCreateOutboxMessage = <ThrowOnError extends boolean = false>(options: Options<OutboxOperationsCreateOutboxMessageData, ThrowOnError>) => (options.client ?? client).post<OutboxOperationsCreateOutboxMessageResponses, unknown, ThrowOnError>({
405
+ security: [{ name: 'Authorization', type: 'apiKey' }],
406
+ url: '/outbox',
407
+ ...options,
408
+ headers: {
409
+ 'Content-Type': 'application/json',
410
+ ...options.headers
411
+ }
412
+ });
413
+
414
+ /**
415
+ * Delete a draft or failed outbox message
416
+ */
417
+ export const outboxDetailOperationsDeleteOutboxMessage = <ThrowOnError extends boolean = false>(options: Options<OutboxDetailOperationsDeleteOutboxMessageData, ThrowOnError>) => (options.client ?? client).delete<OutboxDetailOperationsDeleteOutboxMessageResponses, unknown, ThrowOnError>({
418
+ security: [{ name: 'Authorization', type: 'apiKey' }],
419
+ url: '/outbox/{outboxMessageId}',
420
+ ...options
421
+ });
422
+
423
+ /**
424
+ * Get an outbox message by ID
425
+ */
426
+ export const outboxDetailOperationsGetOutboxMessage = <ThrowOnError extends boolean = false>(options: Options<OutboxDetailOperationsGetOutboxMessageData, ThrowOnError>) => (options.client ?? client).get<OutboxDetailOperationsGetOutboxMessageResponses, unknown, ThrowOnError>({
427
+ security: [{ name: 'Authorization', type: 'apiKey' }],
428
+ url: '/outbox/{outboxMessageId}',
429
+ ...options
430
+ });
431
+
432
+ /**
433
+ * Update a draft outbox message
434
+ */
435
+ export const outboxDetailOperationsUpdateOutboxMessage = <ThrowOnError extends boolean = false>(options: Options<OutboxDetailOperationsUpdateOutboxMessageData, ThrowOnError>) => (options.client ?? client).patch<OutboxDetailOperationsUpdateOutboxMessageResponses, unknown, ThrowOnError>({
436
+ security: [{ name: 'Authorization', type: 'apiKey' }],
437
+ url: '/outbox/{outboxMessageId}',
438
+ ...options,
439
+ headers: {
440
+ 'Content-Type': 'application/json',
441
+ ...options.headers
442
+ }
443
+ });
444
+
445
+ /**
446
+ * Queue a draft message for sending
447
+ */
448
+ export const outboxDetailOperationsSendOutboxMessage = <ThrowOnError extends boolean = false>(options: Options<OutboxDetailOperationsSendOutboxMessageData, ThrowOnError>) => (options.client ?? client).post<OutboxDetailOperationsSendOutboxMessageResponses, unknown, ThrowOnError>({
449
+ security: [{ name: 'Authorization', type: 'apiKey' }],
450
+ url: '/outbox/{outboxMessageId}/send',
451
+ ...options
452
+ });
453
+
454
+ /**
455
+ * Run a semantic vector search across the caller's indexed messages.
456
+ */
457
+ export const semanticSearchOperationsSemanticSearch = <ThrowOnError extends boolean = false>(options: Options<SemanticSearchOperationsSemanticSearchData, ThrowOnError>) => (options.client ?? client).get<SemanticSearchOperationsSemanticSearchResponses, unknown, ThrowOnError>({
458
+ security: [{ name: 'Authorization', type: 'apiKey' }],
459
+ url: '/search/semantic',
460
+ ...options
461
+ });
462
+
463
+ /**
464
+ * List threads across all non-muted accounts of the caller, ordered by sentDate desc. Each row carries an attached `accountId` (derived from a mailboxId→accountId map at read time) plus the usual `senderTrust`/`category` enrichment. Served by the `byDate` LSI1 (pk = the caller's account config), so the caller can never see another account config's threads.
465
+ *
466
+ * INBOX scope: results are filtered to each account's top-level INBOX, matched by exact path `fullPath === "INBOX"` (RFC 6154 defines no Inbox special-use). By design this excludes namespaced sub-paths like `INBOX/Receipts` and non-English server primaries — the unified inbox is each account's primary INBOX, not its sub-folders. Soft-deleted rows are also excluded.
467
+ *
468
+ * Mute exclusion: muted accounts and muted mailboxes are excluded. The inbox/mute filter set is rebuilt per page from live state, so muting/unmuting a mailbox mid-pagination takes effect on the next page (never retroactively).
469
+ *
470
+ * Pagination: pass the returned `continuationToken` to fetch the next page; keep paging until it is absent. The INBOX/deleted filter is applied after the index read with a bounded read window per request, so a page may return FEWER than `limit` rows while still carrying a `continuationToken` — treat the presence of the token (not a full page) as the "more results" signal. No rows are skipped or duplicated across pages.
471
+ */
472
+ export const unifiedThreadOperationsListAllThreads = <ThrowOnError extends boolean = false>(options?: Options<UnifiedThreadOperationsListAllThreadsData, ThrowOnError>) => (options?.client ?? client).get<UnifiedThreadOperationsListAllThreadsResponses, unknown, ThrowOnError>({
473
+ security: [{ name: 'Authorization', type: 'apiKey' }],
474
+ url: '/threads',
475
+ ...options
476
+ });
477
+
478
+ /**
479
+ * Get all messages in a thread. Optionally filter by mailboxId to deduplicate when messages exist in multiple mailboxes.
480
+ */
481
+ export const threadDetailOperationsListThreadMessages = <ThrowOnError extends boolean = false>(options: Options<ThreadDetailOperationsListThreadMessagesData, ThrowOnError>) => (options.client ?? client).get<ThreadDetailOperationsListThreadMessagesResponses, unknown, ThrowOnError>({
482
+ security: [{ name: 'Authorization', type: 'apiKey' }],
483
+ url: '/threads/{threadId}/messages',
484
+ ...options
485
+ });