@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.
@@ -0,0 +1,834 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import { type DefaultError, queryOptions, type UseMutationOptions } from '@tanstack/react-query';
4
+
5
+ import { client } from '../client.gen.js';
6
+ import { accountDetailOperationsDeleteAccount, accountDetailOperationsUpdateAccount, accountOperationsCreateAccount, accountOperationsTestConnection, addressDetailOperationsUpdateAddress, addressOperationsSearchAddresses, configOperationsGetConfig, filterDetailOperationsDeleteFilter, filterDetailOperationsGetFilter, filterDetailOperationsUpdateFilter, filterOperationsCreateFilter, filterOperationsListFilters, folderRoleOperationsAppointFolderRole, mailboxDetailOperationsDeleteMailbox, mailboxDetailOperationsGetMailbox, mailboxDetailOperationsRenameMailbox, mailboxOperationsCreateMailbox, mailboxOperationsListMailboxes, meOperationsCreateExport, meOperationsDeleteMe, meOperationsGetExport, meOperationsListVipSuggestions, messageBulkOperationsCopyMessages, messageBulkOperationsDeleteMessages, messageBulkOperationsMoveMessages, messageBulkOperationsUpdateFlags, messageOperationsDescribeMessage, messageOperationsGetRawMessage, messageOperationsUpdateMessageFlags, microsoftOAuthOperationsMicrosoftOAuthCallback, microsoftOAuthOperationsMicrosoftOAuthStart, type Options, organizeJobDetailOperationsGetOrganizeJob, organizeOperationsCreateOrganizeJob, organizeOperationsPreviewOrganize, outboxDetailOperationsDeleteOutboxMessage, outboxDetailOperationsGetOutboxMessage, outboxDetailOperationsSendOutboxMessage, outboxDetailOperationsUpdateOutboxMessage, outboxOperationsCreateOutboxMessage, outboxOperationsListOutboxMessages, semanticSearchOperationsSemanticSearch, syncOperationsGetSyncStatus, syncOperationsTriggerSync, threadDetailOperationsListThreadMessages, threadOperationsListThreads, threadOperationsSearchThreads, trashOperationsEmptyTrash, unifiedThreadOperationsListAllThreads } from '../sdk.gen.js';
7
+ import type { AccountDetailOperationsDeleteAccountData, AccountDetailOperationsDeleteAccountResponse, AccountDetailOperationsUpdateAccountData, AccountDetailOperationsUpdateAccountResponse, AccountOperationsCreateAccountData, AccountOperationsCreateAccountResponse, AccountOperationsTestConnectionData, AccountOperationsTestConnectionResponse, AddressDetailOperationsUpdateAddressData, AddressDetailOperationsUpdateAddressResponse, AddressOperationsSearchAddressesData, AddressOperationsSearchAddressesResponse, ConfigOperationsGetConfigData, ConfigOperationsGetConfigResponse, FilterDetailOperationsDeleteFilterData, FilterDetailOperationsDeleteFilterResponse, FilterDetailOperationsGetFilterData, FilterDetailOperationsGetFilterResponse, FilterDetailOperationsUpdateFilterData, FilterDetailOperationsUpdateFilterResponse, FilterOperationsCreateFilterData, FilterOperationsCreateFilterResponse, FilterOperationsListFiltersData, FilterOperationsListFiltersResponse, FolderRoleOperationsAppointFolderRoleData, FolderRoleOperationsAppointFolderRoleResponse, MailboxDetailOperationsDeleteMailboxData, MailboxDetailOperationsDeleteMailboxResponse, MailboxDetailOperationsGetMailboxData, MailboxDetailOperationsGetMailboxResponse, MailboxDetailOperationsRenameMailboxData, MailboxDetailOperationsRenameMailboxResponse, MailboxOperationsCreateMailboxData, MailboxOperationsCreateMailboxResponse, MailboxOperationsListMailboxesData, MailboxOperationsListMailboxesResponse, MeOperationsCreateExportData, MeOperationsCreateExportResponse, MeOperationsDeleteMeData, MeOperationsDeleteMeError, MeOperationsDeleteMeResponse, MeOperationsGetExportData, MeOperationsGetExportResponse, MeOperationsListVipSuggestionsData, MeOperationsListVipSuggestionsResponse, MessageBulkOperationsCopyMessagesData, MessageBulkOperationsCopyMessagesResponse, MessageBulkOperationsDeleteMessagesData, MessageBulkOperationsDeleteMessagesResponse, MessageBulkOperationsMoveMessagesData, MessageBulkOperationsMoveMessagesResponse, MessageBulkOperationsUpdateFlagsData, MessageBulkOperationsUpdateFlagsResponse, MessageOperationsDescribeMessageData, MessageOperationsDescribeMessageResponse, MessageOperationsGetRawMessageData, MessageOperationsGetRawMessageResponse, MessageOperationsUpdateMessageFlagsData, MessageOperationsUpdateMessageFlagsResponse, MicrosoftOAuthOperationsMicrosoftOAuthCallbackData, MicrosoftOAuthOperationsMicrosoftOAuthStartData, MicrosoftOAuthOperationsMicrosoftOAuthStartResponse, OrganizeJobDetailOperationsGetOrganizeJobData, OrganizeJobDetailOperationsGetOrganizeJobResponse, OrganizeOperationsCreateOrganizeJobData, OrganizeOperationsCreateOrganizeJobResponse, OrganizeOperationsPreviewOrganizeData, OrganizeOperationsPreviewOrganizeResponse, OutboxDetailOperationsDeleteOutboxMessageData, OutboxDetailOperationsDeleteOutboxMessageResponse, OutboxDetailOperationsGetOutboxMessageData, OutboxDetailOperationsGetOutboxMessageResponse, OutboxDetailOperationsSendOutboxMessageData, OutboxDetailOperationsSendOutboxMessageResponse, OutboxDetailOperationsUpdateOutboxMessageData, OutboxDetailOperationsUpdateOutboxMessageResponse, OutboxOperationsCreateOutboxMessageData, OutboxOperationsCreateOutboxMessageResponse, OutboxOperationsListOutboxMessagesData, OutboxOperationsListOutboxMessagesResponse, SemanticSearchOperationsSemanticSearchData, SemanticSearchOperationsSemanticSearchResponse, SyncOperationsGetSyncStatusData, SyncOperationsGetSyncStatusResponse, SyncOperationsTriggerSyncData, SyncOperationsTriggerSyncResponse, ThreadDetailOperationsListThreadMessagesData, ThreadDetailOperationsListThreadMessagesResponse, ThreadOperationsListThreadsData, ThreadOperationsListThreadsResponse, ThreadOperationsSearchThreadsData, ThreadOperationsSearchThreadsResponse, TrashOperationsEmptyTrashData, TrashOperationsEmptyTrashResponse, UnifiedThreadOperationsListAllThreadsData, UnifiedThreadOperationsListAllThreadsResponse } from '../types.gen.js';
8
+
9
+ /**
10
+ * Create a new email account
11
+ */
12
+ export const accountOperationsCreateAccountMutation = (options?: Partial<Options<AccountOperationsCreateAccountData>>): UseMutationOptions<AccountOperationsCreateAccountResponse, DefaultError, Options<AccountOperationsCreateAccountData>> => {
13
+ const mutationOptions: UseMutationOptions<AccountOperationsCreateAccountResponse, DefaultError, Options<AccountOperationsCreateAccountData>> = {
14
+ mutationFn: async (fnOptions) => {
15
+ const { data } = await accountOperationsCreateAccount({
16
+ ...options,
17
+ ...fnOptions,
18
+ throwOnError: true
19
+ });
20
+ return data;
21
+ }
22
+ };
23
+ return mutationOptions;
24
+ };
25
+
26
+ export type QueryKey<TOptions extends Options> = [
27
+ Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
28
+ _id: string;
29
+ _infinite?: boolean;
30
+ tags?: ReadonlyArray<string>;
31
+ }
32
+ ];
33
+
34
+ const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray<string>): [
35
+ QueryKey<TOptions>[0]
36
+ ] => {
37
+ const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0];
38
+ if (infinite) {
39
+ params._infinite = infinite;
40
+ }
41
+ if (tags) {
42
+ params.tags = tags;
43
+ }
44
+ if (options?.body) {
45
+ params.body = options.body;
46
+ }
47
+ if (options?.headers) {
48
+ params.headers = options.headers;
49
+ }
50
+ if (options?.path) {
51
+ params.path = options.path;
52
+ }
53
+ if (options?.query) {
54
+ params.query = options.query;
55
+ }
56
+ return [params];
57
+ };
58
+
59
+ export const microsoftOAuthOperationsMicrosoftOAuthCallbackQueryKey = (options?: Options<MicrosoftOAuthOperationsMicrosoftOAuthCallbackData>) => createQueryKey('microsoftOAuthOperationsMicrosoftOAuthCallback', options);
60
+
61
+ /**
62
+ * 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.
63
+ */
64
+ export const microsoftOAuthOperationsMicrosoftOAuthCallbackOptions = (options?: Options<MicrosoftOAuthOperationsMicrosoftOAuthCallbackData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof microsoftOAuthOperationsMicrosoftOAuthCallbackQueryKey>>({
65
+ queryFn: async ({ queryKey, signal }) => {
66
+ const { data } = await microsoftOAuthOperationsMicrosoftOAuthCallback({
67
+ ...options,
68
+ ...queryKey[0],
69
+ signal,
70
+ throwOnError: true
71
+ });
72
+ return data;
73
+ },
74
+ queryKey: microsoftOAuthOperationsMicrosoftOAuthCallbackQueryKey(options)
75
+ });
76
+
77
+ /**
78
+ * Start Microsoft OAuth2 authorization flow
79
+ */
80
+ export const microsoftOAuthOperationsMicrosoftOAuthStartMutation = (options?: Partial<Options<MicrosoftOAuthOperationsMicrosoftOAuthStartData>>): UseMutationOptions<MicrosoftOAuthOperationsMicrosoftOAuthStartResponse, DefaultError, Options<MicrosoftOAuthOperationsMicrosoftOAuthStartData>> => {
81
+ const mutationOptions: UseMutationOptions<MicrosoftOAuthOperationsMicrosoftOAuthStartResponse, DefaultError, Options<MicrosoftOAuthOperationsMicrosoftOAuthStartData>> = {
82
+ mutationFn: async (fnOptions) => {
83
+ const { data } = await microsoftOAuthOperationsMicrosoftOAuthStart({
84
+ ...options,
85
+ ...fnOptions,
86
+ throwOnError: true
87
+ });
88
+ return data;
89
+ }
90
+ };
91
+ return mutationOptions;
92
+ };
93
+
94
+ /**
95
+ * Test IMAP/SMTP connection without saving
96
+ */
97
+ export const accountOperationsTestConnectionMutation = (options?: Partial<Options<AccountOperationsTestConnectionData>>): UseMutationOptions<AccountOperationsTestConnectionResponse, DefaultError, Options<AccountOperationsTestConnectionData>> => {
98
+ const mutationOptions: UseMutationOptions<AccountOperationsTestConnectionResponse, DefaultError, Options<AccountOperationsTestConnectionData>> = {
99
+ mutationFn: async (fnOptions) => {
100
+ const { data } = await accountOperationsTestConnection({
101
+ ...options,
102
+ ...fnOptions,
103
+ throwOnError: true
104
+ });
105
+ return data;
106
+ }
107
+ };
108
+ return mutationOptions;
109
+ };
110
+
111
+ /**
112
+ * Delete an account and all associated data
113
+ */
114
+ export const accountDetailOperationsDeleteAccountMutation = (options?: Partial<Options<AccountDetailOperationsDeleteAccountData>>): UseMutationOptions<AccountDetailOperationsDeleteAccountResponse, DefaultError, Options<AccountDetailOperationsDeleteAccountData>> => {
115
+ const mutationOptions: UseMutationOptions<AccountDetailOperationsDeleteAccountResponse, DefaultError, Options<AccountDetailOperationsDeleteAccountData>> = {
116
+ mutationFn: async (fnOptions) => {
117
+ const { data } = await accountDetailOperationsDeleteAccount({
118
+ ...options,
119
+ ...fnOptions,
120
+ throwOnError: true
121
+ });
122
+ return data;
123
+ }
124
+ };
125
+ return mutationOptions;
126
+ };
127
+
128
+ /**
129
+ * Update an existing account
130
+ */
131
+ export const accountDetailOperationsUpdateAccountMutation = (options?: Partial<Options<AccountDetailOperationsUpdateAccountData>>): UseMutationOptions<AccountDetailOperationsUpdateAccountResponse, DefaultError, Options<AccountDetailOperationsUpdateAccountData>> => {
132
+ const mutationOptions: UseMutationOptions<AccountDetailOperationsUpdateAccountResponse, DefaultError, Options<AccountDetailOperationsUpdateAccountData>> = {
133
+ mutationFn: async (fnOptions) => {
134
+ const { data } = await accountDetailOperationsUpdateAccount({
135
+ ...options,
136
+ ...fnOptions,
137
+ throwOnError: true
138
+ });
139
+ return data;
140
+ }
141
+ };
142
+ return mutationOptions;
143
+ };
144
+
145
+ export const filterOperationsListFiltersQueryKey = (options: Options<FilterOperationsListFiltersData>) => createQueryKey('filterOperationsListFilters', options);
146
+
147
+ export const filterOperationsListFiltersOptions = (options: Options<FilterOperationsListFiltersData>) => queryOptions<FilterOperationsListFiltersResponse, DefaultError, FilterOperationsListFiltersResponse, ReturnType<typeof filterOperationsListFiltersQueryKey>>({
148
+ queryFn: async ({ queryKey, signal }) => {
149
+ const { data } = await filterOperationsListFilters({
150
+ ...options,
151
+ ...queryKey[0],
152
+ signal,
153
+ throwOnError: true
154
+ });
155
+ return data;
156
+ },
157
+ queryKey: filterOperationsListFiltersQueryKey(options)
158
+ });
159
+
160
+ export const filterOperationsCreateFilterMutation = (options?: Partial<Options<FilterOperationsCreateFilterData>>): UseMutationOptions<FilterOperationsCreateFilterResponse, DefaultError, Options<FilterOperationsCreateFilterData>> => {
161
+ const mutationOptions: UseMutationOptions<FilterOperationsCreateFilterResponse, DefaultError, Options<FilterOperationsCreateFilterData>> = {
162
+ mutationFn: async (fnOptions) => {
163
+ const { data } = await filterOperationsCreateFilter({
164
+ ...options,
165
+ ...fnOptions,
166
+ throwOnError: true
167
+ });
168
+ return data;
169
+ }
170
+ };
171
+ return mutationOptions;
172
+ };
173
+
174
+ export const filterDetailOperationsDeleteFilterMutation = (options?: Partial<Options<FilterDetailOperationsDeleteFilterData>>): UseMutationOptions<FilterDetailOperationsDeleteFilterResponse, DefaultError, Options<FilterDetailOperationsDeleteFilterData>> => {
175
+ const mutationOptions: UseMutationOptions<FilterDetailOperationsDeleteFilterResponse, DefaultError, Options<FilterDetailOperationsDeleteFilterData>> = {
176
+ mutationFn: async (fnOptions) => {
177
+ const { data } = await filterDetailOperationsDeleteFilter({
178
+ ...options,
179
+ ...fnOptions,
180
+ throwOnError: true
181
+ });
182
+ return data;
183
+ }
184
+ };
185
+ return mutationOptions;
186
+ };
187
+
188
+ export const filterDetailOperationsGetFilterQueryKey = (options: Options<FilterDetailOperationsGetFilterData>) => createQueryKey('filterDetailOperationsGetFilter', options);
189
+
190
+ export const filterDetailOperationsGetFilterOptions = (options: Options<FilterDetailOperationsGetFilterData>) => queryOptions<FilterDetailOperationsGetFilterResponse, DefaultError, FilterDetailOperationsGetFilterResponse, ReturnType<typeof filterDetailOperationsGetFilterQueryKey>>({
191
+ queryFn: async ({ queryKey, signal }) => {
192
+ const { data } = await filterDetailOperationsGetFilter({
193
+ ...options,
194
+ ...queryKey[0],
195
+ signal,
196
+ throwOnError: true
197
+ });
198
+ return data;
199
+ },
200
+ queryKey: filterDetailOperationsGetFilterQueryKey(options)
201
+ });
202
+
203
+ export const filterDetailOperationsUpdateFilterMutation = (options?: Partial<Options<FilterDetailOperationsUpdateFilterData>>): UseMutationOptions<FilterDetailOperationsUpdateFilterResponse, DefaultError, Options<FilterDetailOperationsUpdateFilterData>> => {
204
+ const mutationOptions: UseMutationOptions<FilterDetailOperationsUpdateFilterResponse, DefaultError, Options<FilterDetailOperationsUpdateFilterData>> = {
205
+ mutationFn: async (fnOptions) => {
206
+ const { data } = await filterDetailOperationsUpdateFilter({
207
+ ...options,
208
+ ...fnOptions,
209
+ throwOnError: true
210
+ });
211
+ return data;
212
+ }
213
+ };
214
+ return mutationOptions;
215
+ };
216
+
217
+ /**
218
+ * 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.
219
+ */
220
+ export const folderRoleOperationsAppointFolderRoleMutation = (options?: Partial<Options<FolderRoleOperationsAppointFolderRoleData>>): UseMutationOptions<FolderRoleOperationsAppointFolderRoleResponse, DefaultError, Options<FolderRoleOperationsAppointFolderRoleData>> => {
221
+ const mutationOptions: UseMutationOptions<FolderRoleOperationsAppointFolderRoleResponse, DefaultError, Options<FolderRoleOperationsAppointFolderRoleData>> = {
222
+ mutationFn: async (fnOptions) => {
223
+ const { data } = await folderRoleOperationsAppointFolderRole({
224
+ ...options,
225
+ ...fnOptions,
226
+ throwOnError: true
227
+ });
228
+ return data;
229
+ }
230
+ };
231
+ return mutationOptions;
232
+ };
233
+
234
+ export const mailboxOperationsListMailboxesQueryKey = (options: Options<MailboxOperationsListMailboxesData>) => createQueryKey('mailboxOperationsListMailboxes', options);
235
+
236
+ export const mailboxOperationsListMailboxesOptions = (options: Options<MailboxOperationsListMailboxesData>) => queryOptions<MailboxOperationsListMailboxesResponse, DefaultError, MailboxOperationsListMailboxesResponse, ReturnType<typeof mailboxOperationsListMailboxesQueryKey>>({
237
+ queryFn: async ({ queryKey, signal }) => {
238
+ const { data } = await mailboxOperationsListMailboxes({
239
+ ...options,
240
+ ...queryKey[0],
241
+ signal,
242
+ throwOnError: true
243
+ });
244
+ return data;
245
+ },
246
+ queryKey: mailboxOperationsListMailboxesQueryKey(options)
247
+ });
248
+
249
+ export const mailboxOperationsCreateMailboxMutation = (options?: Partial<Options<MailboxOperationsCreateMailboxData>>): UseMutationOptions<MailboxOperationsCreateMailboxResponse, DefaultError, Options<MailboxOperationsCreateMailboxData>> => {
250
+ const mutationOptions: UseMutationOptions<MailboxOperationsCreateMailboxResponse, DefaultError, Options<MailboxOperationsCreateMailboxData>> = {
251
+ mutationFn: async (fnOptions) => {
252
+ const { data } = await mailboxOperationsCreateMailbox({
253
+ ...options,
254
+ ...fnOptions,
255
+ throwOnError: true
256
+ });
257
+ return data;
258
+ }
259
+ };
260
+ return mutationOptions;
261
+ };
262
+
263
+ export const mailboxDetailOperationsDeleteMailboxMutation = (options?: Partial<Options<MailboxDetailOperationsDeleteMailboxData>>): UseMutationOptions<MailboxDetailOperationsDeleteMailboxResponse, DefaultError, Options<MailboxDetailOperationsDeleteMailboxData>> => {
264
+ const mutationOptions: UseMutationOptions<MailboxDetailOperationsDeleteMailboxResponse, DefaultError, Options<MailboxDetailOperationsDeleteMailboxData>> = {
265
+ mutationFn: async (fnOptions) => {
266
+ const { data } = await mailboxDetailOperationsDeleteMailbox({
267
+ ...options,
268
+ ...fnOptions,
269
+ throwOnError: true
270
+ });
271
+ return data;
272
+ }
273
+ };
274
+ return mutationOptions;
275
+ };
276
+
277
+ export const mailboxDetailOperationsGetMailboxQueryKey = (options: Options<MailboxDetailOperationsGetMailboxData>) => createQueryKey('mailboxDetailOperationsGetMailbox', options);
278
+
279
+ export const mailboxDetailOperationsGetMailboxOptions = (options: Options<MailboxDetailOperationsGetMailboxData>) => queryOptions<MailboxDetailOperationsGetMailboxResponse, DefaultError, MailboxDetailOperationsGetMailboxResponse, ReturnType<typeof mailboxDetailOperationsGetMailboxQueryKey>>({
280
+ queryFn: async ({ queryKey, signal }) => {
281
+ const { data } = await mailboxDetailOperationsGetMailbox({
282
+ ...options,
283
+ ...queryKey[0],
284
+ signal,
285
+ throwOnError: true
286
+ });
287
+ return data;
288
+ },
289
+ queryKey: mailboxDetailOperationsGetMailboxQueryKey(options)
290
+ });
291
+
292
+ export const mailboxDetailOperationsRenameMailboxMutation = (options?: Partial<Options<MailboxDetailOperationsRenameMailboxData>>): UseMutationOptions<MailboxDetailOperationsRenameMailboxResponse, DefaultError, Options<MailboxDetailOperationsRenameMailboxData>> => {
293
+ const mutationOptions: UseMutationOptions<MailboxDetailOperationsRenameMailboxResponse, DefaultError, Options<MailboxDetailOperationsRenameMailboxData>> = {
294
+ mutationFn: async (fnOptions) => {
295
+ const { data } = await mailboxDetailOperationsRenameMailbox({
296
+ ...options,
297
+ ...fnOptions,
298
+ throwOnError: true
299
+ });
300
+ return data;
301
+ }
302
+ };
303
+ return mutationOptions;
304
+ };
305
+
306
+ /**
307
+ * 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).
308
+ */
309
+ export const organizeOperationsCreateOrganizeJobMutation = (options?: Partial<Options<OrganizeOperationsCreateOrganizeJobData>>): UseMutationOptions<OrganizeOperationsCreateOrganizeJobResponse, DefaultError, Options<OrganizeOperationsCreateOrganizeJobData>> => {
310
+ const mutationOptions: UseMutationOptions<OrganizeOperationsCreateOrganizeJobResponse, DefaultError, Options<OrganizeOperationsCreateOrganizeJobData>> = {
311
+ mutationFn: async (fnOptions) => {
312
+ const { data } = await organizeOperationsCreateOrganizeJob({
313
+ ...options,
314
+ ...fnOptions,
315
+ throwOnError: true
316
+ });
317
+ return data;
318
+ }
319
+ };
320
+ return mutationOptions;
321
+ };
322
+
323
+ /**
324
+ * 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.
325
+ */
326
+ export const organizeOperationsPreviewOrganizeMutation = (options?: Partial<Options<OrganizeOperationsPreviewOrganizeData>>): UseMutationOptions<OrganizeOperationsPreviewOrganizeResponse, DefaultError, Options<OrganizeOperationsPreviewOrganizeData>> => {
327
+ const mutationOptions: UseMutationOptions<OrganizeOperationsPreviewOrganizeResponse, DefaultError, Options<OrganizeOperationsPreviewOrganizeData>> = {
328
+ mutationFn: async (fnOptions) => {
329
+ const { data } = await organizeOperationsPreviewOrganize({
330
+ ...options,
331
+ ...fnOptions,
332
+ throwOnError: true
333
+ });
334
+ return data;
335
+ }
336
+ };
337
+ return mutationOptions;
338
+ };
339
+
340
+ export const organizeJobDetailOperationsGetOrganizeJobQueryKey = (options: Options<OrganizeJobDetailOperationsGetOrganizeJobData>) => createQueryKey('organizeJobDetailOperationsGetOrganizeJob', options);
341
+
342
+ /**
343
+ * Get the status of a back-apply job, including matched/applied/failed counts. Terminal states are Complete and Failed.
344
+ */
345
+ export const organizeJobDetailOperationsGetOrganizeJobOptions = (options: Options<OrganizeJobDetailOperationsGetOrganizeJobData>) => queryOptions<OrganizeJobDetailOperationsGetOrganizeJobResponse, DefaultError, OrganizeJobDetailOperationsGetOrganizeJobResponse, ReturnType<typeof organizeJobDetailOperationsGetOrganizeJobQueryKey>>({
346
+ queryFn: async ({ queryKey, signal }) => {
347
+ const { data } = await organizeJobDetailOperationsGetOrganizeJob({
348
+ ...options,
349
+ ...queryKey[0],
350
+ signal,
351
+ throwOnError: true
352
+ });
353
+ return data;
354
+ },
355
+ queryKey: organizeJobDetailOperationsGetOrganizeJobQueryKey(options)
356
+ });
357
+
358
+ export const syncOperationsTriggerSyncMutation = (options?: Partial<Options<SyncOperationsTriggerSyncData>>): UseMutationOptions<SyncOperationsTriggerSyncResponse, DefaultError, Options<SyncOperationsTriggerSyncData>> => {
359
+ const mutationOptions: UseMutationOptions<SyncOperationsTriggerSyncResponse, DefaultError, Options<SyncOperationsTriggerSyncData>> = {
360
+ mutationFn: async (fnOptions) => {
361
+ const { data } = await syncOperationsTriggerSync({
362
+ ...options,
363
+ ...fnOptions,
364
+ throwOnError: true
365
+ });
366
+ return data;
367
+ }
368
+ };
369
+ return mutationOptions;
370
+ };
371
+
372
+ export const syncOperationsGetSyncStatusQueryKey = (options: Options<SyncOperationsGetSyncStatusData>) => createQueryKey('syncOperationsGetSyncStatus', options);
373
+
374
+ /**
375
+ * 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).
376
+ */
377
+ export const syncOperationsGetSyncStatusOptions = (options: Options<SyncOperationsGetSyncStatusData>) => queryOptions<SyncOperationsGetSyncStatusResponse, DefaultError, SyncOperationsGetSyncStatusResponse, ReturnType<typeof syncOperationsGetSyncStatusQueryKey>>({
378
+ queryFn: async ({ queryKey, signal }) => {
379
+ const { data } = await syncOperationsGetSyncStatus({
380
+ ...options,
381
+ ...queryKey[0],
382
+ signal,
383
+ throwOnError: true
384
+ });
385
+ return data;
386
+ },
387
+ queryKey: syncOperationsGetSyncStatusQueryKey(options)
388
+ });
389
+
390
+ /**
391
+ * Permanently delete all messages in the Trash mailbox
392
+ */
393
+ export const trashOperationsEmptyTrashMutation = (options?: Partial<Options<TrashOperationsEmptyTrashData>>): UseMutationOptions<TrashOperationsEmptyTrashResponse, DefaultError, Options<TrashOperationsEmptyTrashData>> => {
394
+ const mutationOptions: UseMutationOptions<TrashOperationsEmptyTrashResponse, DefaultError, Options<TrashOperationsEmptyTrashData>> = {
395
+ mutationFn: async (fnOptions) => {
396
+ const { data } = await trashOperationsEmptyTrash({
397
+ ...options,
398
+ ...fnOptions,
399
+ throwOnError: true
400
+ });
401
+ return data;
402
+ }
403
+ };
404
+ return mutationOptions;
405
+ };
406
+
407
+ export const addressOperationsSearchAddressesQueryKey = (options: Options<AddressOperationsSearchAddressesData>) => createQueryKey('addressOperationsSearchAddresses', options);
408
+
409
+ /**
410
+ * Search addresses for autocomplete
411
+ */
412
+ export const addressOperationsSearchAddressesOptions = (options: Options<AddressOperationsSearchAddressesData>) => queryOptions<AddressOperationsSearchAddressesResponse, DefaultError, AddressOperationsSearchAddressesResponse, ReturnType<typeof addressOperationsSearchAddressesQueryKey>>({
413
+ queryFn: async ({ queryKey, signal }) => {
414
+ const { data } = await addressOperationsSearchAddresses({
415
+ ...options,
416
+ ...queryKey[0],
417
+ signal,
418
+ throwOnError: true
419
+ });
420
+ return data;
421
+ },
422
+ queryKey: addressOperationsSearchAddressesQueryKey(options)
423
+ });
424
+
425
+ /**
426
+ * Update an address (currently: per-sender flags). Pass `flags: { <name>: null }` to remove a flag. Other flags are untouched.
427
+ */
428
+ export const addressDetailOperationsUpdateAddressMutation = (options?: Partial<Options<AddressDetailOperationsUpdateAddressData>>): UseMutationOptions<AddressDetailOperationsUpdateAddressResponse, DefaultError, Options<AddressDetailOperationsUpdateAddressData>> => {
429
+ const mutationOptions: UseMutationOptions<AddressDetailOperationsUpdateAddressResponse, DefaultError, Options<AddressDetailOperationsUpdateAddressData>> = {
430
+ mutationFn: async (fnOptions) => {
431
+ const { data } = await addressDetailOperationsUpdateAddress({
432
+ ...options,
433
+ ...fnOptions,
434
+ throwOnError: true
435
+ });
436
+ return data;
437
+ }
438
+ };
439
+ return mutationOptions;
440
+ };
441
+
442
+ export const configOperationsGetConfigQueryKey = (options?: Options<ConfigOperationsGetConfigData>) => createQueryKey('configOperationsGetConfig', options);
443
+
444
+ /**
445
+ * Get the current user's configuration including accounts and addresses
446
+ */
447
+ export const configOperationsGetConfigOptions = (options?: Options<ConfigOperationsGetConfigData>) => queryOptions<ConfigOperationsGetConfigResponse, DefaultError, ConfigOperationsGetConfigResponse, ReturnType<typeof configOperationsGetConfigQueryKey>>({
448
+ queryFn: async ({ queryKey, signal }) => {
449
+ const { data } = await configOperationsGetConfig({
450
+ ...options,
451
+ ...queryKey[0],
452
+ signal,
453
+ throwOnError: true
454
+ });
455
+ return data;
456
+ },
457
+ queryKey: configOperationsGetConfigQueryKey(options)
458
+ });
459
+
460
+ export const threadOperationsListThreadsQueryKey = (options: Options<ThreadOperationsListThreadsData>) => createQueryKey('threadOperationsListThreads', options);
461
+
462
+ export const threadOperationsListThreadsOptions = (options: Options<ThreadOperationsListThreadsData>) => queryOptions<ThreadOperationsListThreadsResponse, DefaultError, ThreadOperationsListThreadsResponse, ReturnType<typeof threadOperationsListThreadsQueryKey>>({
463
+ queryFn: async ({ queryKey, signal }) => {
464
+ const { data } = await threadOperationsListThreads({
465
+ ...options,
466
+ ...queryKey[0],
467
+ signal,
468
+ throwOnError: true
469
+ });
470
+ return data;
471
+ },
472
+ queryKey: threadOperationsListThreadsQueryKey(options)
473
+ });
474
+
475
+ export const threadOperationsSearchThreadsQueryKey = (options: Options<ThreadOperationsSearchThreadsData>) => createQueryKey('threadOperationsSearchThreads', options);
476
+
477
+ export const threadOperationsSearchThreadsOptions = (options: Options<ThreadOperationsSearchThreadsData>) => queryOptions<ThreadOperationsSearchThreadsResponse, DefaultError, ThreadOperationsSearchThreadsResponse, ReturnType<typeof threadOperationsSearchThreadsQueryKey>>({
478
+ queryFn: async ({ queryKey, signal }) => {
479
+ const { data } = await threadOperationsSearchThreads({
480
+ ...options,
481
+ ...queryKey[0],
482
+ signal,
483
+ throwOnError: true
484
+ });
485
+ return data;
486
+ },
487
+ queryKey: threadOperationsSearchThreadsQueryKey(options)
488
+ });
489
+
490
+ /**
491
+ * Request full erasure of the current user's account and all associated data
492
+ */
493
+ export const meOperationsDeleteMeMutation = (options?: Partial<Options<MeOperationsDeleteMeData>>): UseMutationOptions<MeOperationsDeleteMeResponse, MeOperationsDeleteMeError, Options<MeOperationsDeleteMeData>> => {
494
+ const mutationOptions: UseMutationOptions<MeOperationsDeleteMeResponse, MeOperationsDeleteMeError, Options<MeOperationsDeleteMeData>> = {
495
+ mutationFn: async (fnOptions) => {
496
+ const { data } = await meOperationsDeleteMe({
497
+ ...options,
498
+ ...fnOptions,
499
+ throwOnError: true
500
+ });
501
+ return data;
502
+ }
503
+ };
504
+ return mutationOptions;
505
+ };
506
+
507
+ /**
508
+ * 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.
509
+ */
510
+ export const meOperationsCreateExportMutation = (options?: Partial<Options<MeOperationsCreateExportData>>): UseMutationOptions<MeOperationsCreateExportResponse, DefaultError, Options<MeOperationsCreateExportData>> => {
511
+ const mutationOptions: UseMutationOptions<MeOperationsCreateExportResponse, DefaultError, Options<MeOperationsCreateExportData>> = {
512
+ mutationFn: async (fnOptions) => {
513
+ const { data } = await meOperationsCreateExport({
514
+ ...options,
515
+ ...fnOptions,
516
+ throwOnError: true
517
+ });
518
+ return data;
519
+ }
520
+ };
521
+ return mutationOptions;
522
+ };
523
+
524
+ export const meOperationsGetExportQueryKey = (options: Options<MeOperationsGetExportData>) => createQueryKey('meOperationsGetExport', options);
525
+
526
+ /**
527
+ * Get the status of a previously requested data export. When state is Ready, downloadUrl holds a 30-day presigned S3 URL.
528
+ */
529
+ export const meOperationsGetExportOptions = (options: Options<MeOperationsGetExportData>) => queryOptions<MeOperationsGetExportResponse, DefaultError, MeOperationsGetExportResponse, ReturnType<typeof meOperationsGetExportQueryKey>>({
530
+ queryFn: async ({ queryKey, signal }) => {
531
+ const { data } = await meOperationsGetExport({
532
+ ...options,
533
+ ...queryKey[0],
534
+ signal,
535
+ throwOnError: true
536
+ });
537
+ return data;
538
+ },
539
+ queryKey: meOperationsGetExportQueryKey(options)
540
+ });
541
+
542
+ export const meOperationsListVipSuggestionsQueryKey = (options?: Options<MeOperationsListVipSuggestionsData>) => createQueryKey('meOperationsListVipSuggestions', options);
543
+
544
+ /**
545
+ * 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.
546
+ */
547
+ export const meOperationsListVipSuggestionsOptions = (options?: Options<MeOperationsListVipSuggestionsData>) => queryOptions<MeOperationsListVipSuggestionsResponse, DefaultError, MeOperationsListVipSuggestionsResponse, ReturnType<typeof meOperationsListVipSuggestionsQueryKey>>({
548
+ queryFn: async ({ queryKey, signal }) => {
549
+ const { data } = await meOperationsListVipSuggestions({
550
+ ...options,
551
+ ...queryKey[0],
552
+ signal,
553
+ throwOnError: true
554
+ });
555
+ return data;
556
+ },
557
+ queryKey: meOperationsListVipSuggestionsQueryKey(options)
558
+ });
559
+
560
+ /**
561
+ * Copy messages to a destination mailbox
562
+ */
563
+ export const messageBulkOperationsCopyMessagesMutation = (options?: Partial<Options<MessageBulkOperationsCopyMessagesData>>): UseMutationOptions<MessageBulkOperationsCopyMessagesResponse, DefaultError, Options<MessageBulkOperationsCopyMessagesData>> => {
564
+ const mutationOptions: UseMutationOptions<MessageBulkOperationsCopyMessagesResponse, DefaultError, Options<MessageBulkOperationsCopyMessagesData>> = {
565
+ mutationFn: async (fnOptions) => {
566
+ const { data } = await messageBulkOperationsCopyMessages({
567
+ ...options,
568
+ ...fnOptions,
569
+ throwOnError: true
570
+ });
571
+ return data;
572
+ }
573
+ };
574
+ return mutationOptions;
575
+ };
576
+
577
+ /**
578
+ * Delete messages (move to Trash or permanent delete)
579
+ */
580
+ export const messageBulkOperationsDeleteMessagesMutation = (options?: Partial<Options<MessageBulkOperationsDeleteMessagesData>>): UseMutationOptions<MessageBulkOperationsDeleteMessagesResponse, DefaultError, Options<MessageBulkOperationsDeleteMessagesData>> => {
581
+ const mutationOptions: UseMutationOptions<MessageBulkOperationsDeleteMessagesResponse, DefaultError, Options<MessageBulkOperationsDeleteMessagesData>> = {
582
+ mutationFn: async (fnOptions) => {
583
+ const { data } = await messageBulkOperationsDeleteMessages({
584
+ ...options,
585
+ ...fnOptions,
586
+ throwOnError: true
587
+ });
588
+ return data;
589
+ }
590
+ };
591
+ return mutationOptions;
592
+ };
593
+
594
+ /**
595
+ * Update flags on multiple messages
596
+ */
597
+ export const messageBulkOperationsUpdateFlagsMutation = (options?: Partial<Options<MessageBulkOperationsUpdateFlagsData>>): UseMutationOptions<MessageBulkOperationsUpdateFlagsResponse, DefaultError, Options<MessageBulkOperationsUpdateFlagsData>> => {
598
+ const mutationOptions: UseMutationOptions<MessageBulkOperationsUpdateFlagsResponse, DefaultError, Options<MessageBulkOperationsUpdateFlagsData>> = {
599
+ mutationFn: async (fnOptions) => {
600
+ const { data } = await messageBulkOperationsUpdateFlags({
601
+ ...options,
602
+ ...fnOptions,
603
+ throwOnError: true
604
+ });
605
+ return data;
606
+ }
607
+ };
608
+ return mutationOptions;
609
+ };
610
+
611
+ export const messageBulkOperationsMoveMessagesMutation = (options?: Partial<Options<MessageBulkOperationsMoveMessagesData>>): UseMutationOptions<MessageBulkOperationsMoveMessagesResponse, DefaultError, Options<MessageBulkOperationsMoveMessagesData>> => {
612
+ const mutationOptions: UseMutationOptions<MessageBulkOperationsMoveMessagesResponse, DefaultError, Options<MessageBulkOperationsMoveMessagesData>> = {
613
+ mutationFn: async (fnOptions) => {
614
+ const { data } = await messageBulkOperationsMoveMessages({
615
+ ...options,
616
+ ...fnOptions,
617
+ throwOnError: true
618
+ });
619
+ return data;
620
+ }
621
+ };
622
+ return mutationOptions;
623
+ };
624
+
625
+ export const messageOperationsDescribeMessageQueryKey = (options: Options<MessageOperationsDescribeMessageData>) => createQueryKey('messageOperationsDescribeMessage', options);
626
+
627
+ export const messageOperationsDescribeMessageOptions = (options: Options<MessageOperationsDescribeMessageData>) => queryOptions<MessageOperationsDescribeMessageResponse, DefaultError, MessageOperationsDescribeMessageResponse, ReturnType<typeof messageOperationsDescribeMessageQueryKey>>({
628
+ queryFn: async ({ queryKey, signal }) => {
629
+ const { data } = await messageOperationsDescribeMessage({
630
+ ...options,
631
+ ...queryKey[0],
632
+ signal,
633
+ throwOnError: true
634
+ });
635
+ return data;
636
+ },
637
+ queryKey: messageOperationsDescribeMessageQueryKey(options)
638
+ });
639
+
640
+ export const messageOperationsUpdateMessageFlagsMutation = (options?: Partial<Options<MessageOperationsUpdateMessageFlagsData>>): UseMutationOptions<MessageOperationsUpdateMessageFlagsResponse, DefaultError, Options<MessageOperationsUpdateMessageFlagsData>> => {
641
+ const mutationOptions: UseMutationOptions<MessageOperationsUpdateMessageFlagsResponse, DefaultError, Options<MessageOperationsUpdateMessageFlagsData>> = {
642
+ mutationFn: async (fnOptions) => {
643
+ const { data } = await messageOperationsUpdateMessageFlags({
644
+ ...options,
645
+ ...fnOptions,
646
+ throwOnError: true
647
+ });
648
+ return data;
649
+ }
650
+ };
651
+ return mutationOptions;
652
+ };
653
+
654
+ export const messageOperationsGetRawMessageQueryKey = (options: Options<MessageOperationsGetRawMessageData>) => createQueryKey('messageOperationsGetRawMessage', options);
655
+
656
+ /**
657
+ * Get the raw RFC822/MIME source of a message (headers and body) for inspection.
658
+ */
659
+ export const messageOperationsGetRawMessageOptions = (options: Options<MessageOperationsGetRawMessageData>) => queryOptions<MessageOperationsGetRawMessageResponse, DefaultError, MessageOperationsGetRawMessageResponse, ReturnType<typeof messageOperationsGetRawMessageQueryKey>>({
660
+ queryFn: async ({ queryKey, signal }) => {
661
+ const { data } = await messageOperationsGetRawMessage({
662
+ ...options,
663
+ ...queryKey[0],
664
+ signal,
665
+ throwOnError: true
666
+ });
667
+ return data;
668
+ },
669
+ queryKey: messageOperationsGetRawMessageQueryKey(options)
670
+ });
671
+
672
+ export const outboxOperationsListOutboxMessagesQueryKey = (options?: Options<OutboxOperationsListOutboxMessagesData>) => createQueryKey('outboxOperationsListOutboxMessages', options);
673
+
674
+ /**
675
+ * List outbox messages for the current account
676
+ */
677
+ export const outboxOperationsListOutboxMessagesOptions = (options?: Options<OutboxOperationsListOutboxMessagesData>) => queryOptions<OutboxOperationsListOutboxMessagesResponse, DefaultError, OutboxOperationsListOutboxMessagesResponse, ReturnType<typeof outboxOperationsListOutboxMessagesQueryKey>>({
678
+ queryFn: async ({ queryKey, signal }) => {
679
+ const { data } = await outboxOperationsListOutboxMessages({
680
+ ...options,
681
+ ...queryKey[0],
682
+ signal,
683
+ throwOnError: true
684
+ });
685
+ return data;
686
+ },
687
+ queryKey: outboxOperationsListOutboxMessagesQueryKey(options)
688
+ });
689
+
690
+ /**
691
+ * Create a new outbox message (draft or send immediately)
692
+ */
693
+ export const outboxOperationsCreateOutboxMessageMutation = (options?: Partial<Options<OutboxOperationsCreateOutboxMessageData>>): UseMutationOptions<OutboxOperationsCreateOutboxMessageResponse, DefaultError, Options<OutboxOperationsCreateOutboxMessageData>> => {
694
+ const mutationOptions: UseMutationOptions<OutboxOperationsCreateOutboxMessageResponse, DefaultError, Options<OutboxOperationsCreateOutboxMessageData>> = {
695
+ mutationFn: async (fnOptions) => {
696
+ const { data } = await outboxOperationsCreateOutboxMessage({
697
+ ...options,
698
+ ...fnOptions,
699
+ throwOnError: true
700
+ });
701
+ return data;
702
+ }
703
+ };
704
+ return mutationOptions;
705
+ };
706
+
707
+ /**
708
+ * Delete a draft or failed outbox message
709
+ */
710
+ export const outboxDetailOperationsDeleteOutboxMessageMutation = (options?: Partial<Options<OutboxDetailOperationsDeleteOutboxMessageData>>): UseMutationOptions<OutboxDetailOperationsDeleteOutboxMessageResponse, DefaultError, Options<OutboxDetailOperationsDeleteOutboxMessageData>> => {
711
+ const mutationOptions: UseMutationOptions<OutboxDetailOperationsDeleteOutboxMessageResponse, DefaultError, Options<OutboxDetailOperationsDeleteOutboxMessageData>> = {
712
+ mutationFn: async (fnOptions) => {
713
+ const { data } = await outboxDetailOperationsDeleteOutboxMessage({
714
+ ...options,
715
+ ...fnOptions,
716
+ throwOnError: true
717
+ });
718
+ return data;
719
+ }
720
+ };
721
+ return mutationOptions;
722
+ };
723
+
724
+ export const outboxDetailOperationsGetOutboxMessageQueryKey = (options: Options<OutboxDetailOperationsGetOutboxMessageData>) => createQueryKey('outboxDetailOperationsGetOutboxMessage', options);
725
+
726
+ /**
727
+ * Get an outbox message by ID
728
+ */
729
+ export const outboxDetailOperationsGetOutboxMessageOptions = (options: Options<OutboxDetailOperationsGetOutboxMessageData>) => queryOptions<OutboxDetailOperationsGetOutboxMessageResponse, DefaultError, OutboxDetailOperationsGetOutboxMessageResponse, ReturnType<typeof outboxDetailOperationsGetOutboxMessageQueryKey>>({
730
+ queryFn: async ({ queryKey, signal }) => {
731
+ const { data } = await outboxDetailOperationsGetOutboxMessage({
732
+ ...options,
733
+ ...queryKey[0],
734
+ signal,
735
+ throwOnError: true
736
+ });
737
+ return data;
738
+ },
739
+ queryKey: outboxDetailOperationsGetOutboxMessageQueryKey(options)
740
+ });
741
+
742
+ /**
743
+ * Update a draft outbox message
744
+ */
745
+ export const outboxDetailOperationsUpdateOutboxMessageMutation = (options?: Partial<Options<OutboxDetailOperationsUpdateOutboxMessageData>>): UseMutationOptions<OutboxDetailOperationsUpdateOutboxMessageResponse, DefaultError, Options<OutboxDetailOperationsUpdateOutboxMessageData>> => {
746
+ const mutationOptions: UseMutationOptions<OutboxDetailOperationsUpdateOutboxMessageResponse, DefaultError, Options<OutboxDetailOperationsUpdateOutboxMessageData>> = {
747
+ mutationFn: async (fnOptions) => {
748
+ const { data } = await outboxDetailOperationsUpdateOutboxMessage({
749
+ ...options,
750
+ ...fnOptions,
751
+ throwOnError: true
752
+ });
753
+ return data;
754
+ }
755
+ };
756
+ return mutationOptions;
757
+ };
758
+
759
+ /**
760
+ * Queue a draft message for sending
761
+ */
762
+ export const outboxDetailOperationsSendOutboxMessageMutation = (options?: Partial<Options<OutboxDetailOperationsSendOutboxMessageData>>): UseMutationOptions<OutboxDetailOperationsSendOutboxMessageResponse, DefaultError, Options<OutboxDetailOperationsSendOutboxMessageData>> => {
763
+ const mutationOptions: UseMutationOptions<OutboxDetailOperationsSendOutboxMessageResponse, DefaultError, Options<OutboxDetailOperationsSendOutboxMessageData>> = {
764
+ mutationFn: async (fnOptions) => {
765
+ const { data } = await outboxDetailOperationsSendOutboxMessage({
766
+ ...options,
767
+ ...fnOptions,
768
+ throwOnError: true
769
+ });
770
+ return data;
771
+ }
772
+ };
773
+ return mutationOptions;
774
+ };
775
+
776
+ export const semanticSearchOperationsSemanticSearchQueryKey = (options: Options<SemanticSearchOperationsSemanticSearchData>) => createQueryKey('semanticSearchOperationsSemanticSearch', options);
777
+
778
+ /**
779
+ * Run a semantic vector search across the caller's indexed messages.
780
+ */
781
+ export const semanticSearchOperationsSemanticSearchOptions = (options: Options<SemanticSearchOperationsSemanticSearchData>) => queryOptions<SemanticSearchOperationsSemanticSearchResponse, DefaultError, SemanticSearchOperationsSemanticSearchResponse, ReturnType<typeof semanticSearchOperationsSemanticSearchQueryKey>>({
782
+ queryFn: async ({ queryKey, signal }) => {
783
+ const { data } = await semanticSearchOperationsSemanticSearch({
784
+ ...options,
785
+ ...queryKey[0],
786
+ signal,
787
+ throwOnError: true
788
+ });
789
+ return data;
790
+ },
791
+ queryKey: semanticSearchOperationsSemanticSearchQueryKey(options)
792
+ });
793
+
794
+ export const unifiedThreadOperationsListAllThreadsQueryKey = (options?: Options<UnifiedThreadOperationsListAllThreadsData>) => createQueryKey('unifiedThreadOperationsListAllThreads', options);
795
+
796
+ /**
797
+ * 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.
798
+ *
799
+ * 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.
800
+ *
801
+ * 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).
802
+ *
803
+ * 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.
804
+ */
805
+ export const unifiedThreadOperationsListAllThreadsOptions = (options?: Options<UnifiedThreadOperationsListAllThreadsData>) => queryOptions<UnifiedThreadOperationsListAllThreadsResponse, DefaultError, UnifiedThreadOperationsListAllThreadsResponse, ReturnType<typeof unifiedThreadOperationsListAllThreadsQueryKey>>({
806
+ queryFn: async ({ queryKey, signal }) => {
807
+ const { data } = await unifiedThreadOperationsListAllThreads({
808
+ ...options,
809
+ ...queryKey[0],
810
+ signal,
811
+ throwOnError: true
812
+ });
813
+ return data;
814
+ },
815
+ queryKey: unifiedThreadOperationsListAllThreadsQueryKey(options)
816
+ });
817
+
818
+ export const threadDetailOperationsListThreadMessagesQueryKey = (options: Options<ThreadDetailOperationsListThreadMessagesData>) => createQueryKey('threadDetailOperationsListThreadMessages', options);
819
+
820
+ /**
821
+ * Get all messages in a thread. Optionally filter by mailboxId to deduplicate when messages exist in multiple mailboxes.
822
+ */
823
+ export const threadDetailOperationsListThreadMessagesOptions = (options: Options<ThreadDetailOperationsListThreadMessagesData>) => queryOptions<ThreadDetailOperationsListThreadMessagesResponse, DefaultError, ThreadDetailOperationsListThreadMessagesResponse, ReturnType<typeof threadDetailOperationsListThreadMessagesQueryKey>>({
824
+ queryFn: async ({ queryKey, signal }) => {
825
+ const { data } = await threadDetailOperationsListThreadMessages({
826
+ ...options,
827
+ ...queryKey[0],
828
+ signal,
829
+ throwOnError: true
830
+ });
831
+ return data;
832
+ },
833
+ queryKey: threadDetailOperationsListThreadMessagesQueryKey(options)
834
+ });