@ziwako/contact 0.0.0-stage → 0.2.0

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,1446 @@
1
+ import {
2
+ configure,
3
+ getInstance,
4
+ request
5
+ } from "./chunk-7NM6YSHA.js";
6
+
7
+ // src/provider.tsx
8
+ import { createContext, useContext } from "react";
9
+ import { jsx } from "react/jsx-runtime";
10
+ var ContactContext = createContext(null);
11
+ function ContactProvider({ apiKey, accessToken, baseURL, children }) {
12
+ configure({ apiKey, accessToken, baseURL });
13
+ return /* @__PURE__ */ jsx(ContactContext.Provider, { value: getInstance(), children });
14
+ }
15
+ function useContactClient() {
16
+ const ctx = useContext(ContactContext);
17
+ if (!ctx) throw new Error("useContactClient doit \xEAtre utilis\xE9 dans un <ContactProvider>");
18
+ return ctx;
19
+ }
20
+
21
+ // src/generated/react-query/endpoints/account.tanstack.ts
22
+ import {
23
+ useQuery
24
+ } from "@tanstack/react-query";
25
+ var withQueryKey = (query, queryKey) => {
26
+ const result = { queryKey };
27
+ for (const key of Object.keys(query)) {
28
+ if (key === "queryKey") continue;
29
+ Object.defineProperty(result, key, {
30
+ enumerable: true,
31
+ configurable: true,
32
+ get: () => query[key]
33
+ });
34
+ }
35
+ return result;
36
+ };
37
+ var getAccount = (signal) => {
38
+ return request(
39
+ {
40
+ url: `/account`,
41
+ method: "GET",
42
+ signal
43
+ }
44
+ );
45
+ };
46
+ var getGetAccountQueryKey = () => {
47
+ return [
48
+ `/account`
49
+ ];
50
+ };
51
+ var getGetAccountQueryOptions = (options) => {
52
+ const { query: queryOptions } = options ?? {};
53
+ const queryKey = queryOptions?.queryKey ?? getGetAccountQueryKey();
54
+ const queryFn = ({ signal }) => getAccount(signal);
55
+ return { queryKey, queryFn, ...queryOptions };
56
+ };
57
+ function useGetAccount(options, queryClient) {
58
+ const queryOptions = getGetAccountQueryOptions(options);
59
+ const query = useQuery(queryOptions, queryClient);
60
+ return withQueryKey(query, queryOptions.queryKey);
61
+ }
62
+
63
+ // src/generated/react-query/endpoints/api-keys.tanstack.ts
64
+ import {
65
+ useMutation,
66
+ useQuery as useQuery2
67
+ } from "@tanstack/react-query";
68
+ var withQueryKey2 = (query, queryKey) => {
69
+ const result = { queryKey };
70
+ for (const key of Object.keys(query)) {
71
+ if (key === "queryKey") continue;
72
+ Object.defineProperty(result, key, {
73
+ enumerable: true,
74
+ configurable: true,
75
+ get: () => query[key]
76
+ });
77
+ }
78
+ return result;
79
+ };
80
+ var listApiKeyScopes = (signal) => {
81
+ return request(
82
+ {
83
+ url: `/my/api-keys/scopes`,
84
+ method: "GET",
85
+ signal
86
+ }
87
+ );
88
+ };
89
+ var getListApiKeyScopesQueryKey = () => {
90
+ return [
91
+ `/my/api-keys/scopes`
92
+ ];
93
+ };
94
+ var getListApiKeyScopesQueryOptions = (options) => {
95
+ const { query: queryOptions } = options ?? {};
96
+ const queryKey = queryOptions?.queryKey ?? getListApiKeyScopesQueryKey();
97
+ const queryFn = ({ signal }) => listApiKeyScopes(signal);
98
+ return { queryKey, queryFn, ...queryOptions };
99
+ };
100
+ function useListApiKeyScopes(options, queryClient) {
101
+ const queryOptions = getListApiKeyScopesQueryOptions(options);
102
+ const query = useQuery2(queryOptions, queryClient);
103
+ return withQueryKey2(query, queryOptions.queryKey);
104
+ }
105
+ var listApiKeys = (signal) => {
106
+ return request(
107
+ {
108
+ url: `/my/api-keys`,
109
+ method: "GET",
110
+ signal
111
+ }
112
+ );
113
+ };
114
+ var getListApiKeysQueryKey = () => {
115
+ return [
116
+ `/my/api-keys`
117
+ ];
118
+ };
119
+ var getListApiKeysQueryOptions = (options) => {
120
+ const { query: queryOptions } = options ?? {};
121
+ const queryKey = queryOptions?.queryKey ?? getListApiKeysQueryKey();
122
+ const queryFn = ({ signal }) => listApiKeys(signal);
123
+ return { queryKey, queryFn, ...queryOptions };
124
+ };
125
+ function useListApiKeys(options, queryClient) {
126
+ const queryOptions = getListApiKeysQueryOptions(options);
127
+ const query = useQuery2(queryOptions, queryClient);
128
+ return withQueryKey2(query, queryOptions.queryKey);
129
+ }
130
+ var createApiKey = (createApiKeyBody, signal) => {
131
+ return request(
132
+ {
133
+ url: `/my/api-keys`,
134
+ method: "POST",
135
+ headers: { "Content-Type": "application/json" },
136
+ data: createApiKeyBody,
137
+ signal
138
+ }
139
+ );
140
+ };
141
+ var getCreateApiKeyMutationOptions = (options) => {
142
+ const mutationKey = ["createApiKey"];
143
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
144
+ const mutationFn = (props) => {
145
+ const { data } = props ?? {};
146
+ return createApiKey(data);
147
+ };
148
+ return { mutationFn, ...mutationOptions };
149
+ };
150
+ var useCreateApiKey = (options, queryClient) => {
151
+ return useMutation(getCreateApiKeyMutationOptions(options), queryClient);
152
+ };
153
+ var revokeApiKey = (id, signal) => {
154
+ return request(
155
+ {
156
+ url: `/my/api-keys/${id}`,
157
+ method: "DELETE",
158
+ signal
159
+ }
160
+ );
161
+ };
162
+ var getRevokeApiKeyMutationOptions = (options) => {
163
+ const mutationKey = ["revokeApiKey"];
164
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
165
+ const mutationFn = (props) => {
166
+ const { id } = props ?? {};
167
+ return revokeApiKey(id);
168
+ };
169
+ return { mutationFn, ...mutationOptions };
170
+ };
171
+ var useRevokeApiKey = (options, queryClient) => {
172
+ return useMutation(getRevokeApiKeyMutationOptions(options), queryClient);
173
+ };
174
+ var rotateApiKey = (id, signal) => {
175
+ return request(
176
+ {
177
+ url: `/my/api-keys/${id}/rotate`,
178
+ method: "POST",
179
+ signal
180
+ }
181
+ );
182
+ };
183
+ var getRotateApiKeyMutationOptions = (options) => {
184
+ const mutationKey = ["rotateApiKey"];
185
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
186
+ const mutationFn = (props) => {
187
+ const { id } = props ?? {};
188
+ return rotateApiKey(id);
189
+ };
190
+ return { mutationFn, ...mutationOptions };
191
+ };
192
+ var useRotateApiKey = (options, queryClient) => {
193
+ return useMutation(getRotateApiKeyMutationOptions(options), queryClient);
194
+ };
195
+ var getApiKeyUsage = (id, signal) => {
196
+ return request(
197
+ {
198
+ url: `/my/api-keys/${id}/usage`,
199
+ method: "GET",
200
+ signal
201
+ }
202
+ );
203
+ };
204
+ var getGetApiKeyUsageQueryKey = (id) => {
205
+ return [
206
+ `/my/api-keys/${id}/usage`
207
+ ];
208
+ };
209
+ var getGetApiKeyUsageQueryOptions = (id, options) => {
210
+ const { query: queryOptions } = options ?? {};
211
+ const queryKey = queryOptions?.queryKey ?? getGetApiKeyUsageQueryKey(id);
212
+ const queryFn = ({ signal }) => getApiKeyUsage(id, signal);
213
+ return { queryKey, queryFn, enabled: id !== null && id !== void 0, ...queryOptions };
214
+ };
215
+ function useGetApiKeyUsage(id, options, queryClient) {
216
+ const queryOptions = getGetApiKeyUsageQueryOptions(id, options);
217
+ const query = useQuery2(queryOptions, queryClient);
218
+ return withQueryKey2(query, queryOptions.queryKey);
219
+ }
220
+
221
+ // src/generated/react-query/endpoints/audiences.tanstack.ts
222
+ import {
223
+ useMutation as useMutation2,
224
+ useQuery as useQuery3
225
+ } from "@tanstack/react-query";
226
+ var withQueryKey3 = (query, queryKey) => {
227
+ const result = { queryKey };
228
+ for (const key of Object.keys(query)) {
229
+ if (key === "queryKey") continue;
230
+ Object.defineProperty(result, key, {
231
+ enumerable: true,
232
+ configurable: true,
233
+ get: () => query[key]
234
+ });
235
+ }
236
+ return result;
237
+ };
238
+ var listAudiences = (signal) => {
239
+ return request(
240
+ {
241
+ url: `/audiences`,
242
+ method: "GET",
243
+ signal
244
+ }
245
+ );
246
+ };
247
+ var getListAudiencesQueryKey = () => {
248
+ return [
249
+ `/audiences`
250
+ ];
251
+ };
252
+ var getListAudiencesQueryOptions = (options) => {
253
+ const { query: queryOptions } = options ?? {};
254
+ const queryKey = queryOptions?.queryKey ?? getListAudiencesQueryKey();
255
+ const queryFn = ({ signal }) => listAudiences(signal);
256
+ return { queryKey, queryFn, ...queryOptions };
257
+ };
258
+ function useListAudiences(options, queryClient) {
259
+ const queryOptions = getListAudiencesQueryOptions(options);
260
+ const query = useQuery3(queryOptions, queryClient);
261
+ return withQueryKey3(query, queryOptions.queryKey);
262
+ }
263
+ var createAudience = (createAudienceBody, signal) => {
264
+ return request(
265
+ {
266
+ url: `/audiences`,
267
+ method: "POST",
268
+ headers: { "Content-Type": "application/json" },
269
+ data: createAudienceBody,
270
+ signal
271
+ }
272
+ );
273
+ };
274
+ var getCreateAudienceMutationOptions = (options) => {
275
+ const mutationKey = ["createAudience"];
276
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
277
+ const mutationFn = (props) => {
278
+ const { data } = props ?? {};
279
+ return createAudience(data);
280
+ };
281
+ return { mutationFn, ...mutationOptions };
282
+ };
283
+ var useCreateAudience = (options, queryClient) => {
284
+ return useMutation2(getCreateAudienceMutationOptions(options), queryClient);
285
+ };
286
+ var getAudience = (id, signal) => {
287
+ return request(
288
+ {
289
+ url: `/audiences/${id}`,
290
+ method: "GET",
291
+ signal
292
+ }
293
+ );
294
+ };
295
+ var getGetAudienceQueryKey = (id) => {
296
+ return [
297
+ `/audiences/${id}`
298
+ ];
299
+ };
300
+ var getGetAudienceQueryOptions = (id, options) => {
301
+ const { query: queryOptions } = options ?? {};
302
+ const queryKey = queryOptions?.queryKey ?? getGetAudienceQueryKey(id);
303
+ const queryFn = ({ signal }) => getAudience(id, signal);
304
+ return { queryKey, queryFn, enabled: id !== null && id !== void 0, ...queryOptions };
305
+ };
306
+ function useGetAudience(id, options, queryClient) {
307
+ const queryOptions = getGetAudienceQueryOptions(id, options);
308
+ const query = useQuery3(queryOptions, queryClient);
309
+ return withQueryKey3(query, queryOptions.queryKey);
310
+ }
311
+ var updateAudience = (id, updateAudienceBody, signal) => {
312
+ return request(
313
+ {
314
+ url: `/audiences/${id}`,
315
+ method: "PATCH",
316
+ headers: { "Content-Type": "application/json" },
317
+ data: updateAudienceBody,
318
+ signal
319
+ }
320
+ );
321
+ };
322
+ var getUpdateAudienceMutationOptions = (options) => {
323
+ const mutationKey = ["updateAudience"];
324
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
325
+ const mutationFn = (props) => {
326
+ const { id, data } = props ?? {};
327
+ return updateAudience(id, data);
328
+ };
329
+ return { mutationFn, ...mutationOptions };
330
+ };
331
+ var useUpdateAudience = (options, queryClient) => {
332
+ return useMutation2(getUpdateAudienceMutationOptions(options), queryClient);
333
+ };
334
+ var deleteAudience = (id, signal) => {
335
+ return request(
336
+ {
337
+ url: `/audiences/${id}`,
338
+ method: "DELETE",
339
+ signal
340
+ }
341
+ );
342
+ };
343
+ var getDeleteAudienceMutationOptions = (options) => {
344
+ const mutationKey = ["deleteAudience"];
345
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
346
+ const mutationFn = (props) => {
347
+ const { id } = props ?? {};
348
+ return deleteAudience(id);
349
+ };
350
+ return { mutationFn, ...mutationOptions };
351
+ };
352
+ var useDeleteAudience = (options, queryClient) => {
353
+ return useMutation2(getDeleteAudienceMutationOptions(options), queryClient);
354
+ };
355
+ var getAudienceRecipients = (id, signal) => {
356
+ return request(
357
+ {
358
+ url: `/audiences/${id}/recipients`,
359
+ method: "GET",
360
+ signal
361
+ }
362
+ );
363
+ };
364
+ var getGetAudienceRecipientsQueryKey = (id) => {
365
+ return [
366
+ `/audiences/${id}/recipients`
367
+ ];
368
+ };
369
+ var getGetAudienceRecipientsQueryOptions = (id, options) => {
370
+ const { query: queryOptions } = options ?? {};
371
+ const queryKey = queryOptions?.queryKey ?? getGetAudienceRecipientsQueryKey(id);
372
+ const queryFn = ({ signal }) => getAudienceRecipients(id, signal);
373
+ return { queryKey, queryFn, enabled: id !== null && id !== void 0, ...queryOptions };
374
+ };
375
+ function useGetAudienceRecipients(id, options, queryClient) {
376
+ const queryOptions = getGetAudienceRecipientsQueryOptions(id, options);
377
+ const query = useQuery3(queryOptions, queryClient);
378
+ return withQueryKey3(query, queryOptions.queryKey);
379
+ }
380
+ var addAudienceContact = (id, addAudienceContactBody, signal) => {
381
+ return request(
382
+ {
383
+ url: `/audiences/${id}/leads`,
384
+ method: "POST",
385
+ headers: { "Content-Type": "application/json" },
386
+ data: addAudienceContactBody,
387
+ signal
388
+ }
389
+ );
390
+ };
391
+ var getAddAudienceContactMutationOptions = (options) => {
392
+ const mutationKey = ["addAudienceContact"];
393
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
394
+ const mutationFn = (props) => {
395
+ const { id, data } = props ?? {};
396
+ return addAudienceContact(id, data);
397
+ };
398
+ return { mutationFn, ...mutationOptions };
399
+ };
400
+ var useAddAudienceContact = (options, queryClient) => {
401
+ return useMutation2(getAddAudienceContactMutationOptions(options), queryClient);
402
+ };
403
+ var removeAudienceContact = (id, leadId, signal) => {
404
+ return request(
405
+ {
406
+ url: `/audiences/${id}/leads/${leadId}`,
407
+ method: "DELETE",
408
+ signal
409
+ }
410
+ );
411
+ };
412
+ var getRemoveAudienceContactMutationOptions = (options) => {
413
+ const mutationKey = ["removeAudienceContact"];
414
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
415
+ const mutationFn = (props) => {
416
+ const { id, leadId } = props ?? {};
417
+ return removeAudienceContact(id, leadId);
418
+ };
419
+ return { mutationFn, ...mutationOptions };
420
+ };
421
+ var useRemoveAudienceContact = (options, queryClient) => {
422
+ return useMutation2(getRemoveAudienceContactMutationOptions(options), queryClient);
423
+ };
424
+
425
+ // src/generated/react-query/endpoints/contacts.tanstack.ts
426
+ import {
427
+ useMutation as useMutation3,
428
+ useQuery as useQuery4
429
+ } from "@tanstack/react-query";
430
+ var withQueryKey4 = (query, queryKey) => {
431
+ const result = { queryKey };
432
+ for (const key of Object.keys(query)) {
433
+ if (key === "queryKey") continue;
434
+ Object.defineProperty(result, key, {
435
+ enumerable: true,
436
+ configurable: true,
437
+ get: () => query[key]
438
+ });
439
+ }
440
+ return result;
441
+ };
442
+ var createContact = (createContactBody, signal) => {
443
+ return request(
444
+ {
445
+ url: `/contacts`,
446
+ method: "POST",
447
+ headers: { "Content-Type": "application/json" },
448
+ data: createContactBody,
449
+ signal
450
+ }
451
+ );
452
+ };
453
+ var getCreateContactMutationOptions = (options) => {
454
+ const mutationKey = ["createContact"];
455
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
456
+ const mutationFn = (props) => {
457
+ const { data } = props ?? {};
458
+ return createContact(data);
459
+ };
460
+ return { mutationFn, ...mutationOptions };
461
+ };
462
+ var useCreateContact = (options, queryClient) => {
463
+ return useMutation3(getCreateContactMutationOptions(options), queryClient);
464
+ };
465
+ var listContact = (params, signal) => {
466
+ return request(
467
+ {
468
+ url: `/contacts`,
469
+ method: "GET",
470
+ params,
471
+ signal
472
+ }
473
+ );
474
+ };
475
+ var getListContactQueryKey = (params) => {
476
+ return [
477
+ `/contacts`,
478
+ ...params ? [params] : []
479
+ ];
480
+ };
481
+ var getListContactQueryOptions = (params, options) => {
482
+ const { query: queryOptions } = options ?? {};
483
+ const queryKey = queryOptions?.queryKey ?? getListContactQueryKey(params);
484
+ const queryFn = ({ signal }) => listContact(params, signal);
485
+ return { queryKey, queryFn, ...queryOptions };
486
+ };
487
+ function useListContact(params, options, queryClient) {
488
+ const queryOptions = getListContactQueryOptions(params, options);
489
+ const query = useQuery4(queryOptions, queryClient);
490
+ return withQueryKey4(query, queryOptions.queryKey);
491
+ }
492
+ var getContact = (id, signal) => {
493
+ return request(
494
+ {
495
+ url: `/contacts/${id}`,
496
+ method: "GET",
497
+ signal
498
+ }
499
+ );
500
+ };
501
+ var getGetContactQueryKey = (id) => {
502
+ return [
503
+ `/contacts/${id}`
504
+ ];
505
+ };
506
+ var getGetContactQueryOptions = (id, options) => {
507
+ const { query: queryOptions } = options ?? {};
508
+ const queryKey = queryOptions?.queryKey ?? getGetContactQueryKey(id);
509
+ const queryFn = ({ signal }) => getContact(id, signal);
510
+ return { queryKey, queryFn, enabled: id !== null && id !== void 0, ...queryOptions };
511
+ };
512
+ function useGetContact(id, options, queryClient) {
513
+ const queryOptions = getGetContactQueryOptions(id, options);
514
+ const query = useQuery4(queryOptions, queryClient);
515
+ return withQueryKey4(query, queryOptions.queryKey);
516
+ }
517
+ var updateContact = (id, updateContactBody, signal) => {
518
+ return request(
519
+ {
520
+ url: `/contacts/${id}`,
521
+ method: "PUT",
522
+ headers: { "Content-Type": "application/json" },
523
+ data: updateContactBody,
524
+ signal
525
+ }
526
+ );
527
+ };
528
+ var getUpdateContactMutationOptions = (options) => {
529
+ const mutationKey = ["updateContact"];
530
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
531
+ const mutationFn = (props) => {
532
+ const { id, data } = props ?? {};
533
+ return updateContact(id, data);
534
+ };
535
+ return { mutationFn, ...mutationOptions };
536
+ };
537
+ var useUpdateContact = (options, queryClient) => {
538
+ return useMutation3(getUpdateContactMutationOptions(options), queryClient);
539
+ };
540
+ var deletedContact = (id, signal) => {
541
+ return request(
542
+ {
543
+ url: `/contacts/${id}`,
544
+ method: "DELETE",
545
+ signal
546
+ }
547
+ );
548
+ };
549
+ var getDeletedContactMutationOptions = (options) => {
550
+ const mutationKey = ["deletedContact"];
551
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
552
+ const mutationFn = (props) => {
553
+ const { id } = props ?? {};
554
+ return deletedContact(id);
555
+ };
556
+ return { mutationFn, ...mutationOptions };
557
+ };
558
+ var useDeletedContact = (options, queryClient) => {
559
+ return useMutation3(getDeletedContactMutationOptions(options), queryClient);
560
+ };
561
+ var assignLabel = (id, assignLabelBody, signal) => {
562
+ return request(
563
+ {
564
+ url: `/contacts/${id}/labels`,
565
+ method: "POST",
566
+ headers: { "Content-Type": "application/json" },
567
+ data: assignLabelBody,
568
+ signal
569
+ }
570
+ );
571
+ };
572
+ var getAssignLabelMutationOptions = (options) => {
573
+ const mutationKey = ["assignLabel"];
574
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
575
+ const mutationFn = (props) => {
576
+ const { id, data } = props ?? {};
577
+ return assignLabel(id, data);
578
+ };
579
+ return { mutationFn, ...mutationOptions };
580
+ };
581
+ var useAssignLabel = (options, queryClient) => {
582
+ return useMutation3(getAssignLabelMutationOptions(options), queryClient);
583
+ };
584
+ var removeLabel = (id, labelId, signal) => {
585
+ return request(
586
+ {
587
+ url: `/contacts/${id}/labels/${labelId}`,
588
+ method: "DELETE",
589
+ signal
590
+ }
591
+ );
592
+ };
593
+ var getRemoveLabelMutationOptions = (options) => {
594
+ const mutationKey = ["removeLabel"];
595
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
596
+ const mutationFn = (props) => {
597
+ const { id, labelId } = props ?? {};
598
+ return removeLabel(id, labelId);
599
+ };
600
+ return { mutationFn, ...mutationOptions };
601
+ };
602
+ var useRemoveLabel = (options, queryClient) => {
603
+ return useMutation3(getRemoveLabelMutationOptions(options), queryClient);
604
+ };
605
+ var listDuplicate = (signal) => {
606
+ return request(
607
+ {
608
+ url: `/contacts/duplicates`,
609
+ method: "GET",
610
+ signal
611
+ }
612
+ );
613
+ };
614
+ var getListDuplicateQueryKey = () => {
615
+ return [
616
+ `/contacts/duplicates`
617
+ ];
618
+ };
619
+ var getListDuplicateQueryOptions = (options) => {
620
+ const { query: queryOptions } = options ?? {};
621
+ const queryKey = queryOptions?.queryKey ?? getListDuplicateQueryKey();
622
+ const queryFn = ({ signal }) => listDuplicate(signal);
623
+ return { queryKey, queryFn, ...queryOptions };
624
+ };
625
+ function useListDuplicate(options, queryClient) {
626
+ const queryOptions = getListDuplicateQueryOptions(options);
627
+ const query = useQuery4(queryOptions, queryClient);
628
+ return withQueryKey4(query, queryOptions.queryKey);
629
+ }
630
+ var mergeContact = (mergeContactBody, signal) => {
631
+ return request(
632
+ {
633
+ url: `/contacts/merge`,
634
+ method: "POST",
635
+ headers: { "Content-Type": "application/json" },
636
+ data: mergeContactBody,
637
+ signal
638
+ }
639
+ );
640
+ };
641
+ var getMergeContactMutationOptions = (options) => {
642
+ const mutationKey = ["mergeContact"];
643
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
644
+ const mutationFn = (props) => {
645
+ const { data } = props ?? {};
646
+ return mergeContact(data);
647
+ };
648
+ return { mutationFn, ...mutationOptions };
649
+ };
650
+ var useMergeContact = (options, queryClient) => {
651
+ return useMutation3(getMergeContactMutationOptions(options), queryClient);
652
+ };
653
+ var importFromVcard = (importFromVcardBody, signal) => {
654
+ const formData = new FormData();
655
+ if (importFromVcardBody.file !== void 0) {
656
+ formData.append(`file`, importFromVcardBody.file);
657
+ }
658
+ return request(
659
+ {
660
+ url: `/contacts/import/vcard`,
661
+ method: "POST",
662
+ headers: { "Content-Type": "multipart/form-data" },
663
+ data: formData,
664
+ signal
665
+ }
666
+ );
667
+ };
668
+ var getImportFromVcardMutationOptions = (options) => {
669
+ const mutationKey = ["importFromVcard"];
670
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
671
+ const mutationFn = (props) => {
672
+ const { data } = props ?? {};
673
+ return importFromVcard(data);
674
+ };
675
+ return { mutationFn, ...mutationOptions };
676
+ };
677
+ var useImportFromVcard = (options, queryClient) => {
678
+ return useMutation3(getImportFromVcardMutationOptions(options), queryClient);
679
+ };
680
+ var importFromCsv = (importFromCsvBody, signal) => {
681
+ const formData = new FormData();
682
+ if (importFromCsvBody.file !== void 0) {
683
+ formData.append(`file`, importFromCsvBody.file);
684
+ }
685
+ return request(
686
+ {
687
+ url: `/contacts/import/csv`,
688
+ method: "POST",
689
+ headers: { "Content-Type": "multipart/form-data" },
690
+ data: formData,
691
+ signal
692
+ }
693
+ );
694
+ };
695
+ var getImportFromCsvMutationOptions = (options) => {
696
+ const mutationKey = ["importFromCsv"];
697
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
698
+ const mutationFn = (props) => {
699
+ const { data } = props ?? {};
700
+ return importFromCsv(data);
701
+ };
702
+ return { mutationFn, ...mutationOptions };
703
+ };
704
+ var useImportFromCsv = (options, queryClient) => {
705
+ return useMutation3(getImportFromCsvMutationOptions(options), queryClient);
706
+ };
707
+ var exportToVcard = (signal) => {
708
+ return request(
709
+ {
710
+ url: `/contacts/export/vcard`,
711
+ method: "GET",
712
+ signal
713
+ }
714
+ );
715
+ };
716
+ var getExportToVcardQueryKey = () => {
717
+ return [
718
+ `/contacts/export/vcard`
719
+ ];
720
+ };
721
+ var getExportToVcardQueryOptions = (options) => {
722
+ const { query: queryOptions } = options ?? {};
723
+ const queryKey = queryOptions?.queryKey ?? getExportToVcardQueryKey();
724
+ const queryFn = ({ signal }) => exportToVcard(signal);
725
+ return { queryKey, queryFn, ...queryOptions };
726
+ };
727
+ function useExportToVcard(options, queryClient) {
728
+ const queryOptions = getExportToVcardQueryOptions(options);
729
+ const query = useQuery4(queryOptions, queryClient);
730
+ return withQueryKey4(query, queryOptions.queryKey);
731
+ }
732
+ var exportToCsv = (signal) => {
733
+ return request(
734
+ {
735
+ url: `/contacts/export/csv`,
736
+ method: "GET",
737
+ signal
738
+ }
739
+ );
740
+ };
741
+ var getExportToCsvQueryKey = () => {
742
+ return [
743
+ `/contacts/export/csv`
744
+ ];
745
+ };
746
+ var getExportToCsvQueryOptions = (options) => {
747
+ const { query: queryOptions } = options ?? {};
748
+ const queryKey = queryOptions?.queryKey ?? getExportToCsvQueryKey();
749
+ const queryFn = ({ signal }) => exportToCsv(signal);
750
+ return { queryKey, queryFn, ...queryOptions };
751
+ };
752
+ function useExportToCsv(options, queryClient) {
753
+ const queryOptions = getExportToCsvQueryOptions(options);
754
+ const query = useQuery4(queryOptions, queryClient);
755
+ return withQueryKey4(query, queryOptions.queryKey);
756
+ }
757
+ var toggleFavorite = (id, signal) => {
758
+ return request(
759
+ {
760
+ url: `/contacts/${id}/favorite`,
761
+ method: "PATCH",
762
+ signal
763
+ }
764
+ );
765
+ };
766
+ var getToggleFavoriteMutationOptions = (options) => {
767
+ const mutationKey = ["toggleFavorite"];
768
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
769
+ const mutationFn = (props) => {
770
+ const { id } = props ?? {};
771
+ return toggleFavorite(id);
772
+ };
773
+ return { mutationFn, ...mutationOptions };
774
+ };
775
+ var useToggleFavorite = (options, queryClient) => {
776
+ return useMutation3(getToggleFavoriteMutationOptions(options), queryClient);
777
+ };
778
+
779
+ // src/generated/react-query/endpoints/labels.tanstack.ts
780
+ import {
781
+ useMutation as useMutation4,
782
+ useQuery as useQuery5
783
+ } from "@tanstack/react-query";
784
+ var withQueryKey5 = (query, queryKey) => {
785
+ const result = { queryKey };
786
+ for (const key of Object.keys(query)) {
787
+ if (key === "queryKey") continue;
788
+ Object.defineProperty(result, key, {
789
+ enumerable: true,
790
+ configurable: true,
791
+ get: () => query[key]
792
+ });
793
+ }
794
+ return result;
795
+ };
796
+ var createLabel = (createLabelBody, signal) => {
797
+ return request(
798
+ {
799
+ url: `/labels`,
800
+ method: "POST",
801
+ headers: { "Content-Type": "application/json" },
802
+ data: createLabelBody,
803
+ signal
804
+ }
805
+ );
806
+ };
807
+ var getCreateLabelMutationOptions = (options) => {
808
+ const mutationKey = ["createLabel"];
809
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
810
+ const mutationFn = (props) => {
811
+ const { data } = props ?? {};
812
+ return createLabel(data);
813
+ };
814
+ return { mutationFn, ...mutationOptions };
815
+ };
816
+ var useCreateLabel = (options, queryClient) => {
817
+ return useMutation4(getCreateLabelMutationOptions(options), queryClient);
818
+ };
819
+ var listLabel = (signal) => {
820
+ return request(
821
+ {
822
+ url: `/labels`,
823
+ method: "GET",
824
+ signal
825
+ }
826
+ );
827
+ };
828
+ var getListLabelQueryKey = () => {
829
+ return [
830
+ `/labels`
831
+ ];
832
+ };
833
+ var getListLabelQueryOptions = (options) => {
834
+ const { query: queryOptions } = options ?? {};
835
+ const queryKey = queryOptions?.queryKey ?? getListLabelQueryKey();
836
+ const queryFn = ({ signal }) => listLabel(signal);
837
+ return { queryKey, queryFn, ...queryOptions };
838
+ };
839
+ function useListLabel(options, queryClient) {
840
+ const queryOptions = getListLabelQueryOptions(options);
841
+ const query = useQuery5(queryOptions, queryClient);
842
+ return withQueryKey5(query, queryOptions.queryKey);
843
+ }
844
+ var updateLabel = (id, updateLabelBody, signal) => {
845
+ return request(
846
+ {
847
+ url: `/labels/${id}`,
848
+ method: "PUT",
849
+ headers: { "Content-Type": "application/json" },
850
+ data: updateLabelBody,
851
+ signal
852
+ }
853
+ );
854
+ };
855
+ var getUpdateLabelMutationOptions = (options) => {
856
+ const mutationKey = ["updateLabel"];
857
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
858
+ const mutationFn = (props) => {
859
+ const { id, data } = props ?? {};
860
+ return updateLabel(id, data);
861
+ };
862
+ return { mutationFn, ...mutationOptions };
863
+ };
864
+ var useUpdateLabel = (options, queryClient) => {
865
+ return useMutation4(getUpdateLabelMutationOptions(options), queryClient);
866
+ };
867
+ var deleteLabel = (id, signal) => {
868
+ return request(
869
+ {
870
+ url: `/labels/${id}`,
871
+ method: "DELETE",
872
+ signal
873
+ }
874
+ );
875
+ };
876
+ var getDeleteLabelMutationOptions = (options) => {
877
+ const mutationKey = ["deleteLabel"];
878
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
879
+ const mutationFn = (props) => {
880
+ const { id } = props ?? {};
881
+ return deleteLabel(id);
882
+ };
883
+ return { mutationFn, ...mutationOptions };
884
+ };
885
+ var useDeleteLabel = (options, queryClient) => {
886
+ return useMutation4(getDeleteLabelMutationOptions(options), queryClient);
887
+ };
888
+
889
+ // src/generated/react-query/endpoints/leads.tanstack.ts
890
+ import {
891
+ useMutation as useMutation5,
892
+ useQuery as useQuery6
893
+ } from "@tanstack/react-query";
894
+ var withQueryKey6 = (query, queryKey) => {
895
+ const result = { queryKey };
896
+ for (const key of Object.keys(query)) {
897
+ if (key === "queryKey") continue;
898
+ Object.defineProperty(result, key, {
899
+ enumerable: true,
900
+ configurable: true,
901
+ get: () => query[key]
902
+ });
903
+ }
904
+ return result;
905
+ };
906
+ var listLeads = (params, signal) => {
907
+ return request(
908
+ {
909
+ url: `/leads`,
910
+ method: "GET",
911
+ params,
912
+ signal
913
+ }
914
+ );
915
+ };
916
+ var getListLeadsQueryKey = (params) => {
917
+ return [
918
+ `/leads`,
919
+ ...params ? [params] : []
920
+ ];
921
+ };
922
+ var getListLeadsQueryOptions = (params, options) => {
923
+ const { query: queryOptions } = options ?? {};
924
+ const queryKey = queryOptions?.queryKey ?? getListLeadsQueryKey(params);
925
+ const queryFn = ({ signal }) => listLeads(params, signal);
926
+ return { queryKey, queryFn, ...queryOptions };
927
+ };
928
+ function useListLeads(params, options, queryClient) {
929
+ const queryOptions = getListLeadsQueryOptions(params, options);
930
+ const query = useQuery6(queryOptions, queryClient);
931
+ return withQueryKey6(query, queryOptions.queryKey);
932
+ }
933
+ var importLeads = (importLeadsBody, signal) => {
934
+ const formData = new FormData();
935
+ if (importLeadsBody.file !== void 0) {
936
+ formData.append(`file`, importLeadsBody.file);
937
+ }
938
+ return request(
939
+ {
940
+ url: `/leads/import`,
941
+ method: "POST",
942
+ headers: { "Content-Type": "multipart/form-data" },
943
+ data: formData,
944
+ signal
945
+ }
946
+ );
947
+ };
948
+ var getImportLeadsMutationOptions = (options) => {
949
+ const mutationKey = ["importLeads"];
950
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
951
+ const mutationFn = (props) => {
952
+ const { data } = props ?? {};
953
+ return importLeads(data);
954
+ };
955
+ return { mutationFn, ...mutationOptions };
956
+ };
957
+ var useImportLeads = (options, queryClient) => {
958
+ return useMutation5(getImportLeadsMutationOptions(options), queryClient);
959
+ };
960
+ var getLead = (id, signal) => {
961
+ return request(
962
+ {
963
+ url: `/leads/${id}`,
964
+ method: "GET",
965
+ signal
966
+ }
967
+ );
968
+ };
969
+ var getGetLeadQueryKey = (id) => {
970
+ return [
971
+ `/leads/${id}`
972
+ ];
973
+ };
974
+ var getGetLeadQueryOptions = (id, options) => {
975
+ const { query: queryOptions } = options ?? {};
976
+ const queryKey = queryOptions?.queryKey ?? getGetLeadQueryKey(id);
977
+ const queryFn = ({ signal }) => getLead(id, signal);
978
+ return { queryKey, queryFn, enabled: id !== null && id !== void 0, ...queryOptions };
979
+ };
980
+ function useGetLead(id, options, queryClient) {
981
+ const queryOptions = getGetLeadQueryOptions(id, options);
982
+ const query = useQuery6(queryOptions, queryClient);
983
+ return withQueryKey6(query, queryOptions.queryKey);
984
+ }
985
+ var updateLead = (id, updateLeadBody, signal) => {
986
+ return request(
987
+ {
988
+ url: `/leads/${id}`,
989
+ method: "PATCH",
990
+ headers: { "Content-Type": "application/json" },
991
+ data: updateLeadBody,
992
+ signal
993
+ }
994
+ );
995
+ };
996
+ var getUpdateLeadMutationOptions = (options) => {
997
+ const mutationKey = ["updateLead"];
998
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
999
+ const mutationFn = (props) => {
1000
+ const { id, data } = props ?? {};
1001
+ return updateLead(id, data);
1002
+ };
1003
+ return { mutationFn, ...mutationOptions };
1004
+ };
1005
+ var useUpdateLead = (options, queryClient) => {
1006
+ return useMutation5(getUpdateLeadMutationOptions(options), queryClient);
1007
+ };
1008
+ var listLeadEvents = (id, signal) => {
1009
+ return request(
1010
+ {
1011
+ url: `/leads/${id}/events`,
1012
+ method: "GET",
1013
+ signal
1014
+ }
1015
+ );
1016
+ };
1017
+ var getListLeadEventsQueryKey = (id) => {
1018
+ return [
1019
+ `/leads/${id}/events`
1020
+ ];
1021
+ };
1022
+ var getListLeadEventsQueryOptions = (id, options) => {
1023
+ const { query: queryOptions } = options ?? {};
1024
+ const queryKey = queryOptions?.queryKey ?? getListLeadEventsQueryKey(id);
1025
+ const queryFn = ({ signal }) => listLeadEvents(id, signal);
1026
+ return { queryKey, queryFn, enabled: id !== null && id !== void 0, ...queryOptions };
1027
+ };
1028
+ function useListLeadEvents(id, options, queryClient) {
1029
+ const queryOptions = getListLeadEventsQueryOptions(id, options);
1030
+ const query = useQuery6(queryOptions, queryClient);
1031
+ return withQueryKey6(query, queryOptions.queryKey);
1032
+ }
1033
+
1034
+ // src/generated/react-query/endpoints/magnets.tanstack.ts
1035
+ import {
1036
+ useMutation as useMutation6,
1037
+ useQuery as useQuery7
1038
+ } from "@tanstack/react-query";
1039
+ var withQueryKey7 = (query, queryKey) => {
1040
+ const result = { queryKey };
1041
+ for (const key of Object.keys(query)) {
1042
+ if (key === "queryKey") continue;
1043
+ Object.defineProperty(result, key, {
1044
+ enumerable: true,
1045
+ configurable: true,
1046
+ get: () => query[key]
1047
+ });
1048
+ }
1049
+ return result;
1050
+ };
1051
+ var listLeadMagnets = (signal) => {
1052
+ return request(
1053
+ {
1054
+ url: `/lead-magnets`,
1055
+ method: "GET",
1056
+ signal
1057
+ }
1058
+ );
1059
+ };
1060
+ var getListLeadMagnetsQueryKey = () => {
1061
+ return [
1062
+ `/lead-magnets`
1063
+ ];
1064
+ };
1065
+ var getListLeadMagnetsQueryOptions = (options) => {
1066
+ const { query: queryOptions } = options ?? {};
1067
+ const queryKey = queryOptions?.queryKey ?? getListLeadMagnetsQueryKey();
1068
+ const queryFn = ({ signal }) => listLeadMagnets(signal);
1069
+ return { queryKey, queryFn, ...queryOptions };
1070
+ };
1071
+ function useListLeadMagnets(options, queryClient) {
1072
+ const queryOptions = getListLeadMagnetsQueryOptions(options);
1073
+ const query = useQuery7(queryOptions, queryClient);
1074
+ return withQueryKey7(query, queryOptions.queryKey);
1075
+ }
1076
+ var createLeadMagnet = (createLeadMagnetBody, signal) => {
1077
+ return request(
1078
+ {
1079
+ url: `/lead-magnets`,
1080
+ method: "POST",
1081
+ headers: { "Content-Type": "application/json" },
1082
+ data: createLeadMagnetBody,
1083
+ signal
1084
+ }
1085
+ );
1086
+ };
1087
+ var getCreateLeadMagnetMutationOptions = (options) => {
1088
+ const mutationKey = ["createLeadMagnet"];
1089
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
1090
+ const mutationFn = (props) => {
1091
+ const { data } = props ?? {};
1092
+ return createLeadMagnet(data);
1093
+ };
1094
+ return { mutationFn, ...mutationOptions };
1095
+ };
1096
+ var useCreateLeadMagnet = (options, queryClient) => {
1097
+ return useMutation6(getCreateLeadMagnetMutationOptions(options), queryClient);
1098
+ };
1099
+ var uploadLeadMagnetFile = (uploadLeadMagnetFileBody, signal) => {
1100
+ const formData = new FormData();
1101
+ if (uploadLeadMagnetFileBody.file !== void 0) {
1102
+ formData.append(`file`, uploadLeadMagnetFileBody.file);
1103
+ }
1104
+ return request(
1105
+ {
1106
+ url: `/lead-magnets/upload`,
1107
+ method: "POST",
1108
+ headers: { "Content-Type": "multipart/form-data" },
1109
+ data: formData,
1110
+ signal
1111
+ }
1112
+ );
1113
+ };
1114
+ var getUploadLeadMagnetFileMutationOptions = (options) => {
1115
+ const mutationKey = ["uploadLeadMagnetFile"];
1116
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
1117
+ const mutationFn = (props) => {
1118
+ const { data } = props ?? {};
1119
+ return uploadLeadMagnetFile(data);
1120
+ };
1121
+ return { mutationFn, ...mutationOptions };
1122
+ };
1123
+ var useUploadLeadMagnetFile = (options, queryClient) => {
1124
+ return useMutation6(getUploadLeadMagnetFileMutationOptions(options), queryClient);
1125
+ };
1126
+ var getLeadMagnet = (id, signal) => {
1127
+ return request(
1128
+ {
1129
+ url: `/lead-magnets/${id}`,
1130
+ method: "GET",
1131
+ signal
1132
+ }
1133
+ );
1134
+ };
1135
+ var getGetLeadMagnetQueryKey = (id) => {
1136
+ return [
1137
+ `/lead-magnets/${id}`
1138
+ ];
1139
+ };
1140
+ var getGetLeadMagnetQueryOptions = (id, options) => {
1141
+ const { query: queryOptions } = options ?? {};
1142
+ const queryKey = queryOptions?.queryKey ?? getGetLeadMagnetQueryKey(id);
1143
+ const queryFn = ({ signal }) => getLeadMagnet(id, signal);
1144
+ return { queryKey, queryFn, enabled: id !== null && id !== void 0, ...queryOptions };
1145
+ };
1146
+ function useGetLeadMagnet(id, options, queryClient) {
1147
+ const queryOptions = getGetLeadMagnetQueryOptions(id, options);
1148
+ const query = useQuery7(queryOptions, queryClient);
1149
+ return withQueryKey7(query, queryOptions.queryKey);
1150
+ }
1151
+ var updateLeadMagnet = (id, updateLeadMagnetBody, signal) => {
1152
+ return request(
1153
+ {
1154
+ url: `/lead-magnets/${id}`,
1155
+ method: "PATCH",
1156
+ headers: { "Content-Type": "application/json" },
1157
+ data: updateLeadMagnetBody,
1158
+ signal
1159
+ }
1160
+ );
1161
+ };
1162
+ var getUpdateLeadMagnetMutationOptions = (options) => {
1163
+ const mutationKey = ["updateLeadMagnet"];
1164
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
1165
+ const mutationFn = (props) => {
1166
+ const { id, data } = props ?? {};
1167
+ return updateLeadMagnet(id, data);
1168
+ };
1169
+ return { mutationFn, ...mutationOptions };
1170
+ };
1171
+ var useUpdateLeadMagnet = (options, queryClient) => {
1172
+ return useMutation6(getUpdateLeadMagnetMutationOptions(options), queryClient);
1173
+ };
1174
+ var deleteLeadMagnet = (id, signal) => {
1175
+ return request(
1176
+ {
1177
+ url: `/lead-magnets/${id}`,
1178
+ method: "DELETE",
1179
+ signal
1180
+ }
1181
+ );
1182
+ };
1183
+ var getDeleteLeadMagnetMutationOptions = (options) => {
1184
+ const mutationKey = ["deleteLeadMagnet"];
1185
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
1186
+ const mutationFn = (props) => {
1187
+ const { id } = props ?? {};
1188
+ return deleteLeadMagnet(id);
1189
+ };
1190
+ return { mutationFn, ...mutationOptions };
1191
+ };
1192
+ var useDeleteLeadMagnet = (options, queryClient) => {
1193
+ return useMutation6(getDeleteLeadMagnetMutationOptions(options), queryClient);
1194
+ };
1195
+
1196
+ // src/generated/react-query/endpoints/suppressions.tanstack.ts
1197
+ import {
1198
+ useMutation as useMutation7,
1199
+ useQuery as useQuery8
1200
+ } from "@tanstack/react-query";
1201
+ var withQueryKey8 = (query, queryKey) => {
1202
+ const result = { queryKey };
1203
+ for (const key of Object.keys(query)) {
1204
+ if (key === "queryKey") continue;
1205
+ Object.defineProperty(result, key, {
1206
+ enumerable: true,
1207
+ configurable: true,
1208
+ get: () => query[key]
1209
+ });
1210
+ }
1211
+ return result;
1212
+ };
1213
+ var listSuppressions = (signal) => {
1214
+ return request(
1215
+ {
1216
+ url: `/suppressions`,
1217
+ method: "GET",
1218
+ signal
1219
+ }
1220
+ );
1221
+ };
1222
+ var getListSuppressionsQueryKey = () => {
1223
+ return [
1224
+ `/suppressions`
1225
+ ];
1226
+ };
1227
+ var getListSuppressionsQueryOptions = (options) => {
1228
+ const { query: queryOptions } = options ?? {};
1229
+ const queryKey = queryOptions?.queryKey ?? getListSuppressionsQueryKey();
1230
+ const queryFn = ({ signal }) => listSuppressions(signal);
1231
+ return { queryKey, queryFn, ...queryOptions };
1232
+ };
1233
+ function useListSuppressions(options, queryClient) {
1234
+ const queryOptions = getListSuppressionsQueryOptions(options);
1235
+ const query = useQuery8(queryOptions, queryClient);
1236
+ return withQueryKey8(query, queryOptions.queryKey);
1237
+ }
1238
+ var createSuppression = (createSuppressionBody, signal) => {
1239
+ return request(
1240
+ {
1241
+ url: `/suppressions`,
1242
+ method: "POST",
1243
+ headers: { "Content-Type": "application/json" },
1244
+ data: createSuppressionBody,
1245
+ signal
1246
+ }
1247
+ );
1248
+ };
1249
+ var getCreateSuppressionMutationOptions = (options) => {
1250
+ const mutationKey = ["createSuppression"];
1251
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
1252
+ const mutationFn = (props) => {
1253
+ const { data } = props ?? {};
1254
+ return createSuppression(data);
1255
+ };
1256
+ return { mutationFn, ...mutationOptions };
1257
+ };
1258
+ var useCreateSuppression = (options, queryClient) => {
1259
+ return useMutation7(getCreateSuppressionMutationOptions(options), queryClient);
1260
+ };
1261
+ var deleteSuppression = (id, signal) => {
1262
+ return request(
1263
+ {
1264
+ url: `/suppressions/${id}`,
1265
+ method: "DELETE",
1266
+ signal
1267
+ }
1268
+ );
1269
+ };
1270
+ var getDeleteSuppressionMutationOptions = (options) => {
1271
+ const mutationKey = ["deleteSuppression"];
1272
+ const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
1273
+ const mutationFn = (props) => {
1274
+ const { id } = props ?? {};
1275
+ return deleteSuppression(id);
1276
+ };
1277
+ return { mutationFn, ...mutationOptions };
1278
+ };
1279
+ var useDeleteSuppression = (options, queryClient) => {
1280
+ return useMutation7(getDeleteSuppressionMutationOptions(options), queryClient);
1281
+ };
1282
+ export {
1283
+ ContactProvider,
1284
+ addAudienceContact,
1285
+ assignLabel,
1286
+ createApiKey,
1287
+ createAudience,
1288
+ createContact,
1289
+ createLabel,
1290
+ createLeadMagnet,
1291
+ createSuppression,
1292
+ deleteAudience,
1293
+ deleteLabel,
1294
+ deleteLeadMagnet,
1295
+ deleteSuppression,
1296
+ deletedContact,
1297
+ exportToCsv,
1298
+ exportToVcard,
1299
+ getAccount,
1300
+ getAddAudienceContactMutationOptions,
1301
+ getApiKeyUsage,
1302
+ getAssignLabelMutationOptions,
1303
+ getAudience,
1304
+ getAudienceRecipients,
1305
+ getContact,
1306
+ getCreateApiKeyMutationOptions,
1307
+ getCreateAudienceMutationOptions,
1308
+ getCreateContactMutationOptions,
1309
+ getCreateLabelMutationOptions,
1310
+ getCreateLeadMagnetMutationOptions,
1311
+ getCreateSuppressionMutationOptions,
1312
+ getDeleteAudienceMutationOptions,
1313
+ getDeleteLabelMutationOptions,
1314
+ getDeleteLeadMagnetMutationOptions,
1315
+ getDeleteSuppressionMutationOptions,
1316
+ getDeletedContactMutationOptions,
1317
+ getExportToCsvQueryKey,
1318
+ getExportToCsvQueryOptions,
1319
+ getExportToVcardQueryKey,
1320
+ getExportToVcardQueryOptions,
1321
+ getGetAccountQueryKey,
1322
+ getGetAccountQueryOptions,
1323
+ getGetApiKeyUsageQueryKey,
1324
+ getGetApiKeyUsageQueryOptions,
1325
+ getGetAudienceQueryKey,
1326
+ getGetAudienceQueryOptions,
1327
+ getGetAudienceRecipientsQueryKey,
1328
+ getGetAudienceRecipientsQueryOptions,
1329
+ getGetContactQueryKey,
1330
+ getGetContactQueryOptions,
1331
+ getGetLeadMagnetQueryKey,
1332
+ getGetLeadMagnetQueryOptions,
1333
+ getGetLeadQueryKey,
1334
+ getGetLeadQueryOptions,
1335
+ getImportFromCsvMutationOptions,
1336
+ getImportFromVcardMutationOptions,
1337
+ getImportLeadsMutationOptions,
1338
+ getLead,
1339
+ getLeadMagnet,
1340
+ getListApiKeyScopesQueryKey,
1341
+ getListApiKeyScopesQueryOptions,
1342
+ getListApiKeysQueryKey,
1343
+ getListApiKeysQueryOptions,
1344
+ getListAudiencesQueryKey,
1345
+ getListAudiencesQueryOptions,
1346
+ getListContactQueryKey,
1347
+ getListContactQueryOptions,
1348
+ getListDuplicateQueryKey,
1349
+ getListDuplicateQueryOptions,
1350
+ getListLabelQueryKey,
1351
+ getListLabelQueryOptions,
1352
+ getListLeadEventsQueryKey,
1353
+ getListLeadEventsQueryOptions,
1354
+ getListLeadMagnetsQueryKey,
1355
+ getListLeadMagnetsQueryOptions,
1356
+ getListLeadsQueryKey,
1357
+ getListLeadsQueryOptions,
1358
+ getListSuppressionsQueryKey,
1359
+ getListSuppressionsQueryOptions,
1360
+ getMergeContactMutationOptions,
1361
+ getRemoveAudienceContactMutationOptions,
1362
+ getRemoveLabelMutationOptions,
1363
+ getRevokeApiKeyMutationOptions,
1364
+ getRotateApiKeyMutationOptions,
1365
+ getToggleFavoriteMutationOptions,
1366
+ getUpdateAudienceMutationOptions,
1367
+ getUpdateContactMutationOptions,
1368
+ getUpdateLabelMutationOptions,
1369
+ getUpdateLeadMagnetMutationOptions,
1370
+ getUpdateLeadMutationOptions,
1371
+ getUploadLeadMagnetFileMutationOptions,
1372
+ importFromCsv,
1373
+ importFromVcard,
1374
+ importLeads,
1375
+ listApiKeyScopes,
1376
+ listApiKeys,
1377
+ listAudiences,
1378
+ listContact,
1379
+ listDuplicate,
1380
+ listLabel,
1381
+ listLeadEvents,
1382
+ listLeadMagnets,
1383
+ listLeads,
1384
+ listSuppressions,
1385
+ mergeContact,
1386
+ removeAudienceContact,
1387
+ removeLabel,
1388
+ revokeApiKey,
1389
+ rotateApiKey,
1390
+ toggleFavorite,
1391
+ updateAudience,
1392
+ updateContact,
1393
+ updateLabel,
1394
+ updateLead,
1395
+ updateLeadMagnet,
1396
+ uploadLeadMagnetFile,
1397
+ useAddAudienceContact,
1398
+ useAssignLabel,
1399
+ useContactClient,
1400
+ useCreateApiKey,
1401
+ useCreateAudience,
1402
+ useCreateContact,
1403
+ useCreateLabel,
1404
+ useCreateLeadMagnet,
1405
+ useCreateSuppression,
1406
+ useDeleteAudience,
1407
+ useDeleteLabel,
1408
+ useDeleteLeadMagnet,
1409
+ useDeleteSuppression,
1410
+ useDeletedContact,
1411
+ useExportToCsv,
1412
+ useExportToVcard,
1413
+ useGetAccount,
1414
+ useGetApiKeyUsage,
1415
+ useGetAudience,
1416
+ useGetAudienceRecipients,
1417
+ useGetContact,
1418
+ useGetLead,
1419
+ useGetLeadMagnet,
1420
+ useImportFromCsv,
1421
+ useImportFromVcard,
1422
+ useImportLeads,
1423
+ useListApiKeyScopes,
1424
+ useListApiKeys,
1425
+ useListAudiences,
1426
+ useListContact,
1427
+ useListDuplicate,
1428
+ useListLabel,
1429
+ useListLeadEvents,
1430
+ useListLeadMagnets,
1431
+ useListLeads,
1432
+ useListSuppressions,
1433
+ useMergeContact,
1434
+ useRemoveAudienceContact,
1435
+ useRemoveLabel,
1436
+ useRevokeApiKey,
1437
+ useRotateApiKey,
1438
+ useToggleFavorite,
1439
+ useUpdateAudience,
1440
+ useUpdateContact,
1441
+ useUpdateLabel,
1442
+ useUpdateLead,
1443
+ useUpdateLeadMagnet,
1444
+ useUploadLeadMagnetFile
1445
+ };
1446
+ //# sourceMappingURL=react-query.js.map