autumn-js 0.0.103 → 0.0.104
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 +28 -4
- package/dist/libraries/backend/better-auth.d.ts +28 -4
- package/dist/libraries/backend/better-auth.js +76 -83
- package/dist/libraries/backend/better-auth.mjs +7 -7
- package/dist/libraries/backend/{chunk-YFWJ6E4U.mjs → chunk-2RZ2FZX2.mjs} +10 -10
- package/dist/libraries/backend/{chunk-33NT3WE5.mjs → chunk-3OLXYDCU.mjs} +1 -1
- package/dist/libraries/backend/{chunk-AKV5N4WO.mjs → chunk-5EKNB4IJ.mjs} +1 -1
- package/dist/libraries/backend/{chunk-CEZHD5H6.mjs → chunk-5H6HVCOP.mjs} +1 -1
- package/dist/libraries/backend/{chunk-J3L3OBSS.mjs → chunk-HHMIVOXX.mjs} +18 -1
- package/dist/libraries/backend/{chunk-6VS7TU7O.mjs → chunk-IOSEAUDJ.mjs} +57 -81
- package/dist/libraries/backend/{chunk-RA4AC56B.mjs → chunk-K7JGEYUX.mjs} +1 -1
- package/dist/libraries/backend/convex.js +73 -80
- package/dist/libraries/backend/convex.mjs +7 -7
- package/dist/libraries/backend/elysia.js +73 -80
- package/dist/libraries/backend/elysia.mjs +7 -7
- package/dist/libraries/backend/express.d.mts +1 -1
- package/dist/libraries/backend/express.d.ts +1 -1
- package/dist/libraries/backend/express.js +73 -80
- package/dist/libraries/backend/express.mjs +7 -7
- package/dist/libraries/backend/fastify.js +73 -80
- package/dist/libraries/backend/fastify.mjs +7 -7
- package/dist/libraries/backend/hono.js +73 -80
- package/dist/libraries/backend/hono.mjs +7 -7
- package/dist/libraries/backend/next.js +169 -176
- package/dist/libraries/backend/next.mjs +101 -101
- package/dist/libraries/backend/react-router.js +73 -80
- package/dist/libraries/backend/react-router.mjs +7 -7
- package/dist/libraries/backend/{referralTypes-DV8s1h8w.d.ts → referralTypes-CnYanpMd.d.ts} +199 -102
- package/dist/libraries/backend/{referralTypes-DcDxMGTp.d.mts → referralTypes-jA7MQ1y5.d.mts} +199 -102
- package/dist/libraries/backend/remix_dep.js +73 -80
- package/dist/libraries/backend/remix_dep.mjs +7 -7
- package/dist/libraries/backend/routes/backendRouter.js +73 -80
- package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
- package/dist/libraries/backend/routes/entityRoutes.js +56 -80
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +73 -80
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.js +56 -80
- package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +56 -80
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +73 -80
- package/dist/libraries/backend/supabase.mjs +7 -7
- package/dist/libraries/backend/tanstack.js +73 -80
- package/dist/libraries/backend/tanstack.mjs +7 -7
- package/dist/libraries/backend/utils/backendRes.js +56 -80
- package/dist/libraries/backend/utils/backendRes.mjs +1 -1
- package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
- package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
- package/dist/libraries/backend/utils/withAuth.js +56 -80
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +5 -4
- package/dist/libraries/react/AutumnContext.d.ts +5 -4
- package/dist/libraries/react/AutumnContext.js +63 -82
- package/dist/libraries/react/AutumnContext.mjs +6 -6
- package/dist/libraries/react/BaseAutumnProvider.d.mts +5 -4
- package/dist/libraries/react/BaseAutumnProvider.d.ts +5 -4
- package/dist/libraries/react/BaseAutumnProvider.js +96 -111
- package/dist/libraries/react/BaseAutumnProvider.mjs +10 -10
- package/dist/libraries/react/{ReactAutumnClient-C8Nt-pqu.d.mts → ReactAutumnClient-BGI56QI_.d.mts} +21 -10
- package/dist/libraries/react/{ReactAutumnClient-BlxQQOXE.d.ts → ReactAutumnClient-CEv9YGLM.d.ts} +21 -10
- package/dist/libraries/react/ReactAutumnProvider.d.mts +1 -1
- package/dist/libraries/react/ReactAutumnProvider.d.ts +1 -1
- package/dist/libraries/react/ReactAutumnProvider.js +96 -111
- package/dist/libraries/react/ReactAutumnProvider.mjs +11 -11
- package/dist/libraries/react/attachTypes-Cexub7bN.d.ts +58 -0
- package/dist/libraries/react/attachTypes-DqI7qtXD.d.mts +58 -0
- package/dist/libraries/react/{chunk-VUBJ6JM3.mjs → chunk-253MTZP3.mjs} +7 -2
- package/dist/libraries/react/{chunk-RQN4VDAE.mjs → chunk-3N6WLQH3.mjs} +3 -3
- package/dist/libraries/react/{chunk-DHJ36QEV.mjs → chunk-473LVTGN.mjs} +2 -2
- package/dist/libraries/react/{chunk-LXSKONN2.mjs → chunk-4A53GN44.mjs} +5 -5
- package/dist/libraries/react/{chunk-EHOBTSZ7.mjs → chunk-4BQDSIWM.mjs} +5 -8
- package/dist/libraries/react/{chunk-S6JUZ43Q.mjs → chunk-4VXBAIPC.mjs} +2 -2
- package/dist/libraries/react/{chunk-OAWFFAKA.mjs → chunk-6EZVNJHQ.mjs} +6 -6
- package/dist/libraries/react/{chunk-DBGTWERW.mjs → chunk-ASL5VH2W.mjs} +4 -3
- package/dist/libraries/react/{chunk-QBBE72EF.mjs → chunk-CBPZVSMZ.mjs} +12 -7
- package/dist/libraries/react/chunk-CUWUAQML.mjs +179 -0
- package/dist/libraries/react/chunk-DJIRJJNG.mjs +34 -0
- package/dist/libraries/react/{chunk-CYW4LNFZ.mjs → chunk-E5EYSQYJ.mjs} +68 -90
- package/dist/libraries/react/{chunk-GQIE3MFB.mjs → chunk-EBQBPZCM.mjs} +3 -3
- package/dist/libraries/react/{chunk-AL3VJLFU.mjs → chunk-EV5RNY5U.mjs} +1 -1
- package/dist/libraries/react/chunk-G6NOGGDA.mjs +695 -0
- package/dist/libraries/react/{chunk-OAPUYXBO.mjs → chunk-KWNH6C27.mjs} +6 -6
- package/dist/libraries/react/{chunk-X4R3V6O6.mjs → chunk-MNOH7Q3B.mjs} +2 -2
- package/dist/libraries/react/{chunk-3SGSKYJ7.mjs → chunk-P5MIFIIO.mjs} +2 -2
- package/dist/libraries/react/{chunk-PZJQBCVG.mjs → chunk-PIENO233.mjs} +1 -1
- package/dist/libraries/react/chunk-QUO2CYKM.mjs +30 -0
- package/dist/libraries/react/{chunk-BCMBFJ7E.mjs → chunk-RCTILKK3.mjs} +70 -37
- package/dist/libraries/react/{chunk-ZVQKDPUP.mjs → chunk-RPEGNKJH.mjs} +3 -3
- package/dist/libraries/react/{chunk-SDMBKRAI.mjs → chunk-WAFSQH6N.mjs} +37 -37
- package/dist/libraries/react/{chunk-CGWNDUYV.mjs → chunk-ZFIJI37N.mjs} +1 -1
- package/dist/libraries/react/{chunk-KYSWTOMQ.mjs → chunk-ZITEHPEQ.mjs} +30 -24
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +5 -5
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +5 -5
- package/dist/libraries/react/client/ReactAutumnClient.js +63 -82
- package/dist/libraries/react/client/ReactAutumnClient.mjs +5 -5
- package/dist/libraries/react/client/clientCompMethods.d.mts +5 -5
- package/dist/libraries/react/client/clientCompMethods.d.ts +5 -5
- package/dist/libraries/react/client/clientCusMethods.d.mts +5 -5
- package/dist/libraries/react/client/clientCusMethods.d.ts +5 -5
- package/dist/libraries/react/client/clientEntityMethods.d.mts +5 -5
- package/dist/libraries/react/client/clientEntityMethods.d.ts +5 -5
- package/dist/libraries/react/client/clientGenMethods.d.mts +9 -7
- package/dist/libraries/react/client/clientGenMethods.d.ts +9 -7
- package/dist/libraries/react/client/clientGenMethods.js +8 -2
- package/dist/libraries/react/client/clientGenMethods.mjs +3 -1
- package/dist/libraries/react/client/clientProdMethods.d.mts +5 -5
- package/dist/libraries/react/client/clientProdMethods.d.ts +5 -5
- package/dist/libraries/react/client/clientReferralMethods.d.mts +5 -5
- package/dist/libraries/react/client/clientReferralMethods.d.ts +5 -5
- package/dist/libraries/react/client/types/clientAttachTypes.d.mts +115 -0
- package/dist/libraries/react/client/types/clientAttachTypes.d.ts +115 -0
- package/dist/libraries/react/client/types/clientAttachTypes.js +68 -0
- package/dist/libraries/react/client/types/clientAttachTypes.mjs +42 -0
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +10 -81
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +10 -81
- package/dist/libraries/react/client/types/clientGenTypes.js +1 -24
- package/dist/libraries/react/client/types/clientGenTypes.mjs +1 -22
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.css +213 -4
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +5 -32
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +5 -32
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +720 -371
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +30 -33
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +3 -2
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +3 -2
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.js +70 -37
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.mjs +1 -1
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +1 -1
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +1 -1
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.js +43 -43
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +5 -5
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -1
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +3 -1
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +3 -1
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.js +12 -7
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.mjs +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.css +213 -4
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +794 -456
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +29 -26
- package/dist/libraries/react/components/ui/accordion.d.mts +9 -0
- package/dist/libraries/react/components/ui/accordion.d.ts +9 -0
- package/dist/libraries/react/components/ui/accordion.js +2721 -0
- package/dist/libraries/react/components/ui/accordion.mjs +15 -0
- package/dist/libraries/react/components/ui/button.d.mts +1 -1
- package/dist/libraries/react/components/ui/button.d.ts +1 -1
- package/dist/libraries/react/components/ui/button.js +3 -3
- package/dist/libraries/react/components/ui/button.mjs +2 -2
- package/dist/libraries/react/components/ui/dialog.js +43 -43
- package/dist/libraries/react/components/ui/dialog.mjs +3 -3
- package/dist/libraries/react/components/ui/input.d.mts +5 -0
- package/dist/libraries/react/components/ui/input.d.ts +5 -0
- package/dist/libraries/react/components/ui/input.js +2587 -0
- package/dist/libraries/react/components/ui/input.mjs +9 -0
- package/dist/libraries/react/components/ui/popover.d.mts +9 -0
- package/dist/libraries/react/components/ui/popover.d.ts +9 -0
- package/dist/libraries/react/components/ui/popover.js +2594 -0
- package/dist/libraries/react/components/ui/popover.mjs +15 -0
- package/dist/libraries/react/components/ui/switch.js +12 -12
- package/dist/libraries/react/components/ui/switch.mjs +3 -3
- package/dist/libraries/react/{cusTypes-CHcG59KG.d.mts → cusTypes-DCeNEQLu.d.mts} +28 -10
- package/dist/libraries/react/{cusTypes-CHcG59KG.d.ts → cusTypes-DCeNEQLu.d.ts} +28 -10
- package/dist/libraries/react/{entTypes-8-4TWxee.d.ts → entTypes-BJD_Hxbp.d.ts} +1 -1
- package/dist/libraries/react/{entTypes-3t7AbNhm.d.mts → entTypes-CJhJFCKD.d.mts} +1 -1
- package/dist/libraries/react/hooks/handleAllowed.d.mts +2 -2
- package/dist/libraries/react/hooks/handleAllowed.d.ts +2 -2
- package/dist/libraries/react/hooks/useAutumn.d.mts +21 -6
- package/dist/libraries/react/hooks/useAutumn.d.ts +21 -6
- package/dist/libraries/react/hooks/useAutumn.js +94 -110
- package/dist/libraries/react/hooks/useAutumn.mjs +9 -9
- package/dist/libraries/react/hooks/useAutumnBase.d.mts +24 -9
- package/dist/libraries/react/hooks/useAutumnBase.d.ts +24 -9
- package/dist/libraries/react/hooks/useAutumnBase.js +94 -110
- package/dist/libraries/react/hooks/useAutumnBase.mjs +8 -8
- 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 +96 -111
- package/dist/libraries/react/hooks/useCustomer.mjs +10 -10
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +8 -5
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +8 -5
- package/dist/libraries/react/hooks/useCustomerBase.js +96 -111
- package/dist/libraries/react/hooks/useCustomerBase.mjs +9 -9
- package/dist/libraries/react/hooks/useEntity.d.mts +14 -7
- package/dist/libraries/react/hooks/useEntity.d.ts +14 -7
- package/dist/libraries/react/hooks/useEntity.js +94 -110
- package/dist/libraries/react/hooks/useEntity.mjs +10 -10
- package/dist/libraries/react/hooks/useEntityBase.d.mts +16 -7
- package/dist/libraries/react/hooks/useEntityBase.d.ts +16 -7
- package/dist/libraries/react/hooks/useEntityBase.js +94 -110
- package/dist/libraries/react/hooks/useEntityBase.mjs +9 -9
- package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
- package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
- package/dist/libraries/react/hooks/usePricingTable.js +66 -88
- package/dist/libraries/react/hooks/usePricingTable.mjs +8 -8
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -6
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -6
- package/dist/libraries/react/hooks/usePricingTableBase.js +66 -88
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +7 -7
- package/dist/libraries/react/hooks/useProductsBase.js +63 -82
- package/dist/libraries/react/hooks/useProductsBase.mjs +6 -6
- package/dist/libraries/react/index.d.mts +217 -106
- package/dist/libraries/react/index.d.ts +217 -106
- package/dist/libraries/react/index.js +801 -463
- package/dist/libraries/react/index.mjs +792 -454
- package/dist/libraries/react/{response-DnJCkvfc.d.ts → response-Dek2TEnE.d.ts} +2 -25
- package/dist/libraries/react/{response-B8MYd86O.d.mts → response-HZAWTgGp.d.mts} +2 -25
- package/dist/next/{AutumnProvider-Xl1mqxls.d.mts → AutumnProvider-CHFySjFm.d.mts} +30 -12
- package/dist/next/{AutumnProvider-Xl1mqxls.d.ts → AutumnProvider-CHFySjFm.d.ts} +30 -12
- package/dist/next/AutumnProvider.d.mts +1 -1
- package/dist/next/AutumnProvider.d.ts +1 -1
- package/dist/next/client/NextAutumnClient.d.mts +18 -7
- package/dist/next/client/NextAutumnClient.d.ts +18 -7
- package/dist/next/client/NextAutumnClient.js +13 -2
- package/dist/next/client/NextAutumnClient.mjs +13 -2
- package/dist/next/client/NextAutumnProvider.d.mts +1 -1
- package/dist/next/client/NextAutumnProvider.d.ts +1 -1
- package/dist/next/client/attachTypes-BL6x9Zbx.d.ts +58 -0
- package/dist/next/client/attachTypes-BPYeJ6E4.d.mts +58 -0
- package/dist/next/client/{clientGenTypes-Dx1TULjb.d.ts → clientAttachTypes-Dj6U8D7o.d.ts} +108 -90
- package/dist/next/client/{clientGenTypes-tE8HbEdV.d.mts → clientAttachTypes-fN66J754.d.mts} +108 -90
- package/dist/next/client/clientUtils.d.mts +2 -2
- package/dist/next/client/clientUtils.d.ts +2 -2
- package/dist/next/client/{cusTypes-nWQygxXu.d.mts → cusTypes-BoVZ2omf.d.mts} +32 -14
- package/dist/next/client/{cusTypes-nWQygxXu.d.ts → cusTypes-BoVZ2omf.d.ts} +32 -14
- package/dist/next/client/{entTypes-DDZyYuom.d.ts → entTypes-BrHkjvC9.d.ts} +1 -1
- package/dist/next/client/{entTypes-DusU3WqD.d.mts → entTypes-Li6ZrG0C.d.mts} +1 -1
- package/dist/next/client/hooks/useAutumn.d.mts +19 -5
- package/dist/next/client/hooks/useAutumn.d.ts +19 -5
- package/dist/next/client/hooks/useCustomer.d.mts +5 -4
- package/dist/next/client/hooks/useCustomer.d.ts +5 -4
- package/dist/next/client/hooks/useEntity.d.mts +14 -8
- package/dist/next/client/hooks/useEntity.d.ts +14 -8
- package/dist/next/client/hooks/usePricingTable.d.mts +1 -1
- package/dist/next/client/hooks/usePricingTable.d.ts +1 -1
- package/dist/next/client/types.d.mts +2 -2
- package/dist/next/client/types.d.ts +2 -2
- package/dist/next/index.d.mts +213 -107
- package/dist/next/index.d.ts +213 -107
- package/dist/next/server/auth/withNextAuth.d.mts +1 -1
- package/dist/next/server/auth/withNextAuth.d.ts +1 -1
- package/dist/next/server/componentActions.d.mts +1 -1
- package/dist/next/server/componentActions.d.ts +1 -1
- package/dist/next/server/cusActions.d.mts +173 -94
- package/dist/next/server/cusActions.d.ts +173 -94
- package/dist/next/server/{cusTypes-Tc189V9T.d.mts → cusTypes-Bh_pVAJp.d.mts} +32 -14
- package/dist/next/server/{cusTypes-Tc189V9T.d.ts → cusTypes-Bh_pVAJp.d.ts} +32 -14
- package/dist/next/server/genActions.d.mts +3 -4
- package/dist/next/server/genActions.d.ts +3 -4
- package/dist/sdk/index.d.mts +221 -135
- package/dist/sdk/index.d.ts +221 -135
- package/dist/sdk/index.js +55 -80
- package/dist/sdk/index.mjs +54 -81
- package/dist/styles/global.css +213 -4
- package/dist/utils/encryptUtils.js +56 -80
- package/dist/utils/encryptUtils.mjs +56 -80
- package/package.json +7 -4
- package/dist/libraries/react/chunk-ZEVKOP7Z.mjs +0 -548
package/dist/libraries/react/{ReactAutumnClient-C8Nt-pqu.d.mts → ReactAutumnClient-BGI56QI_.d.mts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CreateEntityParams, GetEntityParams } from './client/types/clientEntTypes.mjs';
|
|
2
2
|
import { OpenBillingPortalParams, SetupPaymentParams } from './client/types/clientGenTypes.mjs';
|
|
3
|
-
import * as React from 'react';
|
|
4
3
|
import { A as AutumnError } from './error-DHbclCVh.mjs';
|
|
5
|
-
import { R as Result, A as AutumnPromise,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { R as Result, A as AutumnPromise, a as CheckResult, S as SetupPaymentResult } from './response-HZAWTgGp.mjs';
|
|
5
|
+
import { C as CheckoutResult } from './attachTypes-DqI7qtXD.mjs';
|
|
6
|
+
import { g as ProductItem, k as ProductScenario, C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResult, P as Product } from './cusTypes-DCeNEQLu.mjs';
|
|
7
|
+
import { E as Entity, D as DeleteEntityResult } from './entTypes-CJhJFCKD.mjs';
|
|
8
8
|
|
|
9
9
|
interface PricingTableProduct {
|
|
10
10
|
id: string;
|
|
@@ -87,12 +87,12 @@ declare class AutumnClient {
|
|
|
87
87
|
reward?: string | undefined;
|
|
88
88
|
productId?: string | undefined;
|
|
89
89
|
entityId?: string | undefined;
|
|
90
|
+
dialog?: any;
|
|
91
|
+
entityData?: any;
|
|
90
92
|
productIds?: string[] | undefined;
|
|
91
93
|
freeTrial?: boolean | undefined;
|
|
92
94
|
successUrl?: string | undefined;
|
|
93
95
|
forceCheckout?: boolean | undefined;
|
|
94
|
-
dialog?: ((args_0: any, ...args: unknown[]) => JSX.Element | React.ReactNode) | undefined;
|
|
95
|
-
entityData?: any;
|
|
96
96
|
openInNewTab?: boolean | undefined;
|
|
97
97
|
checkoutSessionParams?: Record<string, any> | undefined;
|
|
98
98
|
}) => AutumnPromise<{
|
|
@@ -103,6 +103,17 @@ declare class AutumnClient {
|
|
|
103
103
|
customer_data?: any;
|
|
104
104
|
checkout_url?: string | undefined;
|
|
105
105
|
}>;
|
|
106
|
+
checkout: (params: {
|
|
107
|
+
productId: string;
|
|
108
|
+
options?: {
|
|
109
|
+
quantity: number;
|
|
110
|
+
featureId: string;
|
|
111
|
+
}[] | undefined;
|
|
112
|
+
entityId?: string | undefined;
|
|
113
|
+
dialog?: any;
|
|
114
|
+
successUrl?: string | undefined;
|
|
115
|
+
openInNewTab?: boolean | undefined;
|
|
116
|
+
}) => AutumnPromise<CheckoutResult>;
|
|
106
117
|
cancel: (params: {
|
|
107
118
|
productId: string;
|
|
108
119
|
entityId?: string | undefined;
|
|
@@ -113,19 +124,19 @@ declare class AutumnClient {
|
|
|
113
124
|
success: boolean;
|
|
114
125
|
}>;
|
|
115
126
|
check: (params: {
|
|
116
|
-
featureId?: string | undefined;
|
|
117
127
|
productId?: string | undefined;
|
|
118
128
|
entityId?: string | undefined;
|
|
119
|
-
|
|
120
|
-
entityData?: any;
|
|
129
|
+
featureId?: string | undefined;
|
|
121
130
|
requiredBalance?: number | undefined;
|
|
122
131
|
sendEvent?: boolean | undefined;
|
|
123
132
|
withPreview?: boolean | undefined;
|
|
133
|
+
dialog?: any;
|
|
134
|
+
entityData?: any;
|
|
124
135
|
}) => AutumnPromise<CheckResult>;
|
|
125
136
|
track: (params: {
|
|
126
137
|
value?: number | undefined;
|
|
127
|
-
featureId?: string | undefined;
|
|
128
138
|
entityId?: string | undefined;
|
|
139
|
+
featureId?: string | undefined;
|
|
129
140
|
entityData?: any;
|
|
130
141
|
eventName?: string | undefined;
|
|
131
142
|
idempotencyKey?: string | undefined;
|
package/dist/libraries/react/{ReactAutumnClient-BlxQQOXE.d.ts → ReactAutumnClient-CEv9YGLM.d.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CreateEntityParams, GetEntityParams } from './client/types/clientEntTypes.js';
|
|
2
2
|
import { OpenBillingPortalParams, SetupPaymentParams } from './client/types/clientGenTypes.js';
|
|
3
|
-
import * as React from 'react';
|
|
4
3
|
import { A as AutumnError } from './error-DHbclCVh.js';
|
|
5
|
-
import { R as Result, A as AutumnPromise,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { R as Result, A as AutumnPromise, a as CheckResult, S as SetupPaymentResult } from './response-Dek2TEnE.js';
|
|
5
|
+
import { C as CheckoutResult } from './attachTypes-Cexub7bN.js';
|
|
6
|
+
import { g as ProductItem, k as ProductScenario, C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResult, P as Product } from './cusTypes-DCeNEQLu.js';
|
|
7
|
+
import { E as Entity, D as DeleteEntityResult } from './entTypes-BJD_Hxbp.js';
|
|
8
8
|
|
|
9
9
|
interface PricingTableProduct {
|
|
10
10
|
id: string;
|
|
@@ -87,12 +87,12 @@ declare class AutumnClient {
|
|
|
87
87
|
reward?: string | undefined;
|
|
88
88
|
productId?: string | undefined;
|
|
89
89
|
entityId?: string | undefined;
|
|
90
|
+
dialog?: any;
|
|
91
|
+
entityData?: any;
|
|
90
92
|
productIds?: string[] | undefined;
|
|
91
93
|
freeTrial?: boolean | undefined;
|
|
92
94
|
successUrl?: string | undefined;
|
|
93
95
|
forceCheckout?: boolean | undefined;
|
|
94
|
-
dialog?: ((args_0: any, ...args: unknown[]) => JSX.Element | React.ReactNode) | undefined;
|
|
95
|
-
entityData?: any;
|
|
96
96
|
openInNewTab?: boolean | undefined;
|
|
97
97
|
checkoutSessionParams?: Record<string, any> | undefined;
|
|
98
98
|
}) => AutumnPromise<{
|
|
@@ -103,6 +103,17 @@ declare class AutumnClient {
|
|
|
103
103
|
customer_data?: any;
|
|
104
104
|
checkout_url?: string | undefined;
|
|
105
105
|
}>;
|
|
106
|
+
checkout: (params: {
|
|
107
|
+
productId: string;
|
|
108
|
+
options?: {
|
|
109
|
+
quantity: number;
|
|
110
|
+
featureId: string;
|
|
111
|
+
}[] | undefined;
|
|
112
|
+
entityId?: string | undefined;
|
|
113
|
+
dialog?: any;
|
|
114
|
+
successUrl?: string | undefined;
|
|
115
|
+
openInNewTab?: boolean | undefined;
|
|
116
|
+
}) => AutumnPromise<CheckoutResult>;
|
|
106
117
|
cancel: (params: {
|
|
107
118
|
productId: string;
|
|
108
119
|
entityId?: string | undefined;
|
|
@@ -113,19 +124,19 @@ declare class AutumnClient {
|
|
|
113
124
|
success: boolean;
|
|
114
125
|
}>;
|
|
115
126
|
check: (params: {
|
|
116
|
-
featureId?: string | undefined;
|
|
117
127
|
productId?: string | undefined;
|
|
118
128
|
entityId?: string | undefined;
|
|
119
|
-
|
|
120
|
-
entityData?: any;
|
|
129
|
+
featureId?: string | undefined;
|
|
121
130
|
requiredBalance?: number | undefined;
|
|
122
131
|
sendEvent?: boolean | undefined;
|
|
123
132
|
withPreview?: boolean | undefined;
|
|
133
|
+
dialog?: any;
|
|
134
|
+
entityData?: any;
|
|
124
135
|
}) => AutumnPromise<CheckResult>;
|
|
125
136
|
track: (params: {
|
|
126
137
|
value?: number | undefined;
|
|
127
|
-
featureId?: string | undefined;
|
|
128
138
|
entityId?: string | undefined;
|
|
139
|
+
featureId?: string | undefined;
|
|
129
140
|
entityData?: any;
|
|
130
141
|
eventName?: string | undefined;
|
|
131
142
|
idempotencyKey?: string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CustomerData } from './cusTypes-
|
|
2
|
+
import { C as CustomerData } from './cusTypes-DCeNEQLu.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
declare const ReactAutumnProvider: ({ children, getBearerToken, backendUrl, customerData, includeCredentials, betterAuthUrl, }: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CustomerData } from './cusTypes-
|
|
2
|
+
import { C as CustomerData } from './cusTypes-DCeNEQLu.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
declare const ReactAutumnProvider: ({ children, getBearerToken, backendUrl, customerData, includeCredentials, betterAuthUrl, }: {
|
|
@@ -100,6 +100,12 @@ var AutumnError = class _AutumnError extends Error {
|
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
// src/sdk/general/genMethods.ts
|
|
103
|
+
var handleCheckout = async ({
|
|
104
|
+
instance,
|
|
105
|
+
params
|
|
106
|
+
}) => {
|
|
107
|
+
return instance.post("/checkout", params);
|
|
108
|
+
};
|
|
103
109
|
var handleAttach = async ({
|
|
104
110
|
instance,
|
|
105
111
|
params
|
|
@@ -118,18 +124,6 @@ var handleCancel = async ({
|
|
|
118
124
|
}) => {
|
|
119
125
|
return instance.post("/cancel", params);
|
|
120
126
|
};
|
|
121
|
-
var handleEntitled = async ({
|
|
122
|
-
instance,
|
|
123
|
-
params
|
|
124
|
-
}) => {
|
|
125
|
-
return instance.post("/entitled", params);
|
|
126
|
-
};
|
|
127
|
-
var handleEvent = async ({
|
|
128
|
-
instance,
|
|
129
|
-
params
|
|
130
|
-
}) => {
|
|
131
|
-
return instance.post("/events", params);
|
|
132
|
-
};
|
|
133
127
|
var handleTrack = async ({
|
|
134
128
|
instance,
|
|
135
129
|
params
|
|
@@ -476,6 +470,13 @@ var Autumn = class {
|
|
|
476
470
|
products = productMethods(this);
|
|
477
471
|
entities = entityMethods(this);
|
|
478
472
|
referrals = referralMethods(this);
|
|
473
|
+
static checkout = (params) => staticWrapper(handleCheckout, void 0, { params });
|
|
474
|
+
async checkout(params) {
|
|
475
|
+
return handleCheckout({
|
|
476
|
+
instance: this,
|
|
477
|
+
params
|
|
478
|
+
});
|
|
479
|
+
}
|
|
479
480
|
static attach = (params) => staticWrapper(handleAttach, void 0, { params });
|
|
480
481
|
static usage = (params) => staticWrapper(handleUsage, void 0, { params });
|
|
481
482
|
async attach(params) {
|
|
@@ -498,21 +499,6 @@ var Autumn = class {
|
|
|
498
499
|
params
|
|
499
500
|
});
|
|
500
501
|
}
|
|
501
|
-
/**
|
|
502
|
-
* @deprecated This method is deprecated and will be removed in a future version.
|
|
503
|
-
* Please use the new check() method instead.
|
|
504
|
-
*/
|
|
505
|
-
static entitled = (params) => staticWrapper(handleEntitled, void 0, { params });
|
|
506
|
-
/**
|
|
507
|
-
* @deprecated This method is deprecated and will be removed in a future version.
|
|
508
|
-
* Please use the new check() method instead.
|
|
509
|
-
*/
|
|
510
|
-
async entitled(params) {
|
|
511
|
-
return handleEntitled({
|
|
512
|
-
instance: this,
|
|
513
|
-
params
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
502
|
static check = (params) => staticWrapper(handleCheck, void 0, { params });
|
|
517
503
|
async check(params) {
|
|
518
504
|
return handleCheck({
|
|
@@ -520,21 +506,6 @@ var Autumn = class {
|
|
|
520
506
|
params
|
|
521
507
|
});
|
|
522
508
|
}
|
|
523
|
-
/**
|
|
524
|
-
* @deprecated This method is deprecated and will be removed in a future version.
|
|
525
|
-
* Please use the new track() method instead.
|
|
526
|
-
*/
|
|
527
|
-
static event = (params) => staticWrapper(handleEvent, void 0, { params });
|
|
528
|
-
/**
|
|
529
|
-
* @deprecated This method is deprecated and will be removed in a future version.
|
|
530
|
-
* Please use the new track() method instead.
|
|
531
|
-
*/
|
|
532
|
-
async event(params) {
|
|
533
|
-
return handleEvent({
|
|
534
|
-
instance: this,
|
|
535
|
-
params
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
509
|
static track = (params) => staticWrapper(handleTrack, void 0, { params });
|
|
539
510
|
async track(params) {
|
|
540
511
|
return handleTrack({
|
|
@@ -559,44 +530,6 @@ var EntityDataSchema = import_zod.z.object({
|
|
|
559
530
|
|
|
560
531
|
// src/sdk/general/genTypes.ts
|
|
561
532
|
var import_zod2 = require("zod");
|
|
562
|
-
var AttachFeatureOptionsSchema = import_zod2.z.object({
|
|
563
|
-
feature_id: import_zod2.z.string(),
|
|
564
|
-
quantity: import_zod2.z.number()
|
|
565
|
-
});
|
|
566
|
-
var AttachParamsSchema = import_zod2.z.object({
|
|
567
|
-
customer_id: import_zod2.z.string(),
|
|
568
|
-
product_id: import_zod2.z.string().optional(),
|
|
569
|
-
entity_id: import_zod2.z.string().optional(),
|
|
570
|
-
options: import_zod2.z.array(
|
|
571
|
-
import_zod2.z.object({
|
|
572
|
-
feature_id: import_zod2.z.string(),
|
|
573
|
-
quantity: import_zod2.z.number()
|
|
574
|
-
})
|
|
575
|
-
).optional(),
|
|
576
|
-
product_ids: import_zod2.z.array(import_zod2.z.string()).optional(),
|
|
577
|
-
// If set, will attach multiple products to the customer (cannot be used with product_id)
|
|
578
|
-
free_trial: import_zod2.z.boolean().optional(),
|
|
579
|
-
// Default is true -- if set to false, will bypass product free trial
|
|
580
|
-
success_url: import_zod2.z.string().optional(),
|
|
581
|
-
// Passed to Stripe
|
|
582
|
-
metadata: import_zod2.z.record(import_zod2.z.string()).optional(),
|
|
583
|
-
// Passed to Stripe
|
|
584
|
-
force_checkout: import_zod2.z.boolean().optional(),
|
|
585
|
-
// Default is false -- if set to true, will force the customer to checkout (not allowed for upgrades / downgrades)
|
|
586
|
-
customer_data: import_zod2.z.any().optional(),
|
|
587
|
-
entity_data: import_zod2.z.any().optional(),
|
|
588
|
-
checkout_session_params: import_zod2.z.record(import_zod2.z.any()).optional(),
|
|
589
|
-
// Passed to Stripe
|
|
590
|
-
reward: import_zod2.z.string().optional()
|
|
591
|
-
});
|
|
592
|
-
var AttachResultSchema = import_zod2.z.object({
|
|
593
|
-
checkout_url: import_zod2.z.string().optional(),
|
|
594
|
-
customer_id: import_zod2.z.string(),
|
|
595
|
-
product_ids: import_zod2.z.array(import_zod2.z.string()),
|
|
596
|
-
code: import_zod2.z.string(),
|
|
597
|
-
message: import_zod2.z.string(),
|
|
598
|
-
customer_data: import_zod2.z.any().optional()
|
|
599
|
-
});
|
|
600
533
|
var CancelParamsSchema = import_zod2.z.object({
|
|
601
534
|
customer_id: import_zod2.z.string(),
|
|
602
535
|
product_id: import_zod2.z.string(),
|
|
@@ -650,6 +583,11 @@ var CustomerExpandEnum = import_zod3.z.enum([
|
|
|
650
583
|
|
|
651
584
|
// src/sdk/customers/cusTypes.ts
|
|
652
585
|
var import_zod4 = require("zod");
|
|
586
|
+
var CustomerDataSchema = import_zod4.z.object({
|
|
587
|
+
name: import_zod4.z.string().nullish(),
|
|
588
|
+
email: import_zod4.z.string().nullish(),
|
|
589
|
+
fingerprint: import_zod4.z.string().nullish()
|
|
590
|
+
});
|
|
653
591
|
var CreateCustomerParamsSchema = import_zod4.z.object({
|
|
654
592
|
id: import_zod4.z.string().nullish(),
|
|
655
593
|
email: import_zod4.z.string().nullish(),
|
|
@@ -673,6 +611,44 @@ var RedeemReferralCodeParamsSchema = import_zod5.z.object({
|
|
|
673
611
|
customer_id: import_zod5.z.string()
|
|
674
612
|
});
|
|
675
613
|
|
|
614
|
+
// src/sdk/general/attachTypes.ts
|
|
615
|
+
var import_zod6 = require("zod");
|
|
616
|
+
var AttachFeatureOptionsSchema = import_zod6.z.object({
|
|
617
|
+
feature_id: import_zod6.z.string(),
|
|
618
|
+
quantity: import_zod6.z.number()
|
|
619
|
+
});
|
|
620
|
+
var AttachParamsSchema = import_zod6.z.object({
|
|
621
|
+
customer_id: import_zod6.z.string(),
|
|
622
|
+
product_id: import_zod6.z.string().optional(),
|
|
623
|
+
entity_id: import_zod6.z.string().optional(),
|
|
624
|
+
options: import_zod6.z.array(AttachFeatureOptionsSchema).optional(),
|
|
625
|
+
product_ids: import_zod6.z.array(import_zod6.z.string()).optional(),
|
|
626
|
+
free_trial: import_zod6.z.boolean().optional(),
|
|
627
|
+
success_url: import_zod6.z.string().optional(),
|
|
628
|
+
metadata: import_zod6.z.record(import_zod6.z.string()).optional(),
|
|
629
|
+
force_checkout: import_zod6.z.boolean().optional(),
|
|
630
|
+
customer_data: CustomerDataSchema.optional(),
|
|
631
|
+
entity_data: import_zod6.z.any().optional(),
|
|
632
|
+
checkout_session_params: import_zod6.z.record(import_zod6.z.any()).optional(),
|
|
633
|
+
reward: import_zod6.z.string().optional()
|
|
634
|
+
});
|
|
635
|
+
var AttachResultSchema = import_zod6.z.object({
|
|
636
|
+
checkout_url: import_zod6.z.string().optional(),
|
|
637
|
+
customer_id: import_zod6.z.string(),
|
|
638
|
+
product_ids: import_zod6.z.array(import_zod6.z.string()),
|
|
639
|
+
code: import_zod6.z.string(),
|
|
640
|
+
message: import_zod6.z.string(),
|
|
641
|
+
customer_data: import_zod6.z.any().optional()
|
|
642
|
+
});
|
|
643
|
+
var CheckoutParamsSchema = import_zod6.z.object({
|
|
644
|
+
customer_id: import_zod6.z.string(),
|
|
645
|
+
product_id: import_zod6.z.string(),
|
|
646
|
+
entity_id: import_zod6.z.string().optional(),
|
|
647
|
+
success_url: import_zod6.z.string().optional(),
|
|
648
|
+
customer_data: CustomerDataSchema.optional(),
|
|
649
|
+
options: import_zod6.z.array(AttachFeatureOptionsSchema).optional()
|
|
650
|
+
});
|
|
651
|
+
|
|
676
652
|
// src/libraries/react/errorUtils/logFetchError.ts
|
|
677
653
|
var logFetchError = ({
|
|
678
654
|
method,
|
|
@@ -748,9 +724,13 @@ async function deleteEntityMethod(entityId) {
|
|
|
748
724
|
}
|
|
749
725
|
|
|
750
726
|
// src/libraries/react/client/clientGenMethods.ts
|
|
727
|
+
async function checkoutMethod(params) {
|
|
728
|
+
let snakeParams = toSnakeCase(params);
|
|
729
|
+
const res = await this.post(`${this.prefix}/checkout`, snakeParams);
|
|
730
|
+
return res;
|
|
731
|
+
}
|
|
751
732
|
async function attachMethod(params) {
|
|
752
|
-
let
|
|
753
|
-
let snakeParams = toSnakeCase(rest, ["checkoutSessionparams"]);
|
|
733
|
+
let snakeParams = toSnakeCase(params, ["checkoutSessionparams"]);
|
|
754
734
|
const res = await this.post(`${this.prefix}/attach`, snakeParams);
|
|
755
735
|
return res;
|
|
756
736
|
}
|
|
@@ -957,6 +937,7 @@ var AutumnClient = class {
|
|
|
957
937
|
return await getPricingTableMethod.bind(this)();
|
|
958
938
|
}
|
|
959
939
|
attach = attachMethod.bind(this);
|
|
940
|
+
checkout = checkoutMethod.bind(this);
|
|
960
941
|
cancel = cancelMethod.bind(this);
|
|
961
942
|
check = checkMethod.bind(this);
|
|
962
943
|
track = trackMethod.bind(this);
|
|
@@ -1177,15 +1158,13 @@ var defaultSWRConfig = {
|
|
|
1177
1158
|
};
|
|
1178
1159
|
var usePricingTableBase = ({
|
|
1179
1160
|
AutumnContext: AutumnContext2,
|
|
1180
|
-
params
|
|
1181
|
-
authClient
|
|
1161
|
+
params
|
|
1182
1162
|
}) => {
|
|
1183
1163
|
const context = useAutumnContext({
|
|
1184
1164
|
AutumnContext: AutumnContext2,
|
|
1185
|
-
name: "usePricingTable"
|
|
1186
|
-
errorIfNotInitialized: !authClient
|
|
1165
|
+
name: "usePricingTable"
|
|
1187
1166
|
});
|
|
1188
|
-
const client =
|
|
1167
|
+
const client = context.client;
|
|
1189
1168
|
const fetcher = async () => {
|
|
1190
1169
|
try {
|
|
1191
1170
|
const { data: data2, error: error2 } = await client.products.list();
|
|
@@ -1205,7 +1184,6 @@ var usePricingTableBase = ({
|
|
|
1205
1184
|
);
|
|
1206
1185
|
return {
|
|
1207
1186
|
products: mergeProductDetails(data || [], params?.productDetails),
|
|
1208
|
-
// products: data || [],
|
|
1209
1187
|
isLoading: !error && !data,
|
|
1210
1188
|
error,
|
|
1211
1189
|
refetch: mutate
|
|
@@ -1215,20 +1193,16 @@ var usePricingTableBase = ({
|
|
|
1215
1193
|
// src/libraries/react/hooks/useAutumnBase.tsx
|
|
1216
1194
|
var useAutumnBase = ({
|
|
1217
1195
|
AutumnContext: AutumnContext2,
|
|
1218
|
-
authClient,
|
|
1219
1196
|
refetchCustomer
|
|
1220
1197
|
}) => {
|
|
1221
1198
|
const context = useAutumnContext({
|
|
1222
1199
|
AutumnContext: AutumnContext2,
|
|
1223
|
-
name: "useAutumn"
|
|
1224
|
-
errorIfNotInitialized: !authClient
|
|
1200
|
+
name: "useAutumn"
|
|
1225
1201
|
});
|
|
1226
1202
|
const { attachDialog, paywallDialog } = context;
|
|
1227
|
-
const client =
|
|
1228
|
-
const authClientExists = !!authClient;
|
|
1203
|
+
const client = context.client;
|
|
1229
1204
|
const { refetch: refetchPricingTable } = usePricingTableBase({
|
|
1230
|
-
AutumnContext: AutumnContext2
|
|
1231
|
-
authClient
|
|
1205
|
+
AutumnContext: AutumnContext2
|
|
1232
1206
|
});
|
|
1233
1207
|
let {
|
|
1234
1208
|
open: attachOpen,
|
|
@@ -1263,8 +1237,29 @@ var useAutumnBase = ({
|
|
|
1263
1237
|
}
|
|
1264
1238
|
return result;
|
|
1265
1239
|
};
|
|
1240
|
+
const checkout = async (params) => {
|
|
1241
|
+
const { data, error } = await client.checkout(params);
|
|
1242
|
+
const { dialog, ...rest } = params;
|
|
1243
|
+
if (error) {
|
|
1244
|
+
return { data, error };
|
|
1245
|
+
}
|
|
1246
|
+
if (data.url) {
|
|
1247
|
+
if (params.openInNewTab) {
|
|
1248
|
+
window.open(data.url, "_blank");
|
|
1249
|
+
} else {
|
|
1250
|
+
window.location.href = data.url;
|
|
1251
|
+
}
|
|
1252
|
+
return { data, error };
|
|
1253
|
+
}
|
|
1254
|
+
if (params.dialog) {
|
|
1255
|
+
setAttachProps({ checkoutResult: data, attachParams: rest });
|
|
1256
|
+
setAttachComponent(params.dialog);
|
|
1257
|
+
setAttachOpen(true);
|
|
1258
|
+
}
|
|
1259
|
+
return { data, error };
|
|
1260
|
+
};
|
|
1266
1261
|
const attachWithDialog = async (params) => {
|
|
1267
|
-
let {
|
|
1262
|
+
let { ...rest } = params;
|
|
1268
1263
|
const { productId, entityId, entityData } = params;
|
|
1269
1264
|
const checkRes = await client.check({
|
|
1270
1265
|
productId,
|
|
@@ -1285,14 +1280,8 @@ var useAutumnBase = ({
|
|
|
1285
1280
|
return checkRes;
|
|
1286
1281
|
};
|
|
1287
1282
|
const attach = async (params) => {
|
|
1288
|
-
const { dialog
|
|
1283
|
+
const { dialog } = params;
|
|
1289
1284
|
let finalDialog = dialog;
|
|
1290
|
-
if (dialog && authClientExists) {
|
|
1291
|
-
console.error(
|
|
1292
|
-
"[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"
|
|
1293
|
-
);
|
|
1294
|
-
return void 0;
|
|
1295
|
-
}
|
|
1296
1285
|
if (finalDialog && !attachOpen) {
|
|
1297
1286
|
setAttachComponent(finalDialog);
|
|
1298
1287
|
return await attachWithDialog(params);
|
|
@@ -1308,12 +1297,6 @@ var useAutumnBase = ({
|
|
|
1308
1297
|
};
|
|
1309
1298
|
const check = async (params) => {
|
|
1310
1299
|
let { dialog, withPreview } = params;
|
|
1311
|
-
if (dialog && authClientExists) {
|
|
1312
|
-
console.error(
|
|
1313
|
-
"[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"
|
|
1314
|
-
);
|
|
1315
|
-
return void 0;
|
|
1316
|
-
}
|
|
1317
1300
|
if (dialog) {
|
|
1318
1301
|
setPaywallComponent(dialog);
|
|
1319
1302
|
}
|
|
@@ -1389,7 +1372,8 @@ var useAutumnBase = ({
|
|
|
1389
1372
|
track,
|
|
1390
1373
|
cancel,
|
|
1391
1374
|
openBillingPortal,
|
|
1392
|
-
setupPayment
|
|
1375
|
+
setupPayment,
|
|
1376
|
+
checkout
|
|
1393
1377
|
};
|
|
1394
1378
|
};
|
|
1395
1379
|
|
|
@@ -1461,7 +1445,8 @@ var emptyDefaultFunctions = {
|
|
|
1461
1445
|
track: "",
|
|
1462
1446
|
cancel: "",
|
|
1463
1447
|
openBillingPortal: "",
|
|
1464
|
-
setupPayment: ""
|
|
1448
|
+
setupPayment: "",
|
|
1449
|
+
checkout: ""
|
|
1465
1450
|
};
|
|
1466
1451
|
var useCustomerBase = ({
|
|
1467
1452
|
params,
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
ReactAutumnProvider
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-DBGTWERW.mjs";
|
|
5
|
+
} from "./chunk-EBQBPZCM.mjs";
|
|
6
|
+
import "./chunk-3N6WLQH3.mjs";
|
|
8
7
|
import "./chunk-4QPHNIQ7.mjs";
|
|
8
|
+
import "./chunk-ASL5VH2W.mjs";
|
|
9
9
|
import "./chunk-3JJC2VU5.mjs";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-ZITEHPEQ.mjs";
|
|
11
|
+
import "./chunk-4BQDSIWM.mjs";
|
|
12
|
+
import "./chunk-ZFIJI37N.mjs";
|
|
13
|
+
import "./chunk-E5EYSQYJ.mjs";
|
|
14
|
+
import "./chunk-JVCOY7ZL.mjs";
|
|
15
|
+
import "./chunk-CIBQ4BJU.mjs";
|
|
16
|
+
import "./chunk-V575SGOW.mjs";
|
|
14
17
|
import "./chunk-ZV4RPZTM.mjs";
|
|
15
18
|
import "./chunk-VTGR7VVK.mjs";
|
|
16
19
|
import "./chunk-WFFVOEUG.mjs";
|
|
17
20
|
import "./chunk-ZF2HUCN6.mjs";
|
|
18
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-253MTZP3.mjs";
|
|
19
22
|
import "./chunk-KQT5G3HT.mjs";
|
|
20
|
-
import "./chunk-V575SGOW.mjs";
|
|
21
|
-
import "./chunk-JVCOY7ZL.mjs";
|
|
22
|
-
import "./chunk-CIBQ4BJU.mjs";
|
|
23
23
|
export {
|
|
24
24
|
ReactAutumnProvider
|
|
25
25
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { g as ProductItem, P as Product } from './cusTypes-DCeNEQLu.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
declare const AttachFeatureOptionsSchema: z.ZodObject<{
|
|
5
|
+
feature_id: z.ZodString;
|
|
6
|
+
quantity: z.ZodNumber;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
feature_id: string;
|
|
9
|
+
quantity: number;
|
|
10
|
+
}, {
|
|
11
|
+
feature_id: string;
|
|
12
|
+
quantity: number;
|
|
13
|
+
}>;
|
|
14
|
+
type AttachFeatureOptions = z.infer<typeof AttachFeatureOptionsSchema>;
|
|
15
|
+
declare const AttachResultSchema: z.ZodObject<{
|
|
16
|
+
checkout_url: z.ZodOptional<z.ZodString>;
|
|
17
|
+
customer_id: z.ZodString;
|
|
18
|
+
product_ids: z.ZodArray<z.ZodString, "many">;
|
|
19
|
+
code: z.ZodString;
|
|
20
|
+
message: z.ZodString;
|
|
21
|
+
customer_data: z.ZodOptional<z.ZodAny>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
customer_id: string;
|
|
24
|
+
code: string;
|
|
25
|
+
message: string;
|
|
26
|
+
product_ids: string[];
|
|
27
|
+
customer_data?: any;
|
|
28
|
+
checkout_url?: string | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
customer_id: string;
|
|
31
|
+
code: string;
|
|
32
|
+
message: string;
|
|
33
|
+
product_ids: string[];
|
|
34
|
+
customer_data?: any;
|
|
35
|
+
checkout_url?: string | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
type AttachResult = z.infer<typeof AttachResultSchema>;
|
|
38
|
+
type CheckoutResult = {
|
|
39
|
+
url?: string;
|
|
40
|
+
customer_id: string;
|
|
41
|
+
has_prorations: boolean;
|
|
42
|
+
lines: {
|
|
43
|
+
description: string;
|
|
44
|
+
amount: number;
|
|
45
|
+
item: ProductItem;
|
|
46
|
+
}[];
|
|
47
|
+
total: number;
|
|
48
|
+
currency: string;
|
|
49
|
+
options: AttachFeatureOptions[];
|
|
50
|
+
product: Product;
|
|
51
|
+
current_product: Product;
|
|
52
|
+
next_cycle?: {
|
|
53
|
+
starts_at: number;
|
|
54
|
+
total: number;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type { AttachResult as A, CheckoutResult as C };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { g as ProductItem, P as Product } from './cusTypes-DCeNEQLu.mjs';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
declare const AttachFeatureOptionsSchema: z.ZodObject<{
|
|
5
|
+
feature_id: z.ZodString;
|
|
6
|
+
quantity: z.ZodNumber;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
feature_id: string;
|
|
9
|
+
quantity: number;
|
|
10
|
+
}, {
|
|
11
|
+
feature_id: string;
|
|
12
|
+
quantity: number;
|
|
13
|
+
}>;
|
|
14
|
+
type AttachFeatureOptions = z.infer<typeof AttachFeatureOptionsSchema>;
|
|
15
|
+
declare const AttachResultSchema: z.ZodObject<{
|
|
16
|
+
checkout_url: z.ZodOptional<z.ZodString>;
|
|
17
|
+
customer_id: z.ZodString;
|
|
18
|
+
product_ids: z.ZodArray<z.ZodString, "many">;
|
|
19
|
+
code: z.ZodString;
|
|
20
|
+
message: z.ZodString;
|
|
21
|
+
customer_data: z.ZodOptional<z.ZodAny>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
customer_id: string;
|
|
24
|
+
code: string;
|
|
25
|
+
message: string;
|
|
26
|
+
product_ids: string[];
|
|
27
|
+
customer_data?: any;
|
|
28
|
+
checkout_url?: string | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
customer_id: string;
|
|
31
|
+
code: string;
|
|
32
|
+
message: string;
|
|
33
|
+
product_ids: string[];
|
|
34
|
+
customer_data?: any;
|
|
35
|
+
checkout_url?: string | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
type AttachResult = z.infer<typeof AttachResultSchema>;
|
|
38
|
+
type CheckoutResult = {
|
|
39
|
+
url?: string;
|
|
40
|
+
customer_id: string;
|
|
41
|
+
has_prorations: boolean;
|
|
42
|
+
lines: {
|
|
43
|
+
description: string;
|
|
44
|
+
amount: number;
|
|
45
|
+
item: ProductItem;
|
|
46
|
+
}[];
|
|
47
|
+
total: number;
|
|
48
|
+
currency: string;
|
|
49
|
+
options: AttachFeatureOptions[];
|
|
50
|
+
product: Product;
|
|
51
|
+
current_product: Product;
|
|
52
|
+
next_cycle?: {
|
|
53
|
+
starts_at: number;
|
|
54
|
+
total: number;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type { AttachResult as A, CheckoutResult as C };
|
|
@@ -5,9 +5,13 @@ import {
|
|
|
5
5
|
} from "./chunk-KQT5G3HT.mjs";
|
|
6
6
|
|
|
7
7
|
// src/libraries/react/client/clientGenMethods.ts
|
|
8
|
+
async function checkoutMethod(params) {
|
|
9
|
+
let snakeParams = toSnakeCase(params);
|
|
10
|
+
const res = await this.post(`${this.prefix}/checkout`, snakeParams);
|
|
11
|
+
return res;
|
|
12
|
+
}
|
|
8
13
|
async function attachMethod(params) {
|
|
9
|
-
let
|
|
10
|
-
let snakeParams = toSnakeCase(rest, ["checkoutSessionparams"]);
|
|
14
|
+
let snakeParams = toSnakeCase(params, ["checkoutSessionparams"]);
|
|
11
15
|
const res = await this.post(`${this.prefix}/attach`, snakeParams);
|
|
12
16
|
return res;
|
|
13
17
|
}
|
|
@@ -39,6 +43,7 @@ async function openBillingPortalMethod(params) {
|
|
|
39
43
|
}
|
|
40
44
|
|
|
41
45
|
export {
|
|
46
|
+
checkoutMethod,
|
|
42
47
|
attachMethod,
|
|
43
48
|
setupPaymentMethod,
|
|
44
49
|
cancelMethod,
|