autumn-js 0.0.102 → 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-NW6B7QXB.mjs → chunk-2RZ2FZX2.mjs} +6 -6
- 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 +284 -268
- package/dist/libraries/backend/next.mjs +216 -193
- package/dist/libraries/backend/react-router.js +73 -80
- package/dist/libraries/backend/react-router.mjs +7 -7
- package/dist/libraries/backend/{referralTypes-D1Q2i3mG.d.ts → referralTypes-CnYanpMd.d.ts} +205 -104
- package/dist/libraries/backend/{referralTypes-Dfg6if8j.d.mts → referralTypes-jA7MQ1y5.d.mts} +205 -104
- 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 +5 -5
- 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 +9 -9
- package/dist/libraries/react/{ReactAutumnClient-YzfxjqPK.d.mts → ReactAutumnClient-BGI56QI_.d.mts} +21 -10
- package/dist/libraries/react/{ReactAutumnClient-DBbq29Nn.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 +10 -10
- 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-5NDO7C7R.mjs → chunk-3N6WLQH3.mjs} +1 -1
- package/dist/libraries/react/{chunk-H2NGSCWI.mjs → chunk-473LVTGN.mjs} +2 -2
- package/dist/libraries/react/{chunk-LXSKONN2.mjs → chunk-4A53GN44.mjs} +5 -5
- package/dist/libraries/react/{chunk-TPKQIL3N.mjs → chunk-4BQDSIWM.mjs} +5 -8
- package/dist/libraries/react/{chunk-X6RY6VG5.mjs → chunk-4VXBAIPC.mjs} +2 -2
- package/dist/libraries/react/{chunk-OAWFFAKA.mjs → chunk-6EZVNJHQ.mjs} +6 -6
- package/dist/libraries/react/{chunk-3VHO7VUQ.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-ALIGIMSK.mjs → chunk-E5EYSQYJ.mjs} +65 -87
- package/dist/libraries/react/{chunk-5URK7LI3.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-JI7WQ6AC.mjs → chunk-MNOH7Q3B.mjs} +2 -2
- package/dist/libraries/react/{chunk-SY5GNYZ7.mjs → chunk-P5MIFIIO.mjs} +2 -2
- package/dist/libraries/react/{chunk-T73WQC2X.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-GQ3TAHSV.mjs → chunk-ZFIJI37N.mjs} +1 -1
- package/dist/libraries/react/{chunk-CE33P32V.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 +4 -4
- 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 +28 -31
- 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 +27 -24
- 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-CFofdxsA.d.ts → cusTypes-DCeNEQLu.d.mts} +30 -12
- package/dist/libraries/react/{cusTypes-CFofdxsA.d.mts → cusTypes-DCeNEQLu.d.ts} +30 -12
- package/dist/libraries/react/{entTypes-BhUZh8uE.d.ts → entTypes-BJD_Hxbp.d.ts} +1 -1
- package/dist/libraries/react/{entTypes-BeWtfIqo.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 +8 -8
- 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 +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 +96 -111
- package/dist/libraries/react/hooks/useCustomer.mjs +9 -9
- 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 +8 -8
- 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 +9 -9
- 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 +8 -8
- 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 +7 -7
- 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 +6 -6
- package/dist/libraries/react/hooks/useProductsBase.js +63 -82
- package/dist/libraries/react/hooks/useProductsBase.mjs +5 -5
- 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-CxMWdpyl.d.ts → response-Dek2TEnE.d.ts} +2 -25
- package/dist/libraries/react/{response-AGK9KlYm.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 +25 -14
- package/dist/next/client/NextAutumnClient.d.ts +25 -14
- 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-D8f8BwMo.d.ts → clientAttachTypes-Dj6U8D7o.d.ts} +114 -96
- package/dist/next/client/{clientGenTypes-BcRfHmUS.d.mts → clientAttachTypes-fN66J754.d.mts} +114 -96
- package/dist/next/client/clientUtils.d.mts +2 -2
- package/dist/next/client/clientUtils.d.ts +2 -2
- package/dist/next/client/{cusTypes-Gh2wfcmj.d.mts → cusTypes-BoVZ2omf.d.mts} +30 -12
- package/dist/next/client/{cusTypes-Gh2wfcmj.d.ts → cusTypes-BoVZ2omf.d.ts} +30 -12
- package/dist/next/client/{entTypes-B_w6I3y-.d.ts → entTypes-BrHkjvC9.d.ts} +1 -1
- package/dist/next/client/{entTypes-C_xS1VPE.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 +12 -6
- package/dist/next/client/hooks/useEntity.d.ts +12 -6
- 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 +185 -106
- package/dist/next/server/cusActions.d.ts +185 -106
- package/dist/next/server/{cusTypes-DVA6iu7V.d.mts → cusTypes-Bh_pVAJp.d.mts} +34 -12
- package/dist/next/server/{cusTypes-DVA6iu7V.d.ts → cusTypes-Bh_pVAJp.d.ts} +34 -12
- package/dist/next/server/genActions.d.mts +3 -4
- package/dist/next/server/genActions.d.ts +3 -4
- package/dist/sdk/index.d.mts +223 -137
- package/dist/sdk/index.d.ts +223 -137
- 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 +10 -15
- package/dist/libraries/react/chunk-LKV32IPT.mjs +0 -548
|
@@ -1,66 +1,7 @@
|
|
|
1
|
-
import { C as CustomerData, a as CheckFeatureResult, b as CheckProductResult, G as GetCustomerParams,
|
|
1
|
+
import { C as CustomerData, a as CheckFeatureResult, b as CheckProductResult, P as ProductItem, c as Product, G as GetCustomerParams, d as Customer, e as CreateCustomerParams, U as UpdateCustomerParams, B as BillingPortalParams, f as BillingPortalResult, g as CreateProductParams, L as ListProductsParams, h as CustomerProduct, i as CustomerFeature, j as CustomerInvoice } from './cusTypes-Bh_pVAJp.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { R as Result, A as AutumnError } from './response-eH4S4sg0.js';
|
|
4
4
|
|
|
5
|
-
declare const AttachParamsSchema: z.ZodObject<{
|
|
6
|
-
customer_id: z.ZodString;
|
|
7
|
-
product_id: z.ZodOptional<z.ZodString>;
|
|
8
|
-
entity_id: z.ZodOptional<z.ZodString>;
|
|
9
|
-
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10
|
-
feature_id: z.ZodString;
|
|
11
|
-
quantity: z.ZodNumber;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
feature_id: string;
|
|
14
|
-
quantity: number;
|
|
15
|
-
}, {
|
|
16
|
-
feature_id: string;
|
|
17
|
-
quantity: number;
|
|
18
|
-
}>, "many">>;
|
|
19
|
-
product_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
20
|
-
free_trial: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
-
success_url: z.ZodOptional<z.ZodString>;
|
|
22
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
23
|
-
force_checkout: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
-
customer_data: z.ZodOptional<z.ZodAny>;
|
|
25
|
-
entity_data: z.ZodOptional<z.ZodAny>;
|
|
26
|
-
checkout_session_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
27
|
-
reward: z.ZodOptional<z.ZodString>;
|
|
28
|
-
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
customer_id: string;
|
|
30
|
-
entity_id?: string | undefined;
|
|
31
|
-
options?: {
|
|
32
|
-
feature_id: string;
|
|
33
|
-
quantity: number;
|
|
34
|
-
}[] | undefined;
|
|
35
|
-
metadata?: Record<string, string> | undefined;
|
|
36
|
-
product_id?: string | undefined;
|
|
37
|
-
product_ids?: string[] | undefined;
|
|
38
|
-
free_trial?: boolean | undefined;
|
|
39
|
-
success_url?: string | undefined;
|
|
40
|
-
force_checkout?: boolean | undefined;
|
|
41
|
-
customer_data?: any;
|
|
42
|
-
entity_data?: any;
|
|
43
|
-
checkout_session_params?: Record<string, any> | undefined;
|
|
44
|
-
reward?: string | undefined;
|
|
45
|
-
}, {
|
|
46
|
-
customer_id: string;
|
|
47
|
-
entity_id?: string | undefined;
|
|
48
|
-
options?: {
|
|
49
|
-
feature_id: string;
|
|
50
|
-
quantity: number;
|
|
51
|
-
}[] | undefined;
|
|
52
|
-
metadata?: Record<string, string> | undefined;
|
|
53
|
-
product_id?: string | undefined;
|
|
54
|
-
product_ids?: string[] | undefined;
|
|
55
|
-
free_trial?: boolean | undefined;
|
|
56
|
-
success_url?: string | undefined;
|
|
57
|
-
force_checkout?: boolean | undefined;
|
|
58
|
-
customer_data?: any;
|
|
59
|
-
entity_data?: any;
|
|
60
|
-
checkout_session_params?: Record<string, any> | undefined;
|
|
61
|
-
reward?: string | undefined;
|
|
62
|
-
}>;
|
|
63
|
-
type AttachParams = z.infer<typeof AttachParamsSchema>;
|
|
64
5
|
declare const CancelParamsSchema: z.ZodObject<{
|
|
65
6
|
customer_id: z.ZodString;
|
|
66
7
|
product_id: z.ZodString;
|
|
@@ -89,18 +30,18 @@ declare const TrackParamsSchema: z.ZodObject<{
|
|
|
89
30
|
entity_data: z.ZodOptional<z.ZodAny>;
|
|
90
31
|
}, "strip", z.ZodTypeAny, {
|
|
91
32
|
customer_id: string;
|
|
92
|
-
feature_id?: string | undefined;
|
|
93
|
-
entity_id?: string | undefined;
|
|
94
33
|
value?: number | undefined;
|
|
34
|
+
entity_id?: string | undefined;
|
|
35
|
+
feature_id?: string | undefined;
|
|
95
36
|
customer_data?: any;
|
|
96
37
|
entity_data?: any;
|
|
97
38
|
event_name?: string | undefined;
|
|
98
39
|
idempotency_key?: string | undefined;
|
|
99
40
|
}, {
|
|
100
41
|
customer_id: string;
|
|
101
|
-
feature_id?: string | undefined;
|
|
102
|
-
entity_id?: string | undefined;
|
|
103
42
|
value?: number | undefined;
|
|
43
|
+
entity_id?: string | undefined;
|
|
44
|
+
feature_id?: string | undefined;
|
|
104
45
|
customer_data?: any;
|
|
105
46
|
entity_data?: any;
|
|
106
47
|
event_name?: string | undefined;
|
|
@@ -128,8 +69,8 @@ declare const CheckParamsSchema: z.ZodObject<{
|
|
|
128
69
|
}>>;
|
|
129
70
|
}, "strip", z.ZodTypeAny, {
|
|
130
71
|
customer_id: string;
|
|
131
|
-
feature_id?: string | undefined;
|
|
132
72
|
entity_id?: string | undefined;
|
|
73
|
+
feature_id?: string | undefined;
|
|
133
74
|
required_balance?: number | undefined;
|
|
134
75
|
product_id?: string | undefined;
|
|
135
76
|
customer_data?: any;
|
|
@@ -141,8 +82,8 @@ declare const CheckParamsSchema: z.ZodObject<{
|
|
|
141
82
|
with_preview?: boolean | undefined;
|
|
142
83
|
}, {
|
|
143
84
|
customer_id: string;
|
|
144
|
-
feature_id?: string | undefined;
|
|
145
85
|
entity_id?: string | undefined;
|
|
86
|
+
feature_id?: string | undefined;
|
|
146
87
|
required_balance?: number | undefined;
|
|
147
88
|
product_id?: string | undefined;
|
|
148
89
|
customer_data?: any;
|
|
@@ -176,6 +117,174 @@ interface SetupPaymentResult {
|
|
|
176
117
|
url: string;
|
|
177
118
|
}
|
|
178
119
|
|
|
120
|
+
declare const AttachFeatureOptionsSchema: z.ZodObject<{
|
|
121
|
+
feature_id: z.ZodString;
|
|
122
|
+
quantity: z.ZodNumber;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
feature_id: string;
|
|
125
|
+
quantity: number;
|
|
126
|
+
}, {
|
|
127
|
+
feature_id: string;
|
|
128
|
+
quantity: number;
|
|
129
|
+
}>;
|
|
130
|
+
type AttachFeatureOptions = z.infer<typeof AttachFeatureOptionsSchema>;
|
|
131
|
+
declare const AttachParamsSchema: z.ZodObject<{
|
|
132
|
+
customer_id: z.ZodString;
|
|
133
|
+
product_id: z.ZodOptional<z.ZodString>;
|
|
134
|
+
entity_id: z.ZodOptional<z.ZodString>;
|
|
135
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
136
|
+
feature_id: z.ZodString;
|
|
137
|
+
quantity: z.ZodNumber;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
feature_id: string;
|
|
140
|
+
quantity: number;
|
|
141
|
+
}, {
|
|
142
|
+
feature_id: string;
|
|
143
|
+
quantity: number;
|
|
144
|
+
}>, "many">>;
|
|
145
|
+
product_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
146
|
+
free_trial: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
success_url: z.ZodOptional<z.ZodString>;
|
|
148
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
149
|
+
force_checkout: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
+
customer_data: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
152
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
153
|
+
fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
name?: string | null | undefined;
|
|
156
|
+
email?: string | null | undefined;
|
|
157
|
+
fingerprint?: string | null | undefined;
|
|
158
|
+
}, {
|
|
159
|
+
name?: string | null | undefined;
|
|
160
|
+
email?: string | null | undefined;
|
|
161
|
+
fingerprint?: string | null | undefined;
|
|
162
|
+
}>>;
|
|
163
|
+
entity_data: z.ZodOptional<z.ZodAny>;
|
|
164
|
+
checkout_session_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
165
|
+
reward: z.ZodOptional<z.ZodString>;
|
|
166
|
+
}, "strip", z.ZodTypeAny, {
|
|
167
|
+
customer_id: string;
|
|
168
|
+
options?: {
|
|
169
|
+
feature_id: string;
|
|
170
|
+
quantity: number;
|
|
171
|
+
}[] | undefined;
|
|
172
|
+
metadata?: Record<string, string> | undefined;
|
|
173
|
+
entity_id?: string | undefined;
|
|
174
|
+
product_id?: string | undefined;
|
|
175
|
+
product_ids?: string[] | undefined;
|
|
176
|
+
free_trial?: boolean | undefined;
|
|
177
|
+
success_url?: string | undefined;
|
|
178
|
+
force_checkout?: boolean | undefined;
|
|
179
|
+
customer_data?: {
|
|
180
|
+
name?: string | null | undefined;
|
|
181
|
+
email?: string | null | undefined;
|
|
182
|
+
fingerprint?: string | null | undefined;
|
|
183
|
+
} | undefined;
|
|
184
|
+
entity_data?: any;
|
|
185
|
+
checkout_session_params?: Record<string, any> | undefined;
|
|
186
|
+
reward?: string | undefined;
|
|
187
|
+
}, {
|
|
188
|
+
customer_id: string;
|
|
189
|
+
options?: {
|
|
190
|
+
feature_id: string;
|
|
191
|
+
quantity: number;
|
|
192
|
+
}[] | undefined;
|
|
193
|
+
metadata?: Record<string, string> | undefined;
|
|
194
|
+
entity_id?: string | undefined;
|
|
195
|
+
product_id?: string | undefined;
|
|
196
|
+
product_ids?: string[] | undefined;
|
|
197
|
+
free_trial?: boolean | undefined;
|
|
198
|
+
success_url?: string | undefined;
|
|
199
|
+
force_checkout?: boolean | undefined;
|
|
200
|
+
customer_data?: {
|
|
201
|
+
name?: string | null | undefined;
|
|
202
|
+
email?: string | null | undefined;
|
|
203
|
+
fingerprint?: string | null | undefined;
|
|
204
|
+
} | undefined;
|
|
205
|
+
entity_data?: any;
|
|
206
|
+
checkout_session_params?: Record<string, any> | undefined;
|
|
207
|
+
reward?: string | undefined;
|
|
208
|
+
}>;
|
|
209
|
+
type AttachParams = z.infer<typeof AttachParamsSchema>;
|
|
210
|
+
declare const CheckoutParamsSchema: z.ZodObject<{
|
|
211
|
+
customer_id: z.ZodString;
|
|
212
|
+
product_id: z.ZodString;
|
|
213
|
+
entity_id: z.ZodOptional<z.ZodString>;
|
|
214
|
+
success_url: z.ZodOptional<z.ZodString>;
|
|
215
|
+
customer_data: z.ZodOptional<z.ZodObject<{
|
|
216
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
217
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
218
|
+
fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
219
|
+
}, "strip", z.ZodTypeAny, {
|
|
220
|
+
name?: string | null | undefined;
|
|
221
|
+
email?: string | null | undefined;
|
|
222
|
+
fingerprint?: string | null | undefined;
|
|
223
|
+
}, {
|
|
224
|
+
name?: string | null | undefined;
|
|
225
|
+
email?: string | null | undefined;
|
|
226
|
+
fingerprint?: string | null | undefined;
|
|
227
|
+
}>>;
|
|
228
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
229
|
+
feature_id: z.ZodString;
|
|
230
|
+
quantity: z.ZodNumber;
|
|
231
|
+
}, "strip", z.ZodTypeAny, {
|
|
232
|
+
feature_id: string;
|
|
233
|
+
quantity: number;
|
|
234
|
+
}, {
|
|
235
|
+
feature_id: string;
|
|
236
|
+
quantity: number;
|
|
237
|
+
}>, "many">>;
|
|
238
|
+
}, "strip", z.ZodTypeAny, {
|
|
239
|
+
customer_id: string;
|
|
240
|
+
product_id: string;
|
|
241
|
+
options?: {
|
|
242
|
+
feature_id: string;
|
|
243
|
+
quantity: number;
|
|
244
|
+
}[] | undefined;
|
|
245
|
+
entity_id?: string | undefined;
|
|
246
|
+
success_url?: string | undefined;
|
|
247
|
+
customer_data?: {
|
|
248
|
+
name?: string | null | undefined;
|
|
249
|
+
email?: string | null | undefined;
|
|
250
|
+
fingerprint?: string | null | undefined;
|
|
251
|
+
} | undefined;
|
|
252
|
+
}, {
|
|
253
|
+
customer_id: string;
|
|
254
|
+
product_id: string;
|
|
255
|
+
options?: {
|
|
256
|
+
feature_id: string;
|
|
257
|
+
quantity: number;
|
|
258
|
+
}[] | undefined;
|
|
259
|
+
entity_id?: string | undefined;
|
|
260
|
+
success_url?: string | undefined;
|
|
261
|
+
customer_data?: {
|
|
262
|
+
name?: string | null | undefined;
|
|
263
|
+
email?: string | null | undefined;
|
|
264
|
+
fingerprint?: string | null | undefined;
|
|
265
|
+
} | undefined;
|
|
266
|
+
}>;
|
|
267
|
+
type CheckoutParams = z.infer<typeof CheckoutParamsSchema>;
|
|
268
|
+
type CheckoutResult = {
|
|
269
|
+
url?: string;
|
|
270
|
+
customer_id: string;
|
|
271
|
+
has_prorations: boolean;
|
|
272
|
+
lines: {
|
|
273
|
+
description: string;
|
|
274
|
+
amount: number;
|
|
275
|
+
item: ProductItem;
|
|
276
|
+
}[];
|
|
277
|
+
total: number;
|
|
278
|
+
currency: string;
|
|
279
|
+
options: AttachFeatureOptions[];
|
|
280
|
+
product: Product;
|
|
281
|
+
current_product: Product;
|
|
282
|
+
next_cycle?: {
|
|
283
|
+
starts_at: number;
|
|
284
|
+
total: number;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
|
|
179
288
|
declare class Autumn {
|
|
180
289
|
private readonly secretKey;
|
|
181
290
|
private readonly publishableKey;
|
|
@@ -198,7 +307,7 @@ declare class Autumn {
|
|
|
198
307
|
create: (params?: CreateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
199
308
|
update: (id: string, params: UpdateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
200
309
|
delete: (id: string) => Promise<Result<Customer, AutumnError>>;
|
|
201
|
-
billingPortal: (id: string, params?: BillingPortalParams) => Promise<Result<
|
|
310
|
+
billingPortal: (id: string, params?: BillingPortalParams) => Promise<Result<BillingPortalResult, AutumnError>>;
|
|
202
311
|
};
|
|
203
312
|
static products: {
|
|
204
313
|
get: (id: string) => Promise<Result<Product, AutumnError>>;
|
|
@@ -221,7 +330,7 @@ declare class Autumn {
|
|
|
221
330
|
create: (params?: CreateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
222
331
|
update: (id: string, params: UpdateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
223
332
|
delete: (id: string) => Promise<Result<Customer, AutumnError>>;
|
|
224
|
-
billingPortal: (id: string, params?: BillingPortalParams) => Promise<Result<
|
|
333
|
+
billingPortal: (id: string, params?: BillingPortalParams) => Promise<Result<BillingPortalResult, AutumnError>>;
|
|
225
334
|
};
|
|
226
335
|
products: {
|
|
227
336
|
get: (id: string) => Promise<Result<Product, AutumnError>>;
|
|
@@ -239,19 +348,21 @@ declare class Autumn {
|
|
|
239
348
|
createCode: (params: CreateReferralCodeParams) => Promise<Result<any, AutumnError>>;
|
|
240
349
|
redeemCode: (params: RedeemReferralCodeParams) => Promise<Result<any, AutumnError>>;
|
|
241
350
|
};
|
|
351
|
+
static checkout: (params: CheckoutParams) => Promise<Result<CheckoutResult, AutumnError>>;
|
|
352
|
+
checkout(params: CheckoutParams): Promise<Result<CheckoutResult, AutumnError>>;
|
|
242
353
|
static attach: (params: AttachParams) => Promise<Result<{
|
|
243
|
-
customer_id: string;
|
|
244
354
|
code: string;
|
|
245
355
|
message: string;
|
|
356
|
+
customer_id: string;
|
|
246
357
|
product_ids: string[];
|
|
247
358
|
customer_data?: any;
|
|
248
359
|
checkout_url?: string | undefined;
|
|
249
360
|
}, AutumnError>>;
|
|
250
361
|
static usage: (params: UsageParams) => Promise<Result<UsageResult, AutumnError>>;
|
|
251
362
|
attach(params: AttachParams): Promise<Result<{
|
|
252
|
-
customer_id: string;
|
|
253
363
|
code: string;
|
|
254
364
|
message: string;
|
|
365
|
+
customer_id: string;
|
|
255
366
|
product_ids: string[];
|
|
256
367
|
customer_data?: any;
|
|
257
368
|
checkout_url?: string | undefined;
|
|
@@ -268,51 +379,19 @@ declare class Autumn {
|
|
|
268
379
|
product_id: string;
|
|
269
380
|
success: boolean;
|
|
270
381
|
}, AutumnError>>;
|
|
271
|
-
/**
|
|
272
|
-
* @deprecated This method is deprecated and will be removed in a future version.
|
|
273
|
-
* Please use the new check() method instead.
|
|
274
|
-
*/
|
|
275
|
-
static entitled: (params: CheckParams) => Promise<Result<CheckResult, AutumnError>>;
|
|
276
|
-
/**
|
|
277
|
-
* @deprecated This method is deprecated and will be removed in a future version.
|
|
278
|
-
* Please use the new check() method instead.
|
|
279
|
-
*/
|
|
280
|
-
entitled(params: CheckParams): Promise<Result<CheckResult, AutumnError>>;
|
|
281
382
|
static check: (params: CheckParams) => Promise<Result<CheckResult, AutumnError>>;
|
|
282
383
|
check(params: CheckParams): Promise<Result<CheckResult, AutumnError>>;
|
|
283
|
-
/**
|
|
284
|
-
* @deprecated This method is deprecated and will be removed in a future version.
|
|
285
|
-
* Please use the new track() method instead.
|
|
286
|
-
*/
|
|
287
|
-
static event: (params: TrackParams) => Promise<Result<{
|
|
288
|
-
customer_id: string;
|
|
289
|
-
code: string;
|
|
290
|
-
id: string;
|
|
291
|
-
feature_id?: string | undefined;
|
|
292
|
-
event_name?: string | undefined;
|
|
293
|
-
}, AutumnError>>;
|
|
294
|
-
/**
|
|
295
|
-
* @deprecated This method is deprecated and will be removed in a future version.
|
|
296
|
-
* Please use the new track() method instead.
|
|
297
|
-
*/
|
|
298
|
-
event(params: TrackParams): Promise<Result<{
|
|
299
|
-
customer_id: string;
|
|
300
|
-
code: string;
|
|
301
|
-
id: string;
|
|
302
|
-
feature_id?: string | undefined;
|
|
303
|
-
event_name?: string | undefined;
|
|
304
|
-
}, AutumnError>>;
|
|
305
384
|
static track: (params: TrackParams) => Promise<Result<{
|
|
306
|
-
customer_id: string;
|
|
307
385
|
code: string;
|
|
308
386
|
id: string;
|
|
387
|
+
customer_id: string;
|
|
309
388
|
feature_id?: string | undefined;
|
|
310
389
|
event_name?: string | undefined;
|
|
311
390
|
}, AutumnError>>;
|
|
312
391
|
track(params: TrackParams): Promise<Result<{
|
|
313
|
-
customer_id: string;
|
|
314
392
|
code: string;
|
|
315
393
|
id: string;
|
|
394
|
+
customer_id: string;
|
|
316
395
|
feature_id?: string | undefined;
|
|
317
396
|
event_name?: string | undefined;
|
|
318
397
|
}, AutumnError>>;
|
|
@@ -362,11 +441,11 @@ declare const RedeemReferralCodeParamsSchema: z.ZodObject<{
|
|
|
362
441
|
code: z.ZodString;
|
|
363
442
|
customer_id: z.ZodString;
|
|
364
443
|
}, "strip", z.ZodTypeAny, {
|
|
365
|
-
customer_id: string;
|
|
366
444
|
code: string;
|
|
367
|
-
}, {
|
|
368
445
|
customer_id: string;
|
|
446
|
+
}, {
|
|
369
447
|
code: string;
|
|
448
|
+
customer_id: string;
|
|
370
449
|
}>;
|
|
371
450
|
type RedeemReferralCodeParams = z.infer<typeof RedeemReferralCodeParamsSchema>;
|
|
372
451
|
|
|
@@ -88,10 +88,17 @@ declare enum AppEnv {
|
|
|
88
88
|
Live = "live"
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
interface Feature {
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
type: "boolean" | "continuous_use" | "single_use" | "credit_system";
|
|
95
|
+
}
|
|
91
96
|
interface ProductItem {
|
|
97
|
+
type?: "feature" | "priced_feature" | "price";
|
|
92
98
|
feature_id?: string;
|
|
93
99
|
included_usage?: number | typeof Infinite;
|
|
94
100
|
interval?: ProductItemIntervalType;
|
|
101
|
+
feature?: Feature;
|
|
95
102
|
usage_model?: UsageModel;
|
|
96
103
|
price?: number;
|
|
97
104
|
billing_units?: number;
|
|
@@ -123,10 +130,12 @@ interface Product {
|
|
|
123
130
|
free_trial: FreeTrial | null;
|
|
124
131
|
scenario?: ProductScenario;
|
|
125
132
|
base_variant_id: string | null;
|
|
126
|
-
properties
|
|
127
|
-
is_free
|
|
128
|
-
is_one_off
|
|
129
|
-
interval_group
|
|
133
|
+
properties: {
|
|
134
|
+
is_free: boolean;
|
|
135
|
+
is_one_off: boolean;
|
|
136
|
+
interval_group: string;
|
|
137
|
+
has_trial: boolean;
|
|
138
|
+
has_prepaid: boolean;
|
|
130
139
|
};
|
|
131
140
|
display?: {
|
|
132
141
|
name?: string;
|
|
@@ -214,11 +223,20 @@ interface Customer {
|
|
|
214
223
|
features: Record<string, CustomerFeature>;
|
|
215
224
|
invoices?: CustomerInvoice[];
|
|
216
225
|
}
|
|
217
|
-
|
|
218
|
-
name
|
|
219
|
-
email
|
|
220
|
-
fingerprint
|
|
221
|
-
}
|
|
226
|
+
declare const CustomerDataSchema: z.ZodObject<{
|
|
227
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
229
|
+
fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
230
|
+
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
name?: string | null | undefined;
|
|
232
|
+
email?: string | null | undefined;
|
|
233
|
+
fingerprint?: string | null | undefined;
|
|
234
|
+
}, {
|
|
235
|
+
name?: string | null | undefined;
|
|
236
|
+
email?: string | null | undefined;
|
|
237
|
+
fingerprint?: string | null | undefined;
|
|
238
|
+
}>;
|
|
239
|
+
type CustomerData = z.infer<typeof CustomerDataSchema>;
|
|
222
240
|
interface GetCustomerParams {
|
|
223
241
|
expand?: CustomerExpandOption[];
|
|
224
242
|
}
|
|
@@ -230,17 +248,17 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
|
|
|
230
248
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
231
249
|
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
|
|
232
250
|
}, "strip", z.ZodTypeAny, {
|
|
233
|
-
id?: string | null | undefined;
|
|
234
251
|
name?: string | null | undefined;
|
|
235
252
|
email?: string | null | undefined;
|
|
236
253
|
fingerprint?: string | null | undefined;
|
|
254
|
+
id?: string | null | undefined;
|
|
237
255
|
metadata?: Record<string, any> | undefined;
|
|
238
256
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
239
257
|
}, {
|
|
240
|
-
id?: string | null | undefined;
|
|
241
258
|
name?: string | null | undefined;
|
|
242
259
|
email?: string | null | undefined;
|
|
243
260
|
fingerprint?: string | null | undefined;
|
|
261
|
+
id?: string | null | undefined;
|
|
244
262
|
metadata?: Record<string, any> | undefined;
|
|
245
263
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
246
264
|
}>;
|
|
@@ -259,6 +277,10 @@ declare const BillingPortalParamsSchema: z.ZodObject<{
|
|
|
259
277
|
return_url?: string | undefined;
|
|
260
278
|
}>;
|
|
261
279
|
type BillingPortalParams = z.infer<typeof BillingPortalParamsSchema>;
|
|
280
|
+
interface BillingPortalResult {
|
|
281
|
+
customer_id: string;
|
|
282
|
+
url: string;
|
|
283
|
+
}
|
|
262
284
|
interface CustomerInvoice {
|
|
263
285
|
product_ids: string[];
|
|
264
286
|
stripe_id: string;
|
|
@@ -269,4 +291,4 @@ interface CustomerInvoice {
|
|
|
269
291
|
hosted_invoice_url: string;
|
|
270
292
|
}
|
|
271
293
|
|
|
272
|
-
export type { BillingPortalParams as B, CustomerData as C, GetCustomerParams as G, ListProductsParams as L,
|
|
294
|
+
export type { BillingPortalParams as B, CustomerData as C, GetCustomerParams as G, ListProductsParams as L, ProductItem as P, UpdateCustomerParams as U, CheckFeatureResult as a, CheckProductResult as b, Product as c, Customer as d, CreateCustomerParams as e, BillingPortalResult as f, CreateProductParams as g, CustomerProduct as h, CustomerFeature as i, CustomerInvoice as j };
|
|
@@ -88,10 +88,17 @@ declare enum AppEnv {
|
|
|
88
88
|
Live = "live"
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
interface Feature {
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
type: "boolean" | "continuous_use" | "single_use" | "credit_system";
|
|
95
|
+
}
|
|
91
96
|
interface ProductItem {
|
|
97
|
+
type?: "feature" | "priced_feature" | "price";
|
|
92
98
|
feature_id?: string;
|
|
93
99
|
included_usage?: number | typeof Infinite;
|
|
94
100
|
interval?: ProductItemIntervalType;
|
|
101
|
+
feature?: Feature;
|
|
95
102
|
usage_model?: UsageModel;
|
|
96
103
|
price?: number;
|
|
97
104
|
billing_units?: number;
|
|
@@ -123,10 +130,12 @@ interface Product {
|
|
|
123
130
|
free_trial: FreeTrial | null;
|
|
124
131
|
scenario?: ProductScenario;
|
|
125
132
|
base_variant_id: string | null;
|
|
126
|
-
properties
|
|
127
|
-
is_free
|
|
128
|
-
is_one_off
|
|
129
|
-
interval_group
|
|
133
|
+
properties: {
|
|
134
|
+
is_free: boolean;
|
|
135
|
+
is_one_off: boolean;
|
|
136
|
+
interval_group: string;
|
|
137
|
+
has_trial: boolean;
|
|
138
|
+
has_prepaid: boolean;
|
|
130
139
|
};
|
|
131
140
|
display?: {
|
|
132
141
|
name?: string;
|
|
@@ -214,11 +223,20 @@ interface Customer {
|
|
|
214
223
|
features: Record<string, CustomerFeature>;
|
|
215
224
|
invoices?: CustomerInvoice[];
|
|
216
225
|
}
|
|
217
|
-
|
|
218
|
-
name
|
|
219
|
-
email
|
|
220
|
-
fingerprint
|
|
221
|
-
}
|
|
226
|
+
declare const CustomerDataSchema: z.ZodObject<{
|
|
227
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
229
|
+
fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
230
|
+
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
name?: string | null | undefined;
|
|
232
|
+
email?: string | null | undefined;
|
|
233
|
+
fingerprint?: string | null | undefined;
|
|
234
|
+
}, {
|
|
235
|
+
name?: string | null | undefined;
|
|
236
|
+
email?: string | null | undefined;
|
|
237
|
+
fingerprint?: string | null | undefined;
|
|
238
|
+
}>;
|
|
239
|
+
type CustomerData = z.infer<typeof CustomerDataSchema>;
|
|
222
240
|
interface GetCustomerParams {
|
|
223
241
|
expand?: CustomerExpandOption[];
|
|
224
242
|
}
|
|
@@ -230,17 +248,17 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
|
|
|
230
248
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
231
249
|
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
|
|
232
250
|
}, "strip", z.ZodTypeAny, {
|
|
233
|
-
id?: string | null | undefined;
|
|
234
251
|
name?: string | null | undefined;
|
|
235
252
|
email?: string | null | undefined;
|
|
236
253
|
fingerprint?: string | null | undefined;
|
|
254
|
+
id?: string | null | undefined;
|
|
237
255
|
metadata?: Record<string, any> | undefined;
|
|
238
256
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
239
257
|
}, {
|
|
240
|
-
id?: string | null | undefined;
|
|
241
258
|
name?: string | null | undefined;
|
|
242
259
|
email?: string | null | undefined;
|
|
243
260
|
fingerprint?: string | null | undefined;
|
|
261
|
+
id?: string | null | undefined;
|
|
244
262
|
metadata?: Record<string, any> | undefined;
|
|
245
263
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
246
264
|
}>;
|
|
@@ -259,6 +277,10 @@ declare const BillingPortalParamsSchema: z.ZodObject<{
|
|
|
259
277
|
return_url?: string | undefined;
|
|
260
278
|
}>;
|
|
261
279
|
type BillingPortalParams = z.infer<typeof BillingPortalParamsSchema>;
|
|
280
|
+
interface BillingPortalResult {
|
|
281
|
+
customer_id: string;
|
|
282
|
+
url: string;
|
|
283
|
+
}
|
|
262
284
|
interface CustomerInvoice {
|
|
263
285
|
product_ids: string[];
|
|
264
286
|
stripe_id: string;
|
|
@@ -269,4 +291,4 @@ interface CustomerInvoice {
|
|
|
269
291
|
hosted_invoice_url: string;
|
|
270
292
|
}
|
|
271
293
|
|
|
272
|
-
export type { BillingPortalParams as B, CustomerData as C, GetCustomerParams as G, ListProductsParams as L,
|
|
294
|
+
export type { BillingPortalParams as B, CustomerData as C, GetCustomerParams as G, ListProductsParams as L, ProductItem as P, UpdateCustomerParams as U, CheckFeatureResult as a, CheckProductResult as b, Product as c, Customer as d, CreateCustomerParams as e, BillingPortalResult as f, CreateProductParams as g, CustomerProduct as h, CustomerFeature as i, CustomerInvoice as j };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { C as CustomerData, B as BillingPortalParams } from './cusTypes-DVA6iu7V.mjs';
|
|
1
|
+
import { C as CustomerData, B as BillingPortalParams } from './cusTypes-Bh_pVAJp.mjs';
|
|
3
2
|
import 'zod';
|
|
4
3
|
|
|
5
4
|
declare const attachAction: (args: Omit<{
|
|
@@ -15,7 +14,7 @@ declare const attachAction: (args: Omit<{
|
|
|
15
14
|
freeTrial?: boolean | undefined;
|
|
16
15
|
successUrl?: string | undefined;
|
|
17
16
|
forceCheckout?: boolean | undefined;
|
|
18
|
-
dialog?:
|
|
17
|
+
dialog?: any;
|
|
19
18
|
entityData?: any;
|
|
20
19
|
openInNewTab?: boolean | undefined;
|
|
21
20
|
checkoutSessionParams?: Record<string, any> | undefined;
|
|
@@ -38,7 +37,7 @@ declare const checkAction: (args: Omit<{
|
|
|
38
37
|
productId?: string | undefined;
|
|
39
38
|
entityId?: string | undefined;
|
|
40
39
|
featureId?: string | undefined;
|
|
41
|
-
dialog?:
|
|
40
|
+
dialog?: any;
|
|
42
41
|
entityData?: any;
|
|
43
42
|
requiredBalance?: number | undefined;
|
|
44
43
|
sendEvent?: boolean | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { C as CustomerData, B as BillingPortalParams } from './cusTypes-DVA6iu7V.js';
|
|
1
|
+
import { C as CustomerData, B as BillingPortalParams } from './cusTypes-Bh_pVAJp.js';
|
|
3
2
|
import 'zod';
|
|
4
3
|
|
|
5
4
|
declare const attachAction: (args: Omit<{
|
|
@@ -15,7 +14,7 @@ declare const attachAction: (args: Omit<{
|
|
|
15
14
|
freeTrial?: boolean | undefined;
|
|
16
15
|
successUrl?: string | undefined;
|
|
17
16
|
forceCheckout?: boolean | undefined;
|
|
18
|
-
dialog?:
|
|
17
|
+
dialog?: any;
|
|
19
18
|
entityData?: any;
|
|
20
19
|
openInNewTab?: boolean | undefined;
|
|
21
20
|
checkoutSessionParams?: Record<string, any> | undefined;
|
|
@@ -38,7 +37,7 @@ declare const checkAction: (args: Omit<{
|
|
|
38
37
|
productId?: string | undefined;
|
|
39
38
|
entityId?: string | undefined;
|
|
40
39
|
featureId?: string | undefined;
|
|
41
|
-
dialog?:
|
|
40
|
+
dialog?: any;
|
|
42
41
|
entityData?: any;
|
|
43
42
|
requiredBalance?: number | undefined;
|
|
44
43
|
sendEvent?: boolean | undefined;
|