autumn-js 0.0.77 → 0.0.80
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.js +30 -0
- package/dist/libraries/backend/better-auth.mjs +7 -7
- package/dist/libraries/backend/{chunk-J7UA442M.mjs → chunk-3VWJMYUQ.mjs} +13 -0
- package/dist/libraries/backend/{chunk-T4YSUMNB.mjs → chunk-6YOFMAEQ.mjs} +6 -6
- package/dist/libraries/backend/{chunk-Y2VYFWJD.mjs → chunk-7NHMUGUP.mjs} +1 -1
- package/dist/libraries/backend/{chunk-GUZSIYGF.mjs → chunk-CPLIRBCA.mjs} +1 -1
- package/dist/libraries/backend/{chunk-PBBWXVWW.mjs → chunk-HDGYVYU5.mjs} +1 -1
- package/dist/libraries/backend/{chunk-ZF4V3SVZ.mjs → chunk-MIWNIVVB.mjs} +1 -1
- package/dist/libraries/backend/{chunk-2JZFMBVR.mjs → chunk-PCYIWHGN.mjs} +18 -1
- package/dist/libraries/backend/express.d.mts +3 -2
- package/dist/libraries/backend/express.d.ts +3 -2
- package/dist/libraries/backend/express.js +32 -2
- package/dist/libraries/backend/express.mjs +9 -9
- package/dist/libraries/backend/fastify.d.mts +1 -0
- package/dist/libraries/backend/fastify.d.ts +1 -0
- package/dist/libraries/backend/fastify.js +49 -0
- package/dist/libraries/backend/fastify.mjs +14 -7
- package/dist/libraries/backend/hono.d.mts +2 -0
- package/dist/libraries/backend/hono.d.ts +2 -0
- package/dist/libraries/backend/hono.js +50 -1
- package/dist/libraries/backend/hono.mjs +15 -8
- package/dist/libraries/backend/next.js +30 -0
- package/dist/libraries/backend/next.mjs +7 -7
- package/dist/libraries/backend/react-router.d.mts +1 -1
- package/dist/libraries/backend/react-router.d.ts +1 -1
- package/dist/libraries/backend/react-router.js +51 -0
- package/dist/libraries/backend/react-router.mjs +16 -7
- package/dist/libraries/backend/{referralTypes-CSbCGBim.d.ts → referralTypes-3L_pJkT7.d.ts} +137 -126
- package/dist/libraries/backend/{referralTypes-DiYwS4QY.d.mts → referralTypes-BOtccenE.d.mts} +137 -126
- package/dist/libraries/backend/remix_dep.js +30 -0
- package/dist/libraries/backend/remix_dep.mjs +7 -7
- package/dist/libraries/backend/routes/backendRouter.js +30 -0
- package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
- package/dist/libraries/backend/routes/entityRoutes.js +13 -0
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +30 -0
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.js +13 -0
- package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +13 -0
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.d.mts +1 -0
- package/dist/libraries/backend/supabase.d.ts +1 -0
- package/dist/libraries/backend/supabase.js +51 -0
- package/dist/libraries/backend/supabase.mjs +16 -7
- package/dist/libraries/backend/tanstack.d.mts +1 -0
- package/dist/libraries/backend/tanstack.d.ts +1 -0
- package/dist/libraries/backend/tanstack.js +51 -0
- package/dist/libraries/backend/tanstack.mjs +16 -7
- package/dist/libraries/backend/utils/backendRes.js +13 -0
- 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 +13 -0
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +4 -5
- package/dist/libraries/react/AutumnContext.d.ts +4 -5
- package/dist/libraries/react/AutumnContext.js +19 -0
- package/dist/libraries/react/AutumnContext.mjs +7 -7
- package/dist/libraries/react/BaseAutumnProvider.css +1264 -0
- package/dist/libraries/react/BaseAutumnProvider.d.mts +4 -5
- package/dist/libraries/react/BaseAutumnProvider.d.ts +4 -5
- package/dist/libraries/react/BaseAutumnProvider.js +45 -3
- package/dist/libraries/react/BaseAutumnProvider.mjs +15 -14
- package/dist/libraries/react/{ReactAutumnClient-CrkFLuOn.d.mts → ReactAutumnClient-B-g4zQsF.d.mts} +5 -5
- package/dist/libraries/react/{ReactAutumnClient-A7x9envm.d.ts → ReactAutumnClient-BUIEn-KV.d.ts} +5 -5
- package/dist/libraries/react/ReactAutumnProvider.css +1264 -0
- package/dist/libraries/react/ReactAutumnProvider.d.mts +1 -1
- package/dist/libraries/react/ReactAutumnProvider.d.ts +1 -1
- package/dist/libraries/react/ReactAutumnProvider.js +45 -3
- package/dist/libraries/react/ReactAutumnProvider.mjs +15 -14
- package/dist/libraries/react/{chunk-XXMAVKQ4.mjs → chunk-3OBQBUE2.mjs} +2 -2
- package/dist/libraries/react/{chunk-77N4ARHR.mjs → chunk-JNM4BLTM.mjs} +6 -0
- package/dist/libraries/react/{chunk-WI6WFW54.mjs → chunk-JYOLY75Q.mjs} +3 -2
- package/dist/libraries/react/chunk-OWFX3JFF.mjs +23 -0
- package/dist/libraries/react/{chunk-EH2VPTFH.mjs → chunk-RRXCG32N.mjs} +13 -0
- package/dist/libraries/react/{chunk-UMZA5GHL.mjs → chunk-WYADGMAH.mjs} +1 -1
- package/dist/libraries/react/{chunk-FINFVKJY.mjs → chunk-XPGX7SQG.mjs} +44 -18
- package/dist/libraries/react/{chunk-4CRZJJPY.mjs → chunk-Y6UVL46W.mjs} +17 -15
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +4 -5
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +4 -5
- package/dist/libraries/react/client/ReactAutumnClient.js +19 -0
- package/dist/libraries/react/client/ReactAutumnClient.mjs +6 -6
- package/dist/libraries/react/client/clientCompMethods.d.mts +4 -5
- package/dist/libraries/react/client/clientCompMethods.d.ts +4 -5
- package/dist/libraries/react/client/clientCusMethods.d.mts +4 -5
- package/dist/libraries/react/client/clientCusMethods.d.ts +4 -5
- package/dist/libraries/react/client/clientEntityMethods.d.mts +4 -5
- package/dist/libraries/react/client/clientEntityMethods.d.ts +4 -5
- package/dist/libraries/react/client/clientGenMethods.d.mts +7 -7
- package/dist/libraries/react/client/clientGenMethods.d.ts +7 -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 +4 -5
- package/dist/libraries/react/client/clientProdMethods.d.ts +4 -5
- package/dist/libraries/react/client/clientReferralMethods.d.mts +4 -5
- package/dist/libraries/react/client/clientReferralMethods.d.ts +4 -5
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +6 -1
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +6 -1
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.css +1264 -0
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +1 -2
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +1 -2
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +45 -3
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +15 -14
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +1 -2
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +1 -2
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +1 -2
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +1 -2
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -2
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -2
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.css +1264 -0
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -2
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -2
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +62 -4
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +15 -14
- package/dist/libraries/react/cusTypes-DSlkhuov.d.mts +225 -0
- package/dist/libraries/react/cusTypes-DSlkhuov.d.ts +225 -0
- package/dist/libraries/react/{entTypes-C8jD10M8.d.ts → entTypes-CcB_hEh5.d.ts} +1 -1
- package/dist/libraries/react/{entTypes-8gkfAi3g.d.mts → entTypes-Rpnetevb.d.mts} +1 -1
- package/dist/libraries/react/errorUtils/logAuthError.js +13 -0
- package/dist/libraries/react/errorUtils/logAuthError.mjs +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.css +1264 -0
- package/dist/libraries/react/hooks/useAutumn.d.mts +4 -4
- package/dist/libraries/react/hooks/useAutumn.d.ts +4 -4
- package/dist/libraries/react/hooks/useAutumn.js +45 -3
- package/dist/libraries/react/hooks/useAutumn.mjs +15 -14
- package/dist/libraries/react/hooks/useAutumnBase.css +1264 -0
- package/dist/libraries/react/hooks/useAutumnBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useAutumnBase.d.ts +6 -6
- package/dist/libraries/react/hooks/useAutumnBase.js +45 -3
- package/dist/libraries/react/hooks/useAutumnBase.mjs +15 -14
- package/dist/libraries/react/hooks/useCustomer.css +1264 -0
- package/dist/libraries/react/hooks/useCustomer.d.mts +4 -5
- package/dist/libraries/react/hooks/useCustomer.d.ts +4 -5
- package/dist/libraries/react/hooks/useCustomer.js +45 -3
- package/dist/libraries/react/hooks/useCustomer.mjs +15 -14
- package/dist/libraries/react/hooks/useCustomerBase.css +1264 -0
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +6 -6
- package/dist/libraries/react/hooks/useCustomerBase.js +45 -3
- package/dist/libraries/react/hooks/useCustomerBase.mjs +15 -14
- package/dist/libraries/react/hooks/useEntity.css +1264 -0
- package/dist/libraries/react/hooks/useEntity.d.mts +3 -4
- package/dist/libraries/react/hooks/useEntity.d.ts +3 -4
- package/dist/libraries/react/hooks/useEntity.js +45 -3
- package/dist/libraries/react/hooks/useEntity.mjs +15 -14
- package/dist/libraries/react/hooks/useEntityBase.css +1264 -0
- package/dist/libraries/react/hooks/useEntityBase.d.mts +4 -5
- package/dist/libraries/react/hooks/useEntityBase.d.ts +4 -5
- package/dist/libraries/react/hooks/useEntityBase.js +45 -3
- package/dist/libraries/react/hooks/useEntityBase.mjs +15 -14
- package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -2
- package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -2
- package/dist/libraries/react/hooks/usePricingTable.js +20 -0
- package/dist/libraries/react/hooks/usePricingTable.mjs +9 -9
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +4 -5
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +4 -5
- package/dist/libraries/react/hooks/usePricingTableBase.js +20 -0
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +8 -8
- package/dist/libraries/react/hooks/useProductsBase.js +19 -0
- package/dist/libraries/react/hooks/useProductsBase.mjs +7 -7
- package/dist/libraries/react/index.d.ts +126 -115
- package/dist/libraries/react/index.js +87 -5
- package/dist/libraries/react/index.mjs +87 -5
- package/dist/libraries/react/{response-DLD-1iva.d.ts → response-BKKi_PDD.d.ts} +6 -3
- package/dist/libraries/react/{response-BGS7hGc7.d.mts → response-CTqlSAVK.d.mts} +6 -3
- package/dist/libraries/react/utils/inject-styles.d.mts +4 -0
- package/dist/libraries/react/utils/inject-styles.d.ts +4 -0
- package/dist/libraries/react/utils/inject-styles.js +47 -0
- package/dist/libraries/react/utils/inject-styles.mjs +10 -0
- package/dist/next/{AutumnProvider-BdIwgk_j.d.ts → AutumnProvider-CGdXoZNQ.d.mts} +116 -7
- package/dist/next/{AutumnProvider-BdIwgk_j.d.mts → AutumnProvider-CGdXoZNQ.d.ts} +116 -7
- package/dist/next/AutumnProvider.d.mts +1 -1
- package/dist/next/AutumnProvider.d.ts +1 -1
- package/dist/next/client/NextAutumnClient.d.mts +5 -4
- package/dist/next/client/NextAutumnClient.d.ts +5 -4
- package/dist/next/client/NextAutumnProvider.d.mts +1 -1
- package/dist/next/client/NextAutumnProvider.d.ts +1 -1
- package/dist/next/client/{clientGenTypes-Dh9BiE0s.d.mts → clientGenTypes-BHrxzZi_.d.mts} +12 -3
- package/dist/next/client/{clientGenTypes-CXkGuJ6W.d.ts → clientGenTypes-HDbUC8f6.d.ts} +12 -3
- package/dist/next/client/clientUtils.d.mts +2 -2
- package/dist/next/client/clientUtils.d.ts +2 -2
- package/dist/next/client/cusTypes-CSbB7Wu9.d.mts +225 -0
- package/dist/next/client/cusTypes-CSbB7Wu9.d.ts +225 -0
- package/dist/next/client/{entTypes-C1-bumir.d.mts → entTypes-6xEkbn32.d.mts} +1 -1
- package/dist/next/client/{entTypes-CKc2qHBt.d.ts → entTypes-B3R2yjLW.d.ts} +1 -1
- package/dist/next/client/error-DHbclCVh.d.mts +17 -0
- package/dist/next/client/error-DHbclCVh.d.ts +17 -0
- package/dist/next/client/hooks/useAutumn.d.mts +5 -4
- package/dist/next/client/hooks/useAutumn.d.ts +5 -4
- 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 +5 -5
- package/dist/next/client/hooks/useEntity.d.ts +5 -5
- package/dist/next/client/hooks/usePricingTable.d.mts +2 -2
- package/dist/next/client/hooks/usePricingTable.d.ts +2 -2
- package/dist/next/client/types.d.mts +2 -2
- package/dist/next/client/types.d.ts +2 -2
- package/dist/next/index.d.mts +14 -111
- package/dist/next/index.d.ts +14 -111
- 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 +12 -121
- package/dist/next/server/cusActions.d.ts +12 -121
- package/dist/next/server/cusTypes-ASrCF4fa.d.mts +244 -0
- package/dist/next/server/cusTypes-ASrCF4fa.d.ts +244 -0
- package/dist/next/server/genActions.d.mts +1 -1
- package/dist/next/server/genActions.d.ts +1 -1
- package/dist/sdk/index.d.mts +142 -131
- package/dist/sdk/index.d.ts +142 -131
- package/dist/sdk/index.js +13 -0
- package/dist/sdk/index.mjs +13 -0
- package/dist/styles/global.css +50 -3
- package/dist/utils/encryptUtils.js +13 -0
- package/dist/utils/encryptUtils.mjs +13 -0
- package/package.json +3 -2
- package/scripts/css-transform-plugin.js +28 -0
- package/scripts/post-build.js +65 -15
- package/scripts/sync-registry.ts +10 -0
- package/tsup.config.ts +6 -2
- package/tsup.dev.config.ts +6 -2
- package/dist/libraries/react/checkTypes-Bz2m_2pr.d.ts +0 -112
- package/dist/libraries/react/checkTypes-Cjk7BjiU.d.mts +0 -112
- package/dist/libraries/react/cusTypes-DNx5bwlw.d.mts +0 -116
- package/dist/libraries/react/cusTypes-DNx5bwlw.d.ts +0 -116
- package/dist/next/client/checkTypes-BVlLFoUT.d.ts +0 -128
- package/dist/next/client/checkTypes-CGZpuidI.d.mts +0 -128
- package/dist/next/client/cusTypes-CV5q3GIA.d.mts +0 -116
- package/dist/next/client/cusTypes-CV5q3GIA.d.ts +0 -116
- package/dist/next/server/cusTypes-Cc8NWXXF.d.mts +0 -124
- package/dist/next/server/cusTypes-Cc8NWXXF.d.ts +0 -124
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { R as Result, A as AttachParams, c as AutumnPromise, a as AttachResult, e as CancelParams, f as CancelResult, b as CheckParams, C as CheckResult, T as TrackParams, d as TrackResult, O as OpenBillingPortalParams, g as CreateEntityParams, G as GetEntityParams } from './clientGenTypes-
|
|
2
|
-
import { C as CustomerData,
|
|
3
|
-
import { E as Entity, D as DeleteEntityResult } from './entTypes-
|
|
1
|
+
import { R as Result, A as AttachParams, c as AutumnPromise, a as AttachResult, e as CancelParams, f as CancelResult, b as CheckParams, C as CheckResult, T as TrackParams, d as TrackResult, O as OpenBillingPortalParams, S as SetupPaymentParams, g as SetupPaymentResult, h as CreateEntityParams, G as GetEntityParams } from './clientGenTypes-BHrxzZi_.mjs';
|
|
2
|
+
import { f as ProductItem, g as ProductScenario, C as CustomerData, h as CreateCustomerParams, a as Customer, B as BillingPortalResult, P as Product } from './cusTypes-CSbB7Wu9.mjs';
|
|
3
|
+
import { E as Entity, D as DeleteEntityResult } from './entTypes-6xEkbn32.mjs';
|
|
4
4
|
import { C as CreateReferralCodeParams, a as CreateReferralCodeResult, R as RedeemReferralCodeParams, b as RedeemReferralCodeResult } from './clientReferralTypes-C9JiOk2s.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { A as AutumnError } from './error-DHbclCVh.mjs';
|
|
6
6
|
|
|
7
7
|
interface PricingTableProduct {
|
|
8
8
|
id: string;
|
|
@@ -54,6 +54,7 @@ declare class AutumnClient {
|
|
|
54
54
|
check: (params: CheckParams) => AutumnPromise<CheckResult>;
|
|
55
55
|
track: (params: TrackParams) => AutumnPromise<TrackResult>;
|
|
56
56
|
openBillingPortal: (params?: OpenBillingPortalParams | undefined) => AutumnPromise<BillingPortalResult>;
|
|
57
|
+
setupPayment: (params: SetupPaymentParams) => AutumnPromise<SetupPaymentResult>;
|
|
57
58
|
entities: {
|
|
58
59
|
create: (params: CreateEntityParams | CreateEntityParams[]) => AutumnPromise<Entity | Entity[]>;
|
|
59
60
|
get: (entityId: string, params?: GetEntityParams | undefined) => AutumnPromise<Entity>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { R as Result, A as AttachParams, c as AutumnPromise, a as AttachResult, e as CancelParams, f as CancelResult, b as CheckParams, C as CheckResult, T as TrackParams, d as TrackResult, O as OpenBillingPortalParams, g as CreateEntityParams, G as GetEntityParams } from './clientGenTypes-
|
|
2
|
-
import { C as CustomerData,
|
|
3
|
-
import { E as Entity, D as DeleteEntityResult } from './entTypes-
|
|
1
|
+
import { R as Result, A as AttachParams, c as AutumnPromise, a as AttachResult, e as CancelParams, f as CancelResult, b as CheckParams, C as CheckResult, T as TrackParams, d as TrackResult, O as OpenBillingPortalParams, S as SetupPaymentParams, g as SetupPaymentResult, h as CreateEntityParams, G as GetEntityParams } from './clientGenTypes-HDbUC8f6.js';
|
|
2
|
+
import { f as ProductItem, g as ProductScenario, C as CustomerData, h as CreateCustomerParams, a as Customer, B as BillingPortalResult, P as Product } from './cusTypes-CSbB7Wu9.js';
|
|
3
|
+
import { E as Entity, D as DeleteEntityResult } from './entTypes-B3R2yjLW.js';
|
|
4
4
|
import { C as CreateReferralCodeParams, a as CreateReferralCodeResult, R as RedeemReferralCodeParams, b as RedeemReferralCodeResult } from './clientReferralTypes-C9JiOk2s.js';
|
|
5
|
-
import {
|
|
5
|
+
import { A as AutumnError } from './error-DHbclCVh.js';
|
|
6
6
|
|
|
7
7
|
interface PricingTableProduct {
|
|
8
8
|
id: string;
|
|
@@ -54,6 +54,7 @@ declare class AutumnClient {
|
|
|
54
54
|
check: (params: CheckParams) => AutumnPromise<CheckResult>;
|
|
55
55
|
track: (params: TrackParams) => AutumnPromise<TrackResult>;
|
|
56
56
|
openBillingPortal: (params?: OpenBillingPortalParams | undefined) => AutumnPromise<BillingPortalResult>;
|
|
57
|
+
setupPayment: (params: SetupPaymentParams) => AutumnPromise<SetupPaymentResult>;
|
|
57
58
|
entities: {
|
|
58
59
|
create: (params: CreateEntityParams | CreateEntityParams[]) => AutumnPromise<Entity | Entity[]>;
|
|
59
60
|
get: (entityId: string, params?: GetEntityParams | undefined) => AutumnPromise<Entity>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CustomerData } from './cusTypes-
|
|
2
|
+
import { C as CustomerData } from './cusTypes-CSbB7Wu9.mjs';
|
|
3
3
|
|
|
4
4
|
declare const NextAutumnProvider: ({ encryptedCustomerId, customerData, children, }: {
|
|
5
5
|
encryptedCustomerId?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CustomerData } from './cusTypes-
|
|
2
|
+
import { C as CustomerData } from './cusTypes-CSbB7Wu9.js';
|
|
3
3
|
|
|
4
4
|
declare const NextAutumnProvider: ({ encryptedCustomerId, customerData, children, }: {
|
|
5
5
|
encryptedCustomerId?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CustomerData } from './cusTypes-
|
|
2
|
-
import {
|
|
1
|
+
import { C as CustomerData, i as CheckFeatureResult, j as CheckProductResult } from './cusTypes-CSbB7Wu9.mjs';
|
|
2
|
+
import { A as AutumnError } from './error-DHbclCVh.mjs';
|
|
3
3
|
|
|
4
4
|
interface CancelResult {
|
|
5
5
|
success: boolean;
|
|
@@ -22,6 +22,10 @@ interface TrackResult {
|
|
|
22
22
|
event_name?: string;
|
|
23
23
|
}
|
|
24
24
|
type CheckResult = CheckFeatureResult & CheckProductResult;
|
|
25
|
+
interface SetupPaymentResult {
|
|
26
|
+
customer_id: string;
|
|
27
|
+
url: string;
|
|
28
|
+
}
|
|
25
29
|
|
|
26
30
|
type Success<T> = {
|
|
27
31
|
data: T;
|
|
@@ -95,5 +99,10 @@ interface OpenBillingPortalParams {
|
|
|
95
99
|
returnUrl?: string;
|
|
96
100
|
openInNewTab?: boolean;
|
|
97
101
|
}
|
|
102
|
+
interface SetupPaymentParams {
|
|
103
|
+
successUrl?: string;
|
|
104
|
+
checkoutSessionParams?: Record<string, any>;
|
|
105
|
+
openInNewTab?: boolean;
|
|
106
|
+
}
|
|
98
107
|
|
|
99
|
-
export type { AttachParams as A, CheckResult as C, GetEntityParams as G, OpenBillingPortalParams as O, Result as R, TrackParams as T, AttachResult as a, CheckParams as b, AutumnPromise as c, TrackResult as d, CancelParams as e, CancelResult as f,
|
|
108
|
+
export type { AttachParams as A, CheckResult as C, GetEntityParams as G, OpenBillingPortalParams as O, Result as R, SetupPaymentParams as S, TrackParams as T, AttachResult as a, CheckParams as b, AutumnPromise as c, TrackResult as d, CancelParams as e, CancelResult as f, SetupPaymentResult as g, CreateEntityParams as h };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CustomerData } from './cusTypes-
|
|
2
|
-
import {
|
|
1
|
+
import { C as CustomerData, i as CheckFeatureResult, j as CheckProductResult } from './cusTypes-CSbB7Wu9.js';
|
|
2
|
+
import { A as AutumnError } from './error-DHbclCVh.js';
|
|
3
3
|
|
|
4
4
|
interface CancelResult {
|
|
5
5
|
success: boolean;
|
|
@@ -22,6 +22,10 @@ interface TrackResult {
|
|
|
22
22
|
event_name?: string;
|
|
23
23
|
}
|
|
24
24
|
type CheckResult = CheckFeatureResult & CheckProductResult;
|
|
25
|
+
interface SetupPaymentResult {
|
|
26
|
+
customer_id: string;
|
|
27
|
+
url: string;
|
|
28
|
+
}
|
|
25
29
|
|
|
26
30
|
type Success<T> = {
|
|
27
31
|
data: T;
|
|
@@ -95,5 +99,10 @@ interface OpenBillingPortalParams {
|
|
|
95
99
|
returnUrl?: string;
|
|
96
100
|
openInNewTab?: boolean;
|
|
97
101
|
}
|
|
102
|
+
interface SetupPaymentParams {
|
|
103
|
+
successUrl?: string;
|
|
104
|
+
checkoutSessionParams?: Record<string, any>;
|
|
105
|
+
openInNewTab?: boolean;
|
|
106
|
+
}
|
|
98
107
|
|
|
99
|
-
export type { AttachParams as A, CheckResult as C, GetEntityParams as G, OpenBillingPortalParams as O, Result as R, TrackParams as T, AttachResult as a, CheckParams as b, AutumnPromise as c, TrackResult as d, CancelParams as e, CancelResult as f,
|
|
108
|
+
export type { AttachParams as A, CheckResult as C, GetEntityParams as G, OpenBillingPortalParams as O, Result as R, SetupPaymentParams as S, TrackParams as T, AttachResult as a, CheckParams as b, AutumnPromise as c, TrackResult as d, CancelParams as e, CancelResult as f, SetupPaymentResult as g, CreateEntityParams as h };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AutumnClientError, PricingTableProduct } from './types.mjs';
|
|
2
|
-
import './cusTypes-
|
|
3
|
-
import './entTypes-
|
|
2
|
+
import './cusTypes-CSbB7Wu9.mjs';
|
|
3
|
+
import './entTypes-6xEkbn32.mjs';
|
|
4
4
|
|
|
5
5
|
declare const toClientErrorResponse: (error: any) => {
|
|
6
6
|
data: null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AutumnClientError, PricingTableProduct } from './types.js';
|
|
2
|
-
import './cusTypes-
|
|
3
|
-
import './entTypes-
|
|
2
|
+
import './cusTypes-CSbB7Wu9.js';
|
|
3
|
+
import './entTypes-B3R2yjLW.js';
|
|
4
4
|
|
|
5
5
|
declare const toClientErrorResponse: (error: any) => {
|
|
6
6
|
data: null;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
declare const Infinite = "inf";
|
|
2
|
+
declare enum FreeTrialDuration {
|
|
3
|
+
Day = "day"
|
|
4
|
+
}
|
|
5
|
+
declare enum UsageModel {
|
|
6
|
+
Prepaid = "prepaid",
|
|
7
|
+
PayPerUse = "pay_per_use"
|
|
8
|
+
}
|
|
9
|
+
type UsageModelType = "prepaid" | "pay_per_use";
|
|
10
|
+
declare enum ProductItemInterval {
|
|
11
|
+
Minute = "minute",
|
|
12
|
+
Hour = "hour",
|
|
13
|
+
Day = "day",
|
|
14
|
+
Week = "week",
|
|
15
|
+
Month = "month",
|
|
16
|
+
Quarter = "quarter",
|
|
17
|
+
SemiAnnual = "semi_annual",
|
|
18
|
+
Year = "year",
|
|
19
|
+
Multiple = "multiple"
|
|
20
|
+
}
|
|
21
|
+
type ProductItemIntervalType = "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | "multiple";
|
|
22
|
+
|
|
23
|
+
type CheckFeatureScenario = "usage_limit" | "feature_flag";
|
|
24
|
+
interface CheckFeatureResult extends CoreCustomerFeature {
|
|
25
|
+
allowed: boolean;
|
|
26
|
+
feature_id: string;
|
|
27
|
+
customer_id: string;
|
|
28
|
+
entity_id?: string;
|
|
29
|
+
required_balance: number;
|
|
30
|
+
code: string;
|
|
31
|
+
preview?: CheckFeaturePreview;
|
|
32
|
+
}
|
|
33
|
+
interface CheckFeaturePreview {
|
|
34
|
+
scenario: CheckFeatureScenario;
|
|
35
|
+
title: string;
|
|
36
|
+
message: string;
|
|
37
|
+
feature_id: string;
|
|
38
|
+
feature_name: string;
|
|
39
|
+
products: Product[];
|
|
40
|
+
}
|
|
41
|
+
type ProductScenario = "scheduled" | "active" | "new" | "renew" | "upgrade" | "downgrade" | "cancel";
|
|
42
|
+
interface CheckProductResult {
|
|
43
|
+
allowed: boolean;
|
|
44
|
+
customer_id: string;
|
|
45
|
+
product_id: string;
|
|
46
|
+
code: string;
|
|
47
|
+
status?: string;
|
|
48
|
+
preview?: CheckProductPreview;
|
|
49
|
+
}
|
|
50
|
+
interface CheckProductPreview {
|
|
51
|
+
scenario: ProductScenario;
|
|
52
|
+
product_id: string;
|
|
53
|
+
product_name: string;
|
|
54
|
+
recurring: boolean;
|
|
55
|
+
error_on_attach?: boolean;
|
|
56
|
+
next_cycle_at?: number;
|
|
57
|
+
current_product_name?: string;
|
|
58
|
+
items?: {
|
|
59
|
+
price: string;
|
|
60
|
+
description: string;
|
|
61
|
+
usage_model?: UsageModelType;
|
|
62
|
+
}[];
|
|
63
|
+
options?: {
|
|
64
|
+
feature_id: string;
|
|
65
|
+
feature_name: string;
|
|
66
|
+
billing_units: number;
|
|
67
|
+
price?: number;
|
|
68
|
+
tiers?: {
|
|
69
|
+
to: number | string;
|
|
70
|
+
amount: number;
|
|
71
|
+
}[];
|
|
72
|
+
}[];
|
|
73
|
+
due_today?: {
|
|
74
|
+
price: number;
|
|
75
|
+
currency: string;
|
|
76
|
+
};
|
|
77
|
+
due_next_cycle?: {
|
|
78
|
+
price: number;
|
|
79
|
+
currency: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare enum AppEnv {
|
|
84
|
+
Sandbox = "sandbox",
|
|
85
|
+
Live = "live"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface ProductItem {
|
|
89
|
+
feature_id?: string;
|
|
90
|
+
included_usage?: number | typeof Infinite;
|
|
91
|
+
interval?: ProductItemIntervalType;
|
|
92
|
+
usage_model?: UsageModel;
|
|
93
|
+
price?: number;
|
|
94
|
+
billing_units?: number;
|
|
95
|
+
entity_feature_id?: string;
|
|
96
|
+
reset_usage_when_enabled?: boolean;
|
|
97
|
+
display?: {
|
|
98
|
+
primary_text?: string;
|
|
99
|
+
secondary_text?: string;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
interface FreeTrial {
|
|
103
|
+
duration: FreeTrialDuration;
|
|
104
|
+
length: number;
|
|
105
|
+
unique_fingerprint: boolean;
|
|
106
|
+
trial_available?: boolean;
|
|
107
|
+
}
|
|
108
|
+
interface Product {
|
|
109
|
+
id: string;
|
|
110
|
+
created_at: number;
|
|
111
|
+
name: string;
|
|
112
|
+
env: AppEnv;
|
|
113
|
+
is_add_on: boolean;
|
|
114
|
+
is_default: boolean;
|
|
115
|
+
group: string;
|
|
116
|
+
version: number;
|
|
117
|
+
items: ProductItem[];
|
|
118
|
+
free_trial: FreeTrial | null;
|
|
119
|
+
scenario?: ProductScenario;
|
|
120
|
+
base_variant_id: string | null;
|
|
121
|
+
properties?: {
|
|
122
|
+
is_free?: boolean;
|
|
123
|
+
is_one_off?: boolean;
|
|
124
|
+
interval_group?: string;
|
|
125
|
+
};
|
|
126
|
+
display?: {
|
|
127
|
+
name?: string;
|
|
128
|
+
description?: string;
|
|
129
|
+
button_text?: string;
|
|
130
|
+
recommend_text?: string;
|
|
131
|
+
everything_from?: string;
|
|
132
|
+
button_url?: string;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
declare enum ProductStatus {
|
|
137
|
+
Active = "active",
|
|
138
|
+
Expired = "expired",
|
|
139
|
+
Trialing = "trialing",
|
|
140
|
+
Scheduled = "scheduled",
|
|
141
|
+
PastDue = "past_due"
|
|
142
|
+
}
|
|
143
|
+
type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method";
|
|
144
|
+
|
|
145
|
+
interface CoreCustomerFeature {
|
|
146
|
+
unlimited?: boolean;
|
|
147
|
+
interval?: ProductItemInterval | null;
|
|
148
|
+
balance?: number;
|
|
149
|
+
usage?: number;
|
|
150
|
+
included_usage?: number;
|
|
151
|
+
next_reset_at?: number | null;
|
|
152
|
+
overage_allowed?: boolean;
|
|
153
|
+
breakdown?: {
|
|
154
|
+
interval: ProductItemInterval;
|
|
155
|
+
balance?: number;
|
|
156
|
+
usage?: number;
|
|
157
|
+
included_usage?: number;
|
|
158
|
+
next_reset_at?: number;
|
|
159
|
+
}[];
|
|
160
|
+
credit_schema?: {
|
|
161
|
+
feature_id: string;
|
|
162
|
+
credit_amount: number;
|
|
163
|
+
}[];
|
|
164
|
+
}
|
|
165
|
+
interface CustomerFeature extends CoreCustomerFeature {
|
|
166
|
+
id: string;
|
|
167
|
+
name: string;
|
|
168
|
+
type: "static" | "single_use" | "continuous_use";
|
|
169
|
+
}
|
|
170
|
+
interface CustomerProduct {
|
|
171
|
+
id: string;
|
|
172
|
+
name: string | null;
|
|
173
|
+
group: string | null;
|
|
174
|
+
status: ProductStatus;
|
|
175
|
+
started_at: number;
|
|
176
|
+
canceled_at: number | null;
|
|
177
|
+
subscription_ids?: string[] | null;
|
|
178
|
+
current_period_start?: number | null;
|
|
179
|
+
current_period_end?: number | null;
|
|
180
|
+
trial_ends_at?: number;
|
|
181
|
+
entity_id?: string;
|
|
182
|
+
is_add_on: boolean;
|
|
183
|
+
is_default: boolean;
|
|
184
|
+
items: ProductItem[];
|
|
185
|
+
}
|
|
186
|
+
interface Customer {
|
|
187
|
+
id: string | null;
|
|
188
|
+
created_at: number;
|
|
189
|
+
name: string | null;
|
|
190
|
+
email: string | null;
|
|
191
|
+
fingerprint: string | null;
|
|
192
|
+
stripe_id: string | null;
|
|
193
|
+
env: AppEnv;
|
|
194
|
+
metadata: Record<string, any>;
|
|
195
|
+
products: CustomerProduct[];
|
|
196
|
+
features: Record<string, CustomerFeature>;
|
|
197
|
+
invoices?: CustomerInvoice[];
|
|
198
|
+
}
|
|
199
|
+
interface CustomerData {
|
|
200
|
+
name?: string;
|
|
201
|
+
email?: string;
|
|
202
|
+
fingerprint?: string;
|
|
203
|
+
}
|
|
204
|
+
interface CreateCustomerParams {
|
|
205
|
+
id?: string | null;
|
|
206
|
+
email?: string | null;
|
|
207
|
+
name?: string | null;
|
|
208
|
+
fingerprint?: string | null;
|
|
209
|
+
metadata?: Record<string, any>;
|
|
210
|
+
expand?: CustomerExpandOption[];
|
|
211
|
+
}
|
|
212
|
+
interface BillingPortalResult {
|
|
213
|
+
customer_id: string;
|
|
214
|
+
url: string;
|
|
215
|
+
}
|
|
216
|
+
interface CustomerInvoice {
|
|
217
|
+
product_ids: string[];
|
|
218
|
+
stripe_id: string;
|
|
219
|
+
status: string;
|
|
220
|
+
total: number;
|
|
221
|
+
currency: string;
|
|
222
|
+
created_at: number;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export type { BillingPortalResult as B, CustomerData as C, Product as P, Customer as a, CustomerExpandOption as b, CustomerProduct as c, CustomerFeature as d, CustomerInvoice as e, ProductItem as f, ProductScenario as g, CreateCustomerParams as h, CheckFeatureResult as i, CheckProductResult as j };
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
declare const Infinite = "inf";
|
|
2
|
+
declare enum FreeTrialDuration {
|
|
3
|
+
Day = "day"
|
|
4
|
+
}
|
|
5
|
+
declare enum UsageModel {
|
|
6
|
+
Prepaid = "prepaid",
|
|
7
|
+
PayPerUse = "pay_per_use"
|
|
8
|
+
}
|
|
9
|
+
type UsageModelType = "prepaid" | "pay_per_use";
|
|
10
|
+
declare enum ProductItemInterval {
|
|
11
|
+
Minute = "minute",
|
|
12
|
+
Hour = "hour",
|
|
13
|
+
Day = "day",
|
|
14
|
+
Week = "week",
|
|
15
|
+
Month = "month",
|
|
16
|
+
Quarter = "quarter",
|
|
17
|
+
SemiAnnual = "semi_annual",
|
|
18
|
+
Year = "year",
|
|
19
|
+
Multiple = "multiple"
|
|
20
|
+
}
|
|
21
|
+
type ProductItemIntervalType = "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | "multiple";
|
|
22
|
+
|
|
23
|
+
type CheckFeatureScenario = "usage_limit" | "feature_flag";
|
|
24
|
+
interface CheckFeatureResult extends CoreCustomerFeature {
|
|
25
|
+
allowed: boolean;
|
|
26
|
+
feature_id: string;
|
|
27
|
+
customer_id: string;
|
|
28
|
+
entity_id?: string;
|
|
29
|
+
required_balance: number;
|
|
30
|
+
code: string;
|
|
31
|
+
preview?: CheckFeaturePreview;
|
|
32
|
+
}
|
|
33
|
+
interface CheckFeaturePreview {
|
|
34
|
+
scenario: CheckFeatureScenario;
|
|
35
|
+
title: string;
|
|
36
|
+
message: string;
|
|
37
|
+
feature_id: string;
|
|
38
|
+
feature_name: string;
|
|
39
|
+
products: Product[];
|
|
40
|
+
}
|
|
41
|
+
type ProductScenario = "scheduled" | "active" | "new" | "renew" | "upgrade" | "downgrade" | "cancel";
|
|
42
|
+
interface CheckProductResult {
|
|
43
|
+
allowed: boolean;
|
|
44
|
+
customer_id: string;
|
|
45
|
+
product_id: string;
|
|
46
|
+
code: string;
|
|
47
|
+
status?: string;
|
|
48
|
+
preview?: CheckProductPreview;
|
|
49
|
+
}
|
|
50
|
+
interface CheckProductPreview {
|
|
51
|
+
scenario: ProductScenario;
|
|
52
|
+
product_id: string;
|
|
53
|
+
product_name: string;
|
|
54
|
+
recurring: boolean;
|
|
55
|
+
error_on_attach?: boolean;
|
|
56
|
+
next_cycle_at?: number;
|
|
57
|
+
current_product_name?: string;
|
|
58
|
+
items?: {
|
|
59
|
+
price: string;
|
|
60
|
+
description: string;
|
|
61
|
+
usage_model?: UsageModelType;
|
|
62
|
+
}[];
|
|
63
|
+
options?: {
|
|
64
|
+
feature_id: string;
|
|
65
|
+
feature_name: string;
|
|
66
|
+
billing_units: number;
|
|
67
|
+
price?: number;
|
|
68
|
+
tiers?: {
|
|
69
|
+
to: number | string;
|
|
70
|
+
amount: number;
|
|
71
|
+
}[];
|
|
72
|
+
}[];
|
|
73
|
+
due_today?: {
|
|
74
|
+
price: number;
|
|
75
|
+
currency: string;
|
|
76
|
+
};
|
|
77
|
+
due_next_cycle?: {
|
|
78
|
+
price: number;
|
|
79
|
+
currency: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare enum AppEnv {
|
|
84
|
+
Sandbox = "sandbox",
|
|
85
|
+
Live = "live"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface ProductItem {
|
|
89
|
+
feature_id?: string;
|
|
90
|
+
included_usage?: number | typeof Infinite;
|
|
91
|
+
interval?: ProductItemIntervalType;
|
|
92
|
+
usage_model?: UsageModel;
|
|
93
|
+
price?: number;
|
|
94
|
+
billing_units?: number;
|
|
95
|
+
entity_feature_id?: string;
|
|
96
|
+
reset_usage_when_enabled?: boolean;
|
|
97
|
+
display?: {
|
|
98
|
+
primary_text?: string;
|
|
99
|
+
secondary_text?: string;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
interface FreeTrial {
|
|
103
|
+
duration: FreeTrialDuration;
|
|
104
|
+
length: number;
|
|
105
|
+
unique_fingerprint: boolean;
|
|
106
|
+
trial_available?: boolean;
|
|
107
|
+
}
|
|
108
|
+
interface Product {
|
|
109
|
+
id: string;
|
|
110
|
+
created_at: number;
|
|
111
|
+
name: string;
|
|
112
|
+
env: AppEnv;
|
|
113
|
+
is_add_on: boolean;
|
|
114
|
+
is_default: boolean;
|
|
115
|
+
group: string;
|
|
116
|
+
version: number;
|
|
117
|
+
items: ProductItem[];
|
|
118
|
+
free_trial: FreeTrial | null;
|
|
119
|
+
scenario?: ProductScenario;
|
|
120
|
+
base_variant_id: string | null;
|
|
121
|
+
properties?: {
|
|
122
|
+
is_free?: boolean;
|
|
123
|
+
is_one_off?: boolean;
|
|
124
|
+
interval_group?: string;
|
|
125
|
+
};
|
|
126
|
+
display?: {
|
|
127
|
+
name?: string;
|
|
128
|
+
description?: string;
|
|
129
|
+
button_text?: string;
|
|
130
|
+
recommend_text?: string;
|
|
131
|
+
everything_from?: string;
|
|
132
|
+
button_url?: string;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
declare enum ProductStatus {
|
|
137
|
+
Active = "active",
|
|
138
|
+
Expired = "expired",
|
|
139
|
+
Trialing = "trialing",
|
|
140
|
+
Scheduled = "scheduled",
|
|
141
|
+
PastDue = "past_due"
|
|
142
|
+
}
|
|
143
|
+
type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method";
|
|
144
|
+
|
|
145
|
+
interface CoreCustomerFeature {
|
|
146
|
+
unlimited?: boolean;
|
|
147
|
+
interval?: ProductItemInterval | null;
|
|
148
|
+
balance?: number;
|
|
149
|
+
usage?: number;
|
|
150
|
+
included_usage?: number;
|
|
151
|
+
next_reset_at?: number | null;
|
|
152
|
+
overage_allowed?: boolean;
|
|
153
|
+
breakdown?: {
|
|
154
|
+
interval: ProductItemInterval;
|
|
155
|
+
balance?: number;
|
|
156
|
+
usage?: number;
|
|
157
|
+
included_usage?: number;
|
|
158
|
+
next_reset_at?: number;
|
|
159
|
+
}[];
|
|
160
|
+
credit_schema?: {
|
|
161
|
+
feature_id: string;
|
|
162
|
+
credit_amount: number;
|
|
163
|
+
}[];
|
|
164
|
+
}
|
|
165
|
+
interface CustomerFeature extends CoreCustomerFeature {
|
|
166
|
+
id: string;
|
|
167
|
+
name: string;
|
|
168
|
+
type: "static" | "single_use" | "continuous_use";
|
|
169
|
+
}
|
|
170
|
+
interface CustomerProduct {
|
|
171
|
+
id: string;
|
|
172
|
+
name: string | null;
|
|
173
|
+
group: string | null;
|
|
174
|
+
status: ProductStatus;
|
|
175
|
+
started_at: number;
|
|
176
|
+
canceled_at: number | null;
|
|
177
|
+
subscription_ids?: string[] | null;
|
|
178
|
+
current_period_start?: number | null;
|
|
179
|
+
current_period_end?: number | null;
|
|
180
|
+
trial_ends_at?: number;
|
|
181
|
+
entity_id?: string;
|
|
182
|
+
is_add_on: boolean;
|
|
183
|
+
is_default: boolean;
|
|
184
|
+
items: ProductItem[];
|
|
185
|
+
}
|
|
186
|
+
interface Customer {
|
|
187
|
+
id: string | null;
|
|
188
|
+
created_at: number;
|
|
189
|
+
name: string | null;
|
|
190
|
+
email: string | null;
|
|
191
|
+
fingerprint: string | null;
|
|
192
|
+
stripe_id: string | null;
|
|
193
|
+
env: AppEnv;
|
|
194
|
+
metadata: Record<string, any>;
|
|
195
|
+
products: CustomerProduct[];
|
|
196
|
+
features: Record<string, CustomerFeature>;
|
|
197
|
+
invoices?: CustomerInvoice[];
|
|
198
|
+
}
|
|
199
|
+
interface CustomerData {
|
|
200
|
+
name?: string;
|
|
201
|
+
email?: string;
|
|
202
|
+
fingerprint?: string;
|
|
203
|
+
}
|
|
204
|
+
interface CreateCustomerParams {
|
|
205
|
+
id?: string | null;
|
|
206
|
+
email?: string | null;
|
|
207
|
+
name?: string | null;
|
|
208
|
+
fingerprint?: string | null;
|
|
209
|
+
metadata?: Record<string, any>;
|
|
210
|
+
expand?: CustomerExpandOption[];
|
|
211
|
+
}
|
|
212
|
+
interface BillingPortalResult {
|
|
213
|
+
customer_id: string;
|
|
214
|
+
url: string;
|
|
215
|
+
}
|
|
216
|
+
interface CustomerInvoice {
|
|
217
|
+
product_ids: string[];
|
|
218
|
+
stripe_id: string;
|
|
219
|
+
status: string;
|
|
220
|
+
total: number;
|
|
221
|
+
currency: string;
|
|
222
|
+
created_at: number;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export type { BillingPortalResult as B, CustomerData as C, Product as P, Customer as a, CustomerExpandOption as b, CustomerProduct as c, CustomerFeature as d, CustomerInvoice as e, ProductItem as f, ProductScenario as g, CreateCustomerParams as h, CheckFeatureResult as i, CheckProductResult as j };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface ErrorResponse {
|
|
2
|
+
message: string;
|
|
3
|
+
code: string;
|
|
4
|
+
}
|
|
5
|
+
declare class AutumnError extends Error {
|
|
6
|
+
readonly message: string;
|
|
7
|
+
readonly code: string;
|
|
8
|
+
constructor(response: ErrorResponse);
|
|
9
|
+
static fromError(error: any): AutumnError;
|
|
10
|
+
toString(): string;
|
|
11
|
+
toJSON(): {
|
|
12
|
+
message: string;
|
|
13
|
+
code: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { AutumnError as A };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface ErrorResponse {
|
|
2
|
+
message: string;
|
|
3
|
+
code: string;
|
|
4
|
+
}
|
|
5
|
+
declare class AutumnError extends Error {
|
|
6
|
+
readonly message: string;
|
|
7
|
+
readonly code: string;
|
|
8
|
+
constructor(response: ErrorResponse);
|
|
9
|
+
static fromError(error: any): AutumnError;
|
|
10
|
+
toString(): string;
|
|
11
|
+
toJSON(): {
|
|
12
|
+
message: string;
|
|
13
|
+
code: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { AutumnError as A };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { A as AttachParams, R as Result,
|
|
2
|
-
import { A as AutumnError } from '../
|
|
3
|
-
import { B as BillingPortalResult } from '../cusTypes-
|
|
1
|
+
import { A as AttachParams, R as Result, a as AttachResult, C as CheckResult, b as CheckParams, c as AutumnPromise, T as TrackParams, d as TrackResult, e as CancelParams, f as CancelResult, O as OpenBillingPortalParams, S as SetupPaymentParams, g as SetupPaymentResult } from '../clientGenTypes-BHrxzZi_.mjs';
|
|
2
|
+
import { A as AutumnError } from '../error-DHbclCVh.mjs';
|
|
3
|
+
import { B as BillingPortalResult } from '../cusTypes-CSbB7Wu9.mjs';
|
|
4
4
|
|
|
5
5
|
declare const useAutumn: () => {
|
|
6
|
-
attach: (params: AttachParams) => Promise<Result<
|
|
6
|
+
attach: (params: AttachParams) => Promise<Result<AttachResult | CheckResult, AutumnError>>;
|
|
7
7
|
check: (params: CheckParams) => AutumnPromise<CheckResult>;
|
|
8
8
|
track: (params: TrackParams) => AutumnPromise<TrackResult>;
|
|
9
9
|
cancel: (params: CancelParams) => AutumnPromise<CancelResult>;
|
|
10
10
|
openBillingPortal: (params?: OpenBillingPortalParams) => AutumnPromise<BillingPortalResult>;
|
|
11
|
+
setupPayment: (params?: SetupPaymentParams) => AutumnPromise<SetupPaymentResult>;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export { useAutumn };
|