@bunnyapp/components 1.8.0-beta.2 → 1.8.0-beta.4

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/cjs/index.js CHANGED
@@ -1283,7 +1283,7 @@ const DEFAULT_CONFIG = {
1283
1283
  };
1284
1284
 
1285
1285
  // This will be replaced at build time by rollup-plugin-replace
1286
- const PACKAGE_VERSION = '1.8.0-beta.1';
1286
+ const PACKAGE_VERSION = '1.8.0-beta.3';
1287
1287
  const createRequestHeaders = (token) => {
1288
1288
  const headers = createClientDevHeaders({ token });
1289
1289
  // Add the components version header
@@ -1310,7 +1310,12 @@ const gqlRequest = async ({ query, apiHost, token, vars, isInPreviewMode, }) =>
1310
1310
  const requestHeaders = {
1311
1311
  ...baseHeaders,
1312
1312
  };
1313
- return await request$1(`${apiHost}${graphqlEndpoint}`, query, vars, requestHeaders);
1313
+ try {
1314
+ return await request$1(`${apiHost}${graphqlEndpoint}`, query, vars, requestHeaders);
1315
+ }
1316
+ catch (error) {
1317
+ throw error;
1318
+ }
1314
1319
  };
1315
1320
  const createClientDevHeaders = ({ token, componentsVersion, additionalHeaders, }) => {
1316
1321
  const headers = {
@@ -1543,8 +1548,12 @@ const useAllErrorFormats = ({ onUserUnavailable, onInvalidOrMissingAuthorization
1543
1548
  };
1544
1549
 
1545
1550
  const useCreateQueryClient = () => {
1546
- const { onUserUnavailable, onInvalidOrMissingAuthorization, suppressUserUnavailableErrorNotification } = useBunnyProviderCallbacks();
1547
- const handleAllErrorFormats = useAllErrorFormats({ onUserUnavailable, onInvalidOrMissingAuthorization, suppressUserUnavailableErrorNotification });
1551
+ const { onUserUnavailable, onInvalidOrMissingAuthorization, suppressUserUnavailableErrorNotification, } = useBunnyProviderCallbacks();
1552
+ const handleAllErrorFormats = useAllErrorFormats({
1553
+ onUserUnavailable,
1554
+ onInvalidOrMissingAuthorization,
1555
+ suppressUserUnavailableErrorNotification,
1556
+ });
1548
1557
  const onError = (error, _query) => {
1549
1558
  // Extract mutation name from query string
1550
1559
  // const mutationName = query?.mutation?.match(/mutation\s+(\w+)/)?.[1];
@@ -1554,9 +1563,6 @@ const useCreateQueryClient = () => {
1554
1563
  };
1555
1564
  return () => new reactQuery.QueryClient({
1556
1565
  defaultOptions: {
1557
- mutations: {
1558
- onError,
1559
- },
1560
1566
  queries: {
1561
1567
  gcTime: Number.POSITIVE_INFINITY,
1562
1568
  refetchIntervalInBackground: false,
@@ -1565,6 +1571,9 @@ const useCreateQueryClient = () => {
1565
1571
  refetchOnWindowFocus: false,
1566
1572
  },
1567
1573
  },
1574
+ mutationCache: new reactQuery.MutationCache({
1575
+ onError,
1576
+ }),
1568
1577
  queryCache: new reactQuery.QueryCache({
1569
1578
  onError,
1570
1579
  }),
@@ -24436,12 +24445,9 @@ const mutation$c = t(`
24436
24445
  }
24437
24446
  `, [QuoteContext_QuoteFragment]);
24438
24447
  const quoteChargeUpdate$1 = async (quoteChargeId, quantity, apiHost, token) => {
24439
- var _a, _b;
24448
+ var _a;
24440
24449
  const response = await execute(mutation$c, { apiHost, token }, { quoteChargeId, quantity });
24441
- if ((_a = response.quoteChargeUpdate) === null || _a === void 0 ? void 0 : _a.errors) {
24442
- throw new Error(response.quoteChargeUpdate.errors[0]);
24443
- }
24444
- return (_b = response.quoteChargeUpdate) === null || _b === void 0 ? void 0 : _b.quoteCharge;
24450
+ return (_a = response.quoteChargeUpdate) === null || _a === void 0 ? void 0 : _a.quoteCharge;
24445
24451
  };
24446
24452
 
24447
24453
  /**
@@ -24484,12 +24490,9 @@ const mutation$b = t(`
24484
24490
  }
24485
24491
  `, [QuoteContext_QuoteFragment]);
24486
24492
  const quoteChargeDelete = async ({ quoteChargeId, token, apiHost }) => {
24487
- var _a, _b, _c, _d;
24493
+ var _a;
24488
24494
  const response = await execute(mutation$b, { apiHost, token }, { quoteChargeId });
24489
- if ((_a = response.quoteChargeDelete) === null || _a === void 0 ? void 0 : _a.errors) {
24490
- throw new Error((_c = (_b = response.quoteChargeDelete) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c[0]);
24491
- }
24492
- return (_d = response.quoteChargeDelete) === null || _d === void 0 ? void 0 : _d.quoteCharge;
24495
+ return (_a = response.quoteChargeDelete) === null || _a === void 0 ? void 0 : _a.quoteCharge;
24493
24496
  };
24494
24497
 
24495
24498
  const showErrorNotification$1 = useErrorNotification();
@@ -26558,20 +26561,6 @@ function priceListChargePriceDescription(maskedPriceListCharge) {
26558
26561
  return `Per ${unitName ? `${unitName} / ` : ''}${priceListCharge.showPriceAsMonthly ? 'month' : periodLabel}`;
26559
26562
  }
26560
26563
 
26561
- const GetActiveCharges_PriceListChargeFragment = t(`
26562
- fragment GetActiveCharges_PriceListChargeFragment on PriceListCharge {
26563
- deprecated
26564
- featureAddon
26565
- }
26566
- `);
26567
- // Active charges: any charge that is not deprecated and not a feature addon
26568
- function getActiveCharges(charges) {
26569
- return charges.filter(maskedCharge => {
26570
- const charge = readFragment(GetActiveCharges_PriceListChargeFragment, maskedCharge);
26571
- return !charge.deprecated && !charge.featureAddon;
26572
- });
26573
- }
26574
-
26575
26564
  const getPriceListUnitName_PriceListFragment = t(`
26576
26565
  fragment getPriceListUnitName_PriceListFragment on PriceList {
26577
26566
  charges {
@@ -26714,12 +26703,10 @@ const PricingTooltip_PriceListChargeFragment = t(`
26714
26703
  ...priceListChargePriceDescription_PriceListChargeFragment
26715
26704
  ...ChargeHasPriceTiers_PriceListChargeFragment
26716
26705
  ...ChargePriceTiers_PriceListChargeFragment
26717
- ...GetActiveCharges_PriceListChargeFragment
26718
26706
  }
26719
26707
  `, [
26720
26708
  ChargeHasPriceTiers_PriceListChargeFragment,
26721
26709
  ChargePriceTiers_PriceListChargeFragment,
26722
- GetActiveCharges_PriceListChargeFragment,
26723
26710
  priceListChargePriceDescription_PriceListChargeFragment
26724
26711
  ]);
26725
26712
  const PricingTooltip_PriceListFragment = t(`
@@ -26733,16 +26720,15 @@ const PricingTooltip_PriceListFragment = t(`
26733
26720
  const PricingTooltip = ({ className, priceListCharges: maskedPriceListCharges, currencyId, }) => {
26734
26721
  // Read fragments
26735
26722
  const priceListCharges = maskedPriceListCharges.map(charge => readFragment(PricingTooltip_PriceListChargeFragment, charge));
26736
- const activeCharges = getActiveCharges(priceListCharges);
26737
26723
  const content = react.useMemo(() => {
26738
- return (jsxRuntime.jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-3", children: activeCharges === null || activeCharges === void 0 ? void 0 : activeCharges.map((charge, index) => {
26724
+ return (jsxRuntime.jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-3", children: priceListCharges === null || priceListCharges === void 0 ? void 0 : priceListCharges.map((charge, index) => {
26739
26725
  const hasPriceTiers = chargeHasPriceTiers(charge);
26740
26726
  if (hasPriceTiers) {
26741
26727
  return jsxRuntime.jsx(ChargePriceTiers, { charge: charge, currencyId: currencyId }, index);
26742
26728
  }
26743
26729
  return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-1", children: [jsxRuntime.jsx("div", { className: "bunny-text-white bunny-font-bold", children: charge.name }), jsxRuntime.jsxs("div", { className: "bunny-text-gray-400 bunny-text-xs/3", children: [getChargeBasePrice(charge, currencyId), ' ', priceListChargePriceDescription(charge)] })] }, index));
26744
26730
  }) }));
26745
- }, [activeCharges, currencyId]);
26731
+ }, [priceListCharges, currencyId]);
26746
26732
  return (jsxRuntime.jsx(Tooltip, { className: `bunny-text-gray-400 bunny-text-sm ${className}`, title: content, children: jsxRuntime.jsx(icons.InfoCircleOutlined, { className: "bunny-text-gray-400 ", size: 15 }) }));
26747
26733
  };
26748
26734
 
@@ -26756,6 +26742,20 @@ function isEmptyHTML(html) {
26756
26742
  return /^<[^>]*>(\s*)<\/[^>]*>$/.test(html);
26757
26743
  }
26758
26744
 
26745
+ const GetActiveCharges_PriceListChargeFragment = t(`
26746
+ fragment GetActiveCharges_PriceListChargeFragment on PriceListCharge {
26747
+ deprecated
26748
+ featureAddon
26749
+ }
26750
+ `);
26751
+ // Active charges: any charge that is not deprecated and not a feature addon
26752
+ function getActiveCharges(charges) {
26753
+ return charges.filter(maskedCharge => {
26754
+ const charge = readFragment(GetActiveCharges_PriceListChargeFragment, maskedCharge);
26755
+ return !charge.deprecated && !charge.featureAddon;
26756
+ });
26757
+ }
26758
+
26759
26759
  const BillingPeriodDescription_PriceListFragment = t(`
26760
26760
  fragment BillingPeriodDescription_PriceListFragment on PriceList {
26761
26761
  periodMonths
@@ -28222,12 +28222,9 @@ const mutation$6 = t(`
28222
28222
  }
28223
28223
  `, [QuantityDrawer_QuoteFragment]);
28224
28224
  const quoteChargeUpdate = async (quoteChargeId, quantity, apiHost, token) => {
28225
- var _a, _b;
28225
+ var _a;
28226
28226
  const response = await execute(mutation$6, { apiHost, token }, { quoteChargeId, quantity });
28227
- if ((_a = response.quoteChargeUpdate) === null || _a === void 0 ? void 0 : _a.errors) {
28228
- throw new Error(response.quoteChargeUpdate.errors[0]);
28229
- }
28230
- return (_b = response.quoteChargeUpdate) === null || _b === void 0 ? void 0 : _b.quoteCharge;
28227
+ return (_a = response.quoteChargeUpdate) === null || _a === void 0 ? void 0 : _a.quoteCharge;
28231
28228
  };
28232
28229
 
28233
28230
  const mutation$5 = t(`
@@ -28273,12 +28270,9 @@ const mutation$4 = t(`
28273
28270
  }
28274
28271
  `, [QuantityDrawer_QuoteFragment]);
28275
28272
  const quoteSubscriptionUpdate = async (subscriptionIds, apiHost, token) => {
28276
- var _a, _b;
28273
+ var _a;
28277
28274
  const response = await execute(mutation$4, { apiHost, token }, { subscriptionIds });
28278
- if ((_a = response.quoteSubscriptionUpdate) === null || _a === void 0 ? void 0 : _a.errors) {
28279
- throw new Error(response.quoteSubscriptionUpdate.errors[0]);
28280
- }
28281
- return (_b = response.quoteSubscriptionUpdate) === null || _b === void 0 ? void 0 : _b.quote;
28275
+ return (_a = response.quoteSubscriptionUpdate) === null || _a === void 0 ? void 0 : _a.quote;
28282
28276
  };
28283
28277
 
28284
28278
  const formatDateForApi = (date) => {
@@ -17,8 +17,6 @@ export declare const PricingTooltip_PriceListChargeFragment: import("gql.tada").
17
17
  ChargeHasPriceTiers_PriceListChargeFragment: "PriceListCharge";
18
18
  } & {
19
19
  ChargePriceTiers_PriceListChargeFragment: "PriceListCharge";
20
- } & {
21
- GetActiveCharges_PriceListChargeFragment: "PriceListCharge";
22
20
  };
23
21
  }, {}, {
24
22
  fragment: "PricingTooltip_PriceListChargeFragment";
package/dist/esm/index.js CHANGED
@@ -2,7 +2,7 @@ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { useState, useEffect, isValidElement, createContext, useContext, useMemo, createElement, useRef, useCallback, Fragment as Fragment$1 } from 'react';
3
3
  import { WarningOutlined, CheckCircleOutlined, CreditCardOutlined, EllipsisOutlined, BankOutlined, DownloadOutlined, SearchOutlined, CheckCircleFilled, LoadingOutlined, CloseOutlined, InfoCircleOutlined } from '@ant-design/icons';
4
4
  import { notification, theme, ConfigProvider, Tag, Button, Dropdown, Typography, Input, Modal, Checkbox, Skeleton, Collapse, Spin, Form, Tooltip as Tooltip$1, Drawer, Card as Card$1, Divider, Select, Popconfirm, Table, Radio, Space, Switch } from 'antd';
5
- import { QueryClient, QueryCache, QueryClientProvider, useQuery, useMutation, useQueryClient, keepPreviousData, useIsMutating, useIsFetching } from '@tanstack/react-query';
5
+ import { QueryClient, MutationCache, QueryCache, QueryClientProvider, useQuery, useMutation, useQueryClient, keepPreviousData, useIsMutating, useIsFetching } from '@tanstack/react-query';
6
6
  import request$1 from 'graphql-request';
7
7
  import { RecoilRoot } from 'recoil';
8
8
  import { print } from 'graphql';
@@ -1281,7 +1281,7 @@ const DEFAULT_CONFIG = {
1281
1281
  };
1282
1282
 
1283
1283
  // This will be replaced at build time by rollup-plugin-replace
1284
- const PACKAGE_VERSION = '1.8.0-beta.1';
1284
+ const PACKAGE_VERSION = '1.8.0-beta.3';
1285
1285
  const createRequestHeaders = (token) => {
1286
1286
  const headers = createClientDevHeaders({ token });
1287
1287
  // Add the components version header
@@ -1308,7 +1308,12 @@ const gqlRequest = async ({ query, apiHost, token, vars, isInPreviewMode, }) =>
1308
1308
  const requestHeaders = {
1309
1309
  ...baseHeaders,
1310
1310
  };
1311
- return await request$1(`${apiHost}${graphqlEndpoint}`, query, vars, requestHeaders);
1311
+ try {
1312
+ return await request$1(`${apiHost}${graphqlEndpoint}`, query, vars, requestHeaders);
1313
+ }
1314
+ catch (error) {
1315
+ throw error;
1316
+ }
1312
1317
  };
1313
1318
  const createClientDevHeaders = ({ token, componentsVersion, additionalHeaders, }) => {
1314
1319
  const headers = {
@@ -1541,8 +1546,12 @@ const useAllErrorFormats = ({ onUserUnavailable, onInvalidOrMissingAuthorization
1541
1546
  };
1542
1547
 
1543
1548
  const useCreateQueryClient = () => {
1544
- const { onUserUnavailable, onInvalidOrMissingAuthorization, suppressUserUnavailableErrorNotification } = useBunnyProviderCallbacks();
1545
- const handleAllErrorFormats = useAllErrorFormats({ onUserUnavailable, onInvalidOrMissingAuthorization, suppressUserUnavailableErrorNotification });
1549
+ const { onUserUnavailable, onInvalidOrMissingAuthorization, suppressUserUnavailableErrorNotification, } = useBunnyProviderCallbacks();
1550
+ const handleAllErrorFormats = useAllErrorFormats({
1551
+ onUserUnavailable,
1552
+ onInvalidOrMissingAuthorization,
1553
+ suppressUserUnavailableErrorNotification,
1554
+ });
1546
1555
  const onError = (error, _query) => {
1547
1556
  // Extract mutation name from query string
1548
1557
  // const mutationName = query?.mutation?.match(/mutation\s+(\w+)/)?.[1];
@@ -1552,9 +1561,6 @@ const useCreateQueryClient = () => {
1552
1561
  };
1553
1562
  return () => new QueryClient({
1554
1563
  defaultOptions: {
1555
- mutations: {
1556
- onError,
1557
- },
1558
1564
  queries: {
1559
1565
  gcTime: Number.POSITIVE_INFINITY,
1560
1566
  refetchIntervalInBackground: false,
@@ -1563,6 +1569,9 @@ const useCreateQueryClient = () => {
1563
1569
  refetchOnWindowFocus: false,
1564
1570
  },
1565
1571
  },
1572
+ mutationCache: new MutationCache({
1573
+ onError,
1574
+ }),
1566
1575
  queryCache: new QueryCache({
1567
1576
  onError,
1568
1577
  }),
@@ -24434,12 +24443,9 @@ const mutation$c = t(`
24434
24443
  }
24435
24444
  `, [QuoteContext_QuoteFragment]);
24436
24445
  const quoteChargeUpdate$1 = async (quoteChargeId, quantity, apiHost, token) => {
24437
- var _a, _b;
24446
+ var _a;
24438
24447
  const response = await execute(mutation$c, { apiHost, token }, { quoteChargeId, quantity });
24439
- if ((_a = response.quoteChargeUpdate) === null || _a === void 0 ? void 0 : _a.errors) {
24440
- throw new Error(response.quoteChargeUpdate.errors[0]);
24441
- }
24442
- return (_b = response.quoteChargeUpdate) === null || _b === void 0 ? void 0 : _b.quoteCharge;
24448
+ return (_a = response.quoteChargeUpdate) === null || _a === void 0 ? void 0 : _a.quoteCharge;
24443
24449
  };
24444
24450
 
24445
24451
  /**
@@ -24482,12 +24488,9 @@ const mutation$b = t(`
24482
24488
  }
24483
24489
  `, [QuoteContext_QuoteFragment]);
24484
24490
  const quoteChargeDelete = async ({ quoteChargeId, token, apiHost }) => {
24485
- var _a, _b, _c, _d;
24491
+ var _a;
24486
24492
  const response = await execute(mutation$b, { apiHost, token }, { quoteChargeId });
24487
- if ((_a = response.quoteChargeDelete) === null || _a === void 0 ? void 0 : _a.errors) {
24488
- throw new Error((_c = (_b = response.quoteChargeDelete) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c[0]);
24489
- }
24490
- return (_d = response.quoteChargeDelete) === null || _d === void 0 ? void 0 : _d.quoteCharge;
24493
+ return (_a = response.quoteChargeDelete) === null || _a === void 0 ? void 0 : _a.quoteCharge;
24491
24494
  };
24492
24495
 
24493
24496
  const showErrorNotification$1 = useErrorNotification();
@@ -26556,20 +26559,6 @@ function priceListChargePriceDescription(maskedPriceListCharge) {
26556
26559
  return `Per ${unitName ? `${unitName} / ` : ''}${priceListCharge.showPriceAsMonthly ? 'month' : periodLabel}`;
26557
26560
  }
26558
26561
 
26559
- const GetActiveCharges_PriceListChargeFragment = t(`
26560
- fragment GetActiveCharges_PriceListChargeFragment on PriceListCharge {
26561
- deprecated
26562
- featureAddon
26563
- }
26564
- `);
26565
- // Active charges: any charge that is not deprecated and not a feature addon
26566
- function getActiveCharges(charges) {
26567
- return charges.filter(maskedCharge => {
26568
- const charge = readFragment(GetActiveCharges_PriceListChargeFragment, maskedCharge);
26569
- return !charge.deprecated && !charge.featureAddon;
26570
- });
26571
- }
26572
-
26573
26562
  const getPriceListUnitName_PriceListFragment = t(`
26574
26563
  fragment getPriceListUnitName_PriceListFragment on PriceList {
26575
26564
  charges {
@@ -26712,12 +26701,10 @@ const PricingTooltip_PriceListChargeFragment = t(`
26712
26701
  ...priceListChargePriceDescription_PriceListChargeFragment
26713
26702
  ...ChargeHasPriceTiers_PriceListChargeFragment
26714
26703
  ...ChargePriceTiers_PriceListChargeFragment
26715
- ...GetActiveCharges_PriceListChargeFragment
26716
26704
  }
26717
26705
  `, [
26718
26706
  ChargeHasPriceTiers_PriceListChargeFragment,
26719
26707
  ChargePriceTiers_PriceListChargeFragment,
26720
- GetActiveCharges_PriceListChargeFragment,
26721
26708
  priceListChargePriceDescription_PriceListChargeFragment
26722
26709
  ]);
26723
26710
  const PricingTooltip_PriceListFragment = t(`
@@ -26731,16 +26718,15 @@ const PricingTooltip_PriceListFragment = t(`
26731
26718
  const PricingTooltip = ({ className, priceListCharges: maskedPriceListCharges, currencyId, }) => {
26732
26719
  // Read fragments
26733
26720
  const priceListCharges = maskedPriceListCharges.map(charge => readFragment(PricingTooltip_PriceListChargeFragment, charge));
26734
- const activeCharges = getActiveCharges(priceListCharges);
26735
26721
  const content = useMemo(() => {
26736
- return (jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-3", children: activeCharges === null || activeCharges === void 0 ? void 0 : activeCharges.map((charge, index) => {
26722
+ return (jsx("div", { className: "bunny-flex bunny-flex-col bunny-gap-3", children: priceListCharges === null || priceListCharges === void 0 ? void 0 : priceListCharges.map((charge, index) => {
26737
26723
  const hasPriceTiers = chargeHasPriceTiers(charge);
26738
26724
  if (hasPriceTiers) {
26739
26725
  return jsx(ChargePriceTiers, { charge: charge, currencyId: currencyId }, index);
26740
26726
  }
26741
26727
  return (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-1", children: [jsx("div", { className: "bunny-text-white bunny-font-bold", children: charge.name }), jsxs("div", { className: "bunny-text-gray-400 bunny-text-xs/3", children: [getChargeBasePrice(charge, currencyId), ' ', priceListChargePriceDescription(charge)] })] }, index));
26742
26728
  }) }));
26743
- }, [activeCharges, currencyId]);
26729
+ }, [priceListCharges, currencyId]);
26744
26730
  return (jsx(Tooltip, { className: `bunny-text-gray-400 bunny-text-sm ${className}`, title: content, children: jsx(InfoCircleOutlined, { className: "bunny-text-gray-400 ", size: 15 }) }));
26745
26731
  };
26746
26732
 
@@ -26754,6 +26740,20 @@ function isEmptyHTML(html) {
26754
26740
  return /^<[^>]*>(\s*)<\/[^>]*>$/.test(html);
26755
26741
  }
26756
26742
 
26743
+ const GetActiveCharges_PriceListChargeFragment = t(`
26744
+ fragment GetActiveCharges_PriceListChargeFragment on PriceListCharge {
26745
+ deprecated
26746
+ featureAddon
26747
+ }
26748
+ `);
26749
+ // Active charges: any charge that is not deprecated and not a feature addon
26750
+ function getActiveCharges(charges) {
26751
+ return charges.filter(maskedCharge => {
26752
+ const charge = readFragment(GetActiveCharges_PriceListChargeFragment, maskedCharge);
26753
+ return !charge.deprecated && !charge.featureAddon;
26754
+ });
26755
+ }
26756
+
26757
26757
  const BillingPeriodDescription_PriceListFragment = t(`
26758
26758
  fragment BillingPeriodDescription_PriceListFragment on PriceList {
26759
26759
  periodMonths
@@ -28220,12 +28220,9 @@ const mutation$6 = t(`
28220
28220
  }
28221
28221
  `, [QuantityDrawer_QuoteFragment]);
28222
28222
  const quoteChargeUpdate = async (quoteChargeId, quantity, apiHost, token) => {
28223
- var _a, _b;
28223
+ var _a;
28224
28224
  const response = await execute(mutation$6, { apiHost, token }, { quoteChargeId, quantity });
28225
- if ((_a = response.quoteChargeUpdate) === null || _a === void 0 ? void 0 : _a.errors) {
28226
- throw new Error(response.quoteChargeUpdate.errors[0]);
28227
- }
28228
- return (_b = response.quoteChargeUpdate) === null || _b === void 0 ? void 0 : _b.quoteCharge;
28225
+ return (_a = response.quoteChargeUpdate) === null || _a === void 0 ? void 0 : _a.quoteCharge;
28229
28226
  };
28230
28227
 
28231
28228
  const mutation$5 = t(`
@@ -28271,12 +28268,9 @@ const mutation$4 = t(`
28271
28268
  }
28272
28269
  `, [QuantityDrawer_QuoteFragment]);
28273
28270
  const quoteSubscriptionUpdate = async (subscriptionIds, apiHost, token) => {
28274
- var _a, _b;
28271
+ var _a;
28275
28272
  const response = await execute(mutation$4, { apiHost, token }, { subscriptionIds });
28276
- if ((_a = response.quoteSubscriptionUpdate) === null || _a === void 0 ? void 0 : _a.errors) {
28277
- throw new Error(response.quoteSubscriptionUpdate.errors[0]);
28278
- }
28279
- return (_b = response.quoteSubscriptionUpdate) === null || _b === void 0 ? void 0 : _b.quote;
28273
+ return (_a = response.quoteSubscriptionUpdate) === null || _a === void 0 ? void 0 : _a.quote;
28280
28274
  };
28281
28275
 
28282
28276
  const formatDateForApi = (date) => {
@@ -17,8 +17,6 @@ export declare const PricingTooltip_PriceListChargeFragment: import("gql.tada").
17
17
  ChargeHasPriceTiers_PriceListChargeFragment: "PriceListCharge";
18
18
  } & {
19
19
  ChargePriceTiers_PriceListChargeFragment: "PriceListCharge";
20
- } & {
21
- GetActiveCharges_PriceListChargeFragment: "PriceListCharge";
22
20
  };
23
21
  }, {}, {
24
22
  fragment: "PricingTooltip_PriceListChargeFragment";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.8.0-beta.2",
3
+ "version": "1.8.0-beta.4",
4
4
  "description": "Components from the Bunny portal to embed Bunny UI functionality into your application.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",