autumn-js 0.0.84 → 0.0.92
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/libraries/backend/better-auth.d.mts +764 -4
- package/dist/libraries/backend/better-auth.d.ts +764 -4
- package/dist/libraries/backend/better-auth.js +341 -19184
- package/dist/libraries/backend/better-auth.mjs +232 -19135
- package/dist/libraries/backend/{chunk-XGB3TDIC.mjs → chunk-6DZX6EAA.mjs} +0 -5
- package/dist/libraries/backend/{chunk-J3QM5KFT.mjs → chunk-7QSJB2C5.mjs} +1 -1
- package/dist/libraries/backend/{chunk-UJQBHXII.mjs → chunk-FCEB2GBS.mjs} +1 -1
- package/dist/libraries/backend/{chunk-A46IKTLH.mjs → chunk-JPNRDMMC.mjs} +1 -1
- package/dist/libraries/backend/{chunk-PDPPNHEU.mjs → chunk-NTFR7Z2G.mjs} +6 -6
- package/dist/libraries/backend/{chunk-DG3FZZQH.mjs → chunk-U7335VZS.mjs} +1 -1
- package/dist/libraries/backend/{chunk-VCEQ3QBX.mjs → chunk-V6M7KRGN.mjs} +57 -0
- package/dist/libraries/backend/{chunk-WDRHQJKV.mjs → chunk-VFTHGJ5N.mjs} +1 -1
- package/dist/libraries/backend/constants.mjs +1 -1
- package/dist/libraries/backend/convex.js +57 -0
- package/dist/libraries/backend/convex.mjs +8 -8
- package/dist/libraries/backend/express.d.mts +2 -1
- package/dist/libraries/backend/express.d.ts +2 -1
- package/dist/libraries/backend/express.js +57 -0
- package/dist/libraries/backend/express.mjs +8 -8
- package/dist/libraries/backend/fastify.js +57 -0
- package/dist/libraries/backend/fastify.mjs +8 -8
- package/dist/libraries/backend/hono.js +57 -0
- package/dist/libraries/backend/hono.mjs +8 -8
- package/dist/libraries/backend/next.js +59 -2
- package/dist/libraries/backend/next.mjs +8 -8
- package/dist/libraries/backend/react-router.js +57 -0
- package/dist/libraries/backend/react-router.mjs +8 -8
- package/dist/libraries/backend/{referralTypes-C6ao6j-_.d.mts → referralTypes-C_LRkLGP.d.mts} +101 -36
- package/dist/libraries/backend/{referralTypes-BZ4WOVK5.d.ts → referralTypes-KJHGHDgD.d.ts} +101 -36
- package/dist/libraries/backend/remix_dep.js +57 -0
- package/dist/libraries/backend/remix_dep.mjs +8 -8
- package/dist/libraries/backend/routes/backendRouter.js +57 -0
- package/dist/libraries/backend/routes/backendRouter.mjs +8 -8
- package/dist/libraries/backend/routes/entityRoutes.js +57 -0
- package/dist/libraries/backend/routes/entityRoutes.mjs +4 -4
- package/dist/libraries/backend/routes/genRoutes.js +57 -0
- package/dist/libraries/backend/routes/genRoutes.mjs +4 -4
- package/dist/libraries/backend/routes/productRoutes.js +57 -0
- package/dist/libraries/backend/routes/productRoutes.mjs +4 -4
- package/dist/libraries/backend/routes/referralRoutes.js +57 -0
- package/dist/libraries/backend/routes/referralRoutes.mjs +4 -4
- package/dist/libraries/backend/schemas/zod.d.mts +208 -0
- package/dist/libraries/backend/schemas/zod.d.ts +208 -0
- package/dist/libraries/backend/schemas/zod.js +100 -0
- package/dist/libraries/backend/schemas/zod.mjs +69 -0
- package/dist/libraries/backend/supabase.js +57 -0
- package/dist/libraries/backend/supabase.mjs +8 -8
- package/dist/libraries/backend/tanstack.js +57 -0
- package/dist/libraries/backend/tanstack.mjs +8 -8
- package/dist/libraries/backend/utils/backendRes.js +57 -0
- package/dist/libraries/backend/utils/backendRes.mjs +2 -2
- package/dist/libraries/backend/utils/logBackendErrors.mjs +1 -1
- package/dist/libraries/backend/utils/secretKeyCheck.mjs +1 -1
- package/dist/libraries/backend/utils/withAuth.d.mts +2 -1
- package/dist/libraries/backend/utils/withAuth.d.ts +2 -1
- package/dist/libraries/backend/utils/withAuth.js +57 -0
- package/dist/libraries/backend/utils/withAuth.mjs +3 -3
- package/dist/libraries/react/AutumnContext.d.mts +7 -6
- package/dist/libraries/react/AutumnContext.d.ts +7 -6
- package/dist/libraries/react/AutumnContext.js +59 -4
- package/dist/libraries/react/AutumnContext.mjs +5 -5
- package/dist/libraries/react/BaseAutumnProvider.d.mts +6 -7
- package/dist/libraries/react/BaseAutumnProvider.d.ts +6 -7
- package/dist/libraries/react/BaseAutumnProvider.js +140 -31
- package/dist/libraries/react/BaseAutumnProvider.mjs +10 -10
- package/dist/libraries/react/{ReactAutumnClient-DXwfNOsU.d.mts → ReactAutumnClient-BmHGkNH1.d.mts} +59 -11
- package/dist/libraries/react/{ReactAutumnClient-BUgyWQJZ.d.ts → ReactAutumnClient-PGnPqPkr.d.ts} +59 -11
- package/dist/libraries/react/ReactAutumnProvider.d.mts +3 -3
- package/dist/libraries/react/ReactAutumnProvider.d.ts +3 -3
- package/dist/libraries/react/ReactAutumnProvider.js +141 -41
- package/dist/libraries/react/ReactAutumnProvider.mjs +11 -11
- package/dist/libraries/react/{chunk-JFXBUWKA.mjs → chunk-3JJC2VU5.mjs} +22 -5
- package/dist/libraries/react/{chunk-NTQCSYCC.mjs → chunk-6SDVW33H.mjs} +24 -14
- package/dist/libraries/react/{chunk-UVW2G6D5.mjs → chunk-DIJJCQ2N.mjs} +2 -4
- package/dist/libraries/react/{chunk-MH2YTNJL.mjs → chunk-HL4JNKWK.mjs} +3 -5
- package/dist/libraries/react/{chunk-3ZEXZOM3.mjs → chunk-L3IZ2O3T.mjs} +4 -13
- package/dist/libraries/react/{chunk-NM57LOHB.mjs → chunk-LPJSRHPQ.mjs} +2 -2
- package/dist/libraries/react/{chunk-UDRQNZZS.mjs → chunk-NCPXL3J2.mjs} +70 -13
- package/dist/libraries/react/{chunk-FFSCKSIZ.mjs → chunk-OGFFPM5T.mjs} +2 -2
- package/dist/libraries/react/{chunk-RXM5BXAF.mjs → chunk-PJK6OPCU.mjs} +2 -2
- package/dist/libraries/react/{chunk-XKG7TR4L.mjs → chunk-RZW3QO6B.mjs} +25 -6
- package/dist/libraries/react/{chunk-AY477KTD.mjs → chunk-SDZ5NW6G.mjs} +2 -2
- package/dist/libraries/react/{chunk-C23P4R7T.mjs → chunk-TCCWWPEC.mjs} +16 -6
- package/dist/libraries/react/{chunk-TW3RVWYN.mjs → chunk-VH4FTCAC.mjs} +2 -2
- package/dist/libraries/react/{chunk-K6IX3SOV.mjs → chunk-Y6RO4AM2.mjs} +279 -279
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -5
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -5
- package/dist/libraries/react/client/ReactAutumnClient.js +57 -0
- package/dist/libraries/react/client/ReactAutumnClient.mjs +4 -4
- package/dist/libraries/react/client/clientCompMethods.d.mts +6 -5
- package/dist/libraries/react/client/clientCompMethods.d.ts +6 -5
- package/dist/libraries/react/client/clientCusMethods.d.mts +6 -5
- package/dist/libraries/react/client/clientCusMethods.d.ts +6 -5
- package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -5
- package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -5
- package/dist/libraries/react/client/clientGenMethods.d.mts +6 -5
- package/dist/libraries/react/client/clientGenMethods.d.ts +6 -5
- package/dist/libraries/react/client/clientProdMethods.d.mts +6 -5
- package/dist/libraries/react/client/clientProdMethods.d.ts +6 -5
- package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -4
- package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -4
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +136 -41
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +136 -41
- package/dist/libraries/react/client/types/clientGenTypes.js +62 -0
- package/dist/libraries/react/client/types/clientGenTypes.mjs +52 -0
- package/dist/libraries/react/client/types/clientReferralTypes.d.mts +17 -5
- package/dist/libraries/react/client/types/clientReferralTypes.d.ts +17 -5
- package/dist/libraries/react/client/types/clientReferralTypes.js +20 -0
- package/dist/libraries/react/client/types/clientReferralTypes.mjs +13 -0
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +2 -1
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +2 -1
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +139 -28
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +21 -21
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +2 -1
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +2 -1
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +2 -1
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +2 -1
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +2 -1
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +2 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +2 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +2 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +139 -28
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +21 -21
- package/dist/libraries/react/{cusTypes-MRvvutK7.d.ts → cusTypes-WaPJKeAb.d.mts} +29 -9
- package/dist/libraries/react/{cusTypes-MRvvutK7.d.mts → cusTypes-WaPJKeAb.d.ts} +29 -9
- package/dist/libraries/react/{entTypes-CNg4mN1E.d.ts → entTypes-D01S8gFX.d.ts} +1 -1
- package/dist/libraries/react/{entTypes-CGReDkQ9.d.mts → entTypes-aIV0QUCW.d.mts} +1 -1
- package/dist/libraries/react/hooks/handleAllowed.d.mts +4 -3
- package/dist/libraries/react/hooks/handleAllowed.d.ts +4 -3
- package/dist/libraries/react/hooks/handleAllowed.js +22 -5
- package/dist/libraries/react/hooks/handleAllowed.mjs +1 -1
- package/dist/libraries/react/hooks/useAutumn.d.mts +6 -5
- package/dist/libraries/react/hooks/useAutumn.d.ts +6 -5
- package/dist/libraries/react/hooks/useAutumn.js +96 -12
- package/dist/libraries/react/hooks/useAutumn.mjs +8 -8
- package/dist/libraries/react/hooks/useAutumnBase.d.mts +9 -8
- package/dist/libraries/react/hooks/useAutumnBase.d.ts +9 -8
- package/dist/libraries/react/hooks/useAutumnBase.js +96 -12
- package/dist/libraries/react/hooks/useAutumnBase.mjs +7 -7
- package/dist/libraries/react/hooks/useCustomer.d.mts +7 -5
- package/dist/libraries/react/hooks/useCustomer.d.ts +7 -5
- package/dist/libraries/react/hooks/useCustomer.js +139 -28
- package/dist/libraries/react/hooks/useCustomer.mjs +10 -10
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +8 -4
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +8 -4
- package/dist/libraries/react/hooks/useCustomerBase.js +139 -28
- package/dist/libraries/react/hooks/useCustomerBase.mjs +9 -9
- package/dist/libraries/react/hooks/useEntity.d.mts +7 -5
- package/dist/libraries/react/hooks/useEntity.d.ts +7 -5
- package/dist/libraries/react/hooks/useEntity.js +118 -17
- package/dist/libraries/react/hooks/useEntity.mjs +10 -10
- package/dist/libraries/react/hooks/useEntityBase.d.mts +7 -7
- package/dist/libraries/react/hooks/useEntityBase.d.ts +7 -7
- package/dist/libraries/react/hooks/useEntityBase.js +118 -17
- package/dist/libraries/react/hooks/useEntityBase.mjs +9 -9
- package/dist/libraries/react/hooks/usePricingTable.d.mts +2 -1
- package/dist/libraries/react/hooks/usePricingTable.d.ts +2 -1
- package/dist/libraries/react/hooks/usePricingTable.js +73 -8
- package/dist/libraries/react/hooks/usePricingTable.mjs +7 -7
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +7 -6
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +7 -6
- package/dist/libraries/react/hooks/usePricingTableBase.js +73 -8
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +6 -6
- package/dist/libraries/react/hooks/useProductsBase.js +59 -4
- package/dist/libraries/react/hooks/useProductsBase.mjs +5 -5
- package/dist/libraries/react/index.d.mts +611 -0
- package/dist/libraries/react/index.d.ts +168 -57
- package/dist/libraries/react/index.js +142 -42
- package/dist/libraries/react/index.mjs +142 -42
- package/dist/libraries/react/{response-JxL9qiek.d.mts → response-Bt5OMm4y.d.mts} +21 -5
- package/dist/libraries/react/{response-D_2cMcet.d.ts → response-CvPzWrT9.d.ts} +21 -5
- package/dist/next/{AutumnProvider-DPcEuE_Q.d.ts → AutumnProvider-DtLqoQp6.d.mts} +28 -9
- package/dist/next/{AutumnProvider-DPcEuE_Q.d.mts → AutumnProvider-DtLqoQp6.d.ts} +28 -9
- package/dist/next/AutumnProvider.d.mts +2 -1
- package/dist/next/AutumnProvider.d.ts +2 -1
- package/dist/next/client/NextAutumnClient.d.mts +60 -10
- package/dist/next/client/NextAutumnClient.d.ts +60 -10
- package/dist/next/client/NextAutumnProvider.d.mts +2 -1
- package/dist/next/client/NextAutumnProvider.d.ts +2 -1
- package/dist/next/client/clientEntTypes-BFkleT6a.d.mts +22 -0
- package/dist/next/client/clientEntTypes-BFkleT6a.d.ts +22 -0
- package/dist/next/client/clientGenTypes-BPjTbeG-.d.mts +195 -0
- package/dist/next/client/clientGenTypes-Bqecpl58.d.ts +195 -0
- package/dist/next/client/clientUtils.d.mts +3 -2
- package/dist/next/client/clientUtils.d.ts +3 -2
- package/dist/next/client/{cusTypes-CJI8rdlY.d.mts → cusTypes-D8lhXGaX.d.mts} +29 -9
- package/dist/next/client/{cusTypes-CJI8rdlY.d.ts → cusTypes-D8lhXGaX.d.ts} +29 -9
- package/dist/next/client/{entTypes-okM0aeOM.d.mts → entTypes-B-2_9hzP.d.mts} +1 -1
- package/dist/next/client/{entTypes-CqHWTcCX.d.ts → entTypes-Dq2mbehl.d.ts} +1 -1
- package/dist/next/client/hooks/useAutumn.d.mts +6 -4
- package/dist/next/client/hooks/useAutumn.d.ts +6 -4
- package/dist/next/client/hooks/useCustomer.d.mts +26 -4
- package/dist/next/client/hooks/useCustomer.d.ts +26 -4
- package/dist/next/client/hooks/useCustomer.js +3 -1
- package/dist/next/client/hooks/useCustomer.mjs +3 -1
- package/dist/next/client/hooks/useEntity.d.mts +7 -5
- package/dist/next/client/hooks/useEntity.d.ts +7 -5
- package/dist/next/client/hooks/usePricingTable.d.mts +2 -1
- package/dist/next/client/hooks/usePricingTable.d.ts +2 -1
- package/dist/next/client/types.d.mts +3 -2
- package/dist/next/client/types.d.ts +3 -2
- package/dist/next/index.d.mts +221 -65
- package/dist/next/index.d.ts +221 -65
- package/dist/next/server/auth/withNextAuth.d.mts +2 -1
- package/dist/next/server/auth/withNextAuth.d.ts +2 -1
- package/dist/next/server/componentActions.d.mts +2 -1
- package/dist/next/server/componentActions.d.ts +2 -1
- package/dist/next/server/cusActions.d.mts +93 -38
- package/dist/next/server/cusActions.d.ts +93 -38
- package/dist/next/server/{cusTypes-DuSwXVmp.d.mts → cusTypes-C86FOl99.d.mts} +28 -8
- package/dist/next/server/{cusTypes-DuSwXVmp.d.ts → cusTypes-C86FOl99.d.ts} +28 -8
- package/dist/next/server/genActions.d.mts +44 -49
- package/dist/next/server/genActions.d.ts +44 -49
- package/dist/sdk/index.d.mts +123 -29
- package/dist/sdk/index.d.ts +123 -29
- package/dist/sdk/index.js +60 -9
- package/dist/sdk/index.mjs +57 -10
- package/dist/styles/global.css +42 -4
- package/dist/utils/encryptUtils.js +57 -0
- package/dist/utils/encryptUtils.mjs +57 -0
- package/package.json +27 -4
- package/tsup.config.ts +1 -22
- package/components.json +0 -21
- package/dist/next/client/clientGenTypes-CAv4hwb4.d.ts +0 -108
- package/dist/next/client/clientGenTypes-Dlpw9wy_.d.mts +0 -108
- package/dist/next/client/clientReferralTypes-C9JiOk2s.d.mts +0 -20
- package/dist/next/client/clientReferralTypes-C9JiOk2s.d.ts +0 -20
- package/dist/next/server/clientEntTypes-BOVTwIKv.d.mts +0 -14
- package/dist/next/server/clientEntTypes-BOVTwIKv.d.ts +0 -14
- package/postcss.config.js +0 -25
- package/publish.sh +0 -18
- package/scripts/css-transform-plugin.js +0 -28
- package/scripts/post-build.js +0 -91
- package/scripts/sync-registry.ts +0 -190
- package/tailwind.config.ts +0 -96
- package/tsup.dev.config.ts +0 -199
|
@@ -9,41 +9,41 @@ import {
|
|
|
9
9
|
PricingTableContainer,
|
|
10
10
|
RecommendedBadge,
|
|
11
11
|
usePricingTableContext
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
12
|
+
} from "../../chunk-Y6RO4AM2.mjs";
|
|
13
|
+
import "../../chunk-CMO5LYYU.mjs";
|
|
14
|
+
import "../../chunk-QBBE72EF.mjs";
|
|
14
15
|
import "../../chunk-BCMBFJ7E.mjs";
|
|
16
|
+
import "../../chunk-WVKYZYFT.mjs";
|
|
17
|
+
import "../../chunk-27OTS3Q5.mjs";
|
|
15
18
|
import "../../chunk-MY2ODATB.mjs";
|
|
16
|
-
import "../../chunk-QBBE72EF.mjs";
|
|
17
19
|
import "../../chunk-P2O4LZFD.mjs";
|
|
18
20
|
import "../../chunk-5FZ7IV6P.mjs";
|
|
19
|
-
import "../../chunk-CMO5LYYU.mjs";
|
|
20
21
|
import "../../chunk-FPI3PLEL.mjs";
|
|
21
22
|
import "../../chunk-FEFGYFXQ.mjs";
|
|
22
|
-
import "../../chunk-
|
|
23
|
-
import "../../chunk-
|
|
24
|
-
import "../../chunk-
|
|
25
|
-
import "../../chunk-RXM5BXAF.mjs";
|
|
23
|
+
import "../../chunk-OGFFPM5T.mjs";
|
|
24
|
+
import "../../chunk-LPJSRHPQ.mjs";
|
|
25
|
+
import "../../chunk-PJK6OPCU.mjs";
|
|
26
26
|
import "../../chunk-4J6OC4ZQ.mjs";
|
|
27
|
-
import "../../chunk-
|
|
28
|
-
import "../../chunk-
|
|
29
|
-
import "../../chunk-
|
|
30
|
-
import "../../chunk-
|
|
27
|
+
import "../../chunk-SDZ5NW6G.mjs";
|
|
28
|
+
import "../../chunk-VH4FTCAC.mjs";
|
|
29
|
+
import "../../chunk-L3IZ2O3T.mjs";
|
|
30
|
+
import "../../chunk-DIJJCQ2N.mjs";
|
|
31
31
|
import "../../chunk-4QPHNIQ7.mjs";
|
|
32
|
-
import "../../chunk-
|
|
33
|
-
import "../../chunk-
|
|
34
|
-
import "../../chunk-
|
|
35
|
-
import "../../chunk-
|
|
36
|
-
import "../../chunk-
|
|
37
|
-
import "../../chunk-
|
|
32
|
+
import "../../chunk-6SDVW33H.mjs";
|
|
33
|
+
import "../../chunk-3JJC2VU5.mjs";
|
|
34
|
+
import "../../chunk-RZW3QO6B.mjs";
|
|
35
|
+
import "../../chunk-TCCWWPEC.mjs";
|
|
36
|
+
import "../../chunk-HL4JNKWK.mjs";
|
|
37
|
+
import "../../chunk-NCPXL3J2.mjs";
|
|
38
|
+
import "../../chunk-V5PKOA5A.mjs";
|
|
39
|
+
import "../../chunk-JNM4BLTM.mjs";
|
|
38
40
|
import "../../chunk-YUV2Y2RW.mjs";
|
|
39
41
|
import "../../chunk-3EYF7OI5.mjs";
|
|
42
|
+
import "../../chunk-KQT5G3HT.mjs";
|
|
40
43
|
import "../../chunk-JVCOY7ZL.mjs";
|
|
41
44
|
import "../../chunk-CIBQ4BJU.mjs";
|
|
42
45
|
import "../../chunk-NZ5PEXT2.mjs";
|
|
43
46
|
import "../../chunk-TGX6UKKS.mjs";
|
|
44
|
-
import "../../chunk-V5PKOA5A.mjs";
|
|
45
|
-
import "../../chunk-JNM4BLTM.mjs";
|
|
46
|
-
import "../../chunk-KQT5G3HT.mjs";
|
|
47
47
|
export {
|
|
48
48
|
AnnualSwitch,
|
|
49
49
|
PricingCard,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
1
3
|
declare const Infinite = "inf";
|
|
2
4
|
declare enum FreeTrialDuration {
|
|
3
5
|
Day = "day"
|
|
@@ -28,6 +30,7 @@ interface CheckFeatureResult extends CoreCustomerFeature {
|
|
|
28
30
|
entity_id?: string;
|
|
29
31
|
required_balance: number;
|
|
30
32
|
code: string;
|
|
33
|
+
usage_limit?: number;
|
|
31
34
|
preview?: CheckFeaturePreview;
|
|
32
35
|
}
|
|
33
36
|
interface CheckFeaturePreview {
|
|
@@ -152,6 +155,7 @@ interface CoreCustomerFeature {
|
|
|
152
155
|
included_usage?: number;
|
|
153
156
|
next_reset_at?: number | null;
|
|
154
157
|
overage_allowed?: boolean;
|
|
158
|
+
usage_limit?: number;
|
|
155
159
|
breakdown?: {
|
|
156
160
|
interval: ProductItemInterval;
|
|
157
161
|
balance?: number;
|
|
@@ -203,14 +207,29 @@ interface CustomerData {
|
|
|
203
207
|
email?: string;
|
|
204
208
|
fingerprint?: string;
|
|
205
209
|
}
|
|
206
|
-
|
|
207
|
-
id
|
|
208
|
-
email
|
|
209
|
-
name
|
|
210
|
-
fingerprint
|
|
211
|
-
metadata
|
|
212
|
-
expand
|
|
213
|
-
}
|
|
210
|
+
declare const CreateCustomerParamsSchema: z.ZodObject<{
|
|
211
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
212
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
213
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
|
+
fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
215
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
216
|
+
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
id?: string | null | undefined;
|
|
219
|
+
name?: string | null | undefined;
|
|
220
|
+
email?: string | null | undefined;
|
|
221
|
+
fingerprint?: string | null | undefined;
|
|
222
|
+
metadata?: Record<string, any> | undefined;
|
|
223
|
+
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
224
|
+
}, {
|
|
225
|
+
id?: string | null | undefined;
|
|
226
|
+
name?: string | null | undefined;
|
|
227
|
+
email?: string | null | undefined;
|
|
228
|
+
fingerprint?: string | null | undefined;
|
|
229
|
+
metadata?: Record<string, any> | undefined;
|
|
230
|
+
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
231
|
+
}>;
|
|
232
|
+
type CreateCustomerParams = z.infer<typeof CreateCustomerParamsSchema>;
|
|
214
233
|
interface BillingPortalResult {
|
|
215
234
|
customer_id: string;
|
|
216
235
|
url: string;
|
|
@@ -222,6 +241,7 @@ interface CustomerInvoice {
|
|
|
222
241
|
total: number;
|
|
223
242
|
currency: string;
|
|
224
243
|
created_at: number;
|
|
244
|
+
hosted_invoice_url: string;
|
|
225
245
|
}
|
|
226
246
|
|
|
227
|
-
export type { BillingPortalResult as B, CustomerData as C, Product as P, CreateCustomerParams as a, Customer as b, CustomerExpandOption as c, CustomerProduct as d, CustomerFeature as e, CustomerInvoice as f,
|
|
247
|
+
export type { BillingPortalResult as B, CustomerData as C, Product as P, CreateCustomerParams as a, Customer as b, CustomerExpandOption as c, CustomerProduct as d, CustomerFeature as e, CustomerInvoice as f, CheckFeaturePreview as g, ProductItem as h, CheckProductPreview as i, CheckFeatureResult as j, CheckProductResult as k, ProductScenario as l };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
1
3
|
declare const Infinite = "inf";
|
|
2
4
|
declare enum FreeTrialDuration {
|
|
3
5
|
Day = "day"
|
|
@@ -28,6 +30,7 @@ interface CheckFeatureResult extends CoreCustomerFeature {
|
|
|
28
30
|
entity_id?: string;
|
|
29
31
|
required_balance: number;
|
|
30
32
|
code: string;
|
|
33
|
+
usage_limit?: number;
|
|
31
34
|
preview?: CheckFeaturePreview;
|
|
32
35
|
}
|
|
33
36
|
interface CheckFeaturePreview {
|
|
@@ -152,6 +155,7 @@ interface CoreCustomerFeature {
|
|
|
152
155
|
included_usage?: number;
|
|
153
156
|
next_reset_at?: number | null;
|
|
154
157
|
overage_allowed?: boolean;
|
|
158
|
+
usage_limit?: number;
|
|
155
159
|
breakdown?: {
|
|
156
160
|
interval: ProductItemInterval;
|
|
157
161
|
balance?: number;
|
|
@@ -203,14 +207,29 @@ interface CustomerData {
|
|
|
203
207
|
email?: string;
|
|
204
208
|
fingerprint?: string;
|
|
205
209
|
}
|
|
206
|
-
|
|
207
|
-
id
|
|
208
|
-
email
|
|
209
|
-
name
|
|
210
|
-
fingerprint
|
|
211
|
-
metadata
|
|
212
|
-
expand
|
|
213
|
-
}
|
|
210
|
+
declare const CreateCustomerParamsSchema: z.ZodObject<{
|
|
211
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
212
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
213
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
|
+
fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
215
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
216
|
+
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
id?: string | null | undefined;
|
|
219
|
+
name?: string | null | undefined;
|
|
220
|
+
email?: string | null | undefined;
|
|
221
|
+
fingerprint?: string | null | undefined;
|
|
222
|
+
metadata?: Record<string, any> | undefined;
|
|
223
|
+
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
224
|
+
}, {
|
|
225
|
+
id?: string | null | undefined;
|
|
226
|
+
name?: string | null | undefined;
|
|
227
|
+
email?: string | null | undefined;
|
|
228
|
+
fingerprint?: string | null | undefined;
|
|
229
|
+
metadata?: Record<string, any> | undefined;
|
|
230
|
+
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
231
|
+
}>;
|
|
232
|
+
type CreateCustomerParams = z.infer<typeof CreateCustomerParamsSchema>;
|
|
214
233
|
interface BillingPortalResult {
|
|
215
234
|
customer_id: string;
|
|
216
235
|
url: string;
|
|
@@ -222,6 +241,7 @@ interface CustomerInvoice {
|
|
|
222
241
|
total: number;
|
|
223
242
|
currency: string;
|
|
224
243
|
created_at: number;
|
|
244
|
+
hosted_invoice_url: string;
|
|
225
245
|
}
|
|
226
246
|
|
|
227
|
-
export type { BillingPortalResult as B, CustomerData as C, Product as P, CreateCustomerParams as a, Customer as b, CustomerExpandOption as c, CustomerProduct as d, CustomerFeature as e, CustomerInvoice as f,
|
|
247
|
+
export type { BillingPortalResult as B, CustomerData as C, Product as P, CreateCustomerParams as a, Customer as b, CustomerExpandOption as c, CustomerProduct as d, CustomerFeature as e, CustomerInvoice as f, CheckFeaturePreview as g, ProductItem as h, CheckProductPreview as i, CheckFeatureResult as j, CheckProductResult as k, ProductScenario as l };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as CustomerProduct, e as CustomerFeature, f as CustomerInvoice } from './cusTypes-
|
|
1
|
+
import { d as CustomerProduct, e as CustomerFeature, f as CustomerInvoice } from './cusTypes-WaPJKeAb.mjs';
|
|
2
2
|
|
|
3
3
|
interface DeleteEntityResult {
|
|
4
4
|
success: boolean;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { b as Customer } from '../cusTypes-
|
|
2
|
-
import { E as Entity } from '../entTypes-
|
|
1
|
+
import { b as Customer } from '../cusTypes-WaPJKeAb.mjs';
|
|
2
|
+
import { E as Entity } from '../entTypes-aIV0QUCW.mjs';
|
|
3
|
+
import 'zod';
|
|
3
4
|
|
|
4
5
|
interface AllowedParams {
|
|
5
6
|
featureId?: string;
|
|
6
7
|
productId?: string;
|
|
7
8
|
requiredBalance?: number;
|
|
8
9
|
}
|
|
9
|
-
declare const handleAllowed: ({ customer, params }: {
|
|
10
|
+
declare const handleAllowed: ({ customer, params, }: {
|
|
10
11
|
customer: Customer | Entity | null;
|
|
11
12
|
params: AllowedParams;
|
|
12
13
|
}) => boolean;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { b as Customer } from '../cusTypes-
|
|
2
|
-
import { E as Entity } from '../entTypes-
|
|
1
|
+
import { b as Customer } from '../cusTypes-WaPJKeAb.js';
|
|
2
|
+
import { E as Entity } from '../entTypes-D01S8gFX.js';
|
|
3
|
+
import 'zod';
|
|
3
4
|
|
|
4
5
|
interface AllowedParams {
|
|
5
6
|
featureId?: string;
|
|
6
7
|
productId?: string;
|
|
7
8
|
requiredBalance?: number;
|
|
8
9
|
}
|
|
9
|
-
declare const handleAllowed: ({ customer, params }: {
|
|
10
|
+
declare const handleAllowed: ({ customer, params, }: {
|
|
10
11
|
customer: Customer | Entity | null;
|
|
11
12
|
params: AllowedParams;
|
|
12
13
|
}) => boolean;
|
|
@@ -30,9 +30,13 @@ var getCusFeature = ({
|
|
|
30
30
|
featureId,
|
|
31
31
|
requiredBalance = 1
|
|
32
32
|
}) => {
|
|
33
|
-
let creditSchema = Object.values(customer.features).find(
|
|
33
|
+
let creditSchema = Object.values(customer.features).find(
|
|
34
|
+
(f) => f.credit_schema && f.credit_schema.some((c) => c.feature_id === featureId)
|
|
35
|
+
);
|
|
34
36
|
if (creditSchema) {
|
|
35
|
-
let schemaItem = creditSchema.credit_schema?.find(
|
|
37
|
+
let schemaItem = creditSchema.credit_schema?.find(
|
|
38
|
+
(c) => c.feature_id === featureId
|
|
39
|
+
);
|
|
36
40
|
return {
|
|
37
41
|
feature: creditSchema,
|
|
38
42
|
requiredBalance: schemaItem.credit_amount * requiredBalance
|
|
@@ -43,14 +47,27 @@ var getCusFeature = ({
|
|
|
43
47
|
requiredBalance
|
|
44
48
|
};
|
|
45
49
|
};
|
|
46
|
-
var handleFeatureAllowed = ({
|
|
47
|
-
|
|
50
|
+
var handleFeatureAllowed = ({
|
|
51
|
+
customer,
|
|
52
|
+
params
|
|
53
|
+
}) => {
|
|
54
|
+
let { cusFeature, requiredBalance } = getCusFeature({
|
|
55
|
+
customer,
|
|
56
|
+
featureId: params.featureId
|
|
57
|
+
});
|
|
48
58
|
if (!cusFeature) return false;
|
|
49
59
|
if (cusFeature.type == "static") return true;
|
|
50
60
|
if (cusFeature.unlimited || cusFeature.overage_allowed) return true;
|
|
61
|
+
if (cusFeature.usage_limit) {
|
|
62
|
+
let extraUsage = (cusFeature.usage_limit || 0) - (cusFeature.included_usage || 0);
|
|
63
|
+
return (cusFeature.balance || 0) + extraUsage >= requiredBalance;
|
|
64
|
+
}
|
|
51
65
|
return (cusFeature.balance || 0) >= requiredBalance;
|
|
52
66
|
};
|
|
53
|
-
var handleAllowed = ({
|
|
67
|
+
var handleAllowed = ({
|
|
68
|
+
customer,
|
|
69
|
+
params
|
|
70
|
+
}) => {
|
|
54
71
|
if (!customer) return false;
|
|
55
72
|
if (!params.featureId && !params.productId) {
|
|
56
73
|
throw new Error("allowed() requires either featureId or productId");
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { B as BillingPortalResult } from '../cusTypes-MRvvutK7.mjs';
|
|
1
|
+
import { A as AutumnPromise, b as CheckResult, T as TrackResult, C as CancelResult, S as SetupPaymentResult } from '../response-Bt5OMm4y.mjs';
|
|
2
|
+
import { B as BillingPortalResult } from '../cusTypes-WaPJKeAb.mjs';
|
|
4
3
|
import { AttachParams, CheckParams, TrackParams, CancelParams, OpenBillingPortalParams, SetupPaymentParams } from '../client/types/clientGenTypes.mjs';
|
|
5
|
-
import '
|
|
4
|
+
import 'zod';
|
|
5
|
+
import '../error-DHbclCVh.mjs';
|
|
6
|
+
import 'react';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @deprecated The functions exported from this hook can now be found in useCustomer
|
|
9
10
|
*/
|
|
10
11
|
declare const useAutumn: () => {
|
|
11
|
-
attach: (params: AttachParams) => Promise<
|
|
12
|
+
attach: (params: AttachParams) => Promise<any>;
|
|
12
13
|
check: (params: CheckParams) => AutumnPromise<CheckResult>;
|
|
13
14
|
track: (params: TrackParams) => AutumnPromise<TrackResult>;
|
|
14
15
|
cancel: (params: CancelParams) => AutumnPromise<CancelResult>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { B as BillingPortalResult } from '../cusTypes-MRvvutK7.js';
|
|
1
|
+
import { A as AutumnPromise, b as CheckResult, T as TrackResult, C as CancelResult, S as SetupPaymentResult } from '../response-CvPzWrT9.js';
|
|
2
|
+
import { B as BillingPortalResult } from '../cusTypes-WaPJKeAb.js';
|
|
4
3
|
import { AttachParams, CheckParams, TrackParams, CancelParams, OpenBillingPortalParams, SetupPaymentParams } from '../client/types/clientGenTypes.js';
|
|
5
|
-
import '
|
|
4
|
+
import 'zod';
|
|
5
|
+
import '../error-DHbclCVh.js';
|
|
6
|
+
import 'react';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @deprecated The functions exported from this hook can now be found in useCustomer
|
|
9
10
|
*/
|
|
10
11
|
declare const useAutumn: () => {
|
|
11
|
-
attach: (params: AttachParams) => Promise<
|
|
12
|
+
attach: (params: AttachParams) => Promise<any>;
|
|
12
13
|
check: (params: CheckParams) => AutumnPromise<CheckResult>;
|
|
13
14
|
track: (params: TrackParams) => AutumnPromise<TrackResult>;
|
|
14
15
|
cancel: (params: CancelParams) => AutumnPromise<CancelResult>;
|
|
@@ -529,6 +529,63 @@ var Autumn = class {
|
|
|
529
529
|
}
|
|
530
530
|
};
|
|
531
531
|
|
|
532
|
+
// src/sdk/general/genTypes.ts
|
|
533
|
+
var import_zod = require("zod");
|
|
534
|
+
var AttachParamsSchema = import_zod.z.object({
|
|
535
|
+
customer_id: import_zod.z.string(),
|
|
536
|
+
product_id: import_zod.z.string().optional(),
|
|
537
|
+
entity_id: import_zod.z.string().optional(),
|
|
538
|
+
options: import_zod.z.array(import_zod.z.object({
|
|
539
|
+
feature_id: import_zod.z.string(),
|
|
540
|
+
quantity: import_zod.z.number()
|
|
541
|
+
})).optional(),
|
|
542
|
+
product_ids: import_zod.z.array(import_zod.z.string()).optional(),
|
|
543
|
+
// If set, will attach multiple products to the customer (cannot be used with product_id)
|
|
544
|
+
free_trial: import_zod.z.boolean().optional(),
|
|
545
|
+
// Default is true -- if set to false, will bypass product free trial
|
|
546
|
+
success_url: import_zod.z.string().optional(),
|
|
547
|
+
// Passed to Stripe
|
|
548
|
+
metadata: import_zod.z.record(import_zod.z.string()).optional(),
|
|
549
|
+
// Passed to Stripe
|
|
550
|
+
force_checkout: import_zod.z.boolean().optional(),
|
|
551
|
+
// Default is false -- if set to true, will force the customer to checkout (not allowed for upgrades / downgrades)
|
|
552
|
+
customer_data: import_zod.z.any().optional(),
|
|
553
|
+
entity_data: import_zod.z.any().optional(),
|
|
554
|
+
checkout_session_params: import_zod.z.record(import_zod.z.any()).optional(),
|
|
555
|
+
// Passed to Stripe
|
|
556
|
+
reward: import_zod.z.string().optional()
|
|
557
|
+
});
|
|
558
|
+
var AttachResultSchema = import_zod.z.object({
|
|
559
|
+
checkout_url: import_zod.z.string().optional(),
|
|
560
|
+
customer_id: import_zod.z.string(),
|
|
561
|
+
product_ids: import_zod.z.array(import_zod.z.string()),
|
|
562
|
+
code: import_zod.z.string(),
|
|
563
|
+
message: import_zod.z.string(),
|
|
564
|
+
customer_data: import_zod.z.any().optional()
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
// src/sdk/customers/cusEnums.ts
|
|
568
|
+
var import_zod2 = require("zod");
|
|
569
|
+
var CustomerExpandEnum = import_zod2.z.enum([
|
|
570
|
+
"invoices",
|
|
571
|
+
"rewards",
|
|
572
|
+
"trials_used",
|
|
573
|
+
"entities",
|
|
574
|
+
"referrals",
|
|
575
|
+
"payment_method"
|
|
576
|
+
]);
|
|
577
|
+
|
|
578
|
+
// src/sdk/customers/cusTypes.ts
|
|
579
|
+
var import_zod3 = require("zod");
|
|
580
|
+
var CreateCustomerParamsSchema = import_zod3.z.object({
|
|
581
|
+
id: import_zod3.z.string().nullish(),
|
|
582
|
+
email: import_zod3.z.string().nullish(),
|
|
583
|
+
name: import_zod3.z.string().nullish(),
|
|
584
|
+
fingerprint: import_zod3.z.string().nullish(),
|
|
585
|
+
metadata: import_zod3.z.record(import_zod3.z.any()).optional(),
|
|
586
|
+
expand: import_zod3.z.array(CustomerExpandEnum).optional()
|
|
587
|
+
});
|
|
588
|
+
|
|
532
589
|
// src/libraries/react/errorUtils/logFetchError.ts
|
|
533
590
|
var logFetchError = ({
|
|
534
591
|
method,
|
|
@@ -853,12 +910,10 @@ var AutumnContext = (0, import_react.createContext)({
|
|
|
853
910
|
});
|
|
854
911
|
var useAutumnContext = ({
|
|
855
912
|
AutumnContext: AutumnContext2,
|
|
856
|
-
name
|
|
913
|
+
name,
|
|
914
|
+
errorIfNotInitialized = true
|
|
857
915
|
}) => {
|
|
858
916
|
const context = (0, import_react.useContext)(AutumnContext2);
|
|
859
|
-
if (!context.initialized) {
|
|
860
|
-
throw new Error(`${name} must be used within <AutumnProvider />`);
|
|
861
|
-
}
|
|
862
917
|
return context;
|
|
863
918
|
};
|
|
864
919
|
|
|
@@ -1019,14 +1074,23 @@ var mergeProductDetails = (products, productDetails) => {
|
|
|
1019
1074
|
}
|
|
1020
1075
|
return mergedProducts;
|
|
1021
1076
|
};
|
|
1077
|
+
var defaultSWRConfig = {
|
|
1078
|
+
refreshInterval: 0
|
|
1079
|
+
};
|
|
1022
1080
|
var usePricingTableBase = ({
|
|
1023
1081
|
AutumnContext: AutumnContext2,
|
|
1024
|
-
params
|
|
1082
|
+
params,
|
|
1083
|
+
authClient
|
|
1025
1084
|
}) => {
|
|
1026
|
-
const context = useAutumnContext({
|
|
1085
|
+
const context = useAutumnContext({
|
|
1086
|
+
AutumnContext: AutumnContext2,
|
|
1087
|
+
name: "usePricingTable",
|
|
1088
|
+
errorIfNotInitialized: !authClient
|
|
1089
|
+
});
|
|
1090
|
+
const client = authClient ? authClient.autumn : context.client;
|
|
1027
1091
|
const fetcher = async () => {
|
|
1028
1092
|
try {
|
|
1029
|
-
const { data: data2, error: error2 } = await
|
|
1093
|
+
const { data: data2, error: error2 } = await client.products.list();
|
|
1030
1094
|
if (error2) throw error2;
|
|
1031
1095
|
return data2?.list || [];
|
|
1032
1096
|
} catch (error2) {
|
|
@@ -1038,7 +1102,8 @@ var usePricingTableBase = ({
|
|
|
1038
1102
|
};
|
|
1039
1103
|
const { data, error, mutate } = (0, import_swr.default)(
|
|
1040
1104
|
"pricing-table",
|
|
1041
|
-
fetcher
|
|
1105
|
+
fetcher,
|
|
1106
|
+
{ ...defaultSWRConfig }
|
|
1042
1107
|
);
|
|
1043
1108
|
return {
|
|
1044
1109
|
products: mergeProductDetails(data || [], params?.productDetails),
|
|
@@ -1051,13 +1116,20 @@ var usePricingTableBase = ({
|
|
|
1051
1116
|
|
|
1052
1117
|
// src/libraries/react/hooks/useAutumnBase.tsx
|
|
1053
1118
|
var useAutumnBase = ({
|
|
1054
|
-
AutumnContext: AutumnContext2
|
|
1119
|
+
AutumnContext: AutumnContext2,
|
|
1120
|
+
authClient
|
|
1055
1121
|
}) => {
|
|
1056
|
-
const context = useAutumnContext({
|
|
1122
|
+
const context = useAutumnContext({
|
|
1123
|
+
AutumnContext: AutumnContext2,
|
|
1124
|
+
name: "useAutumn",
|
|
1125
|
+
errorIfNotInitialized: !authClient
|
|
1126
|
+
});
|
|
1057
1127
|
const { attachDialog, paywallDialog } = context;
|
|
1058
|
-
const client = context.client;
|
|
1128
|
+
const client = authClient ? authClient.autumn : context.client;
|
|
1129
|
+
const authClientExists = !!authClient;
|
|
1059
1130
|
const { refetch: refetchPricingTable } = usePricingTableBase({
|
|
1060
|
-
AutumnContext: AutumnContext2
|
|
1131
|
+
AutumnContext: AutumnContext2,
|
|
1132
|
+
authClient
|
|
1061
1133
|
});
|
|
1062
1134
|
let {
|
|
1063
1135
|
open: attachOpen,
|
|
@@ -1113,6 +1185,12 @@ var useAutumnBase = ({
|
|
|
1113
1185
|
const attach = async (params) => {
|
|
1114
1186
|
const { dialog, openInNewTab } = params;
|
|
1115
1187
|
let finalDialog = dialog;
|
|
1188
|
+
if (dialog && authClientExists) {
|
|
1189
|
+
console.error(
|
|
1190
|
+
"[Autumn] Attach dialog cannot be used with better auth plugin. To use this, please switch to <AutumnProvider /> and autumnHandler. Learn more here: https://docs.useautumn.com/quickstart/quickstart"
|
|
1191
|
+
);
|
|
1192
|
+
return void 0;
|
|
1193
|
+
}
|
|
1116
1194
|
if (finalDialog && !attachOpen) {
|
|
1117
1195
|
setAttachComponent(finalDialog);
|
|
1118
1196
|
return await attachWithDialog(params);
|
|
@@ -1128,6 +1206,12 @@ var useAutumnBase = ({
|
|
|
1128
1206
|
};
|
|
1129
1207
|
const check = async (params) => {
|
|
1130
1208
|
let { dialog, withPreview } = params;
|
|
1209
|
+
if (dialog && authClientExists) {
|
|
1210
|
+
console.error(
|
|
1211
|
+
"[Autumn] Check dialog cannot be used with better auth plugin. To use this, please switch to <AutumnProvider /> and autumnHandler. Learn more here: https://docs.useautumn.com/quickstart/quickstart"
|
|
1212
|
+
);
|
|
1213
|
+
return void 0;
|
|
1214
|
+
}
|
|
1131
1215
|
if (dialog) {
|
|
1132
1216
|
setPaywallComponent(dialog);
|
|
1133
1217
|
}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
useAutumn
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-SDZ5NW6G.mjs";
|
|
6
|
+
import "../chunk-RZW3QO6B.mjs";
|
|
7
|
+
import "../chunk-TCCWWPEC.mjs";
|
|
8
|
+
import "../chunk-HL4JNKWK.mjs";
|
|
9
|
+
import "../chunk-NCPXL3J2.mjs";
|
|
10
|
+
import "../chunk-V5PKOA5A.mjs";
|
|
11
|
+
import "../chunk-JNM4BLTM.mjs";
|
|
10
12
|
import "../chunk-YUV2Y2RW.mjs";
|
|
11
13
|
import "../chunk-3EYF7OI5.mjs";
|
|
14
|
+
import "../chunk-KQT5G3HT.mjs";
|
|
12
15
|
import "../chunk-JVCOY7ZL.mjs";
|
|
13
16
|
import "../chunk-CIBQ4BJU.mjs";
|
|
14
17
|
import "../chunk-NZ5PEXT2.mjs";
|
|
15
18
|
import "../chunk-TGX6UKKS.mjs";
|
|
16
|
-
import "../chunk-V5PKOA5A.mjs";
|
|
17
|
-
import "../chunk-JNM4BLTM.mjs";
|
|
18
|
-
import "../chunk-KQT5G3HT.mjs";
|
|
19
19
|
export {
|
|
20
20
|
useAutumn
|
|
21
21
|
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { B as BillingPortalResult } from '../cusTypes-MRvvutK7.mjs';
|
|
1
|
+
import { A as AutumnPromise, b as CheckResult, T as TrackResult, C as CancelResult, S as SetupPaymentResult } from '../response-Bt5OMm4y.mjs';
|
|
2
|
+
import { B as BillingPortalResult } from '../cusTypes-WaPJKeAb.mjs';
|
|
4
3
|
import { AutumnContextParams } from '../AutumnContext.mjs';
|
|
5
4
|
import { AttachParams, CheckParams, TrackParams, CancelParams, OpenBillingPortalParams, SetupPaymentParams } from '../client/types/clientGenTypes.mjs';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import '../error-DHbclCVh.mjs';
|
|
6
7
|
import 'react';
|
|
7
|
-
import '../ReactAutumnClient-
|
|
8
|
-
import '../client/types/clientReferralTypes.mjs';
|
|
8
|
+
import '../ReactAutumnClient-BmHGkNH1.mjs';
|
|
9
9
|
import '../client/types/clientEntTypes.mjs';
|
|
10
|
-
import '../entTypes-
|
|
10
|
+
import '../entTypes-aIV0QUCW.mjs';
|
|
11
11
|
|
|
12
|
-
declare const useAutumnBase: ({ AutumnContext, }: {
|
|
12
|
+
declare const useAutumnBase: ({ AutumnContext, authClient, }: {
|
|
13
13
|
AutumnContext: React.Context<AutumnContextParams>;
|
|
14
|
+
authClient?: any;
|
|
14
15
|
}) => {
|
|
15
|
-
attach: (params: AttachParams) => Promise<
|
|
16
|
+
attach: (params: AttachParams) => Promise<any>;
|
|
16
17
|
check: (params: CheckParams) => AutumnPromise<CheckResult>;
|
|
17
18
|
track: (params: TrackParams) => AutumnPromise<TrackResult>;
|
|
18
19
|
cancel: (params: CancelParams) => AutumnPromise<CancelResult>;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { B as BillingPortalResult } from '../cusTypes-MRvvutK7.js';
|
|
1
|
+
import { A as AutumnPromise, b as CheckResult, T as TrackResult, C as CancelResult, S as SetupPaymentResult } from '../response-CvPzWrT9.js';
|
|
2
|
+
import { B as BillingPortalResult } from '../cusTypes-WaPJKeAb.js';
|
|
4
3
|
import { AutumnContextParams } from '../AutumnContext.js';
|
|
5
4
|
import { AttachParams, CheckParams, TrackParams, CancelParams, OpenBillingPortalParams, SetupPaymentParams } from '../client/types/clientGenTypes.js';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import '../error-DHbclCVh.js';
|
|
6
7
|
import 'react';
|
|
7
|
-
import '../ReactAutumnClient-
|
|
8
|
-
import '../client/types/clientReferralTypes.js';
|
|
8
|
+
import '../ReactAutumnClient-PGnPqPkr.js';
|
|
9
9
|
import '../client/types/clientEntTypes.js';
|
|
10
|
-
import '../entTypes-
|
|
10
|
+
import '../entTypes-D01S8gFX.js';
|
|
11
11
|
|
|
12
|
-
declare const useAutumnBase: ({ AutumnContext, }: {
|
|
12
|
+
declare const useAutumnBase: ({ AutumnContext, authClient, }: {
|
|
13
13
|
AutumnContext: React.Context<AutumnContextParams>;
|
|
14
|
+
authClient?: any;
|
|
14
15
|
}) => {
|
|
15
|
-
attach: (params: AttachParams) => Promise<
|
|
16
|
+
attach: (params: AttachParams) => Promise<any>;
|
|
16
17
|
check: (params: CheckParams) => AutumnPromise<CheckResult>;
|
|
17
18
|
track: (params: TrackParams) => AutumnPromise<TrackResult>;
|
|
18
19
|
cancel: (params: CancelParams) => AutumnPromise<CancelResult>;
|