@outseta/react 0.4.23 → 0.4.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2727,6 +2727,119 @@ var useCampaignSendTestCampaignEmail = (options) => {
2727
2727
  const mutationOptions = getCampaignSendTestCampaignEmailMutationOptions(options);
2728
2728
  return useMutation(mutationOptions);
2729
2729
  };
2730
+ var emailListGetAllEmailLists = (params, options, signal) => {
2731
+ return customFetch({
2732
+ url: `/api/v1/email/lists`,
2733
+ method: "GET",
2734
+ params,
2735
+ signal
2736
+ }, options);
2737
+ };
2738
+ var getEmailListGetAllEmailListsQueryKey = (params) => {
2739
+ return [
2740
+ `/api/v1/email/lists`,
2741
+ ...params ? [params] : []
2742
+ ];
2743
+ };
2744
+ var getEmailListGetAllEmailListsQueryOptions = (params, options) => {
2745
+ const { query: queryOptions, request: requestOptions } = options ?? {};
2746
+ const queryKey = queryOptions?.queryKey ?? getEmailListGetAllEmailListsQueryKey(params);
2747
+ const queryFn = ({ signal }) => emailListGetAllEmailLists(params, requestOptions, signal);
2748
+ return { queryKey, queryFn, ...queryOptions };
2749
+ };
2750
+ function useEmailListGetAllEmailLists(params, options) {
2751
+ const queryOptions = getEmailListGetAllEmailListsQueryOptions(params, options);
2752
+ const query = useQuery(queryOptions);
2753
+ query.queryKey = queryOptions.queryKey;
2754
+ return query;
2755
+ }
2756
+ var emailListAddEmailList = (emailListAddEmailListBody, options, signal) => {
2757
+ return customFetch({
2758
+ url: `/api/v1/email/lists`,
2759
+ method: "POST",
2760
+ headers: { "Content-Type": "application/json" },
2761
+ data: emailListAddEmailListBody,
2762
+ signal
2763
+ }, options);
2764
+ };
2765
+ var getEmailListAddEmailListMutationOptions = (options) => {
2766
+ const mutationKey = ["emailListAddEmailList"];
2767
+ const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: undefined };
2768
+ const mutationFn = (props) => {
2769
+ const { data } = props ?? {};
2770
+ return emailListAddEmailList(data, requestOptions);
2771
+ };
2772
+ return { mutationFn, ...mutationOptions };
2773
+ };
2774
+ var useEmailListAddEmailList = (options) => {
2775
+ const mutationOptions = getEmailListAddEmailListMutationOptions(options);
2776
+ return useMutation(mutationOptions);
2777
+ };
2778
+ var emailListGetEmailList = (emailListUid, options, signal) => {
2779
+ return customFetch({
2780
+ url: `/api/v1/email/lists/${emailListUid}`,
2781
+ method: "GET",
2782
+ signal
2783
+ }, options);
2784
+ };
2785
+ var getEmailListGetEmailListQueryKey = (emailListUid) => {
2786
+ return [
2787
+ `/api/v1/email/lists/${emailListUid}`
2788
+ ];
2789
+ };
2790
+ var getEmailListGetEmailListQueryOptions = (emailListUid, options) => {
2791
+ const { query: queryOptions, request: requestOptions } = options ?? {};
2792
+ const queryKey = queryOptions?.queryKey ?? getEmailListGetEmailListQueryKey(emailListUid);
2793
+ const queryFn = ({ signal }) => emailListGetEmailList(emailListUid, requestOptions, signal);
2794
+ return { queryKey, queryFn, enabled: !!emailListUid, ...queryOptions };
2795
+ };
2796
+ function useEmailListGetEmailList(emailListUid, options) {
2797
+ const queryOptions = getEmailListGetEmailListQueryOptions(emailListUid, options);
2798
+ const query = useQuery(queryOptions);
2799
+ query.queryKey = queryOptions.queryKey;
2800
+ return query;
2801
+ }
2802
+ var emailListUpdateEmailList = (emailListUid, emailListUpdateEmailListBody, options) => {
2803
+ return customFetch({
2804
+ url: `/api/v1/email/lists/${emailListUid}`,
2805
+ method: "PUT",
2806
+ headers: { "Content-Type": "application/json" },
2807
+ data: emailListUpdateEmailListBody
2808
+ }, options);
2809
+ };
2810
+ var getEmailListUpdateEmailListMutationOptions = (options) => {
2811
+ const mutationKey = ["emailListUpdateEmailList"];
2812
+ const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: undefined };
2813
+ const mutationFn = (props) => {
2814
+ const { emailListUid, data } = props ?? {};
2815
+ return emailListUpdateEmailList(emailListUid, data, requestOptions);
2816
+ };
2817
+ return { mutationFn, ...mutationOptions };
2818
+ };
2819
+ var useEmailListUpdateEmailList = (options) => {
2820
+ const mutationOptions = getEmailListUpdateEmailListMutationOptions(options);
2821
+ return useMutation(mutationOptions);
2822
+ };
2823
+ var emailListDeleteEmailList = (emailListUid, options) => {
2824
+ return customFetch({
2825
+ url: `/api/v1/email/lists/${emailListUid}`,
2826
+ method: "DELETE",
2827
+ responseType: "blob"
2828
+ }, options);
2829
+ };
2830
+ var getEmailListDeleteEmailListMutationOptions = (options) => {
2831
+ const mutationKey = ["emailListDeleteEmailList"];
2832
+ const { mutation: mutationOptions, request: requestOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, request: undefined };
2833
+ const mutationFn = (props) => {
2834
+ const { emailListUid } = props ?? {};
2835
+ return emailListDeleteEmailList(emailListUid, requestOptions);
2836
+ };
2837
+ return { mutationFn, ...mutationOptions };
2838
+ };
2839
+ var useEmailListDeleteEmailList = (options) => {
2840
+ const mutationOptions = getEmailListDeleteEmailListMutationOptions(options);
2841
+ return useMutation(mutationOptions);
2842
+ };
2730
2843
  var emailListGetAllSubscriptions = (emailListUid, params, options, signal) => {
2731
2844
  return customFetch({
2732
2845
  url: `/api/v1/email/lists/${emailListUid}/subscriptions`,
@@ -3611,9 +3724,14 @@ export {
3611
3724
  useInvoiceGetAllInvoices,
3612
3725
  useInvoiceDeleteInvoice,
3613
3726
  useInvoiceAddInvoice,
3727
+ useEmailListUpdateEmailList,
3728
+ useEmailListGetEmailList,
3614
3729
  useEmailListGetAllSubscriptions,
3730
+ useEmailListGetAllEmailLists,
3615
3731
  useEmailListDeleteSubscription,
3732
+ useEmailListDeleteEmailList,
3616
3733
  useEmailListAddSubscription,
3734
+ useEmailListAddEmailList,
3617
3735
  useDripCampaignUpdateDripCampaignMessage,
3618
3736
  useDripCampaignUpdateDripCampaign,
3619
3737
  useDripCampaignSendTestCampaignEmail,
@@ -3777,10 +3895,17 @@ export {
3777
3895
  getInvoiceGetAllInvoicesQueryKey,
3778
3896
  getInvoiceDeleteInvoiceMutationOptions,
3779
3897
  getInvoiceAddInvoiceMutationOptions,
3898
+ getEmailListUpdateEmailListMutationOptions,
3899
+ getEmailListGetEmailListQueryOptions,
3900
+ getEmailListGetEmailListQueryKey,
3780
3901
  getEmailListGetAllSubscriptionsQueryOptions,
3781
3902
  getEmailListGetAllSubscriptionsQueryKey,
3903
+ getEmailListGetAllEmailListsQueryOptions,
3904
+ getEmailListGetAllEmailListsQueryKey,
3782
3905
  getEmailListDeleteSubscriptionMutationOptions,
3906
+ getEmailListDeleteEmailListMutationOptions,
3783
3907
  getEmailListAddSubscriptionMutationOptions,
3908
+ getEmailListAddEmailListMutationOptions,
3784
3909
  getDripCampaignUpdateDripCampaignMutationOptions,
3785
3910
  getDripCampaignUpdateDripCampaignMessageMutationOptions,
3786
3911
  getDripCampaignSendTestCampaignEmailMutationOptions,
@@ -3853,9 +3978,14 @@ export {
3853
3978
  getAccountCancelAccountMutationOptions,
3854
3979
  getAccountAddPersonToAccountMutationOptions,
3855
3980
  getAccountAddAccountMutationOptions,
3981
+ emailListUpdateEmailList,
3982
+ emailListGetEmailList,
3856
3983
  emailListGetAllSubscriptions,
3984
+ emailListGetAllEmailLists,
3857
3985
  emailListDeleteSubscription,
3986
+ emailListDeleteEmailList,
3858
3987
  emailListAddSubscription,
3988
+ emailListAddEmailList,
3859
3989
  dripCampaignUpdateDripCampaignMessage,
3860
3990
  dripCampaignUpdateDripCampaign,
3861
3991
  dripCampaignSendTestCampaignEmail,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outseta/react",
3
- "version": "0.4.23",
3
+ "version": "0.4.24",
4
4
  "description": "React hooks and components for the Outseta API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -18,7 +18,7 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@outseta/api-client": "0.3.29"
21
+ "@outseta/api-client": "0.3.30"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": "^18.0.0 || ^19.0.0"
@@ -29,10 +29,15 @@ import type {
29
29
  DripCampaignSendTestCampaignEmailBody,
30
30
  DripCampaignUpdateDripCampaignBody,
31
31
  DripCampaignUpdateDripCampaignMessageBody,
32
+ EmailList,
33
+ EmailListAddEmailListBody,
32
34
  EmailListAddSubscriptionBody,
35
+ EmailListGetAllEmailLists200,
36
+ EmailListGetAllEmailListsParams,
33
37
  EmailListGetAllSubscriptions200,
34
38
  EmailListGetAllSubscriptionsParams,
35
- EmailListPerson
39
+ EmailListPerson,
40
+ EmailListUpdateEmailListBody
36
41
  } from '../outsetaAPI.schemas';
37
42
 
38
43
  import { customFetch } from '../../mutator';
@@ -1319,6 +1324,338 @@ export const useCampaignSendTestCampaignEmail = <TError = void,
1319
1324
  return useMutation(mutationOptions);
1320
1325
  }
1321
1326
  /**
1327
+ * @summary Retrieve all email lists.
1328
+ */
1329
+ export const emailListGetAllEmailLists = (
1330
+ params?: EmailListGetAllEmailListsParams,
1331
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
1332
+ ) => {
1333
+
1334
+
1335
+ return customFetch<EmailListGetAllEmailLists200>(
1336
+ {url: `/api/v1/email/lists`, method: 'GET',
1337
+ params, signal
1338
+ },
1339
+ options);
1340
+ }
1341
+
1342
+
1343
+
1344
+
1345
+ export const getEmailListGetAllEmailListsQueryKey = (params?: EmailListGetAllEmailListsParams,) => {
1346
+ return [
1347
+ `/api/v1/email/lists`, ...(params ? [params]: [])
1348
+ ] as const;
1349
+ }
1350
+
1351
+
1352
+ export const getEmailListGetAllEmailListsQueryOptions = <TData = Awaited<ReturnType<typeof emailListGetAllEmailLists>>, TError = void>(params?: EmailListGetAllEmailListsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof emailListGetAllEmailLists>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
1353
+ ) => {
1354
+
1355
+ const {query: queryOptions, request: requestOptions} = options ?? {};
1356
+
1357
+ const queryKey = queryOptions?.queryKey ?? getEmailListGetAllEmailListsQueryKey(params);
1358
+
1359
+
1360
+
1361
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof emailListGetAllEmailLists>>> = ({ signal }) => emailListGetAllEmailLists(params, requestOptions, signal);
1362
+
1363
+
1364
+
1365
+
1366
+
1367
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof emailListGetAllEmailLists>>, TError, TData> & { queryKey: QueryKey }
1368
+ }
1369
+
1370
+ export type EmailListGetAllEmailListsQueryResult = NonNullable<Awaited<ReturnType<typeof emailListGetAllEmailLists>>>
1371
+ export type EmailListGetAllEmailListsQueryError = void
1372
+
1373
+
1374
+ /**
1375
+ * @summary Retrieve all email lists.
1376
+ */
1377
+
1378
+ export function useEmailListGetAllEmailLists<TData = Awaited<ReturnType<typeof emailListGetAllEmailLists>>, TError = void>(
1379
+ params?: EmailListGetAllEmailListsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof emailListGetAllEmailLists>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
1380
+
1381
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
1382
+
1383
+ const queryOptions = getEmailListGetAllEmailListsQueryOptions(params,options)
1384
+
1385
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
1386
+
1387
+ query.queryKey = queryOptions.queryKey ;
1388
+
1389
+ return query;
1390
+ }
1391
+
1392
+
1393
+
1394
+
1395
+ /**
1396
+ * Name is required and must be unique. Set RequiresDoubleOptIn to true to require new
1397
+ subscribers to confirm their subscription. WelcomeSubject and WelcomeBody configure an
1398
+ optional welcome email; use WelcomeFromName and WelcomeFromEmail to set its sender.
1399
+ * @summary Create an email list.
1400
+ */
1401
+ export const emailListAddEmailList = (
1402
+ emailListAddEmailListBody: NonReadonly<EmailListAddEmailListBody>,
1403
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
1404
+ ) => {
1405
+
1406
+
1407
+ return customFetch<EmailList>(
1408
+ {url: `/api/v1/email/lists`, method: 'POST',
1409
+ headers: {'Content-Type': 'application/json', },
1410
+ data: emailListAddEmailListBody, signal
1411
+ },
1412
+ options);
1413
+ }
1414
+
1415
+
1416
+
1417
+ export const getEmailListAddEmailListMutationOptions = <TError = void,
1418
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof emailListAddEmailList>>, TError,{data: NonReadonly<EmailListAddEmailListBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
1419
+ ): UseMutationOptions<Awaited<ReturnType<typeof emailListAddEmailList>>, TError,{data: NonReadonly<EmailListAddEmailListBody>}, TContext> => {
1420
+
1421
+ const mutationKey = ['emailListAddEmailList'];
1422
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1423
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1424
+ options
1425
+ : {...options, mutation: {...options.mutation, mutationKey}}
1426
+ : {mutation: { mutationKey, }, request: undefined};
1427
+
1428
+
1429
+
1430
+
1431
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof emailListAddEmailList>>, {data: NonReadonly<EmailListAddEmailListBody>}> = (props) => {
1432
+ const {data} = props ?? {};
1433
+
1434
+ return emailListAddEmailList(data,requestOptions)
1435
+ }
1436
+
1437
+
1438
+
1439
+
1440
+ return { mutationFn, ...mutationOptions }}
1441
+
1442
+ export type EmailListAddEmailListMutationResult = NonNullable<Awaited<ReturnType<typeof emailListAddEmailList>>>
1443
+ export type EmailListAddEmailListMutationBody = NonReadonly<EmailListAddEmailListBody>
1444
+ export type EmailListAddEmailListMutationError = void
1445
+
1446
+ /**
1447
+ * @summary Create an email list.
1448
+ */
1449
+ export const useEmailListAddEmailList = <TError = void,
1450
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof emailListAddEmailList>>, TError,{data: NonReadonly<EmailListAddEmailListBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
1451
+ ): UseMutationResult<
1452
+ Awaited<ReturnType<typeof emailListAddEmailList>>,
1453
+ TError,
1454
+ {data: NonReadonly<EmailListAddEmailListBody>},
1455
+ TContext
1456
+ > => {
1457
+
1458
+ const mutationOptions = getEmailListAddEmailListMutationOptions(options);
1459
+
1460
+ return useMutation(mutationOptions);
1461
+ }
1462
+ /**
1463
+ * @summary Retrieve an email list.
1464
+ */
1465
+ export const emailListGetEmailList = (
1466
+ emailListUid: string | null,
1467
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
1468
+ ) => {
1469
+
1470
+
1471
+ return customFetch<EmailList>(
1472
+ {url: `/api/v1/email/lists/${emailListUid}`, method: 'GET', signal
1473
+ },
1474
+ options);
1475
+ }
1476
+
1477
+
1478
+
1479
+
1480
+ export const getEmailListGetEmailListQueryKey = (emailListUid?: string | null,) => {
1481
+ return [
1482
+ `/api/v1/email/lists/${emailListUid}`
1483
+ ] as const;
1484
+ }
1485
+
1486
+
1487
+ export const getEmailListGetEmailListQueryOptions = <TData = Awaited<ReturnType<typeof emailListGetEmailList>>, TError = void>(emailListUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof emailListGetEmailList>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
1488
+ ) => {
1489
+
1490
+ const {query: queryOptions, request: requestOptions} = options ?? {};
1491
+
1492
+ const queryKey = queryOptions?.queryKey ?? getEmailListGetEmailListQueryKey(emailListUid);
1493
+
1494
+
1495
+
1496
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof emailListGetEmailList>>> = ({ signal }) => emailListGetEmailList(emailListUid, requestOptions, signal);
1497
+
1498
+
1499
+
1500
+
1501
+
1502
+ return { queryKey, queryFn, enabled: !!(emailListUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof emailListGetEmailList>>, TError, TData> & { queryKey: QueryKey }
1503
+ }
1504
+
1505
+ export type EmailListGetEmailListQueryResult = NonNullable<Awaited<ReturnType<typeof emailListGetEmailList>>>
1506
+ export type EmailListGetEmailListQueryError = void
1507
+
1508
+
1509
+ /**
1510
+ * @summary Retrieve an email list.
1511
+ */
1512
+
1513
+ export function useEmailListGetEmailList<TData = Awaited<ReturnType<typeof emailListGetEmailList>>, TError = void>(
1514
+ emailListUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof emailListGetEmailList>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
1515
+
1516
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
1517
+
1518
+ const queryOptions = getEmailListGetEmailListQueryOptions(emailListUid,options)
1519
+
1520
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
1521
+
1522
+ query.queryKey = queryOptions.queryKey ;
1523
+
1524
+ return query;
1525
+ }
1526
+
1527
+
1528
+
1529
+
1530
+ /**
1531
+ * The Uid may be omitted from the request body. If supplied, it must match the Uid in the URL.
1532
+ * @summary Update an email list.
1533
+ */
1534
+ export const emailListUpdateEmailList = (
1535
+ emailListUid: string | null,
1536
+ emailListUpdateEmailListBody: NonReadonly<EmailListUpdateEmailListBody>,
1537
+ options?: SecondParameter<typeof customFetch>,) => {
1538
+
1539
+
1540
+ return customFetch<EmailList>(
1541
+ {url: `/api/v1/email/lists/${emailListUid}`, method: 'PUT',
1542
+ headers: {'Content-Type': 'application/json', },
1543
+ data: emailListUpdateEmailListBody
1544
+ },
1545
+ options);
1546
+ }
1547
+
1548
+
1549
+
1550
+ export const getEmailListUpdateEmailListMutationOptions = <TError = void,
1551
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof emailListUpdateEmailList>>, TError,{emailListUid: string | null;data: NonReadonly<EmailListUpdateEmailListBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
1552
+ ): UseMutationOptions<Awaited<ReturnType<typeof emailListUpdateEmailList>>, TError,{emailListUid: string | null;data: NonReadonly<EmailListUpdateEmailListBody>}, TContext> => {
1553
+
1554
+ const mutationKey = ['emailListUpdateEmailList'];
1555
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1556
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1557
+ options
1558
+ : {...options, mutation: {...options.mutation, mutationKey}}
1559
+ : {mutation: { mutationKey, }, request: undefined};
1560
+
1561
+
1562
+
1563
+
1564
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof emailListUpdateEmailList>>, {emailListUid: string | null;data: NonReadonly<EmailListUpdateEmailListBody>}> = (props) => {
1565
+ const {emailListUid,data} = props ?? {};
1566
+
1567
+ return emailListUpdateEmailList(emailListUid,data,requestOptions)
1568
+ }
1569
+
1570
+
1571
+
1572
+
1573
+ return { mutationFn, ...mutationOptions }}
1574
+
1575
+ export type EmailListUpdateEmailListMutationResult = NonNullable<Awaited<ReturnType<typeof emailListUpdateEmailList>>>
1576
+ export type EmailListUpdateEmailListMutationBody = NonReadonly<EmailListUpdateEmailListBody>
1577
+ export type EmailListUpdateEmailListMutationError = void
1578
+
1579
+ /**
1580
+ * @summary Update an email list.
1581
+ */
1582
+ export const useEmailListUpdateEmailList = <TError = void,
1583
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof emailListUpdateEmailList>>, TError,{emailListUid: string | null;data: NonReadonly<EmailListUpdateEmailListBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
1584
+ ): UseMutationResult<
1585
+ Awaited<ReturnType<typeof emailListUpdateEmailList>>,
1586
+ TError,
1587
+ {emailListUid: string | null;data: NonReadonly<EmailListUpdateEmailListBody>},
1588
+ TContext
1589
+ > => {
1590
+
1591
+ const mutationOptions = getEmailListUpdateEmailListMutationOptions(options);
1592
+
1593
+ return useMutation(mutationOptions);
1594
+ }
1595
+ /**
1596
+ * Deleting a list also removes all of its subscriptions.
1597
+ * @summary Delete an email list.
1598
+ */
1599
+ export const emailListDeleteEmailList = (
1600
+ emailListUid: string | null,
1601
+ options?: SecondParameter<typeof customFetch>,) => {
1602
+
1603
+
1604
+ return customFetch<Blob>(
1605
+ {url: `/api/v1/email/lists/${emailListUid}`, method: 'DELETE',
1606
+ responseType: 'blob'
1607
+ },
1608
+ options);
1609
+ }
1610
+
1611
+
1612
+
1613
+ export const getEmailListDeleteEmailListMutationOptions = <TError = void,
1614
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof emailListDeleteEmailList>>, TError,{emailListUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1615
+ ): UseMutationOptions<Awaited<ReturnType<typeof emailListDeleteEmailList>>, TError,{emailListUid: string | null}, TContext> => {
1616
+
1617
+ const mutationKey = ['emailListDeleteEmailList'];
1618
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1619
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1620
+ options
1621
+ : {...options, mutation: {...options.mutation, mutationKey}}
1622
+ : {mutation: { mutationKey, }, request: undefined};
1623
+
1624
+
1625
+
1626
+
1627
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof emailListDeleteEmailList>>, {emailListUid: string | null}> = (props) => {
1628
+ const {emailListUid} = props ?? {};
1629
+
1630
+ return emailListDeleteEmailList(emailListUid,requestOptions)
1631
+ }
1632
+
1633
+
1634
+
1635
+
1636
+ return { mutationFn, ...mutationOptions }}
1637
+
1638
+ export type EmailListDeleteEmailListMutationResult = NonNullable<Awaited<ReturnType<typeof emailListDeleteEmailList>>>
1639
+
1640
+ export type EmailListDeleteEmailListMutationError = void
1641
+
1642
+ /**
1643
+ * @summary Delete an email list.
1644
+ */
1645
+ export const useEmailListDeleteEmailList = <TError = void,
1646
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof emailListDeleteEmailList>>, TError,{emailListUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1647
+ ): UseMutationResult<
1648
+ Awaited<ReturnType<typeof emailListDeleteEmailList>>,
1649
+ TError,
1650
+ {emailListUid: string | null},
1651
+ TContext
1652
+ > => {
1653
+
1654
+ const mutationOptions = getEmailListDeleteEmailListMutationOptions(options);
1655
+
1656
+ return useMutation(mutationOptions);
1657
+ }
1658
+ /**
1322
1659
  * @summary Retrieve all subscribers to an email list.
1323
1660
  */
1324
1661
  export const emailListGetAllSubscriptions = (
@@ -9257,6 +9257,32 @@ export type CampaignUpdateBroadcastEmailBody = BroadcastCampaign | null;
9257
9257
  */
9258
9258
  export type CampaignSendTestCampaignEmailBody = SendTestEmailRequest2 | null;
9259
9259
 
9260
+ export type EmailListGetAllEmailListsParams = {
9261
+ /**
9262
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
9263
+ */
9264
+ limit?: LimitParameter;
9265
+ /**
9266
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
9267
+ */
9268
+ offset?: OffsetParameter;
9269
+ };
9270
+
9271
+ export type EmailListGetAllEmailLists200 = {
9272
+ metadata?: CollectionMetadata;
9273
+ items?: EmailList[];
9274
+ };
9275
+
9276
+ /**
9277
+ * @nullable
9278
+ */
9279
+ export type EmailListAddEmailListBody = EmailList | null;
9280
+
9281
+ /**
9282
+ * @nullable
9283
+ */
9284
+ export type EmailListUpdateEmailListBody = EmailList | null;
9285
+
9260
9286
  export type EmailListGetAllSubscriptionsParams = {
9261
9287
  /**
9262
9288
  * Matches person's first name or last name or email address.