autumn-js 0.0.31 → 0.0.34

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.
Files changed (94) hide show
  1. package/dist/next/AutumnProvider.js +1 -3
  2. package/dist/next/AutumnProvider.mjs +1 -3
  3. package/dist/next/client/AutumnContext.d.mts +2 -3
  4. package/dist/next/client/AutumnContext.d.ts +2 -3
  5. package/dist/next/client/AutumnContext.js +4 -0
  6. package/dist/next/client/AutumnContext.mjs +4 -0
  7. package/dist/next/client/AutumnProvider.d.mts +2 -6
  8. package/dist/next/client/AutumnProvider.d.ts +2 -6
  9. package/dist/next/client/AutumnProvider.js +22 -9
  10. package/dist/next/client/AutumnProvider.mjs +22 -9
  11. package/dist/next/client/clientUtils.d.mts +4 -4
  12. package/dist/next/client/clientUtils.d.ts +4 -4
  13. package/dist/next/client/clientUtils.js +13 -0
  14. package/dist/next/client/clientUtils.mjs +13 -0
  15. package/dist/next/client/{cusTypes-CBQqMlZy.d.mts → cusTypes-Cb2VYILZ.d.mts} +1 -1
  16. package/dist/next/client/{cusTypes-CBQqMlZy.d.ts → cusTypes-Cb2VYILZ.d.ts} +1 -1
  17. package/dist/next/client/hooks/types.d.mts +3 -1
  18. package/dist/next/client/hooks/types.d.ts +3 -1
  19. package/dist/next/client/hooks/useAutumn.d.mts +4 -40
  20. package/dist/next/client/hooks/useAutumn.d.ts +4 -40
  21. package/dist/next/client/hooks/useAutumn.js +25 -114
  22. package/dist/next/client/hooks/useAutumn.mjs +25 -114
  23. package/dist/next/client/hooks/useCustomer.d.mts +7 -3
  24. package/dist/next/client/hooks/useCustomer.d.ts +7 -3
  25. package/dist/next/client/hooks/useCustomer.js +19 -7
  26. package/dist/next/client/hooks/useCustomer.mjs +19 -7
  27. package/dist/next/client/hooks/useEntity.d.mts +3 -4
  28. package/dist/next/client/hooks/useEntity.d.ts +3 -4
  29. package/dist/next/client/hooks/useEntity.js +3 -4
  30. package/dist/next/client/hooks/useEntity.mjs +3 -4
  31. package/dist/next/client/hooks/usePricingTable.d.mts +2 -3
  32. package/dist/next/client/hooks/usePricingTable.d.ts +2 -3
  33. package/dist/next/client/types-B4Y4mIQa.d.mts +79 -0
  34. package/dist/next/client/types-D3Exrq7u.d.ts +79 -0
  35. package/dist/next/client/types.d.mts +2 -62
  36. package/dist/next/client/types.d.ts +2 -62
  37. package/dist/next/index.d.mts +80 -127
  38. package/dist/next/index.d.ts +80 -127
  39. package/dist/next/index.js +0 -2
  40. package/dist/next/index.mjs +0 -1
  41. package/dist/next/server/auth/clerk-wrapper.js +3 -3
  42. package/dist/next/server/auth/clerk-wrapper.mjs +3 -3
  43. package/dist/next/server/auth/handleAuthProvider.js +21 -10
  44. package/dist/next/server/auth/handleAuthProvider.mjs +21 -10
  45. package/dist/next/server/auth/withAuth.d.mts +1 -1
  46. package/dist/next/server/auth/withAuth.d.ts +1 -1
  47. package/dist/next/server/auth/withAuth.js +1 -1
  48. package/dist/next/server/auth/withAuth.mjs +1 -1
  49. package/dist/next/server/componentActions.d.mts +1 -1
  50. package/dist/next/server/componentActions.d.ts +1 -1
  51. package/dist/next/server/cusActions.d.mts +5 -5
  52. package/dist/next/server/cusActions.d.ts +5 -5
  53. package/dist/next/server/genActions.d.mts +6 -19
  54. package/dist/next/server/genActions.d.ts +6 -19
  55. package/dist/next/server/genActions.js +0 -30
  56. package/dist/next/server/genActions.mjs +0 -30
  57. package/dist/sdk/check.d.mts +47 -0
  58. package/dist/sdk/check.d.ts +47 -0
  59. package/dist/sdk/{cusTypes-BkqhmnvO.d.mts → cusTypes-1gVjxtAM.d.mts} +1 -1
  60. package/dist/sdk/{cusTypes-Xg665KFq.d.ts → cusTypes-2Z7Pse3i.d.mts} +3 -1
  61. package/dist/sdk/{cusTypes-CjqnH7C3.d.ts → cusTypes-B7CQWtcF.d.ts} +1 -1
  62. package/dist/sdk/{cusTypes-BPazw8Ki.d.mts → cusTypes-C-0PPSaY.d.ts} +3 -1
  63. package/dist/sdk/customers.d.mts +2 -2
  64. package/dist/sdk/customers.d.ts +2 -2
  65. package/dist/sdk/entities.d.mts +2 -2
  66. package/dist/sdk/entities.d.ts +2 -2
  67. package/dist/sdk/genEnums-DeFd80Sr.d.mts +6 -0
  68. package/dist/sdk/genEnums-DeFd80Sr.d.ts +6 -0
  69. package/dist/sdk/general.d.mts +2 -2
  70. package/dist/sdk/general.d.ts +2 -2
  71. package/dist/sdk/index.d.mts +6 -4
  72. package/dist/sdk/index.d.ts +6 -4
  73. package/dist/sdk/{prodEnums-CuZfnjiK.d.mts → prodEnums-C1lccCWI.d.mts} +2 -1
  74. package/dist/sdk/{prodEnums-CuZfnjiK.d.ts → prodEnums-C1lccCWI.d.ts} +2 -1
  75. package/dist/sdk/{prodEnums-BnhKkH4e.d.mts → prodEnums-DHDDT-uF.d.mts} +5 -8
  76. package/dist/sdk/{prodEnums-BnhKkH4e.d.ts → prodEnums-DHDDT-uF.d.ts} +5 -8
  77. package/dist/sdk/products.d.mts +1 -1
  78. package/dist/sdk/products.d.ts +1 -1
  79. package/package.json +1 -5
  80. package/tsup.config.ts +3 -1
  81. package/dist/next/client/entTypes-DHSCGE1o.d.mts +0 -19
  82. package/dist/next/client/entTypes-X4EHXDE5.d.ts +0 -19
  83. package/dist/next/client/error-CG2LXoa7.d.mts +0 -16
  84. package/dist/next/client/error-CG2LXoa7.d.ts +0 -16
  85. package/dist/next/webpack-ignore.js +0 -33
  86. package/dist/next/webpack-ignore.mjs +0 -13
  87. package/dist/sdk/cusTypes-B6L_-8Kz.d.mts +0 -79
  88. package/dist/sdk/cusTypes-B9fUPd5R.d.ts +0 -68
  89. package/dist/sdk/cusTypes-BIzuiqvx.d.mts +0 -74
  90. package/dist/sdk/cusTypes-BxDQNrCc.d.ts +0 -79
  91. package/dist/sdk/cusTypes-DEdFHlrl.d.mts +0 -68
  92. package/dist/sdk/cusTypes-DOUPrslI.d.ts +0 -79
  93. package/dist/sdk/cusTypes-Dqi6Qcj0.d.mts +0 -79
  94. package/dist/sdk/cusTypes-HqJzG9Vv.d.ts +0 -74
