autumn-js 0.1.7 → 0.1.9
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 +37 -33
- package/dist/libraries/backend/better-auth.d.ts +37 -33
- package/dist/libraries/backend/better-auth.js +10 -2
- package/dist/libraries/backend/better-auth.mjs +7 -7
- package/dist/libraries/backend/{chunk-33ET4N4V.mjs → chunk-274BIVOC.mjs} +1 -1
- package/dist/libraries/backend/{chunk-3OVRYTZX.mjs → chunk-7WWKVE4J.mjs} +6 -6
- package/dist/libraries/backend/{chunk-GO7TVFSN.mjs → chunk-EJBD5GH7.mjs} +1 -1
- package/dist/libraries/backend/{chunk-TFYLV3GN.mjs → chunk-I43OU64D.mjs} +1 -1
- package/dist/libraries/backend/{chunk-VBHBF3GP.mjs → chunk-JN4ULI5R.mjs} +1 -1
- package/dist/libraries/backend/{chunk-AREWK25J.mjs → chunk-KY3RLTE7.mjs} +10 -2
- package/dist/libraries/backend/{chunk-LL53FE2Z.mjs → chunk-YN334O74.mjs} +1 -1
- package/dist/libraries/backend/convex.js +10 -2
- package/dist/libraries/backend/convex.mjs +7 -7
- package/dist/libraries/backend/elysia.js +10 -2
- 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 +10 -2
- package/dist/libraries/backend/express.mjs +7 -7
- package/dist/libraries/backend/fastify.js +10 -2
- package/dist/libraries/backend/fastify.mjs +7 -7
- package/dist/libraries/backend/hono.js +10 -2
- package/dist/libraries/backend/hono.mjs +7 -7
- package/dist/libraries/backend/index.d.mts +1 -1
- package/dist/libraries/backend/index.d.ts +1 -1
- package/dist/libraries/backend/index.js +10 -2
- package/dist/libraries/backend/index.mjs +7 -7
- package/dist/libraries/backend/next.js +10 -2
- package/dist/libraries/backend/next.mjs +7 -7
- package/dist/libraries/backend/react-router.js +10 -2
- package/dist/libraries/backend/react-router.mjs +7 -7
- package/dist/libraries/backend/{referralTypes-B50JL4PY.d.mts → referralTypes-BEcapeWf.d.mts} +60 -43
- package/dist/libraries/backend/{referralTypes-dW2HaxKV.d.ts → referralTypes-DuAlUwev.d.ts} +60 -43
- package/dist/libraries/backend/remix_dep.js +10 -2
- package/dist/libraries/backend/remix_dep.mjs +7 -7
- package/dist/libraries/backend/routes/backendRouter.js +10 -2
- package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
- package/dist/libraries/backend/routes/entityRoutes.js +10 -2
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +10 -2
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.js +10 -2
- package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +10 -2
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +10 -2
- package/dist/libraries/backend/supabase.mjs +7 -7
- package/dist/libraries/backend/tanstack.js +10 -2
- package/dist/libraries/backend/tanstack.mjs +7 -7
- package/dist/libraries/backend/utils/backendRes.js +10 -2
- 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 +10 -2
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +4 -4
- package/dist/libraries/react/AutumnContext.d.ts +4 -4
- package/dist/libraries/react/AutumnContext.js +10 -2
- package/dist/libraries/react/AutumnContext.mjs +5 -5
- package/dist/libraries/react/BaseAutumnProvider.d.mts +4 -4
- package/dist/libraries/react/BaseAutumnProvider.d.ts +4 -4
- package/dist/libraries/react/BaseAutumnProvider.js +15 -3
- package/dist/libraries/react/BaseAutumnProvider.mjs +10 -10
- package/dist/libraries/react/{ReactAutumnClient-BUq9E84_.d.ts → ReactAutumnClient-DCMQEadM.d.ts} +10 -3
- package/dist/libraries/react/{ReactAutumnClient-CpAGyyur.d.mts → ReactAutumnClient-Dm14G99_.d.mts} +10 -3
- package/dist/libraries/react/ReactAutumnProvider.d.mts +1 -1
- package/dist/libraries/react/ReactAutumnProvider.d.ts +1 -1
- package/dist/libraries/react/ReactAutumnProvider.js +15 -3
- package/dist/libraries/react/ReactAutumnProvider.mjs +11 -11
- package/dist/libraries/react/{attachTypes-CcB6xjSF.d.ts → attachTypes-QTf_JXj7.d.ts} +33 -0
- package/dist/libraries/react/{attachTypes-DqUN3q8s.d.mts → attachTypes-Sv_paJZ2.d.mts} +33 -0
- package/dist/libraries/react/{chunk-HMZZIUCF.mjs → chunk-3YIV3N5Y.mjs} +1 -1
- package/dist/libraries/react/{chunk-KYZ3DYMI.mjs → chunk-4UPD6W4L.mjs} +16 -15
- package/dist/libraries/react/{chunk-56PEGK2Z.mjs → chunk-7LOW3KZ3.mjs} +2 -2
- package/dist/libraries/react/{chunk-QQKJE2ND.mjs → chunk-CPN2LD2I.mjs} +2 -2
- package/dist/libraries/react/{chunk-ECOBNPRU.mjs → chunk-DRUVAAUW.mjs} +3 -3
- package/dist/libraries/react/{chunk-JFTZRU2U.mjs → chunk-E2BEY4ZP.mjs} +1 -1
- package/dist/libraries/react/{chunk-SFGXTDMX.mjs → chunk-IRTAGYDD.mjs} +2 -2
- package/dist/libraries/react/{chunk-WQXUZO6K.mjs → chunk-JIWMNR2E.mjs} +10 -2
- package/dist/libraries/react/{chunk-FMRBH4CP.mjs → chunk-JJVQIA5V.mjs} +1 -1
- package/dist/libraries/react/{chunk-HIC6P67K.mjs → chunk-KG2NPWAE.mjs} +7 -7
- package/dist/libraries/react/{chunk-JNR7QAPG.mjs → chunk-MKP43WD6.mjs} +1 -1
- package/dist/libraries/react/{chunk-SZJOMZTC.mjs → chunk-QZPMYB2V.mjs} +2 -2
- package/dist/libraries/react/{chunk-GWVZB5GK.mjs → chunk-TBRYCVBL.mjs} +3 -3
- package/dist/libraries/react/{chunk-ULIUD6YP.mjs → chunk-UQ5HI732.mjs} +3 -3
- package/dist/libraries/react/{chunk-ZJBEC254.mjs → chunk-URFTKUL2.mjs} +6 -2
- package/dist/libraries/react/{chunk-MW2FSYG3.mjs → chunk-XTONWQ65.mjs} +1 -1
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +4 -4
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +4 -4
- package/dist/libraries/react/client/ReactAutumnClient.js +10 -2
- package/dist/libraries/react/client/ReactAutumnClient.mjs +4 -4
- package/dist/libraries/react/client/clientCompMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientCompMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientCusMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientCusMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientEntityMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientEntityMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientGenMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientGenMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientProdMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientProdMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientReferralMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientReferralMethods.d.ts +4 -4
- package/dist/libraries/react/client/types/clientGenTypes.js +10 -2
- package/dist/libraries/react/client/types/clientGenTypes.mjs +1 -1
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.mts +1 -1
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.ts +1 -1
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.js +18 -5
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +21 -21
- package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.mts +1 -1
- package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.ts +1 -1
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.js +10 -2
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +21 -21
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +18 -5
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +21 -21
- 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/{entTypes-CoF9enrR.d.ts → entTypes-0CBBecul.d.ts} +1 -1
- package/dist/libraries/react/{entTypes-S4hkh1RG.d.mts → entTypes-kVUQcah5.d.mts} +1 -1
- package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +4 -4
- package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +4 -4
- package/dist/libraries/react/hooks/helpers/handleCheck.js +10 -2
- package/dist/libraries/react/hooks/helpers/handleCheck.mjs +2 -2
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +11 -4
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +11 -4
- package/dist/libraries/react/hooks/helpers/useAutumnBase.js +15 -3
- package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +3 -3
- package/dist/libraries/react/hooks/useAnalytics.js +10 -2
- package/dist/libraries/react/hooks/useAnalytics.mjs +6 -6
- package/dist/libraries/react/hooks/useCustomer.d.mts +4 -4
- package/dist/libraries/react/hooks/useCustomer.d.ts +4 -4
- package/dist/libraries/react/hooks/useCustomer.js +15 -3
- package/dist/libraries/react/hooks/useCustomer.mjs +10 -10
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +4 -4
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +4 -4
- package/dist/libraries/react/hooks/useCustomerBase.js +15 -3
- package/dist/libraries/react/hooks/useCustomerBase.mjs +9 -9
- package/dist/libraries/react/hooks/useEntity.d.mts +9 -2
- package/dist/libraries/react/hooks/useEntity.d.ts +9 -2
- package/dist/libraries/react/hooks/useEntity.js +15 -3
- package/dist/libraries/react/hooks/useEntity.mjs +10 -10
- package/dist/libraries/react/hooks/useEntityBase.d.mts +11 -4
- package/dist/libraries/react/hooks/useEntityBase.d.ts +11 -4
- package/dist/libraries/react/hooks/useEntityBase.js +15 -3
- package/dist/libraries/react/hooks/useEntityBase.mjs +9 -9
- package/dist/libraries/react/hooks/usePaywall.js +10 -2
- package/dist/libraries/react/hooks/usePaywall.mjs +6 -6
- package/dist/libraries/react/hooks/usePricingTable.js +10 -2
- package/dist/libraries/react/hooks/usePricingTable.mjs +7 -7
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +4 -4
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +4 -4
- package/dist/libraries/react/hooks/usePricingTableBase.js +10 -2
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -2
- package/dist/libraries/react/hooks/useProductsBase.d.mts +4 -4
- package/dist/libraries/react/hooks/useProductsBase.d.ts +4 -4
- package/dist/libraries/react/index.d.mts +40 -0
- package/dist/libraries/react/index.d.ts +40 -0
- package/dist/libraries/react/index.js +18 -5
- package/dist/libraries/react/index.mjs +18 -5
- package/dist/next/client/NextAutumnClient.d.mts +25 -18
- package/dist/next/client/NextAutumnClient.d.ts +25 -18
- package/dist/next/client/NextAutumnProvider.d.mts +2 -2
- package/dist/next/client/NextAutumnProvider.d.ts +2 -2
- package/dist/next/client/{attachTypes-EvdK0fPK.d.mts → attachTypes-CReq8zJ_.d.ts} +38 -5
- package/dist/next/client/{attachTypes-DKlQexnQ.d.ts → attachTypes-DUUIHTBt.d.mts} +38 -5
- package/dist/next/client/{clientAttachTypes-CZFjz8Rq.d.mts → clientAttachTypes-BzsPgggN.d.mts} +27 -27
- package/dist/next/client/{clientAttachTypes-CGPjsdPk.d.ts → clientAttachTypes-umadXlvp.d.ts} +27 -27
- package/dist/next/client/clientUtils.d.mts +3 -3
- package/dist/next/client/clientUtils.d.ts +3 -3
- package/dist/next/client/{cusTypes-y5wEmx07.d.mts → cusTypes-CIGvysWL.d.mts} +5 -5
- package/dist/next/client/{cusTypes-DEURYNg4.d.ts → cusTypes-CYojUJSJ.d.ts} +5 -5
- package/dist/next/client/{entTypes-CRFgWhOr.d.ts → entTypes-BAD1NMvb.d.ts} +1 -1
- package/dist/next/client/{entTypes-KRxjcMFv.d.mts → entTypes-mOI7WnPZ.d.mts} +1 -1
- package/dist/next/client/hooks/useAutumn.d.mts +12 -5
- package/dist/next/client/hooks/useAutumn.d.ts +12 -5
- package/dist/next/client/hooks/useCustomer.d.mts +5 -5
- package/dist/next/client/hooks/useCustomer.d.ts +5 -5
- package/dist/next/client/hooks/useEntity.d.mts +14 -7
- package/dist/next/client/hooks/useEntity.d.ts +14 -7
- 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 +3 -3
- package/dist/next/client/types.d.ts +3 -3
- package/dist/next/server/cusActions.d.mts +17 -0
- package/dist/next/server/cusActions.d.ts +17 -0
- package/dist/sdk/index.d.mts +50 -0
- package/dist/sdk/index.d.ts +50 -0
- package/dist/sdk/index.js +10 -2
- package/dist/sdk/index.mjs +10 -2
- package/dist/utils/encryptUtils.js +10 -2
- package/dist/utils/encryptUtils.mjs +10 -2
- package/package.json +1 -1
- package/dist/libraries/react/{cusTypes-DHjT-9rV.d.ts → cusTypes-BeSXIQ6P.d.ts} +2 -2
- package/dist/libraries/react/{cusTypes-CSmAk5io.d.mts → cusTypes-DbCQV8Sj.d.mts} +2 -2
- package/dist/next/client/{prodTypes-DzTLP57C.d.mts → prodTypes-CxvB1YY3.d.mts} +8 -8
- package/dist/next/client/{prodTypes-DzTLP57C.d.ts → prodTypes-CxvB1YY3.d.ts} +8 -8
|
@@ -744,7 +744,8 @@ var AttachParamsSchema = import_zod7.z.object({
|
|
|
744
744
|
customer_data: CustomerDataSchema.optional(),
|
|
745
745
|
entity_data: import_zod7.z.any().optional(),
|
|
746
746
|
checkout_session_params: import_zod7.z.record(import_zod7.z.any()).optional(),
|
|
747
|
-
reward: import_zod7.z.string().optional()
|
|
747
|
+
reward: import_zod7.z.string().optional(),
|
|
748
|
+
invoice: import_zod7.z.boolean().optional()
|
|
748
749
|
});
|
|
749
750
|
var AttachResultSchema = import_zod7.z.object({
|
|
750
751
|
checkout_url: import_zod7.z.string().optional(),
|
|
@@ -752,7 +753,14 @@ var AttachResultSchema = import_zod7.z.object({
|
|
|
752
753
|
product_ids: import_zod7.z.array(import_zod7.z.string()),
|
|
753
754
|
code: import_zod7.z.string(),
|
|
754
755
|
message: import_zod7.z.string(),
|
|
755
|
-
customer_data: import_zod7.z.any().optional()
|
|
756
|
+
customer_data: import_zod7.z.any().optional(),
|
|
757
|
+
invoice: import_zod7.z.object({
|
|
758
|
+
status: import_zod7.z.string(),
|
|
759
|
+
stripe_id: import_zod7.z.string(),
|
|
760
|
+
hosted_invoice_url: import_zod7.z.string().nullable(),
|
|
761
|
+
total: import_zod7.z.number(),
|
|
762
|
+
currency: import_zod7.z.string()
|
|
763
|
+
}).optional()
|
|
756
764
|
});
|
|
757
765
|
var CheckoutParamsSchema = import_zod7.z.object({
|
|
758
766
|
customer_id: import_zod7.z.string(),
|
|
@@ -1486,7 +1494,11 @@ var useAutumnBase = ({
|
|
|
1486
1494
|
if (error) {
|
|
1487
1495
|
return { data, error };
|
|
1488
1496
|
}
|
|
1489
|
-
|
|
1497
|
+
const hasPrepaid = data.product.items.some(
|
|
1498
|
+
(item) => item.usage_model === "prepaid"
|
|
1499
|
+
);
|
|
1500
|
+
const showDialog = hasPrepaid && params.dialog;
|
|
1501
|
+
if (data.url && !showDialog) {
|
|
1490
1502
|
if (params.openInNewTab) {
|
|
1491
1503
|
window.open(data.url, "_blank");
|
|
1492
1504
|
} else {
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
useEntityBase
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-CIBQ4BJU.mjs";
|
|
13
|
-
import "../chunk-WQXUZO6K.mjs";
|
|
5
|
+
} from "../chunk-UQ5HI732.mjs";
|
|
6
|
+
import "../chunk-XTONWQ65.mjs";
|
|
7
|
+
import "../chunk-URFTKUL2.mjs";
|
|
8
|
+
import "../chunk-MKP43WD6.mjs";
|
|
9
|
+
import "../chunk-E2BEY4ZP.mjs";
|
|
10
|
+
import "../chunk-KG2NPWAE.mjs";
|
|
11
|
+
import "../chunk-JIWMNR2E.mjs";
|
|
14
12
|
import "../chunk-V575SGOW.mjs";
|
|
15
13
|
import "../chunk-ZV4RPZTM.mjs";
|
|
14
|
+
import "../chunk-JVCOY7ZL.mjs";
|
|
15
|
+
import "../chunk-CIBQ4BJU.mjs";
|
|
16
16
|
import "../chunk-VTGR7VVK.mjs";
|
|
17
17
|
import "../chunk-WFFVOEUG.mjs";
|
|
18
18
|
import "../chunk-ZF2HUCN6.mjs";
|
|
@@ -742,7 +742,8 @@ var AttachParamsSchema = import_zod7.z.object({
|
|
|
742
742
|
customer_data: CustomerDataSchema.optional(),
|
|
743
743
|
entity_data: import_zod7.z.any().optional(),
|
|
744
744
|
checkout_session_params: import_zod7.z.record(import_zod7.z.any()).optional(),
|
|
745
|
-
reward: import_zod7.z.string().optional()
|
|
745
|
+
reward: import_zod7.z.string().optional(),
|
|
746
|
+
invoice: import_zod7.z.boolean().optional()
|
|
746
747
|
});
|
|
747
748
|
var AttachResultSchema = import_zod7.z.object({
|
|
748
749
|
checkout_url: import_zod7.z.string().optional(),
|
|
@@ -750,7 +751,14 @@ var AttachResultSchema = import_zod7.z.object({
|
|
|
750
751
|
product_ids: import_zod7.z.array(import_zod7.z.string()),
|
|
751
752
|
code: import_zod7.z.string(),
|
|
752
753
|
message: import_zod7.z.string(),
|
|
753
|
-
customer_data: import_zod7.z.any().optional()
|
|
754
|
+
customer_data: import_zod7.z.any().optional(),
|
|
755
|
+
invoice: import_zod7.z.object({
|
|
756
|
+
status: import_zod7.z.string(),
|
|
757
|
+
stripe_id: import_zod7.z.string(),
|
|
758
|
+
hosted_invoice_url: import_zod7.z.string().nullable(),
|
|
759
|
+
total: import_zod7.z.number(),
|
|
760
|
+
currency: import_zod7.z.string()
|
|
761
|
+
}).optional()
|
|
754
762
|
});
|
|
755
763
|
var CheckoutParamsSchema = import_zod7.z.object({
|
|
756
764
|
customer_id: import_zod7.z.string(),
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
usePaywall
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-CIBQ4BJU.mjs";
|
|
10
|
-
import "../chunk-WQXUZO6K.mjs";
|
|
5
|
+
} from "../chunk-JJVQIA5V.mjs";
|
|
6
|
+
import "../chunk-E2BEY4ZP.mjs";
|
|
7
|
+
import "../chunk-KG2NPWAE.mjs";
|
|
8
|
+
import "../chunk-JIWMNR2E.mjs";
|
|
11
9
|
import "../chunk-V575SGOW.mjs";
|
|
12
10
|
import "../chunk-ZV4RPZTM.mjs";
|
|
11
|
+
import "../chunk-JVCOY7ZL.mjs";
|
|
12
|
+
import "../chunk-CIBQ4BJU.mjs";
|
|
13
13
|
import "../chunk-VTGR7VVK.mjs";
|
|
14
14
|
import "../chunk-WFFVOEUG.mjs";
|
|
15
15
|
import "../chunk-ZF2HUCN6.mjs";
|
|
@@ -729,7 +729,8 @@ var AttachParamsSchema = import_zod7.z.object({
|
|
|
729
729
|
customer_data: CustomerDataSchema.optional(),
|
|
730
730
|
entity_data: import_zod7.z.any().optional(),
|
|
731
731
|
checkout_session_params: import_zod7.z.record(import_zod7.z.any()).optional(),
|
|
732
|
-
reward: import_zod7.z.string().optional()
|
|
732
|
+
reward: import_zod7.z.string().optional(),
|
|
733
|
+
invoice: import_zod7.z.boolean().optional()
|
|
733
734
|
});
|
|
734
735
|
var AttachResultSchema = import_zod7.z.object({
|
|
735
736
|
checkout_url: import_zod7.z.string().optional(),
|
|
@@ -737,7 +738,14 @@ var AttachResultSchema = import_zod7.z.object({
|
|
|
737
738
|
product_ids: import_zod7.z.array(import_zod7.z.string()),
|
|
738
739
|
code: import_zod7.z.string(),
|
|
739
740
|
message: import_zod7.z.string(),
|
|
740
|
-
customer_data: import_zod7.z.any().optional()
|
|
741
|
+
customer_data: import_zod7.z.any().optional(),
|
|
742
|
+
invoice: import_zod7.z.object({
|
|
743
|
+
status: import_zod7.z.string(),
|
|
744
|
+
stripe_id: import_zod7.z.string(),
|
|
745
|
+
hosted_invoice_url: import_zod7.z.string().nullable(),
|
|
746
|
+
total: import_zod7.z.number(),
|
|
747
|
+
currency: import_zod7.z.string()
|
|
748
|
+
}).optional()
|
|
741
749
|
});
|
|
742
750
|
var CheckoutParamsSchema = import_zod7.z.object({
|
|
743
751
|
customer_id: import_zod7.z.string(),
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
usePricingTable
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-CIBQ4BJU.mjs";
|
|
11
|
-
import "../chunk-WQXUZO6K.mjs";
|
|
5
|
+
} from "../chunk-QZPMYB2V.mjs";
|
|
6
|
+
import "../chunk-MKP43WD6.mjs";
|
|
7
|
+
import "../chunk-E2BEY4ZP.mjs";
|
|
8
|
+
import "../chunk-KG2NPWAE.mjs";
|
|
9
|
+
import "../chunk-JIWMNR2E.mjs";
|
|
12
10
|
import "../chunk-V575SGOW.mjs";
|
|
13
11
|
import "../chunk-ZV4RPZTM.mjs";
|
|
12
|
+
import "../chunk-JVCOY7ZL.mjs";
|
|
13
|
+
import "../chunk-CIBQ4BJU.mjs";
|
|
14
14
|
import "../chunk-VTGR7VVK.mjs";
|
|
15
15
|
import "../chunk-WFFVOEUG.mjs";
|
|
16
16
|
import "../chunk-ZF2HUCN6.mjs";
|
|
@@ -2,14 +2,14 @@ import * as swr from 'swr';
|
|
|
2
2
|
import { A as AutumnError } from '../error-DHbclCVh.mjs';
|
|
3
3
|
import { P as Product } from '../prodTypes--VvnyGlN.mjs';
|
|
4
4
|
import { ProductDetails } from '../client/types/clientPricingTableTypes.mjs';
|
|
5
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
5
|
+
import { A as AutumnClient } from '../ReactAutumnClient-Dm14G99_.mjs';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import '../client/types/clientEntTypes.mjs';
|
|
8
8
|
import '../client/types/clientGenTypes.mjs';
|
|
9
9
|
import '../genTypes-fEH_nqSm.mjs';
|
|
10
|
-
import '../attachTypes-
|
|
11
|
-
import '../entTypes-
|
|
12
|
-
import '../cusTypes-
|
|
10
|
+
import '../attachTypes-Sv_paJZ2.mjs';
|
|
11
|
+
import '../entTypes-kVUQcah5.mjs';
|
|
12
|
+
import '../cusTypes-DbCQV8Sj.mjs';
|
|
13
13
|
|
|
14
14
|
declare const usePricingTableBase: ({ client, params, }: {
|
|
15
15
|
client: AutumnClient;
|
|
@@ -2,14 +2,14 @@ import * as swr from 'swr';
|
|
|
2
2
|
import { A as AutumnError } from '../error-DHbclCVh.js';
|
|
3
3
|
import { P as Product } from '../prodTypes--VvnyGlN.js';
|
|
4
4
|
import { ProductDetails } from '../client/types/clientPricingTableTypes.js';
|
|
5
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
5
|
+
import { A as AutumnClient } from '../ReactAutumnClient-DCMQEadM.js';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import '../client/types/clientEntTypes.js';
|
|
8
8
|
import '../client/types/clientGenTypes.js';
|
|
9
9
|
import '../genTypes-DsiuvyWS.js';
|
|
10
|
-
import '../attachTypes-
|
|
11
|
-
import '../entTypes-
|
|
12
|
-
import '../cusTypes-
|
|
10
|
+
import '../attachTypes-QTf_JXj7.js';
|
|
11
|
+
import '../entTypes-0CBBecul.js';
|
|
12
|
+
import '../cusTypes-BeSXIQ6P.js';
|
|
13
13
|
|
|
14
14
|
declare const usePricingTableBase: ({ client, params, }: {
|
|
15
15
|
client: AutumnClient;
|
|
@@ -727,7 +727,8 @@ var AttachParamsSchema = import_zod7.z.object({
|
|
|
727
727
|
customer_data: CustomerDataSchema.optional(),
|
|
728
728
|
entity_data: import_zod7.z.any().optional(),
|
|
729
729
|
checkout_session_params: import_zod7.z.record(import_zod7.z.any()).optional(),
|
|
730
|
-
reward: import_zod7.z.string().optional()
|
|
730
|
+
reward: import_zod7.z.string().optional(),
|
|
731
|
+
invoice: import_zod7.z.boolean().optional()
|
|
731
732
|
});
|
|
732
733
|
var AttachResultSchema = import_zod7.z.object({
|
|
733
734
|
checkout_url: import_zod7.z.string().optional(),
|
|
@@ -735,7 +736,14 @@ var AttachResultSchema = import_zod7.z.object({
|
|
|
735
736
|
product_ids: import_zod7.z.array(import_zod7.z.string()),
|
|
736
737
|
code: import_zod7.z.string(),
|
|
737
738
|
message: import_zod7.z.string(),
|
|
738
|
-
customer_data: import_zod7.z.any().optional()
|
|
739
|
+
customer_data: import_zod7.z.any().optional(),
|
|
740
|
+
invoice: import_zod7.z.object({
|
|
741
|
+
status: import_zod7.z.string(),
|
|
742
|
+
stripe_id: import_zod7.z.string(),
|
|
743
|
+
hosted_invoice_url: import_zod7.z.string().nullable(),
|
|
744
|
+
total: import_zod7.z.number(),
|
|
745
|
+
currency: import_zod7.z.string()
|
|
746
|
+
}).optional()
|
|
739
747
|
});
|
|
740
748
|
var CheckoutParamsSchema = import_zod7.z.object({
|
|
741
749
|
customer_id: import_zod7.z.string(),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { P as Product } from '../prodTypes--VvnyGlN.mjs';
|
|
2
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
2
|
+
import { A as AutumnClient } from '../ReactAutumnClient-Dm14G99_.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '../client/types/clientEntTypes.mjs';
|
|
5
5
|
import '../client/types/clientGenTypes.mjs';
|
|
6
6
|
import '../error-DHbclCVh.mjs';
|
|
7
7
|
import '../genTypes-fEH_nqSm.mjs';
|
|
8
|
-
import '../attachTypes-
|
|
9
|
-
import '../entTypes-
|
|
10
|
-
import '../cusTypes-
|
|
8
|
+
import '../attachTypes-Sv_paJZ2.mjs';
|
|
9
|
+
import '../entTypes-kVUQcah5.mjs';
|
|
10
|
+
import '../cusTypes-DbCQV8Sj.mjs';
|
|
11
11
|
|
|
12
12
|
declare const useProductsBase: ({ client }: {
|
|
13
13
|
client: AutumnClient;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { P as Product } from '../prodTypes--VvnyGlN.js';
|
|
2
|
-
import { A as AutumnClient } from '../ReactAutumnClient-
|
|
2
|
+
import { A as AutumnClient } from '../ReactAutumnClient-DCMQEadM.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '../client/types/clientEntTypes.js';
|
|
5
5
|
import '../client/types/clientGenTypes.js';
|
|
6
6
|
import '../error-DHbclCVh.js';
|
|
7
7
|
import '../genTypes-DsiuvyWS.js';
|
|
8
|
-
import '../attachTypes-
|
|
9
|
-
import '../entTypes-
|
|
10
|
-
import '../cusTypes-
|
|
8
|
+
import '../attachTypes-QTf_JXj7.js';
|
|
9
|
+
import '../entTypes-0CBBecul.js';
|
|
10
|
+
import '../cusTypes-BeSXIQ6P.js';
|
|
11
11
|
|
|
12
12
|
declare const useProductsBase: ({ client }: {
|
|
13
13
|
client: AutumnClient;
|
|
@@ -505,12 +505,38 @@ declare const AttachResultSchema: z.ZodObject<{
|
|
|
505
505
|
code: z.ZodString;
|
|
506
506
|
message: z.ZodString;
|
|
507
507
|
customer_data: z.ZodOptional<z.ZodAny>;
|
|
508
|
+
invoice: z.ZodOptional<z.ZodObject<{
|
|
509
|
+
status: z.ZodString;
|
|
510
|
+
stripe_id: z.ZodString;
|
|
511
|
+
hosted_invoice_url: z.ZodNullable<z.ZodString>;
|
|
512
|
+
total: z.ZodNumber;
|
|
513
|
+
currency: z.ZodString;
|
|
514
|
+
}, "strip", z.ZodTypeAny, {
|
|
515
|
+
status: string;
|
|
516
|
+
stripe_id: string;
|
|
517
|
+
hosted_invoice_url: string | null;
|
|
518
|
+
total: number;
|
|
519
|
+
currency: string;
|
|
520
|
+
}, {
|
|
521
|
+
status: string;
|
|
522
|
+
stripe_id: string;
|
|
523
|
+
hosted_invoice_url: string | null;
|
|
524
|
+
total: number;
|
|
525
|
+
currency: string;
|
|
526
|
+
}>>;
|
|
508
527
|
}, "strip", z.ZodTypeAny, {
|
|
509
528
|
customer_id: string;
|
|
510
529
|
code: string;
|
|
511
530
|
message: string;
|
|
512
531
|
product_ids: string[];
|
|
513
532
|
customer_data?: any;
|
|
533
|
+
invoice?: {
|
|
534
|
+
status: string;
|
|
535
|
+
stripe_id: string;
|
|
536
|
+
hosted_invoice_url: string | null;
|
|
537
|
+
total: number;
|
|
538
|
+
currency: string;
|
|
539
|
+
} | undefined;
|
|
514
540
|
checkout_url?: string | undefined;
|
|
515
541
|
}, {
|
|
516
542
|
customer_id: string;
|
|
@@ -518,6 +544,13 @@ declare const AttachResultSchema: z.ZodObject<{
|
|
|
518
544
|
message: string;
|
|
519
545
|
product_ids: string[];
|
|
520
546
|
customer_data?: any;
|
|
547
|
+
invoice?: {
|
|
548
|
+
status: string;
|
|
549
|
+
stripe_id: string;
|
|
550
|
+
hosted_invoice_url: string | null;
|
|
551
|
+
total: number;
|
|
552
|
+
currency: string;
|
|
553
|
+
} | undefined;
|
|
521
554
|
checkout_url?: string | undefined;
|
|
522
555
|
}>;
|
|
523
556
|
type AttachResult = z.infer<typeof AttachResultSchema>;
|
|
@@ -902,6 +935,13 @@ declare const useEntity: (entityId: string | null, params?: GetEntityParams) =>
|
|
|
902
935
|
message: string;
|
|
903
936
|
product_ids: string[];
|
|
904
937
|
customer_data?: any;
|
|
938
|
+
invoice?: {
|
|
939
|
+
status: string;
|
|
940
|
+
stripe_id: string;
|
|
941
|
+
hosted_invoice_url: string | null;
|
|
942
|
+
total: number;
|
|
943
|
+
currency: string;
|
|
944
|
+
} | undefined;
|
|
905
945
|
checkout_url?: string | undefined;
|
|
906
946
|
} | CheckResult, AutumnError>>;
|
|
907
947
|
cancel: (params: CancelParams) => AutumnPromise<{
|
|
@@ -505,12 +505,38 @@ declare const AttachResultSchema: z.ZodObject<{
|
|
|
505
505
|
code: z.ZodString;
|
|
506
506
|
message: z.ZodString;
|
|
507
507
|
customer_data: z.ZodOptional<z.ZodAny>;
|
|
508
|
+
invoice: z.ZodOptional<z.ZodObject<{
|
|
509
|
+
status: z.ZodString;
|
|
510
|
+
stripe_id: z.ZodString;
|
|
511
|
+
hosted_invoice_url: z.ZodNullable<z.ZodString>;
|
|
512
|
+
total: z.ZodNumber;
|
|
513
|
+
currency: z.ZodString;
|
|
514
|
+
}, "strip", z.ZodTypeAny, {
|
|
515
|
+
status: string;
|
|
516
|
+
stripe_id: string;
|
|
517
|
+
hosted_invoice_url: string | null;
|
|
518
|
+
total: number;
|
|
519
|
+
currency: string;
|
|
520
|
+
}, {
|
|
521
|
+
status: string;
|
|
522
|
+
stripe_id: string;
|
|
523
|
+
hosted_invoice_url: string | null;
|
|
524
|
+
total: number;
|
|
525
|
+
currency: string;
|
|
526
|
+
}>>;
|
|
508
527
|
}, "strip", z.ZodTypeAny, {
|
|
509
528
|
customer_id: string;
|
|
510
529
|
code: string;
|
|
511
530
|
message: string;
|
|
512
531
|
product_ids: string[];
|
|
513
532
|
customer_data?: any;
|
|
533
|
+
invoice?: {
|
|
534
|
+
status: string;
|
|
535
|
+
stripe_id: string;
|
|
536
|
+
hosted_invoice_url: string | null;
|
|
537
|
+
total: number;
|
|
538
|
+
currency: string;
|
|
539
|
+
} | undefined;
|
|
514
540
|
checkout_url?: string | undefined;
|
|
515
541
|
}, {
|
|
516
542
|
customer_id: string;
|
|
@@ -518,6 +544,13 @@ declare const AttachResultSchema: z.ZodObject<{
|
|
|
518
544
|
message: string;
|
|
519
545
|
product_ids: string[];
|
|
520
546
|
customer_data?: any;
|
|
547
|
+
invoice?: {
|
|
548
|
+
status: string;
|
|
549
|
+
stripe_id: string;
|
|
550
|
+
hosted_invoice_url: string | null;
|
|
551
|
+
total: number;
|
|
552
|
+
currency: string;
|
|
553
|
+
} | undefined;
|
|
521
554
|
checkout_url?: string | undefined;
|
|
522
555
|
}>;
|
|
523
556
|
type AttachResult = z.infer<typeof AttachResultSchema>;
|
|
@@ -902,6 +935,13 @@ declare const useEntity: (entityId: string | null, params?: GetEntityParams) =>
|
|
|
902
935
|
message: string;
|
|
903
936
|
product_ids: string[];
|
|
904
937
|
customer_data?: any;
|
|
938
|
+
invoice?: {
|
|
939
|
+
status: string;
|
|
940
|
+
stripe_id: string;
|
|
941
|
+
hosted_invoice_url: string | null;
|
|
942
|
+
total: number;
|
|
943
|
+
currency: string;
|
|
944
|
+
} | undefined;
|
|
905
945
|
checkout_url?: string | undefined;
|
|
906
946
|
} | CheckResult, AutumnError>>;
|
|
907
947
|
cancel: (params: CancelParams) => AutumnPromise<{
|
|
@@ -798,7 +798,8 @@ var AttachParamsSchema = import_zod7.z.object({
|
|
|
798
798
|
customer_data: CustomerDataSchema.optional(),
|
|
799
799
|
entity_data: import_zod7.z.any().optional(),
|
|
800
800
|
checkout_session_params: import_zod7.z.record(import_zod7.z.any()).optional(),
|
|
801
|
-
reward: import_zod7.z.string().optional()
|
|
801
|
+
reward: import_zod7.z.string().optional(),
|
|
802
|
+
invoice: import_zod7.z.boolean().optional()
|
|
802
803
|
});
|
|
803
804
|
var AttachResultSchema = import_zod7.z.object({
|
|
804
805
|
checkout_url: import_zod7.z.string().optional(),
|
|
@@ -806,7 +807,14 @@ var AttachResultSchema = import_zod7.z.object({
|
|
|
806
807
|
product_ids: import_zod7.z.array(import_zod7.z.string()),
|
|
807
808
|
code: import_zod7.z.string(),
|
|
808
809
|
message: import_zod7.z.string(),
|
|
809
|
-
customer_data: import_zod7.z.any().optional()
|
|
810
|
+
customer_data: import_zod7.z.any().optional(),
|
|
811
|
+
invoice: import_zod7.z.object({
|
|
812
|
+
status: import_zod7.z.string(),
|
|
813
|
+
stripe_id: import_zod7.z.string(),
|
|
814
|
+
hosted_invoice_url: import_zod7.z.string().nullable(),
|
|
815
|
+
total: import_zod7.z.number(),
|
|
816
|
+
currency: import_zod7.z.string()
|
|
817
|
+
}).optional()
|
|
810
818
|
});
|
|
811
819
|
var CheckoutParamsSchema = import_zod7.z.object({
|
|
812
820
|
customer_id: import_zod7.z.string(),
|
|
@@ -1404,7 +1412,11 @@ var useAutumnBase = ({
|
|
|
1404
1412
|
if (error) {
|
|
1405
1413
|
return { data, error };
|
|
1406
1414
|
}
|
|
1407
|
-
|
|
1415
|
+
const hasPrepaid = data.product.items.some(
|
|
1416
|
+
(item) => item.usage_model === "prepaid"
|
|
1417
|
+
);
|
|
1418
|
+
const showDialog = hasPrepaid && params.dialog;
|
|
1419
|
+
if (data.url && !showDialog) {
|
|
1408
1420
|
if (params.openInNewTab) {
|
|
1409
1421
|
window.open(data.url, "_blank");
|
|
1410
1422
|
} else {
|
|
@@ -10196,7 +10208,7 @@ function CheckoutDialog(params) {
|
|
|
10196
10208
|
const { title, message } = getCheckoutContent(checkoutResult);
|
|
10197
10209
|
const isFree = checkoutResult?.product.properties?.is_free;
|
|
10198
10210
|
const isPaid = isFree === false;
|
|
10199
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog2, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent2, { className: "au-p-0 au-pt-4 au-gap-0 au-text-foreground au-
|
|
10211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog2, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent2, { className: "au-p-0 au-pt-4 au-gap-0 au-text-foreground au-text-sm", children: [
|
|
10200
10212
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogTitle2, { className: "au-px-6 au-mb-1", children: title }),
|
|
10201
10213
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "au-px-6 au-mt-1 au-mb-4 au-text-muted-foreground", children: message }),
|
|
10202
10214
|
isPaid && checkoutResult && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
@@ -10384,7 +10396,8 @@ var PrepaidItem = ({
|
|
|
10384
10396
|
});
|
|
10385
10397
|
const { data, error } = await checkout({
|
|
10386
10398
|
productId: checkoutResult.product.id,
|
|
10387
|
-
options: newOptions
|
|
10399
|
+
options: newOptions,
|
|
10400
|
+
dialog: CheckoutDialog
|
|
10388
10401
|
});
|
|
10389
10402
|
if (error) {
|
|
10390
10403
|
console.error(error);
|
|
@@ -754,7 +754,8 @@ var AttachParamsSchema = z7.object({
|
|
|
754
754
|
customer_data: CustomerDataSchema.optional(),
|
|
755
755
|
entity_data: z7.any().optional(),
|
|
756
756
|
checkout_session_params: z7.record(z7.any()).optional(),
|
|
757
|
-
reward: z7.string().optional()
|
|
757
|
+
reward: z7.string().optional(),
|
|
758
|
+
invoice: z7.boolean().optional()
|
|
758
759
|
});
|
|
759
760
|
var AttachResultSchema = z7.object({
|
|
760
761
|
checkout_url: z7.string().optional(),
|
|
@@ -762,7 +763,14 @@ var AttachResultSchema = z7.object({
|
|
|
762
763
|
product_ids: z7.array(z7.string()),
|
|
763
764
|
code: z7.string(),
|
|
764
765
|
message: z7.string(),
|
|
765
|
-
customer_data: z7.any().optional()
|
|
766
|
+
customer_data: z7.any().optional(),
|
|
767
|
+
invoice: z7.object({
|
|
768
|
+
status: z7.string(),
|
|
769
|
+
stripe_id: z7.string(),
|
|
770
|
+
hosted_invoice_url: z7.string().nullable(),
|
|
771
|
+
total: z7.number(),
|
|
772
|
+
currency: z7.string()
|
|
773
|
+
}).optional()
|
|
766
774
|
});
|
|
767
775
|
var CheckoutParamsSchema = z7.object({
|
|
768
776
|
customer_id: z7.string(),
|
|
@@ -1360,7 +1368,11 @@ var useAutumnBase = ({
|
|
|
1360
1368
|
if (error) {
|
|
1361
1369
|
return { data, error };
|
|
1362
1370
|
}
|
|
1363
|
-
|
|
1371
|
+
const hasPrepaid = data.product.items.some(
|
|
1372
|
+
(item) => item.usage_model === "prepaid"
|
|
1373
|
+
);
|
|
1374
|
+
const showDialog = hasPrepaid && params.dialog;
|
|
1375
|
+
if (data.url && !showDialog) {
|
|
1364
1376
|
if (params.openInNewTab) {
|
|
1365
1377
|
window.open(data.url, "_blank");
|
|
1366
1378
|
} else {
|
|
@@ -10152,7 +10164,7 @@ function CheckoutDialog(params) {
|
|
|
10152
10164
|
const { title, message } = getCheckoutContent(checkoutResult);
|
|
10153
10165
|
const isFree = checkoutResult?.product.properties?.is_free;
|
|
10154
10166
|
const isPaid = isFree === false;
|
|
10155
|
-
return /* @__PURE__ */ jsx24(Dialog2, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs6(DialogContent2, { className: "au-p-0 au-pt-4 au-gap-0 au-text-foreground au-
|
|
10167
|
+
return /* @__PURE__ */ jsx24(Dialog2, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs6(DialogContent2, { className: "au-p-0 au-pt-4 au-gap-0 au-text-foreground au-text-sm", children: [
|
|
10156
10168
|
/* @__PURE__ */ jsx24(DialogTitle2, { className: "au-px-6 au-mb-1", children: title }),
|
|
10157
10169
|
/* @__PURE__ */ jsx24("div", { className: "au-px-6 au-mt-1 au-mb-4 au-text-muted-foreground", children: message }),
|
|
10158
10170
|
isPaid && checkoutResult && /* @__PURE__ */ jsx24(
|
|
@@ -10340,7 +10352,8 @@ var PrepaidItem = ({
|
|
|
10340
10352
|
});
|
|
10341
10353
|
const { data, error } = await checkout({
|
|
10342
10354
|
productId: checkoutResult.product.id,
|
|
10343
|
-
options: newOptions
|
|
10355
|
+
options: newOptions,
|
|
10356
|
+
dialog: CheckoutDialog
|
|
10344
10357
|
});
|
|
10345
10358
|
if (error) {
|
|
10346
10359
|
console.error(error);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { R as Result, a as AutumnPromise, C as CheckResult, O as OpenBillingPortalParams, S as SetupPaymentParams, e as SetupPaymentResult, Q as QueryResult, A as AttachParams, c as CancelParams, d as CancelResult, g as CheckParams, T as TrackParams, b as TrackResult } from './clientAttachTypes-
|
|
2
|
-
import { C as CheckoutResult, A as AttachResult } from './attachTypes-
|
|
3
|
-
import { C as CustomerData, e as CreateCustomerParams, a as Customer, B as BillingPortalResult } from './cusTypes-
|
|
4
|
-
import { E as Entity, D as DeleteEntityResult } from './entTypes-
|
|
1
|
+
import { R as Result, a as AutumnPromise, C as CheckResult, O as OpenBillingPortalParams, S as SetupPaymentParams, e as SetupPaymentResult, Q as QueryResult, A as AttachParams, c as CancelParams, d as CancelResult, g as CheckParams, T as TrackParams, b as TrackResult } from './clientAttachTypes-BzsPgggN.mjs';
|
|
2
|
+
import { C as CheckoutResult, A as AttachResult } from './attachTypes-DUUIHTBt.mjs';
|
|
3
|
+
import { C as CustomerData, e as CreateCustomerParams, a as Customer, B as BillingPortalResult } from './cusTypes-CIGvysWL.mjs';
|
|
4
|
+
import { E as Entity, D as DeleteEntityResult } from './entTypes-mOI7WnPZ.mjs';
|
|
5
5
|
import { C as CreateEntityParams, G as GetEntityParams, a as CreateReferralCodeResult, R as RedeemReferralCodeResult } from './clientEntTypes-BFkleT6a.mjs';
|
|
6
6
|
import { A as AutumnError } from './error-DHbclCVh.mjs';
|
|
7
|
-
import { P as ProductItem, c as ProductScenario, a as Product } from './prodTypes-
|
|
7
|
+
import { P as ProductItem, c as ProductScenario, a as Product } from './prodTypes-CxvB1YY3.mjs';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
10
10
|
interface PricingTableProduct {
|
|
@@ -66,41 +66,48 @@ declare class AutumnClient {
|
|
|
66
66
|
}, AutumnError>>;
|
|
67
67
|
attach: (params: {
|
|
68
68
|
options?: {
|
|
69
|
-
quantity: number;
|
|
70
69
|
featureId: string;
|
|
70
|
+
quantity: number;
|
|
71
71
|
}[] | undefined;
|
|
72
72
|
metadata?: Record<string, string> | undefined;
|
|
73
|
-
reward?: string | undefined;
|
|
74
73
|
productId?: string | undefined;
|
|
75
74
|
entityId?: string | undefined;
|
|
76
|
-
dialog?: any;
|
|
77
|
-
entityData?: any;
|
|
78
75
|
productIds?: string[] | undefined;
|
|
79
76
|
freeTrial?: boolean | undefined;
|
|
80
77
|
successUrl?: string | undefined;
|
|
81
78
|
forceCheckout?: boolean | undefined;
|
|
79
|
+
dialog?: any;
|
|
80
|
+
entityData?: any;
|
|
82
81
|
openInNewTab?: boolean | undefined;
|
|
82
|
+
reward?: string | undefined;
|
|
83
83
|
checkoutSessionParams?: Record<string, any> | undefined;
|
|
84
84
|
}) => AutumnPromise<{
|
|
85
|
-
message: string;
|
|
86
85
|
code: string;
|
|
86
|
+
message: string;
|
|
87
87
|
customer_id: string;
|
|
88
88
|
product_ids: string[];
|
|
89
|
-
customer_data?: any;
|
|
90
89
|
checkout_url?: string | undefined;
|
|
90
|
+
customer_data?: any;
|
|
91
|
+
invoice?: {
|
|
92
|
+
status: string;
|
|
93
|
+
stripe_id: string;
|
|
94
|
+
hosted_invoice_url: string | null;
|
|
95
|
+
total: number;
|
|
96
|
+
currency: string;
|
|
97
|
+
} | undefined;
|
|
91
98
|
}>;
|
|
92
99
|
checkout: (params: {
|
|
93
100
|
productId: string;
|
|
94
101
|
options?: {
|
|
95
|
-
quantity: number;
|
|
96
102
|
featureId: string;
|
|
103
|
+
quantity: number;
|
|
97
104
|
}[] | undefined;
|
|
98
|
-
reward?: string | undefined;
|
|
99
105
|
entityId?: string | undefined;
|
|
106
|
+
successUrl?: string | undefined;
|
|
100
107
|
dialog?: any;
|
|
101
108
|
entityData?: any;
|
|
102
|
-
successUrl?: string | undefined;
|
|
103
109
|
openInNewTab?: boolean | undefined;
|
|
110
|
+
reward?: string | undefined;
|
|
104
111
|
checkoutSessionParams?: Record<string, any> | undefined;
|
|
105
112
|
}) => AutumnPromise<CheckoutResult>;
|
|
106
113
|
cancel: (params: {
|
|
@@ -109,18 +116,18 @@ declare class AutumnClient {
|
|
|
109
116
|
cancelImmediately?: boolean | undefined;
|
|
110
117
|
}) => AutumnPromise<{
|
|
111
118
|
customer_id: string;
|
|
112
|
-
product_id: string;
|
|
113
119
|
success: boolean;
|
|
120
|
+
product_id: string;
|
|
114
121
|
}>;
|
|
115
122
|
check: (params: {
|
|
116
123
|
productId?: string | undefined;
|
|
117
124
|
entityId?: string | undefined;
|
|
118
125
|
featureId?: string | undefined;
|
|
126
|
+
dialog?: any;
|
|
127
|
+
entityData?: any;
|
|
119
128
|
requiredBalance?: number | undefined;
|
|
120
129
|
sendEvent?: boolean | undefined;
|
|
121
130
|
withPreview?: boolean | undefined;
|
|
122
|
-
dialog?: any;
|
|
123
|
-
entityData?: any;
|
|
124
131
|
}) => AutumnPromise<CheckResult>;
|
|
125
132
|
track: (params: {
|
|
126
133
|
value?: number | undefined;
|
|
@@ -131,8 +138,8 @@ declare class AutumnClient {
|
|
|
131
138
|
idempotencyKey?: string | undefined;
|
|
132
139
|
}) => AutumnPromise<{
|
|
133
140
|
code: string;
|
|
134
|
-
customer_id: string;
|
|
135
141
|
id: string;
|
|
142
|
+
customer_id: string;
|
|
136
143
|
feature_id?: string | undefined;
|
|
137
144
|
event_name?: string | undefined;
|
|
138
145
|
}>;
|