autumn-js 0.0.108 → 0.0.109
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 +18 -18
- package/dist/libraries/backend/better-auth.d.ts +18 -18
- package/dist/libraries/backend/better-auth.js +206 -103
- package/dist/libraries/backend/better-auth.mjs +7 -7
- package/dist/libraries/backend/{chunk-IOSEAUDJ.mjs → chunk-26E2Z26Q.mjs} +170 -102
- package/dist/libraries/backend/{chunk-5EKNB4IJ.mjs → chunk-BV3SY6BB.mjs} +1 -1
- package/dist/libraries/backend/{chunk-HHMIVOXX.mjs → chunk-CLW3UTC5.mjs} +36 -1
- package/dist/libraries/backend/{chunk-2RZ2FZX2.mjs → chunk-DMHG3POG.mjs} +6 -6
- package/dist/libraries/backend/{chunk-5H6HVCOP.mjs → chunk-TWERY4S2.mjs} +1 -1
- package/dist/libraries/backend/{chunk-3OLXYDCU.mjs → chunk-XEHT6LRT.mjs} +1 -1
- package/dist/libraries/backend/{chunk-K7JGEYUX.mjs → chunk-YTCNYNTM.mjs} +1 -1
- package/dist/libraries/backend/convex.js +203 -100
- package/dist/libraries/backend/convex.mjs +7 -7
- package/dist/libraries/backend/elysia.js +209 -106
- 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 +203 -100
- package/dist/libraries/backend/express.mjs +7 -7
- package/dist/libraries/backend/fastify.js +203 -100
- package/dist/libraries/backend/fastify.mjs +7 -7
- package/dist/libraries/backend/hono.js +203 -100
- package/dist/libraries/backend/hono.mjs +7 -7
- package/dist/libraries/backend/next.js +205 -102
- package/dist/libraries/backend/next.mjs +7 -7
- package/dist/libraries/backend/react-router.js +203 -100
- package/dist/libraries/backend/react-router.mjs +7 -7
- package/dist/libraries/backend/{referralTypes-CL2y5hbv.d.mts → referralTypes-CpEs5id9.d.mts} +219 -60
- package/dist/libraries/backend/{referralTypes-BpOamxCs.d.ts → referralTypes-PV0SFnx_.d.ts} +219 -60
- package/dist/libraries/backend/remix_dep.js +203 -100
- package/dist/libraries/backend/remix_dep.mjs +7 -7
- package/dist/libraries/backend/routes/backendRouter.js +203 -100
- package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
- package/dist/libraries/backend/routes/entityRoutes.js +167 -99
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +202 -99
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.js +167 -99
- package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +167 -99
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +203 -100
- package/dist/libraries/backend/supabase.mjs +7 -7
- package/dist/libraries/backend/tanstack.js +203 -100
- package/dist/libraries/backend/tanstack.mjs +7 -7
- package/dist/libraries/backend/utils/backendRes.js +167 -99
- 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 +167 -99
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +7 -5
- package/dist/libraries/react/AutumnContext.d.ts +7 -5
- package/dist/libraries/react/AutumnContext.js +175 -100
- package/dist/libraries/react/AutumnContext.mjs +4 -3
- package/dist/libraries/react/BaseAutumnProvider.d.mts +6 -5
- package/dist/libraries/react/BaseAutumnProvider.d.ts +6 -5
- package/dist/libraries/react/BaseAutumnProvider.js +327 -203
- package/dist/libraries/react/BaseAutumnProvider.mjs +10 -9
- package/dist/libraries/react/{ReactAutumnClient-BjRiaYDN.d.mts → ReactAutumnClient-C4CPCKrp.d.mts} +12 -7
- package/dist/libraries/react/{ReactAutumnClient-O2XzkzGM.d.ts → ReactAutumnClient-Cf3-brZx.d.ts} +12 -7
- package/dist/libraries/react/ReactAutumnProvider.d.mts +2 -1
- package/dist/libraries/react/ReactAutumnProvider.d.ts +2 -1
- package/dist/libraries/react/ReactAutumnProvider.js +327 -203
- package/dist/libraries/react/ReactAutumnProvider.mjs +11 -10
- package/dist/{next/client/attachTypes-DZlF8AAj.d.mts → libraries/react/attachTypes-BKzcsvuA.d.ts} +7 -7
- package/dist/libraries/react/{attachTypes-1Dbkyo_d.d.ts → attachTypes-C1BZ4HNs.d.mts} +3 -3
- package/dist/libraries/react/chunk-2H7G6M6Z.mjs +44 -0
- package/dist/libraries/react/chunk-3LLAOCW3.mjs +136 -0
- package/dist/libraries/react/{chunk-253MTZP3.mjs → chunk-BCLKTVUX.mjs} +7 -1
- package/dist/libraries/react/{chunk-6RNG47NV.mjs → chunk-BF36ZT6M.mjs} +12 -11
- package/dist/libraries/react/{chunk-KJLHVBV4.mjs → chunk-CQD37NSX.mjs} +16 -58
- package/dist/libraries/react/{chunk-2PVRCDDK.mjs → chunk-D3GL2QV3.mjs} +240 -381
- package/dist/libraries/react/{chunk-4CHWEUKX.mjs → chunk-FE5GYL7P.mjs} +2 -2
- package/dist/libraries/react/{chunk-MY2ODATB.mjs → chunk-HBCCTYA6.mjs} +6 -0
- package/dist/libraries/react/{chunk-XXGKLOAK.mjs → chunk-K7IJMDIV.mjs} +17 -3
- package/dist/libraries/react/{chunk-OEIUKLFH.mjs → chunk-MIITU3Q2.mjs} +37 -22
- package/dist/libraries/react/chunk-MS4UEBVX.mjs +223 -0
- package/dist/libraries/react/{chunk-OTYSAMRH.mjs → chunk-OXPO56ZD.mjs} +9 -4
- package/dist/libraries/react/chunk-PDCSW5VX.mjs +46 -0
- package/dist/libraries/react/{chunk-4QPHNIQ7.mjs → chunk-RFSQBGLO.mjs} +1 -1
- package/dist/libraries/react/{chunk-DRAIZ3UZ.mjs → chunk-T4Z5BKOW.mjs} +3 -3
- package/dist/libraries/react/{chunk-OM3ROIZO.mjs → chunk-TL2F3PPG.mjs} +2 -10
- package/dist/libraries/react/{chunk-LXD6AEZW.mjs → chunk-V2XCEJ4T.mjs} +3 -2
- package/dist/libraries/react/{chunk-3XJ7NFT2.mjs → chunk-VAWI6RK6.mjs} +51 -17
- package/dist/libraries/react/{chunk-7DINVACK.mjs → chunk-WSB47D4U.mjs} +2 -2
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -5
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -5
- package/dist/libraries/react/client/ReactAutumnClient.js +173 -99
- package/dist/libraries/react/client/ReactAutumnClient.mjs +3 -2
- package/dist/libraries/react/client/clientCompMethods.d.mts +6 -5
- package/dist/libraries/react/client/clientCompMethods.d.ts +6 -5
- package/dist/libraries/react/client/clientCusMethods.d.mts +6 -5
- package/dist/libraries/react/client/clientCusMethods.d.ts +6 -5
- package/dist/libraries/react/client/clientEntityMethods.d.mts +7 -6
- package/dist/libraries/react/client/clientEntityMethods.d.ts +7 -6
- 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 +7 -0
- package/dist/libraries/react/client/clientGenMethods.mjs +3 -1
- package/dist/libraries/react/client/clientProdMethods.d.mts +6 -5
- package/dist/libraries/react/client/clientProdMethods.d.ts +6 -5
- package/dist/libraries/react/client/clientReferralMethods.d.mts +7 -6
- package/dist/libraries/react/client/clientReferralMethods.d.ts +7 -6
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +12 -1
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +12 -1
- package/dist/libraries/react/client/types/clientGenTypes.js +687 -25
- package/dist/libraries/react/client/types/clientGenTypes.mjs +8 -0
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +2 -2
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +2 -2
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +354 -238
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +24 -23
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +2 -2
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +2 -2
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.css +1539 -0
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +2 -3
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +2 -3
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.js +1489 -16
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +36 -4
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +2 -2
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +2 -2
- package/dist/libraries/react/components/check-dialog/lib/check-content.js +6 -0
- package/dist/libraries/react/components/check-dialog/lib/check-content.mjs +1 -1
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +1 -1
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +1 -1
- 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 +519 -399
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +24 -23
- 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/dialog.mjs +2 -2
- package/dist/libraries/react/cusTypes-DG6zrQYk.d.ts +179 -0
- package/dist/libraries/react/cusTypes-DmFGAdnp.d.mts +179 -0
- package/dist/libraries/react/entTypes-BbmxlLGb.d.mts +31 -0
- package/dist/libraries/react/entTypes-DG9rJhum.d.ts +31 -0
- package/dist/libraries/react/{response-C7P_oYqV.d.ts → genTypes-CHD2Kdqf.d.ts} +12 -19
- package/dist/libraries/react/{response-dnzFyX91.d.mts → genTypes-CHerQ_Ka.d.mts} +12 -19
- package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +31 -0
- package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +31 -0
- package/dist/libraries/react/hooks/helpers/handleCheck.js +813 -0
- package/dist/libraries/react/hooks/helpers/handleCheck.mjs +11 -0
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +41 -0
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +41 -0
- package/dist/libraries/react/hooks/helpers/useAutumnBase.js +1024 -0
- package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +10 -0
- package/dist/libraries/react/hooks/{useDialog.js → helpers/useDialog.js} +1 -1
- package/dist/libraries/react/hooks/{useDialog.mjs → helpers/useDialog.mjs} +1 -1
- package/dist/libraries/react/hooks/useAnalytics.d.mts +19 -0
- package/dist/libraries/react/hooks/useAnalytics.d.ts +19 -0
- package/dist/libraries/react/hooks/{useAutumnBase.js → useAnalytics.js} +192 -465
- package/dist/libraries/react/hooks/{useAutumnBase.mjs → useAnalytics.mjs} +7 -7
- package/dist/libraries/react/hooks/useCustomer.d.mts +8 -6
- package/dist/libraries/react/hooks/useCustomer.d.ts +8 -6
- package/dist/libraries/react/hooks/useCustomer.js +309 -199
- package/dist/libraries/react/hooks/useCustomer.mjs +9 -8
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +11 -9
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +11 -9
- package/dist/libraries/react/hooks/useCustomerBase.js +309 -199
- package/dist/libraries/react/hooks/useCustomerBase.mjs +8 -7
- package/dist/libraries/react/hooks/useEntity.d.mts +10 -11
- package/dist/libraries/react/hooks/useEntity.d.ts +10 -11
- package/dist/libraries/react/hooks/useEntity.js +260 -189
- package/dist/libraries/react/hooks/useEntity.mjs +9 -8
- package/dist/libraries/react/hooks/useEntityBase.d.mts +12 -13
- package/dist/libraries/react/hooks/useEntityBase.d.ts +12 -13
- package/dist/libraries/react/hooks/useEntityBase.js +300 -229
- package/dist/libraries/react/hooks/useEntityBase.mjs +8 -7
- package/dist/libraries/react/hooks/usePaywall.d.mts +13 -0
- package/dist/libraries/react/hooks/usePaywall.d.ts +13 -0
- package/dist/libraries/react/hooks/{useAutumn.js → usePaywall.js} +202 -479
- package/dist/libraries/react/hooks/{useAutumn.mjs → usePaywall.mjs} +7 -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 +367 -293
- package/dist/libraries/react/hooks/usePricingTable.mjs +6 -5
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +8 -9
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +8 -9
- package/dist/libraries/react/hooks/usePricingTableBase.js +167 -467
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -12
- package/dist/libraries/react/hooks/useProductsBase.d.mts +18 -1
- package/dist/libraries/react/hooks/useProductsBase.d.ts +18 -1
- package/dist/libraries/react/hooks/useProductsBase.js +11 -947
- package/dist/libraries/react/hooks/useProductsBase.mjs +10 -19
- package/dist/libraries/react/index.d.mts +213 -53
- package/dist/libraries/react/index.d.ts +213 -53
- package/dist/libraries/react/index.js +620 -419
- package/dist/libraries/react/index.mjs +598 -399
- package/dist/libraries/react/prodTypes-Mrr6azoz.d.mts +236 -0
- package/dist/libraries/react/prodTypes-Mrr6azoz.d.ts +236 -0
- package/dist/next/{AutumnProvider-BKgOhoik.d.mts → AutumnProvider-BGyIGvAS.d.mts} +167 -31
- package/dist/next/{AutumnProvider-BKgOhoik.d.ts → AutumnProvider-BGyIGvAS.d.ts} +167 -31
- package/dist/next/AutumnProvider.d.mts +1 -1
- package/dist/next/AutumnProvider.d.ts +1 -1
- package/dist/next/client/NextAutumnClient.d.mts +9 -4
- package/dist/next/client/NextAutumnClient.d.ts +9 -4
- package/dist/next/client/NextAutumnProvider.d.mts +2 -1
- package/dist/next/client/NextAutumnProvider.d.ts +2 -1
- package/dist/{libraries/react/attachTypes-DoFoPh8g.d.mts → next/client/attachTypes-DJ4Lz7dN.d.ts} +5 -5
- package/dist/next/client/{attachTypes-CJ7OSUSn.d.ts → attachTypes-Hja4wFD-.d.mts} +1 -1
- package/dist/next/client/{clientAttachTypes-D84PT2G0.d.mts → clientAttachTypes-Dde-B-ga.d.mts} +9 -2
- package/dist/next/client/{clientAttachTypes-D0_L-cnv.d.ts → clientAttachTypes-SPRZ0-u3.d.ts} +9 -2
- package/dist/next/client/clientUtils.d.mts +3 -2
- package/dist/next/client/clientUtils.d.ts +3 -2
- package/dist/next/client/cusTypes-CGQNbPsC.d.ts +179 -0
- package/dist/next/client/cusTypes-CkonzuMA.d.mts +179 -0
- package/dist/next/client/{entTypes-C-7Uoct9.d.ts → entTypes-BYx5xBXO.d.ts} +1 -1
- package/dist/next/client/{entTypes-CXGgMuHO.d.mts → entTypes-DzTUirPM.d.mts} +1 -1
- package/dist/next/client/hooks/useAutumn.d.mts +6 -6
- package/dist/next/client/hooks/useAutumn.d.ts +6 -6
- package/dist/next/client/hooks/useAutumn.js +10 -3
- package/dist/next/client/hooks/useAutumn.mjs +10 -3
- package/dist/next/client/hooks/useCustomer.d.mts +13 -7
- package/dist/next/client/hooks/useCustomer.d.ts +13 -7
- package/dist/next/client/hooks/useEntity.d.mts +7 -8
- package/dist/next/client/hooks/useEntity.d.ts +7 -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/hooks/usePricingTable.js +6 -2
- package/dist/next/client/hooks/usePricingTable.mjs +6 -2
- package/dist/next/client/prodTypes-CCk7TL_t.d.mts +227 -0
- package/dist/next/client/prodTypes-CCk7TL_t.d.ts +227 -0
- package/dist/next/client/types.d.mts +3 -2
- package/dist/next/client/types.d.ts +3 -2
- package/dist/next/index.d.mts +34 -24
- package/dist/next/index.d.ts +34 -24
- 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 +24 -1
- package/dist/next/server/cusActions.d.ts +24 -1
- package/dist/next/server/{cusTypes-_GDUnrai.d.mts → cusTypes-BpoYhIJ2.d.mts} +168 -32
- package/dist/next/server/{cusTypes-_GDUnrai.d.ts → cusTypes-BpoYhIJ2.d.ts} +168 -32
- package/dist/next/server/genActions.d.mts +1 -1
- package/dist/next/server/genActions.d.ts +1 -1
- package/dist/sdk/index.d.mts +193 -24
- package/dist/sdk/index.d.ts +193 -24
- package/dist/sdk/index.js +111 -56
- package/dist/sdk/index.mjs +108 -57
- package/dist/utils/encryptUtils.js +167 -99
- package/dist/utils/encryptUtils.mjs +167 -99
- package/package.json +3 -2
- package/tsup.config.ts +1 -11
- package/dist/compose/index.d.mts +0 -175
- package/dist/compose/index.d.ts +0 -175
- package/dist/compose/index.js +0 -78
- package/dist/compose/index.mjs +0 -47
- package/dist/libraries/react/chunk-3JJC2VU5.mjs +0 -67
- package/dist/libraries/react/chunk-KDD5RMQ3.mjs +0 -17
- package/dist/libraries/react/chunk-PC6V4RE7.mjs +0 -49
- package/dist/libraries/react/cusTypes-COIU0NG3.d.mts +0 -266
- package/dist/libraries/react/cusTypes-COIU0NG3.d.ts +0 -266
- package/dist/libraries/react/entTypes-BVPtpycG.d.mts +0 -17
- package/dist/libraries/react/entTypes-Ck3_WfOz.d.ts +0 -17
- package/dist/libraries/react/hooks/handleAllowed.d.mts +0 -15
- package/dist/libraries/react/hooks/handleAllowed.d.ts +0 -15
- package/dist/libraries/react/hooks/handleAllowed.js +0 -90
- package/dist/libraries/react/hooks/handleAllowed.mjs +0 -8
- package/dist/libraries/react/hooks/useAutumn.d.mts +0 -35
- package/dist/libraries/react/hooks/useAutumn.d.ts +0 -35
- package/dist/libraries/react/hooks/useAutumnBase.d.mts +0 -40
- package/dist/libraries/react/hooks/useAutumnBase.d.ts +0 -40
- package/dist/next/client/cusTypes-DT2ujoSl.d.mts +0 -266
- package/dist/next/client/cusTypes-DT2ujoSl.d.ts +0 -266
- package/dist/next/client/handleAllowed-B8TBAzfI.d.mts +0 -7
- package/dist/next/client/handleAllowed-B8TBAzfI.d.ts +0 -7
- package/dist/libraries/react/{chunk-JPLUWGH4.mjs → chunk-W5N4PVQU.mjs} +3 -3
- /package/dist/libraries/react/hooks/{useDialog.d.mts → helpers/useDialog.d.mts} +0 -0
- /package/dist/libraries/react/hooks/{useDialog.d.ts → helpers/useDialog.d.ts} +0 -0
|
@@ -23,31 +23,108 @@ declare enum ProductItemInterval {
|
|
|
23
23
|
}
|
|
24
24
|
type ProductItemIntervalType = "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | "multiple";
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
declare const CheckFeatureResultSchema: z.ZodObject<{
|
|
27
|
+
allowed: z.ZodBoolean;
|
|
28
|
+
feature_id: z.ZodString;
|
|
29
|
+
customer_id: z.ZodString;
|
|
30
|
+
entity_id: z.ZodOptional<z.ZodString>;
|
|
31
|
+
required_balance: z.ZodNumber;
|
|
32
|
+
} & {
|
|
33
|
+
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
interval: z.ZodOptional<z.ZodNativeEnum<typeof ProductItemInterval>>;
|
|
35
|
+
balance: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
usage: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
included_usage: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
next_reset_at: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
overage_allowed: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
usage_limit: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
breakdown: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
42
|
+
interval: z.ZodNativeEnum<typeof ProductItemInterval>;
|
|
43
|
+
balance: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
usage: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
included_usage: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
next_reset_at: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
interval: ProductItemInterval;
|
|
49
|
+
balance?: number | undefined;
|
|
50
|
+
usage?: number | undefined;
|
|
51
|
+
included_usage?: number | undefined;
|
|
52
|
+
next_reset_at?: number | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
interval: ProductItemInterval;
|
|
55
|
+
balance?: number | undefined;
|
|
56
|
+
usage?: number | undefined;
|
|
57
|
+
included_usage?: number | undefined;
|
|
58
|
+
next_reset_at?: number | undefined;
|
|
59
|
+
}>, "many">>;
|
|
60
|
+
credit_schema: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
61
|
+
feature_id: z.ZodString;
|
|
62
|
+
credit_amount: z.ZodNumber;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
feature_id: string;
|
|
65
|
+
credit_amount: number;
|
|
66
|
+
}, {
|
|
67
|
+
feature_id: string;
|
|
68
|
+
credit_amount: number;
|
|
69
|
+
}>, "many">>;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
71
|
allowed: boolean;
|
|
29
72
|
feature_id: string;
|
|
30
73
|
customer_id: string;
|
|
31
|
-
entity_id?: string;
|
|
32
74
|
required_balance: number;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
75
|
+
usage_limit?: number | undefined;
|
|
76
|
+
entity_id?: string | undefined;
|
|
77
|
+
unlimited?: boolean | undefined;
|
|
78
|
+
interval?: ProductItemInterval | undefined;
|
|
79
|
+
balance?: number | undefined;
|
|
80
|
+
usage?: number | undefined;
|
|
81
|
+
included_usage?: number | undefined;
|
|
82
|
+
next_reset_at?: number | undefined;
|
|
83
|
+
overage_allowed?: boolean | undefined;
|
|
84
|
+
breakdown?: {
|
|
85
|
+
interval: ProductItemInterval;
|
|
86
|
+
balance?: number | undefined;
|
|
87
|
+
usage?: number | undefined;
|
|
88
|
+
included_usage?: number | undefined;
|
|
89
|
+
next_reset_at?: number | undefined;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
credit_schema?: {
|
|
92
|
+
feature_id: string;
|
|
93
|
+
credit_amount: number;
|
|
94
|
+
}[] | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
allowed: boolean;
|
|
41
97
|
feature_id: string;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
98
|
+
customer_id: string;
|
|
99
|
+
required_balance: number;
|
|
100
|
+
usage_limit?: number | undefined;
|
|
101
|
+
entity_id?: string | undefined;
|
|
102
|
+
unlimited?: boolean | undefined;
|
|
103
|
+
interval?: ProductItemInterval | undefined;
|
|
104
|
+
balance?: number | undefined;
|
|
105
|
+
usage?: number | undefined;
|
|
106
|
+
included_usage?: number | undefined;
|
|
107
|
+
next_reset_at?: number | undefined;
|
|
108
|
+
overage_allowed?: boolean | undefined;
|
|
109
|
+
breakdown?: {
|
|
110
|
+
interval: ProductItemInterval;
|
|
111
|
+
balance?: number | undefined;
|
|
112
|
+
usage?: number | undefined;
|
|
113
|
+
included_usage?: number | undefined;
|
|
114
|
+
next_reset_at?: number | undefined;
|
|
115
|
+
}[] | undefined;
|
|
116
|
+
credit_schema?: {
|
|
117
|
+
feature_id: string;
|
|
118
|
+
credit_amount: number;
|
|
119
|
+
}[] | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
type CheckFeatureResult = z.infer<typeof CheckFeatureResultSchema>;
|
|
45
122
|
type ProductScenario = "scheduled" | "active" | "new" | "renew" | "upgrade" | "downgrade" | "cancel";
|
|
46
123
|
interface CheckProductResult {
|
|
47
124
|
allowed: boolean;
|
|
48
125
|
customer_id: string;
|
|
49
126
|
product_id: string;
|
|
50
|
-
|
|
127
|
+
entity_id?: string;
|
|
51
128
|
status?: string;
|
|
52
129
|
preview?: CheckProductPreview;
|
|
53
130
|
}
|
|
@@ -157,27 +234,86 @@ declare enum ProductStatus {
|
|
|
157
234
|
}
|
|
158
235
|
type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method";
|
|
159
236
|
|
|
160
|
-
|
|
161
|
-
unlimited
|
|
162
|
-
interval
|
|
163
|
-
balance
|
|
164
|
-
usage
|
|
165
|
-
included_usage
|
|
166
|
-
next_reset_at
|
|
167
|
-
overage_allowed
|
|
168
|
-
usage_limit
|
|
237
|
+
declare const CoreCusFeatureSchema: z.ZodObject<{
|
|
238
|
+
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
239
|
+
interval: z.ZodOptional<z.ZodNativeEnum<typeof ProductItemInterval>>;
|
|
240
|
+
balance: z.ZodOptional<z.ZodNumber>;
|
|
241
|
+
usage: z.ZodOptional<z.ZodNumber>;
|
|
242
|
+
included_usage: z.ZodOptional<z.ZodNumber>;
|
|
243
|
+
next_reset_at: z.ZodOptional<z.ZodNumber>;
|
|
244
|
+
overage_allowed: z.ZodOptional<z.ZodBoolean>;
|
|
245
|
+
usage_limit: z.ZodOptional<z.ZodNumber>;
|
|
246
|
+
breakdown: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
247
|
+
interval: z.ZodNativeEnum<typeof ProductItemInterval>;
|
|
248
|
+
balance: z.ZodOptional<z.ZodNumber>;
|
|
249
|
+
usage: z.ZodOptional<z.ZodNumber>;
|
|
250
|
+
included_usage: z.ZodOptional<z.ZodNumber>;
|
|
251
|
+
next_reset_at: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
}, "strip", z.ZodTypeAny, {
|
|
253
|
+
interval: ProductItemInterval;
|
|
254
|
+
balance?: number | undefined;
|
|
255
|
+
usage?: number | undefined;
|
|
256
|
+
included_usage?: number | undefined;
|
|
257
|
+
next_reset_at?: number | undefined;
|
|
258
|
+
}, {
|
|
259
|
+
interval: ProductItemInterval;
|
|
260
|
+
balance?: number | undefined;
|
|
261
|
+
usage?: number | undefined;
|
|
262
|
+
included_usage?: number | undefined;
|
|
263
|
+
next_reset_at?: number | undefined;
|
|
264
|
+
}>, "many">>;
|
|
265
|
+
credit_schema: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
266
|
+
feature_id: z.ZodString;
|
|
267
|
+
credit_amount: z.ZodNumber;
|
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
|
269
|
+
feature_id: string;
|
|
270
|
+
credit_amount: number;
|
|
271
|
+
}, {
|
|
272
|
+
feature_id: string;
|
|
273
|
+
credit_amount: number;
|
|
274
|
+
}>, "many">>;
|
|
275
|
+
}, "strip", z.ZodTypeAny, {
|
|
276
|
+
usage_limit?: number | undefined;
|
|
277
|
+
unlimited?: boolean | undefined;
|
|
278
|
+
interval?: ProductItemInterval | undefined;
|
|
279
|
+
balance?: number | undefined;
|
|
280
|
+
usage?: number | undefined;
|
|
281
|
+
included_usage?: number | undefined;
|
|
282
|
+
next_reset_at?: number | undefined;
|
|
283
|
+
overage_allowed?: boolean | undefined;
|
|
169
284
|
breakdown?: {
|
|
170
285
|
interval: ProductItemInterval;
|
|
171
|
-
balance?: number;
|
|
172
|
-
usage?: number;
|
|
173
|
-
included_usage?: number;
|
|
174
|
-
next_reset_at?: number;
|
|
175
|
-
}[];
|
|
286
|
+
balance?: number | undefined;
|
|
287
|
+
usage?: number | undefined;
|
|
288
|
+
included_usage?: number | undefined;
|
|
289
|
+
next_reset_at?: number | undefined;
|
|
290
|
+
}[] | undefined;
|
|
176
291
|
credit_schema?: {
|
|
177
292
|
feature_id: string;
|
|
178
293
|
credit_amount: number;
|
|
179
|
-
}[];
|
|
180
|
-
}
|
|
294
|
+
}[] | undefined;
|
|
295
|
+
}, {
|
|
296
|
+
usage_limit?: number | undefined;
|
|
297
|
+
unlimited?: boolean | undefined;
|
|
298
|
+
interval?: ProductItemInterval | undefined;
|
|
299
|
+
balance?: number | undefined;
|
|
300
|
+
usage?: number | undefined;
|
|
301
|
+
included_usage?: number | undefined;
|
|
302
|
+
next_reset_at?: number | undefined;
|
|
303
|
+
overage_allowed?: boolean | undefined;
|
|
304
|
+
breakdown?: {
|
|
305
|
+
interval: ProductItemInterval;
|
|
306
|
+
balance?: number | undefined;
|
|
307
|
+
usage?: number | undefined;
|
|
308
|
+
included_usage?: number | undefined;
|
|
309
|
+
next_reset_at?: number | undefined;
|
|
310
|
+
}[] | undefined;
|
|
311
|
+
credit_schema?: {
|
|
312
|
+
feature_id: string;
|
|
313
|
+
credit_amount: number;
|
|
314
|
+
}[] | undefined;
|
|
315
|
+
}>;
|
|
316
|
+
type CoreCustomerFeature = z.infer<typeof CoreCusFeatureSchema>;
|
|
181
317
|
interface CustomerFeature extends CoreCustomerFeature {
|
|
182
318
|
id: string;
|
|
183
319
|
name: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { R as Result,
|
|
2
|
-
import { C as CheckoutResult, A as AttachResult } from './attachTypes-
|
|
3
|
-
import {
|
|
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-Dde-B-ga.mjs';
|
|
2
|
+
import { C as CheckoutResult, A as AttachResult } from './attachTypes-Hja4wFD-.mjs';
|
|
3
|
+
import { C as CustomerData, e as CreateCustomerParams, a as Customer, B as BillingPortalResult } from './cusTypes-CkonzuMA.mjs';
|
|
4
|
+
import { E as Entity, D as DeleteEntityResult } from './entTypes-DzTUirPM.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-CCk7TL_t.mjs';
|
|
7
8
|
import 'zod';
|
|
8
9
|
|
|
9
10
|
interface PricingTableProduct {
|
|
@@ -132,6 +133,10 @@ declare class AutumnClient {
|
|
|
132
133
|
}>;
|
|
133
134
|
openBillingPortal: (params?: OpenBillingPortalParams | undefined) => AutumnPromise<BillingPortalResult>;
|
|
134
135
|
setupPayment: (params: SetupPaymentParams) => AutumnPromise<SetupPaymentResult>;
|
|
136
|
+
query: (params: {
|
|
137
|
+
featureId: string | string[];
|
|
138
|
+
range?: "24h" | "7d" | "30d" | "90d" | "last_cycle" | undefined;
|
|
139
|
+
}) => AutumnPromise<QueryResult>;
|
|
135
140
|
entities: {
|
|
136
141
|
create: (params: CreateEntityParams | CreateEntityParams[]) => AutumnPromise<Entity | Entity[]>;
|
|
137
142
|
get: (entityId: string, params?: GetEntityParams | undefined) => AutumnPromise<Entity>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { R as Result,
|
|
2
|
-
import { C as CheckoutResult, A as AttachResult } from './attachTypes-
|
|
3
|
-
import {
|
|
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-SPRZ0-u3.js';
|
|
2
|
+
import { C as CheckoutResult, A as AttachResult } from './attachTypes-DJ4Lz7dN.js';
|
|
3
|
+
import { C as CustomerData, e as CreateCustomerParams, a as Customer, B as BillingPortalResult } from './cusTypes-CGQNbPsC.js';
|
|
4
|
+
import { E as Entity, D as DeleteEntityResult } from './entTypes-BYx5xBXO.js';
|
|
5
5
|
import { C as CreateEntityParams, G as GetEntityParams, a as CreateReferralCodeResult, R as RedeemReferralCodeResult } from './clientEntTypes-BFkleT6a.js';
|
|
6
6
|
import { A as AutumnError } from './error-DHbclCVh.js';
|
|
7
|
+
import { P as ProductItem, c as ProductScenario, a as Product } from './prodTypes-CCk7TL_t.js';
|
|
7
8
|
import 'zod';
|
|
8
9
|
|
|
9
10
|
interface PricingTableProduct {
|
|
@@ -132,6 +133,10 @@ declare class AutumnClient {
|
|
|
132
133
|
}>;
|
|
133
134
|
openBillingPortal: (params?: OpenBillingPortalParams | undefined) => AutumnPromise<BillingPortalResult>;
|
|
134
135
|
setupPayment: (params: SetupPaymentParams) => AutumnPromise<SetupPaymentResult>;
|
|
136
|
+
query: (params: {
|
|
137
|
+
featureId: string | string[];
|
|
138
|
+
range?: "24h" | "7d" | "30d" | "90d" | "last_cycle" | undefined;
|
|
139
|
+
}) => AutumnPromise<QueryResult>;
|
|
135
140
|
entities: {
|
|
136
141
|
create: (params: CreateEntityParams | CreateEntityParams[]) => AutumnPromise<Entity | Entity[]>;
|
|
137
142
|
get: (entityId: string, params?: GetEntityParams | undefined) => AutumnPromise<Entity>;
|
|
@@ -1,5 +1,6 @@
|
|
|
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-CkonzuMA.mjs';
|
|
3
|
+
import './prodTypes-CCk7TL_t.mjs';
|
|
3
4
|
import 'zod';
|
|
4
5
|
|
|
5
6
|
declare const NextAutumnProvider: ({ encryptedCustomerId, customerData, children, }: {
|
|
@@ -1,5 +1,6 @@
|
|
|
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-CGQNbPsC.js';
|
|
3
|
+
import './prodTypes-CCk7TL_t.js';
|
|
3
4
|
import 'zod';
|
|
4
5
|
|
|
5
6
|
declare const NextAutumnProvider: ({ encryptedCustomerId, customerData, children, }: {
|
package/dist/{libraries/react/attachTypes-DoFoPh8g.d.mts → next/client/attachTypes-DJ4Lz7dN.d.ts}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { P as ProductItem, a as Product } from './prodTypes-CCk7TL_t.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
declare const AttachFeatureOptionsSchema: z.ZodObject<{
|
|
5
5
|
feature_id: z.ZodString;
|
|
6
6
|
quantity: z.ZodNumber;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
feature_id: string;
|
|
9
8
|
quantity: number;
|
|
10
|
-
}, {
|
|
11
9
|
feature_id: string;
|
|
10
|
+
}, {
|
|
12
11
|
quantity: number;
|
|
12
|
+
feature_id: string;
|
|
13
13
|
}>;
|
|
14
14
|
type AttachFeatureOptions = z.infer<typeof AttachFeatureOptionsSchema>;
|
|
15
15
|
declare const AttachResultSchema: z.ZodObject<{
|
|
@@ -24,15 +24,15 @@ declare const AttachResultSchema: z.ZodObject<{
|
|
|
24
24
|
message: string;
|
|
25
25
|
customer_id: string;
|
|
26
26
|
product_ids: string[];
|
|
27
|
-
customer_data?: any;
|
|
28
27
|
checkout_url?: string | undefined;
|
|
28
|
+
customer_data?: any;
|
|
29
29
|
}, {
|
|
30
30
|
code: string;
|
|
31
31
|
message: string;
|
|
32
32
|
customer_id: string;
|
|
33
33
|
product_ids: string[];
|
|
34
|
-
customer_data?: any;
|
|
35
34
|
checkout_url?: string | undefined;
|
|
35
|
+
customer_data?: any;
|
|
36
36
|
}>;
|
|
37
37
|
type AttachResult = z.infer<typeof AttachResultSchema>;
|
|
38
38
|
type CheckoutResult = {
|
package/dist/next/client/{clientAttachTypes-D84PT2G0.d.mts → clientAttachTypes-Dde-B-ga.d.mts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as CheckFeatureResult, d as CheckProductResult } from './prodTypes-CCk7TL_t.mjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { A as AutumnError } from './error-DHbclCVh.mjs';
|
|
4
4
|
|
|
@@ -41,6 +41,13 @@ interface SetupPaymentResult {
|
|
|
41
41
|
customer_id: string;
|
|
42
42
|
url: string;
|
|
43
43
|
}
|
|
44
|
+
type QueryResult = {
|
|
45
|
+
list: Array<{
|
|
46
|
+
period: string;
|
|
47
|
+
} & {
|
|
48
|
+
[key: string]: number;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
44
51
|
|
|
45
52
|
type Success<T> = {
|
|
46
53
|
data: T;
|
|
@@ -232,4 +239,4 @@ declare const CheckoutParamsSchema: z.ZodObject<{
|
|
|
232
239
|
}>;
|
|
233
240
|
type CheckoutParams = z.infer<typeof CheckoutParamsSchema>;
|
|
234
241
|
|
|
235
|
-
export type { AttachParams as A, CheckResult as C, OpenBillingPortalParams as O, Result as R, SetupPaymentParams as S, TrackParams as T,
|
|
242
|
+
export type { AttachParams as A, CheckResult as C, OpenBillingPortalParams as O, QueryResult as Q, Result as R, SetupPaymentParams as S, TrackParams as T, AutumnPromise as a, TrackResult as b, CancelParams as c, CancelResult as d, SetupPaymentResult as e, CheckoutParams as f, CheckParams as g };
|
package/dist/next/client/{clientAttachTypes-D0_L-cnv.d.ts → clientAttachTypes-SPRZ0-u3.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as CheckFeatureResult, d as CheckProductResult } from './prodTypes-CCk7TL_t.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { A as AutumnError } from './error-DHbclCVh.js';
|
|
4
4
|
|
|
@@ -41,6 +41,13 @@ interface SetupPaymentResult {
|
|
|
41
41
|
customer_id: string;
|
|
42
42
|
url: string;
|
|
43
43
|
}
|
|
44
|
+
type QueryResult = {
|
|
45
|
+
list: Array<{
|
|
46
|
+
period: string;
|
|
47
|
+
} & {
|
|
48
|
+
[key: string]: number;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
44
51
|
|
|
45
52
|
type Success<T> = {
|
|
46
53
|
data: T;
|
|
@@ -232,4 +239,4 @@ declare const CheckoutParamsSchema: z.ZodObject<{
|
|
|
232
239
|
}>;
|
|
233
240
|
type CheckoutParams = z.infer<typeof CheckoutParamsSchema>;
|
|
234
241
|
|
|
235
|
-
export type { AttachParams as A, CheckResult as C, OpenBillingPortalParams as O, Result as R, SetupPaymentParams as S, TrackParams as T,
|
|
242
|
+
export type { AttachParams as A, CheckResult as C, OpenBillingPortalParams as O, QueryResult as Q, Result as R, SetupPaymentParams as S, TrackParams as T, AutumnPromise as a, TrackResult as b, CancelParams as c, CancelResult as d, SetupPaymentResult as e, CheckoutParams as f, CheckParams as g };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AutumnClientError, PricingTableProduct } from './types.mjs';
|
|
2
|
-
import './cusTypes-
|
|
2
|
+
import './cusTypes-CkonzuMA.mjs';
|
|
3
|
+
import './prodTypes-CCk7TL_t.mjs';
|
|
3
4
|
import 'zod';
|
|
4
|
-
import './entTypes-
|
|
5
|
+
import './entTypes-DzTUirPM.mjs';
|
|
5
6
|
|
|
6
7
|
declare const toClientErrorResponse: (error: any) => {
|
|
7
8
|
data: null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AutumnClientError, PricingTableProduct } from './types.js';
|
|
2
|
-
import './cusTypes-
|
|
2
|
+
import './cusTypes-CGQNbPsC.js';
|
|
3
|
+
import './prodTypes-CCk7TL_t.js';
|
|
3
4
|
import 'zod';
|
|
4
|
-
import './entTypes-
|
|
5
|
+
import './entTypes-BYx5xBXO.js';
|
|
5
6
|
|
|
6
7
|
declare const toClientErrorResponse: (error: any) => {
|
|
7
8
|
data: null;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { A as AppEnv, P as ProductItem, b as ProductItemInterval } from './prodTypes-CCk7TL_t.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
declare enum ProductStatus {
|
|
5
|
+
Active = "active",
|
|
6
|
+
Expired = "expired",
|
|
7
|
+
Trialing = "trialing",
|
|
8
|
+
Scheduled = "scheduled",
|
|
9
|
+
PastDue = "past_due"
|
|
10
|
+
}
|
|
11
|
+
type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method";
|
|
12
|
+
|
|
13
|
+
declare const CoreCusFeatureSchema: z.ZodObject<{
|
|
14
|
+
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
interval: z.ZodOptional<z.ZodNativeEnum<typeof ProductItemInterval>>;
|
|
16
|
+
balance: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
usage: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
included_usage: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
next_reset_at: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
overage_allowed: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
usage_limit: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
breakdown: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
23
|
+
interval: z.ZodNativeEnum<typeof ProductItemInterval>;
|
|
24
|
+
balance: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
usage: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
included_usage: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
next_reset_at: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
interval: ProductItemInterval;
|
|
30
|
+
balance?: number | undefined;
|
|
31
|
+
usage?: number | undefined;
|
|
32
|
+
included_usage?: number | undefined;
|
|
33
|
+
next_reset_at?: number | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
interval: ProductItemInterval;
|
|
36
|
+
balance?: number | undefined;
|
|
37
|
+
usage?: number | undefined;
|
|
38
|
+
included_usage?: number | undefined;
|
|
39
|
+
next_reset_at?: number | undefined;
|
|
40
|
+
}>, "many">>;
|
|
41
|
+
credit_schema: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
42
|
+
feature_id: z.ZodString;
|
|
43
|
+
credit_amount: z.ZodNumber;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
feature_id: string;
|
|
46
|
+
credit_amount: number;
|
|
47
|
+
}, {
|
|
48
|
+
feature_id: string;
|
|
49
|
+
credit_amount: number;
|
|
50
|
+
}>, "many">>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
unlimited?: boolean | undefined;
|
|
53
|
+
interval?: ProductItemInterval | undefined;
|
|
54
|
+
balance?: number | undefined;
|
|
55
|
+
usage?: number | undefined;
|
|
56
|
+
included_usage?: number | undefined;
|
|
57
|
+
next_reset_at?: number | undefined;
|
|
58
|
+
overage_allowed?: boolean | undefined;
|
|
59
|
+
usage_limit?: number | undefined;
|
|
60
|
+
breakdown?: {
|
|
61
|
+
interval: ProductItemInterval;
|
|
62
|
+
balance?: number | undefined;
|
|
63
|
+
usage?: number | undefined;
|
|
64
|
+
included_usage?: number | undefined;
|
|
65
|
+
next_reset_at?: number | undefined;
|
|
66
|
+
}[] | undefined;
|
|
67
|
+
credit_schema?: {
|
|
68
|
+
feature_id: string;
|
|
69
|
+
credit_amount: number;
|
|
70
|
+
}[] | undefined;
|
|
71
|
+
}, {
|
|
72
|
+
unlimited?: boolean | undefined;
|
|
73
|
+
interval?: ProductItemInterval | undefined;
|
|
74
|
+
balance?: number | undefined;
|
|
75
|
+
usage?: number | undefined;
|
|
76
|
+
included_usage?: number | undefined;
|
|
77
|
+
next_reset_at?: number | undefined;
|
|
78
|
+
overage_allowed?: boolean | undefined;
|
|
79
|
+
usage_limit?: number | undefined;
|
|
80
|
+
breakdown?: {
|
|
81
|
+
interval: ProductItemInterval;
|
|
82
|
+
balance?: number | undefined;
|
|
83
|
+
usage?: number | undefined;
|
|
84
|
+
included_usage?: number | undefined;
|
|
85
|
+
next_reset_at?: number | undefined;
|
|
86
|
+
}[] | undefined;
|
|
87
|
+
credit_schema?: {
|
|
88
|
+
feature_id: string;
|
|
89
|
+
credit_amount: number;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
}>;
|
|
92
|
+
type CoreCustomerFeature = z.infer<typeof CoreCusFeatureSchema>;
|
|
93
|
+
interface CustomerFeature extends CoreCustomerFeature {
|
|
94
|
+
id: string;
|
|
95
|
+
name: string;
|
|
96
|
+
type: "static" | "single_use" | "continuous_use";
|
|
97
|
+
}
|
|
98
|
+
interface CustomerProduct {
|
|
99
|
+
id: string;
|
|
100
|
+
name: string | null;
|
|
101
|
+
group: string | null;
|
|
102
|
+
status: ProductStatus;
|
|
103
|
+
started_at: number;
|
|
104
|
+
canceled_at: number | null;
|
|
105
|
+
version: number;
|
|
106
|
+
subscription_ids?: string[] | null;
|
|
107
|
+
current_period_start?: number | null;
|
|
108
|
+
current_period_end?: number | null;
|
|
109
|
+
trial_ends_at?: number;
|
|
110
|
+
entity_id?: string;
|
|
111
|
+
is_add_on: boolean;
|
|
112
|
+
is_default: boolean;
|
|
113
|
+
items: ProductItem[];
|
|
114
|
+
}
|
|
115
|
+
interface Customer {
|
|
116
|
+
id: string | null;
|
|
117
|
+
created_at: number;
|
|
118
|
+
name: string | null;
|
|
119
|
+
email: string | null;
|
|
120
|
+
fingerprint: string | null;
|
|
121
|
+
stripe_id: string | null;
|
|
122
|
+
env: AppEnv;
|
|
123
|
+
metadata: Record<string, any>;
|
|
124
|
+
products: CustomerProduct[];
|
|
125
|
+
features: Record<string, CustomerFeature>;
|
|
126
|
+
invoices?: CustomerInvoice[];
|
|
127
|
+
}
|
|
128
|
+
declare const CustomerDataSchema: z.ZodObject<{
|
|
129
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
130
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
131
|
+
fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
name?: string | null | undefined;
|
|
134
|
+
email?: string | null | undefined;
|
|
135
|
+
fingerprint?: string | null | undefined;
|
|
136
|
+
}, {
|
|
137
|
+
name?: string | null | undefined;
|
|
138
|
+
email?: string | null | undefined;
|
|
139
|
+
fingerprint?: string | null | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
type CustomerData = z.infer<typeof CustomerDataSchema>;
|
|
142
|
+
declare const CreateCustomerParamsSchema: z.ZodObject<{
|
|
143
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
145
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
146
|
+
fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
147
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
148
|
+
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
150
|
+
name?: string | null | undefined;
|
|
151
|
+
email?: string | null | undefined;
|
|
152
|
+
fingerprint?: string | null | undefined;
|
|
153
|
+
id?: string | null | undefined;
|
|
154
|
+
metadata?: Record<string, any> | undefined;
|
|
155
|
+
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
156
|
+
}, {
|
|
157
|
+
name?: string | null | undefined;
|
|
158
|
+
email?: string | null | undefined;
|
|
159
|
+
fingerprint?: string | null | undefined;
|
|
160
|
+
id?: string | null | undefined;
|
|
161
|
+
metadata?: Record<string, any> | undefined;
|
|
162
|
+
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
163
|
+
}>;
|
|
164
|
+
type CreateCustomerParams = z.infer<typeof CreateCustomerParamsSchema>;
|
|
165
|
+
interface BillingPortalResult {
|
|
166
|
+
customer_id: string;
|
|
167
|
+
url: string;
|
|
168
|
+
}
|
|
169
|
+
interface CustomerInvoice {
|
|
170
|
+
product_ids: string[];
|
|
171
|
+
stripe_id: string;
|
|
172
|
+
status: string;
|
|
173
|
+
total: number;
|
|
174
|
+
currency: string;
|
|
175
|
+
created_at: number;
|
|
176
|
+
hosted_invoice_url: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export type { BillingPortalResult as B, CustomerData as C, Customer as a, CustomerProduct as b, CustomerFeature as c, CustomerInvoice as d, CreateCustomerParams as e, CustomerExpandOption as f };
|