@@ -29,8 +29,7 @@ const AutumnProvider = ({
29
29
  customerId,
30
30
  customerData,
31
31
  authPlugin,
32
- children,
33
- components
32
+ children
34
33
  }) => {
35
34
  if (typeof window !== "undefined") {
36
35
  throw new Error(
@@ -49,7 +48,6 @@ const AutumnProvider = ({
49
48
  {
50
49
  encryptedCustomerId,
51
50
  customerData,
52
- components,
53
51
  children
54
52
  }
55
53
  );
@@ -6,8 +6,7 @@ const AutumnProvider = ({
6
6
  customerId,
7
7
  customerData,
8
8
  authPlugin,
9
- children,
10
- components
9
+ children
11
10
  }) => {
12
11
  if (typeof window !== "undefined") {
13
12
  throw new Error(
@@ -26,7 +25,6 @@ const AutumnProvider = ({
26
25
  {
27
26
  encryptedCustomerId,
28
27
  customerData,
29
- components,
30
28
  children
31
29
  }
32
30
  );
@@ -1,7 +1,6 @@
1
1
  import * as react from 'react';
2
- import { AutumnContextParams } from './types.mjs';
3
- import './cusTypes-CBQqMlZy.mjs';
4
- import './entTypes-DHSCGE1o.mjs';
2
+ import { A as AutumnContextParams } from './types-B4Y4mIQa.mjs';
3
+ import './cusTypes-Cb2VYILZ.mjs';
5
4
 
6
5
  declare const AutumnContext: react.Context<AutumnContextParams>;
7
6
  declare const useAutumnContext: () => AutumnContextParams;
@@ -1,7 +1,6 @@
1
1
  import * as react from 'react';
2
- import { AutumnContextParams } from './types.js';
3
- import './cusTypes-CBQqMlZy.js';
4
- import './entTypes-X4EHXDE5.js';
2
+ import { A as AutumnContextParams } from './types-D3Exrq7u.js';
3
+ import './cusTypes-Cb2VYILZ.js';
5
4
 
6
5
  declare const AutumnContext: react.Context<AutumnContextParams>;
7
6
  declare const useAutumnContext: () => AutumnContextParams;
@@ -15,6 +15,8 @@ const AutumnContext = createContext({
15
15
  setProps: () => {
16
16
  },
17
17
  setOpen: () => {
18
+ },
19
+ setComponent: () => {
18
20
  }
19
21
  },
20
22
  paywallDialog: {
@@ -22,6 +24,8 @@ const AutumnContext = createContext({
22
24
  setProps: () => {
23
25
  },
24
26
  setOpen: () => {
27
+ },
28
+ setComponent: () => {
25
29
  }
26
30
  },
27
31
  pricingTableProducts: null,
@@ -15,6 +15,8 @@ const AutumnContext = createContext({
15
15
  setProps: () => {
16
16
  },
17
17
  setOpen: () => {
18
+ },
19
+ setComponent: () => {
18
20
  }
19
21
  },
20
22
  paywallDialog: {
@@ -22,6 +24,8 @@ const AutumnContext = createContext({
22
24
  setProps: () => {
23
25
  },
24
26
  setOpen: () => {
27
+ },
28
+ setComponent: () => {
25
29
  }
26
30
  },
27
31
  pricingTableProducts: null,
@@ -1,15 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as CustomerData } from './cusTypes-CBQqMlZy.mjs';
2
+ import { C as CustomerData } from './cusTypes-Cb2VYILZ.mjs';
3
3
 
4
4
  interface AutumnProviderProps {
5
5
  children?: React.ReactNode;
6
6
  encryptedCustomerId?: string;
7
7
  customerData?: CustomerData;
8
- components?: {
9
- paywallDialog?: any;
10
- productChangeDialog?: any;
11
- };
12
8
  }
13
- declare const AutumnClientProvider: ({ children, encryptedCustomerId, customerData, components, }: AutumnProviderProps) => react_jsx_runtime.JSX.Element;
9
+ declare const AutumnClientProvider: ({ children, encryptedCustomerId, customerData, }: AutumnProviderProps) => react_jsx_runtime.JSX.Element;
14
10
 
15
11
  export { AutumnClientProvider, type AutumnProviderProps };
@@ -1,15 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as CustomerData } from './cusTypes-CBQqMlZy.js';
2
+ import { C as CustomerData } from './cusTypes-Cb2VYILZ.js';
3
3
 
4
4
  interface AutumnProviderProps {
5
5
  children?: React.ReactNode;
6
6
  encryptedCustomerId?: string;
7
7
  customerData?: CustomerData;
8
- components?: {
9
- paywallDialog?: any;
10
- productChangeDialog?: any;
11
- };
12
8
  }
13
- declare const AutumnClientProvider: ({ children, encryptedCustomerId, customerData, components, }: AutumnProviderProps) => react_jsx_runtime.JSX.Element;
9
+ declare const AutumnClientProvider: ({ children, encryptedCustomerId, customerData, }: AutumnProviderProps) => react_jsx_runtime.JSX.Element;
14
10
 
15
11
  export { AutumnClientProvider, type AutumnProviderProps };
@@ -3,15 +3,11 @@
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { AutumnContext } from "./AutumnContext";
5
5
  import { useEffect, useState } from "react";
6
+ import { useCustomer } from "./hooks/useCustomer";
6
7
  const useDialog = (component) => {
7
8
  const [dialogFound, setDialogFound] = useState(false);
8
9
  const [dialogProps, setDialogProps] = useState(null);
9
10
  const [dialogOpen, setDialogOpen] = useState(false);
10
- useEffect(() => {
11
- if (dialogProps) {
12
- setDialogOpen(true);
13
- }
14
- }, [dialogProps]);
15
11
  useEffect(() => {
16
12
  if (!dialogOpen) {
17
13
  setTimeout(() => {
@@ -34,11 +30,16 @@ const useDialog = (component) => {
34
30
  const AutumnClientProvider = ({
35
31
  children,
36
32
  encryptedCustomerId,
37
- customerData,
38
- components
33
+ customerData
39
34
  }) => {
40
35
  let [customer, setCustomer] = useState(null);
36
+ useCustomer({
37
+ encryptedCustomerId,
38
+ customerData,
39
+ errorOnNotFound: false
40
+ });
41
41
  let [pricingTableProducts, setPricingTableProducts] = useState(null);
42
+ const [components, setComponents] = useState({});
42
43
  const [entity, setEntity] = useState(null);
43
44
  const [
44
45
  prodChangeDialogFound,
@@ -65,12 +66,24 @@ const AutumnClientProvider = ({
65
66
  prodChangeDialog: {
66
67
  found: prodChangeDialogFound,
67
68
  setProps: setProdChangeDialogProps,
68
- setOpen: setProdChangeDialogOpen
69
+ setOpen: setProdChangeDialogOpen,
70
+ setComponent: (component) => {
71
+ setComponents({
72
+ ...components,
73
+ productChangeDialog: component
74
+ });
75
+ }
69
76
  },
70
77
  paywallDialog: {
71
78
  found: paywallFound,
72
79
  setProps: setPaywallProps,
73
- setOpen: setPaywallOpen
80
+ setOpen: setPaywallOpen,
81
+ setComponent: (component) => {
82
+ setComponents({
83
+ ...components,
84
+ paywallDialog: component
85
+ });
86
+ }
74
87
  },
75
88
  pricingTableProducts,
76
89
  setPricingTableProducts,
@@ -3,15 +3,11 @@
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { AutumnContext } from "./AutumnContext";
5
5
  import { useEffect, useState } from "react";
6
+ import { useCustomer } from "./hooks/useCustomer";
6
7
  const useDialog = (component) => {
7
8
  const [dialogFound, setDialogFound] = useState(false);
8
9
  const [dialogProps, setDialogProps] = useState(null);
9
10
  const [dialogOpen, setDialogOpen] = useState(false);
10
- useEffect(() => {
11
- if (dialogProps) {
12
- setDialogOpen(true);
13
- }
14
- }, [dialogProps]);
15
11
  useEffect(() => {
16
12
  if (!dialogOpen) {
17
13
  setTimeout(() => {
@@ -34,11 +30,16 @@ const useDialog = (component) => {
34
30
  const AutumnClientProvider = ({
35
31
  children,
36
32
  encryptedCustomerId,
37
- customerData,
38
- components
33
+ customerData
39
34
  }) => {
40
35
  let [customer, setCustomer] = useState(null);
36
+ useCustomer({
37
+ encryptedCustomerId,
38
+ customerData,
39
+ errorOnNotFound: false
40
+ });
41
41
  let [pricingTableProducts, setPricingTableProducts] = useState(null);
42
+ const [components, setComponents] = useState({});
42
43
  const [entity, setEntity] = useState(null);
43
44
  const [
44
45
  prodChangeDialogFound,
@@ -65,12 +66,24 @@ const AutumnClientProvider = ({
65
66
  prodChangeDialog: {
66
67
  found: prodChangeDialogFound,
67
68
  setProps: setProdChangeDialogProps,
68
- setOpen: setProdChangeDialogOpen
69
+ setOpen: setProdChangeDialogOpen,
70
+ setComponent: (component) => {
71
+ setComponents({
72
+ ...components,
73
+ productChangeDialog: component
74
+ });
75
+ }
69
76
  },
70
77
  paywallDialog: {
71
78
  found: paywallFound,
72
79
  setProps: setPaywallProps,
73
- setOpen: setPaywallOpen
80
+ setOpen: setPaywallOpen,
81
+ setComponent: (component) => {
82
+ setComponents({
83
+ ...components,
84
+ paywallDialog: component
85
+ });
86
+ }
74
87
  },
75
88
  pricingTableProducts,
76
89
  setPricingTableProducts,
@@ -1,11 +1,11 @@
1
- import { AutumnClientError, PricingTableProduct } from './types.mjs';
2
- import './cusTypes-CBQqMlZy.mjs';
3
- import './entTypes-DHSCGE1o.mjs';
1
+ import { a as AutumnClientError, P as PricingTableProduct } from './types-B4Y4mIQa.mjs';
2
+ import './cusTypes-Cb2VYILZ.mjs';
4
3
 
5
4
  declare const toClientErrorResponse: (error: any) => {
6
5
  data: null;
7
6
  error: AutumnClientError;
8
7
  };
8
+ declare const toClientError: (error: any) => AutumnClientError;
9
9
  declare const fetchPricingTableData: ({ setIsLoading, setError, setProducts, encryptedCustomerId, }: {
10
10
  setIsLoading?: (isLoading: boolean) => void;
11
11
  setError?: (error: any) => void;
@@ -13,4 +13,4 @@ declare const fetchPricingTableData: ({ setIsLoading, setError, setProducts, enc
13
13
  encryptedCustomerId?: string;
14
14
  }) => Promise<any>;
15
15
 
16
- export { fetchPricingTableData, toClientErrorResponse };
16
+ export { fetchPricingTableData, toClientError, toClientErrorResponse };
@@ -1,11 +1,11 @@
1
- import { AutumnClientError, PricingTableProduct } from './types.js';
2
- import './cusTypes-CBQqMlZy.js';
3
- import './entTypes-X4EHXDE5.js';
1
+ import { a as AutumnClientError, P as PricingTableProduct } from './types-D3Exrq7u.js';
2
+ import './cusTypes-Cb2VYILZ.js';
4
3
 
5
4
  declare const toClientErrorResponse: (error: any) => {
6
5
  data: null;
7
6
  error: AutumnClientError;
8
7
  };
8
+ declare const toClientError: (error: any) => AutumnClientError;
9
9
  declare const fetchPricingTableData: ({ setIsLoading, setError, setProducts, encryptedCustomerId, }: {
10
10
  setIsLoading?: (isLoading: boolean) => void;
11
11
  setError?: (error: any) => void;
@@ -13,4 +13,4 @@ declare const fetchPricingTableData: ({ setIsLoading, setError, setProducts, enc
13
13
  encryptedCustomerId?: string;
14
14
  }) => Promise<any>;
15
15
 
16
- export { fetchPricingTableData, toClientErrorResponse };
16
+ export { fetchPricingTableData, toClientError, toClientErrorResponse };
@@ -17,6 +17,18 @@ const toClientErrorResponse = (error) => {
17
17
  error: new AutumnClientError({ message: msg, code })
18
18
  };
19
19
  };
20
+ const toClientError = (error) => {
21
+ let msg = "Unknown error";
22
+ let code = "unknown";
23
+ if (error?.message) {
24
+ msg = error.message;
25
+ }
26
+ if (error?.code) {
27
+ code = error.code;
28
+ }
29
+ console.error("Autumn Error: ", msg);
30
+ return new AutumnClientError({ message: msg, code });
31
+ };
20
32
  const fetchPricingTableData = async ({
21
33
  setIsLoading,
22
34
  setError,
@@ -53,5 +65,6 @@ const fetchPricingTableData = async ({
53
65
  };
54
66
  export {
55
67
  fetchPricingTableData,
68
+ toClientError,
56
69
  toClientErrorResponse
57
70
  };
@@ -17,6 +17,18 @@ const toClientErrorResponse = (error) => {
17
17
  error: new AutumnClientError({ message: msg, code })
18
18
  };
19
19
  };
20
+ const toClientError = (error) => {
21
+ let msg = "Unknown error";
22
+ let code = "unknown";
23
+ if (error?.message) {
24
+ msg = error.message;
25
+ }
26
+ if (error?.code) {
27
+ code = error.code;
28
+ }
29
+ console.error("Autumn Error: ", msg);
30
+ return new AutumnClientError({ message: msg, code });
31
+ };
20
32
  const fetchPricingTableData = async ({
21
33
  setIsLoading,
22
34
  setError,
@@ -53,5 +65,6 @@ const fetchPricingTableData = async ({
53
65
  };
54
66
  export {
55
67
  fetchPricingTableData,
68
+ toClientError,
56
69
  toClientErrorResponse
57
70
  };
@@ -77,4 +77,4 @@ interface CustomerInvoice {
77
77
  created_at: number;
78
78
  }
79
79
 
80
- export type { CustomerData as C, Customer as a, CustomerExpandOption as b, CustomerProduct as c, CustomerFeature as d, CustomerInvoice as e };
80
+ export type { CustomerData as C, CustomerExpandOption as a, Customer as b, CustomerProduct as c, CustomerFeature as d, CustomerInvoice as e };
@@ -77,4 +77,4 @@ interface CustomerInvoice {
77
77
  created_at: number;
78
78
  }
79
79
 
80
- export type { CustomerData as C, Customer as a, CustomerExpandOption as b, CustomerProduct as c, CustomerFeature as d, CustomerInvoice as e };
80
+ export type { CustomerData as C, CustomerExpandOption as a, Customer as b, CustomerProduct as c, CustomerFeature as d, CustomerInvoice as e };
@@ -1,5 +1,6 @@
1
+ import react__default from 'react';
2
+
1
3
  interface AttachParams {
2
- dialog?: boolean;
3
4
  productId: string;
4
5
  entityId?: string;
5
6
  options?: {
@@ -9,6 +10,7 @@ interface AttachParams {
9
10
  successUrl?: string;
10
11
  forceCheckout?: boolean;
11
12
  metadata?: Record<string, string>;
13
+ dialog?: () => JSX.Element | react__default.ReactNode;
12
14
  callback?: () => Promise<void>;
13
15
  withPreview?: "formatted" | "raw";
14
16
  }
@@ -1,5 +1,6 @@
1
+ import react__default from 'react';
2
+
1
3
  interface AttachParams {
2
- dialog?: boolean;
3
4
  productId: string;
4
5
  entityId?: string;
5
6
  options?: {
@@ -9,6 +10,7 @@ interface AttachParams {
9
10
  successUrl?: string;
10
11
  forceCheckout?: boolean;
11
12
  metadata?: Record<string, string>;
13
+ dialog?: () => JSX.Element | react__default.ReactNode;
12
14
  callback?: () => Promise<void>;
13
15
  withPreview?: "formatted" | "raw";
14
16
  }
@@ -1,17 +1,16 @@
1
- import { A as AutumnError } from '../error-CG2LXoa7.mjs';
2
- import { a as Customer } from '../cusTypes-CBQqMlZy.mjs';
3
1
  import { AttachParams } from './types.mjs';
2
+ import 'react';
4
3
 
5
4
  declare const useAutumn: () => {
6
- attach: ({ dialog, productId, entityId, options, successUrl, forceCheckout, metadata, callback, }: AttachParams) => Promise<any>;
7
- check: ({ dialog, featureId, productId, entityId, requiredQuantity, sendEvent, withPreview, }: {
8
- dialog?: boolean;
5
+ attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, }: AttachParams) => Promise<any>;
6
+ check: ({ featureId, productId, entityId, requiredQuantity, sendEvent, withPreview, dialog, }: {
9
7
  featureId?: string;
10
8
  productId?: string;
11
9
  entityId?: string;
12
10
  requiredQuantity?: number;
13
11
  sendEvent?: boolean;
14
12
  withPreview?: "formatted" | "raw";
13
+ dialog?: (data: any) => JSX.Element | React.ReactNode;
15
14
  }) => Promise<any>;
16
15
  track: ({ featureId, entityId, value, }: {
17
16
  featureId: string;
@@ -25,41 +24,6 @@ declare const useAutumn: () => {
25
24
  openBillingPortal: (options?: {
26
25
  returnUrl?: string;
27
26
  }) => Promise<any>;
28
- /**
29
- * @deprecated Use track({featureId, value}) instead.
30
- * This method is deprecated and will be removed in a future version.
31
- */
32
- event: ({ featureId, value, }: {
33
- featureId: string;
34
- value?: number;
35
- }) => Promise<any>;
36
- /**
37
- * @deprecated Use check({featureId}) instead.
38
- * This method is deprecated and will be removed in a future version.
39
- */
40
- entitled: ({ featureId }: {
41
- featureId: string;
42
- }) => Promise<any>;
43
- /**
44
- * @deprecated Use the useCustomer() hook instead.
45
- * This property is deprecated and will be removed in a future version.
46
- */
47
- customer: Customer | null;
48
- /**
49
- * @deprecated Use the useCustomer() hook instead.
50
- * This property is deprecated and will be removed in a future version.
51
- */
52
- loading: boolean;
53
- /**
54
- * @deprecated Use the useCustomer() hook instead.
55
- * This property is deprecated and will be removed in a future version.
56
- */
57
- error: AutumnError | null;
58
- /**
59
- * @deprecated Use the useCustomer() hook instead.
60
- * This property is deprecated and will be removed in a future version.
61
- */
62
- refetch: () => Promise<void>;
63
27
  };
64
28
 
65
29
  export { useAutumn };
@@ -1,17 +1,16 @@
1
- import { A as AutumnError } from '../error-CG2LXoa7.js';
2
- import { a as Customer } from '../cusTypes-CBQqMlZy.js';
3
1
  import { AttachParams } from './types.js';
2
+ import 'react';
4
3
 
5
4
  declare const useAutumn: () => {
6
- attach: ({ dialog, productId, entityId, options, successUrl, forceCheckout, metadata, callback, }: AttachParams) => Promise<any>;
7
- check: ({ dialog, featureId, productId, entityId, requiredQuantity, sendEvent, withPreview, }: {
8
- dialog?: boolean;
5
+ attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, }: AttachParams) => Promise<any>;
6
+ check: ({ featureId, productId, entityId, requiredQuantity, sendEvent, withPreview, dialog, }: {
9
7
  featureId?: string;
10
8
  productId?: string;
11
9
  entityId?: string;
12
10
  requiredQuantity?: number;
13
11
  sendEvent?: boolean;
14
12
  withPreview?: "formatted" | "raw";
13
+ dialog?: (data: any) => JSX.Element | React.ReactNode;
15
14
  }) => Promise<any>;
16
15
  track: ({ featureId, entityId, value, }: {
17
16
  featureId: string;
@@ -25,41 +24,6 @@ declare const useAutumn: () => {
25
24
  openBillingPortal: (options?: {
26
25
  returnUrl?: string;
27
26
  }) => Promise<any>;
28
- /**
29
- * @deprecated Use track({featureId, value}) instead.
30
- * This method is deprecated and will be removed in a future version.
31
- */
32
- event: ({ featureId, value, }: {
33
- featureId: string;
34
- value?: number;
35
- }) => Promise<any>;
36
- /**
37
- * @deprecated Use check({featureId}) instead.
38
- * This method is deprecated and will be removed in a future version.
39
- */
40
- entitled: ({ featureId }: {
41
- featureId: string;
42
- }) => Promise<any>;
43
- /**
44
- * @deprecated Use the useCustomer() hook instead.
45
- * This property is deprecated and will be removed in a future version.
46
- */
47
- customer: Customer | null;
48
- /**
49
- * @deprecated Use the useCustomer() hook instead.
50
- * This property is deprecated and will be removed in a future version.
51
- */
52
- loading: boolean;
53
- /**
54
- * @deprecated Use the useCustomer() hook instead.
55
- * This property is deprecated and will be removed in a future version.
56
- */
57
- error: AutumnError | null;
58
- /**
59
- * @deprecated Use the useCustomer() hook instead.
60
- * This property is deprecated and will be removed in a future version.
61
- */
62
- refetch: () => Promise<void>;
63
27
  };
64
28
 
65
29
  export { useAutumn };