autumn-js 0.0.107 → 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-ICPSX5WQ.mjs → chunk-DMHG3POG.mjs} +8 -8
- 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 +8 -7
- 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 +14 -13
- package/dist/libraries/react/{ReactAutumnClient-BpXo7k9S.d.mts → ReactAutumnClient-C4CPCKrp.d.mts} +9 -4
- package/dist/libraries/react/{ReactAutumnClient-Cr0JiREm.d.ts → ReactAutumnClient-Cf3-brZx.d.ts} +9 -4
- 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 +15 -14
- package/dist/libraries/react/{attachTypes-DfACqtlD.d.ts → attachTypes-BKzcsvuA.d.ts} +1 -1
- package/dist/libraries/react/{attachTypes-CRCMAcZg.d.mts → attachTypes-C1BZ4HNs.d.mts} +1 -1
- 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-FB6W5XQX.mjs → chunk-BF36ZT6M.mjs} +12 -11
- package/dist/libraries/react/{chunk-A4HGGTVT.mjs → chunk-CQD37NSX.mjs} +16 -58
- package/dist/libraries/react/{chunk-5ZJQVPJY.mjs → chunk-D3GL2QV3.mjs} +240 -381
- package/dist/libraries/react/{chunk-2LCMYER5.mjs → chunk-FE5GYL7P.mjs} +2 -2
- package/dist/libraries/react/{chunk-MY2ODATB.mjs → chunk-HBCCTYA6.mjs} +6 -0
- package/dist/libraries/react/chunk-JGRLRPKG.mjs +56 -0
- package/dist/libraries/react/{chunk-QKNW5ACT.mjs → chunk-K7IJMDIV.mjs} +19 -5
- package/dist/libraries/react/{chunk-NPEXC3I5.mjs → chunk-MIITU3Q2.mjs} +37 -22
- package/dist/libraries/react/chunk-MS4UEBVX.mjs +223 -0
- package/dist/libraries/react/{chunk-X2ZMWBM7.mjs → chunk-OXPO56ZD.mjs} +9 -4
- package/dist/libraries/react/chunk-PDCSW5VX.mjs +46 -0
- package/dist/libraries/react/{chunk-CUWUAQML.mjs → chunk-QJPZFEVW.mjs} +8 -49
- package/dist/libraries/react/{chunk-4QPHNIQ7.mjs → chunk-RFSQBGLO.mjs} +1 -1
- package/dist/libraries/react/{chunk-5YEDOCUG.mjs → chunk-T4Z5BKOW.mjs} +3 -3
- package/dist/libraries/react/{chunk-HRE3F4SD.mjs → chunk-TL2F3PPG.mjs} +2 -10
- package/dist/libraries/react/{chunk-4K7ZXCEU.mjs → chunk-V2XCEJ4T.mjs} +3 -2
- package/dist/libraries/react/{chunk-VWVC5X2R.mjs → chunk-VAWI6RK6.mjs} +52 -16
- package/dist/libraries/react/{chunk-WAFSQH6N.mjs → chunk-W5N4PVQU.mjs} +7 -1
- package/dist/libraries/react/{chunk-HQTQYHKS.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 +7 -6
- 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 +474 -347
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +28 -26
- 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 +1602 -15
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +36 -3
- 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 +621 -490
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +28 -26
- package/dist/libraries/react/components/ui/accordion.mjs +2 -1
- 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.js +115 -1
- package/dist/libraries/react/components/ui/dialog.mjs +2 -1
- 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-BCyzYfES.d.ts → genTypes-CHD2Kdqf.d.ts} +8 -15
- package/dist/libraries/react/{response-pYjgZr_V.d.mts → genTypes-CHerQ_Ka.d.mts} +8 -15
- 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} +11 -11
- 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 +13 -12
- 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 +12 -11
- 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 +13 -12
- 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 +12 -11
- 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} +11 -12
- 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 +10 -9
- 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 +722 -510
- package/dist/libraries/react/index.mjs +707 -497
- 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 +20 -15
- package/dist/next/client/NextAutumnClient.d.ts +20 -15
- package/dist/next/client/NextAutumnProvider.d.mts +2 -1
- package/dist/next/client/NextAutumnProvider.d.ts +2 -1
- package/dist/next/client/{attachTypes-BE_gD21A.d.mts → attachTypes-DJ4Lz7dN.d.ts} +5 -5
- package/dist/next/client/{attachTypes-c0nmQ7FA.d.ts → attachTypes-Hja4wFD-.d.mts} +5 -5
- package/dist/next/client/{clientAttachTypes-C-bSiO35.d.mts → clientAttachTypes-Dde-B-ga.d.mts} +33 -26
- package/dist/next/client/{clientAttachTypes-BBDJRxyt.d.ts → clientAttachTypes-SPRZ0-u3.d.ts} +33 -26
- 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 +5 -5
- package/dist/next/client/hooks/useAutumn.d.ts +5 -5
- 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 +8 -9
- package/dist/next/client/hooks/useEntity.d.ts +8 -9
- 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-4A53GN44.mjs +0 -49
- package/dist/libraries/react/chunk-IZSSJHYG.mjs +0 -17
- package/dist/libraries/react/cusTypes-B9PUlh3i.d.mts +0 -266
- package/dist/libraries/react/cusTypes-B9PUlh3i.d.ts +0 -266
- package/dist/libraries/react/entTypes-DgHZw9Eg.d.mts +0 -17
- package/dist/libraries/react/entTypes-GuU6bc8U.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/hooks/{useDialog.d.mts → helpers/useDialog.d.mts} +0 -0
- /package/dist/libraries/react/hooks/{useDialog.d.ts → helpers/useDialog.d.ts} +0 -0
package/dist/libraries/backend/{referralTypes-CL2y5hbv.d.mts → referralTypes-CpEs5id9.d.mts}
RENAMED
|
@@ -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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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, {
|
|
30
71
|
customer_id: string;
|
|
31
|
-
|
|
72
|
+
feature_id: string;
|
|
32
73
|
required_balance: number;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
74
|
+
allowed: boolean;
|
|
75
|
+
entity_id?: string | undefined;
|
|
76
|
+
usage_limit?: number | 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
|
+
customer_id: string;
|
|
41
97
|
feature_id: string;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
98
|
+
required_balance: number;
|
|
99
|
+
allowed: boolean;
|
|
100
|
+
entity_id?: string | undefined;
|
|
101
|
+
usage_limit?: number | 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
|
}
|
|
@@ -168,27 +245,86 @@ declare enum ProductStatus {
|
|
|
168
245
|
}
|
|
169
246
|
type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method";
|
|
170
247
|
|
|
171
|
-
|
|
172
|
-
unlimited
|
|
173
|
-
interval
|
|
174
|
-
balance
|
|
175
|
-
usage
|
|
176
|
-
included_usage
|
|
177
|
-
next_reset_at
|
|
178
|
-
overage_allowed
|
|
179
|
-
usage_limit
|
|
248
|
+
declare const CoreCusFeatureSchema: z.ZodObject<{
|
|
249
|
+
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
250
|
+
interval: z.ZodOptional<z.ZodNativeEnum<typeof ProductItemInterval>>;
|
|
251
|
+
balance: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
usage: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
included_usage: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
next_reset_at: z.ZodOptional<z.ZodNumber>;
|
|
255
|
+
overage_allowed: z.ZodOptional<z.ZodBoolean>;
|
|
256
|
+
usage_limit: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
breakdown: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
258
|
+
interval: z.ZodNativeEnum<typeof ProductItemInterval>;
|
|
259
|
+
balance: z.ZodOptional<z.ZodNumber>;
|
|
260
|
+
usage: z.ZodOptional<z.ZodNumber>;
|
|
261
|
+
included_usage: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
next_reset_at: z.ZodOptional<z.ZodNumber>;
|
|
263
|
+
}, "strip", z.ZodTypeAny, {
|
|
264
|
+
interval: ProductItemInterval;
|
|
265
|
+
balance?: number | undefined;
|
|
266
|
+
usage?: number | undefined;
|
|
267
|
+
included_usage?: number | undefined;
|
|
268
|
+
next_reset_at?: number | undefined;
|
|
269
|
+
}, {
|
|
270
|
+
interval: ProductItemInterval;
|
|
271
|
+
balance?: number | undefined;
|
|
272
|
+
usage?: number | undefined;
|
|
273
|
+
included_usage?: number | undefined;
|
|
274
|
+
next_reset_at?: number | undefined;
|
|
275
|
+
}>, "many">>;
|
|
276
|
+
credit_schema: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
277
|
+
feature_id: z.ZodString;
|
|
278
|
+
credit_amount: z.ZodNumber;
|
|
279
|
+
}, "strip", z.ZodTypeAny, {
|
|
280
|
+
feature_id: string;
|
|
281
|
+
credit_amount: number;
|
|
282
|
+
}, {
|
|
283
|
+
feature_id: string;
|
|
284
|
+
credit_amount: number;
|
|
285
|
+
}>, "many">>;
|
|
286
|
+
}, "strip", z.ZodTypeAny, {
|
|
287
|
+
usage_limit?: number | undefined;
|
|
288
|
+
unlimited?: boolean | undefined;
|
|
289
|
+
interval?: ProductItemInterval | undefined;
|
|
290
|
+
balance?: number | undefined;
|
|
291
|
+
usage?: number | undefined;
|
|
292
|
+
included_usage?: number | undefined;
|
|
293
|
+
next_reset_at?: number | undefined;
|
|
294
|
+
overage_allowed?: boolean | undefined;
|
|
180
295
|
breakdown?: {
|
|
181
296
|
interval: ProductItemInterval;
|
|
182
|
-
balance?: number;
|
|
183
|
-
usage?: number;
|
|
184
|
-
included_usage?: number;
|
|
185
|
-
next_reset_at?: number;
|
|
186
|
-
}[];
|
|
297
|
+
balance?: number | undefined;
|
|
298
|
+
usage?: number | undefined;
|
|
299
|
+
included_usage?: number | undefined;
|
|
300
|
+
next_reset_at?: number | undefined;
|
|
301
|
+
}[] | undefined;
|
|
187
302
|
credit_schema?: {
|
|
188
303
|
feature_id: string;
|
|
189
304
|
credit_amount: number;
|
|
190
|
-
}[];
|
|
191
|
-
}
|
|
305
|
+
}[] | undefined;
|
|
306
|
+
}, {
|
|
307
|
+
usage_limit?: number | undefined;
|
|
308
|
+
unlimited?: boolean | undefined;
|
|
309
|
+
interval?: ProductItemInterval | undefined;
|
|
310
|
+
balance?: number | undefined;
|
|
311
|
+
usage?: number | undefined;
|
|
312
|
+
included_usage?: number | undefined;
|
|
313
|
+
next_reset_at?: number | undefined;
|
|
314
|
+
overage_allowed?: boolean | undefined;
|
|
315
|
+
breakdown?: {
|
|
316
|
+
interval: ProductItemInterval;
|
|
317
|
+
balance?: number | undefined;
|
|
318
|
+
usage?: number | undefined;
|
|
319
|
+
included_usage?: number | undefined;
|
|
320
|
+
next_reset_at?: number | undefined;
|
|
321
|
+
}[] | undefined;
|
|
322
|
+
credit_schema?: {
|
|
323
|
+
feature_id: string;
|
|
324
|
+
credit_amount: number;
|
|
325
|
+
}[] | undefined;
|
|
326
|
+
}>;
|
|
327
|
+
type CoreCustomerFeature = z.infer<typeof CoreCusFeatureSchema>;
|
|
192
328
|
interface CustomerFeature extends CoreCustomerFeature {
|
|
193
329
|
id: string;
|
|
194
330
|
name: string;
|
|
@@ -249,19 +385,19 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
|
|
|
249
385
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
250
386
|
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
|
|
251
387
|
}, "strip", z.ZodTypeAny, {
|
|
252
|
-
|
|
388
|
+
metadata?: Record<string, any> | undefined;
|
|
389
|
+
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
253
390
|
name?: string | null | undefined;
|
|
254
391
|
email?: string | null | undefined;
|
|
255
392
|
fingerprint?: string | null | undefined;
|
|
393
|
+
id?: string | null | undefined;
|
|
394
|
+
}, {
|
|
256
395
|
metadata?: Record<string, any> | undefined;
|
|
257
396
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
258
|
-
}, {
|
|
259
|
-
id?: string | null | undefined;
|
|
260
397
|
name?: string | null | undefined;
|
|
261
398
|
email?: string | null | undefined;
|
|
262
399
|
fingerprint?: string | null | undefined;
|
|
263
|
-
|
|
264
|
-
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
400
|
+
id?: string | null | undefined;
|
|
265
401
|
}>;
|
|
266
402
|
type CreateCustomerParams = z.infer<typeof CreateCustomerParamsSchema>;
|
|
267
403
|
interface UpdateCustomerParams {
|
|
@@ -320,18 +456,18 @@ declare const TrackParamsSchema: z.ZodObject<{
|
|
|
320
456
|
entity_data: z.ZodOptional<z.ZodAny>;
|
|
321
457
|
}, "strip", z.ZodTypeAny, {
|
|
322
458
|
customer_id: string;
|
|
323
|
-
feature_id?: string | undefined;
|
|
324
|
-
entity_id?: string | undefined;
|
|
325
459
|
value?: number | undefined;
|
|
460
|
+
entity_id?: string | undefined;
|
|
461
|
+
feature_id?: string | undefined;
|
|
326
462
|
customer_data?: any;
|
|
327
463
|
entity_data?: any;
|
|
328
464
|
event_name?: string | undefined;
|
|
329
465
|
idempotency_key?: string | undefined;
|
|
330
466
|
}, {
|
|
331
467
|
customer_id: string;
|
|
332
|
-
feature_id?: string | undefined;
|
|
333
|
-
entity_id?: string | undefined;
|
|
334
468
|
value?: number | undefined;
|
|
469
|
+
entity_id?: string | undefined;
|
|
470
|
+
feature_id?: string | undefined;
|
|
335
471
|
customer_data?: any;
|
|
336
472
|
entity_data?: any;
|
|
337
473
|
event_name?: string | undefined;
|
|
@@ -359,28 +495,28 @@ declare const CheckParamsSchema: z.ZodObject<{
|
|
|
359
495
|
}>>;
|
|
360
496
|
}, "strip", z.ZodTypeAny, {
|
|
361
497
|
customer_id: string;
|
|
362
|
-
feature_id?: string | undefined;
|
|
363
|
-
entity_id?: string | undefined;
|
|
364
|
-
required_balance?: number | undefined;
|
|
365
498
|
product_id?: string | undefined;
|
|
499
|
+
entity_id?: string | undefined;
|
|
500
|
+
feature_id?: string | undefined;
|
|
366
501
|
customer_data?: any;
|
|
367
502
|
entity_data?: {
|
|
368
503
|
feature_id: string;
|
|
369
504
|
name?: string | undefined;
|
|
370
505
|
} | undefined;
|
|
506
|
+
required_balance?: number | undefined;
|
|
371
507
|
send_event?: boolean | undefined;
|
|
372
508
|
with_preview?: boolean | undefined;
|
|
373
509
|
}, {
|
|
374
510
|
customer_id: string;
|
|
375
|
-
feature_id?: string | undefined;
|
|
376
|
-
entity_id?: string | undefined;
|
|
377
|
-
required_balance?: number | undefined;
|
|
378
511
|
product_id?: string | undefined;
|
|
512
|
+
entity_id?: string | undefined;
|
|
513
|
+
feature_id?: string | undefined;
|
|
379
514
|
customer_data?: any;
|
|
380
515
|
entity_data?: {
|
|
381
516
|
feature_id: string;
|
|
382
517
|
name?: string | undefined;
|
|
383
518
|
} | undefined;
|
|
519
|
+
required_balance?: number | undefined;
|
|
384
520
|
send_event?: boolean | undefined;
|
|
385
521
|
with_preview?: boolean | undefined;
|
|
386
522
|
}>;
|
|
@@ -406,6 +542,27 @@ interface SetupPaymentResult {
|
|
|
406
542
|
customer_id: string;
|
|
407
543
|
url: string;
|
|
408
544
|
}
|
|
545
|
+
declare const QueryParamsSchema: z.ZodObject<{
|
|
546
|
+
customer_id: z.ZodString;
|
|
547
|
+
feature_id: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
548
|
+
range: z.ZodOptional<z.ZodEnum<["24h", "7d", "30d", "90d", "last_cycle"]>>;
|
|
549
|
+
}, "strip", z.ZodTypeAny, {
|
|
550
|
+
customer_id: string;
|
|
551
|
+
feature_id: string | string[];
|
|
552
|
+
range?: "24h" | "7d" | "30d" | "90d" | "last_cycle" | undefined;
|
|
553
|
+
}, {
|
|
554
|
+
customer_id: string;
|
|
555
|
+
feature_id: string | string[];
|
|
556
|
+
range?: "24h" | "7d" | "30d" | "90d" | "last_cycle" | undefined;
|
|
557
|
+
}>;
|
|
558
|
+
type QueryParams = z.infer<typeof QueryParamsSchema>;
|
|
559
|
+
type QueryResult = {
|
|
560
|
+
list: Array<{
|
|
561
|
+
period: string;
|
|
562
|
+
} & {
|
|
563
|
+
[key: string]: number;
|
|
564
|
+
}>;
|
|
565
|
+
};
|
|
409
566
|
|
|
410
567
|
declare const AttachFeatureOptionsSchema: z.ZodObject<{
|
|
411
568
|
feature_id: z.ZodString;
|
|
@@ -455,13 +612,13 @@ declare const AttachParamsSchema: z.ZodObject<{
|
|
|
455
612
|
reward: z.ZodOptional<z.ZodString>;
|
|
456
613
|
}, "strip", z.ZodTypeAny, {
|
|
457
614
|
customer_id: string;
|
|
458
|
-
entity_id?: string | undefined;
|
|
459
615
|
options?: {
|
|
460
616
|
feature_id: string;
|
|
461
617
|
quantity: number;
|
|
462
618
|
}[] | undefined;
|
|
463
619
|
metadata?: Record<string, string> | undefined;
|
|
464
620
|
product_id?: string | undefined;
|
|
621
|
+
entity_id?: string | undefined;
|
|
465
622
|
product_ids?: string[] | undefined;
|
|
466
623
|
free_trial?: boolean | undefined;
|
|
467
624
|
success_url?: string | undefined;
|
|
@@ -476,13 +633,13 @@ declare const AttachParamsSchema: z.ZodObject<{
|
|
|
476
633
|
reward?: string | undefined;
|
|
477
634
|
}, {
|
|
478
635
|
customer_id: string;
|
|
479
|
-
entity_id?: string | undefined;
|
|
480
636
|
options?: {
|
|
481
637
|
feature_id: string;
|
|
482
638
|
quantity: number;
|
|
483
639
|
}[] | undefined;
|
|
484
640
|
metadata?: Record<string, string> | undefined;
|
|
485
641
|
product_id?: string | undefined;
|
|
642
|
+
entity_id?: string | undefined;
|
|
486
643
|
product_ids?: string[] | undefined;
|
|
487
644
|
free_trial?: boolean | undefined;
|
|
488
645
|
success_url?: string | undefined;
|
|
@@ -528,11 +685,11 @@ declare const CheckoutParamsSchema: z.ZodObject<{
|
|
|
528
685
|
}, "strip", z.ZodTypeAny, {
|
|
529
686
|
customer_id: string;
|
|
530
687
|
product_id: string;
|
|
531
|
-
entity_id?: string | undefined;
|
|
532
688
|
options?: {
|
|
533
689
|
feature_id: string;
|
|
534
690
|
quantity: number;
|
|
535
691
|
}[] | undefined;
|
|
692
|
+
entity_id?: string | undefined;
|
|
536
693
|
success_url?: string | undefined;
|
|
537
694
|
customer_data?: {
|
|
538
695
|
name?: string | null | undefined;
|
|
@@ -542,11 +699,11 @@ declare const CheckoutParamsSchema: z.ZodObject<{
|
|
|
542
699
|
}, {
|
|
543
700
|
customer_id: string;
|
|
544
701
|
product_id: string;
|
|
545
|
-
entity_id?: string | undefined;
|
|
546
702
|
options?: {
|
|
547
703
|
feature_id: string;
|
|
548
704
|
quantity: number;
|
|
549
705
|
}[] | undefined;
|
|
706
|
+
entity_id?: string | undefined;
|
|
550
707
|
success_url?: string | undefined;
|
|
551
708
|
customer_data?: {
|
|
552
709
|
name?: string | null | undefined;
|
|
@@ -641,18 +798,18 @@ declare class Autumn {
|
|
|
641
798
|
static checkout: (params: CheckoutParams) => Promise<Result<CheckoutResult, AutumnError>>;
|
|
642
799
|
checkout(params: CheckoutParams): Promise<Result<CheckoutResult, AutumnError>>;
|
|
643
800
|
static attach: (params: AttachParams) => Promise<Result<{
|
|
644
|
-
customer_id: string;
|
|
645
|
-
code: string;
|
|
646
801
|
message: string;
|
|
802
|
+
code: string;
|
|
803
|
+
customer_id: string;
|
|
647
804
|
product_ids: string[];
|
|
648
805
|
customer_data?: any;
|
|
649
806
|
checkout_url?: string | undefined;
|
|
650
807
|
}, AutumnError>>;
|
|
651
808
|
static usage: (params: UsageParams) => Promise<Result<UsageResult, AutumnError>>;
|
|
652
809
|
attach(params: AttachParams): Promise<Result<{
|
|
653
|
-
customer_id: string;
|
|
654
|
-
code: string;
|
|
655
810
|
message: string;
|
|
811
|
+
code: string;
|
|
812
|
+
customer_id: string;
|
|
656
813
|
product_ids: string[];
|
|
657
814
|
customer_data?: any;
|
|
658
815
|
checkout_url?: string | undefined;
|
|
@@ -672,20 +829,22 @@ declare class Autumn {
|
|
|
672
829
|
static check: (params: CheckParams) => Promise<Result<CheckResult, AutumnError>>;
|
|
673
830
|
check(params: CheckParams): Promise<Result<CheckResult, AutumnError>>;
|
|
674
831
|
static track: (params: TrackParams) => Promise<Result<{
|
|
675
|
-
customer_id: string;
|
|
676
832
|
code: string;
|
|
833
|
+
customer_id: string;
|
|
677
834
|
id: string;
|
|
678
835
|
feature_id?: string | undefined;
|
|
679
836
|
event_name?: string | undefined;
|
|
680
837
|
}, AutumnError>>;
|
|
681
838
|
track(params: TrackParams): Promise<Result<{
|
|
682
|
-
customer_id: string;
|
|
683
839
|
code: string;
|
|
840
|
+
customer_id: string;
|
|
684
841
|
id: string;
|
|
685
842
|
feature_id?: string | undefined;
|
|
686
843
|
event_name?: string | undefined;
|
|
687
844
|
}, AutumnError>>;
|
|
688
845
|
usage(params: UsageParams): Promise<Result<UsageResult, AutumnError>>;
|
|
846
|
+
static query: (params: QueryParams) => Promise<Result<QueryResult, AutumnError>>;
|
|
847
|
+
query(params: QueryParams): Promise<Result<QueryResult, AutumnError>>;
|
|
689
848
|
}
|
|
690
849
|
|
|
691
850
|
type EntityExpandOption = "invoices";
|
|
@@ -731,11 +890,11 @@ declare const RedeemReferralCodeParamsSchema: z.ZodObject<{
|
|
|
731
890
|
code: z.ZodString;
|
|
732
891
|
customer_id: z.ZodString;
|
|
733
892
|
}, "strip", z.ZodTypeAny, {
|
|
734
|
-
customer_id: string;
|
|
735
893
|
code: string;
|
|
736
|
-
}, {
|
|
737
894
|
customer_id: string;
|
|
895
|
+
}, {
|
|
738
896
|
code: string;
|
|
897
|
+
customer_id: string;
|
|
739
898
|
}>;
|
|
740
899
|
type RedeemReferralCodeParams = z.infer<typeof RedeemReferralCodeParamsSchema>;
|
|
741
900
|
|