autumn-js 0.1.6 → 0.1.8
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 +28 -0
- package/dist/libraries/backend/better-auth.mjs +7 -7
- package/dist/libraries/backend/{chunk-NTPYEOME.mjs → chunk-33ET4N4V.mjs} +1 -1
- package/dist/libraries/backend/{chunk-TTNUEXHB.mjs → chunk-AREWK25J.mjs} +28 -0
- package/dist/libraries/backend/{chunk-2LSEWYPD.mjs → chunk-BRZHNRU5.mjs} +10 -10
- package/dist/libraries/backend/{chunk-WBYCMG34.mjs → chunk-GO7TVFSN.mjs} +1 -1
- package/dist/libraries/backend/{chunk-7Z2OYXN4.mjs → chunk-LL53FE2Z.mjs} +1 -1
- package/dist/libraries/backend/{chunk-Y63QWBQ6.mjs → chunk-TFYLV3GN.mjs} +1 -1
- package/dist/libraries/backend/{chunk-QVLMREDB.mjs → chunk-VBHBF3GP.mjs} +1 -1
- package/dist/libraries/backend/convex.js +28 -0
- package/dist/libraries/backend/convex.mjs +7 -7
- package/dist/libraries/backend/elysia.js +28 -0
- 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 +28 -0
- package/dist/libraries/backend/express.mjs +7 -7
- package/dist/libraries/backend/fastify.js +28 -0
- package/dist/libraries/backend/fastify.mjs +7 -7
- package/dist/libraries/backend/hono.js +28 -0
- package/dist/libraries/backend/hono.mjs +7 -7
- package/dist/libraries/backend/index.d.mts +1 -1
- package/dist/libraries/backend/index.d.ts +1 -1
- package/dist/libraries/backend/index.js +28 -0
- package/dist/libraries/backend/index.mjs +7 -7
- package/dist/libraries/backend/next.js +28 -0
- package/dist/libraries/backend/next.mjs +7 -7
- package/dist/libraries/backend/react-router.js +28 -0
- package/dist/libraries/backend/react-router.mjs +7 -7
- package/dist/libraries/backend/{referralTypes-CYvuZZeF.d.mts → referralTypes-DyuV6oJo.d.mts} +69 -2
- package/dist/libraries/backend/{referralTypes-B0_fYSI3.d.ts → referralTypes-zcdPSX-p.d.ts} +69 -2
- package/dist/libraries/backend/remix_dep.js +28 -0
- package/dist/libraries/backend/remix_dep.mjs +7 -7
- package/dist/libraries/backend/routes/backendRouter.js +28 -0
- package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
- package/dist/libraries/backend/routes/entityRoutes.js +28 -0
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +28 -0
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.js +28 -0
- package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +28 -0
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +28 -0
- package/dist/libraries/backend/supabase.mjs +7 -7
- package/dist/libraries/backend/tanstack.js +28 -0
- package/dist/libraries/backend/tanstack.mjs +7 -7
- package/dist/libraries/backend/utils/backendRes.js +28 -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 +28 -0
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +6 -6
- package/dist/libraries/react/AutumnContext.d.ts +6 -6
- package/dist/libraries/react/AutumnContext.js +35 -1
- package/dist/libraries/react/AutumnContext.mjs +3 -3
- package/dist/libraries/react/BaseAutumnProvider.d.mts +6 -6
- package/dist/libraries/react/BaseAutumnProvider.d.ts +6 -6
- package/dist/libraries/react/BaseAutumnProvider.js +40 -2
- package/dist/libraries/react/BaseAutumnProvider.mjs +8 -8
- package/dist/libraries/react/{ReactAutumnClient-CK8k8OA5.d.ts → ReactAutumnClient-BUq9E84_.d.ts} +20 -18
- package/dist/libraries/react/{ReactAutumnClient-CjaZ_g4X.d.mts → ReactAutumnClient-CpAGyyur.d.mts} +20 -18
- package/dist/libraries/react/ReactAutumnProvider.d.mts +4 -3
- package/dist/libraries/react/ReactAutumnProvider.d.ts +4 -3
- package/dist/libraries/react/ReactAutumnProvider.js +44 -4
- package/dist/libraries/react/ReactAutumnProvider.mjs +9 -9
- package/dist/libraries/react/{attachTypes-BetWkt95.d.ts → attachTypes-CcB6xjSF.d.ts} +5 -5
- package/dist/libraries/react/{attachTypes-DbI59BLC.d.mts → attachTypes-DqUN3q8s.d.mts} +5 -5
- package/dist/libraries/react/{chunk-OTZ65PCT.mjs → chunk-2TQBFCWM.mjs} +4 -4
- package/dist/libraries/react/{chunk-FEISQQNM.mjs → chunk-5K2M3CQZ.mjs} +1 -1
- package/dist/libraries/react/{chunk-SFDHYUHA.mjs → chunk-5OJIHAX7.mjs} +6 -2
- package/dist/libraries/react/{chunk-PGU4IXT7.mjs → chunk-6I7KWRND.mjs} +1 -1
- package/dist/libraries/react/{chunk-F5QUME7S.mjs → chunk-A5YPS4K4.mjs} +3 -3
- package/dist/libraries/react/{chunk-FJWZPMWU.mjs → chunk-BXMZYHE7.mjs} +3 -3
- package/dist/libraries/react/{chunk-IM2FNHYV.mjs → chunk-HUKIJ7DB.mjs} +2 -2
- package/dist/libraries/react/{chunk-QW2YS3JY.mjs → chunk-I6BTXKGK.mjs} +2 -2
- package/dist/libraries/react/{chunk-QV6Q2XXO.mjs → chunk-IDSAD3KF.mjs} +8 -2
- package/dist/libraries/react/{chunk-GUDRYJ3O.mjs → chunk-JK2TFCOG.mjs} +2 -2
- package/dist/libraries/react/{chunk-7AJBRRXV.mjs → chunk-JNR7QAPG.mjs} +1 -1
- package/dist/libraries/react/{chunk-KUS3X33V.mjs → chunk-M7SUFZ42.mjs} +1 -1
- package/dist/libraries/react/{chunk-W5XUD2S6.mjs → chunk-MW2FSYG3.mjs} +1 -1
- package/dist/libraries/react/{chunk-YWQTQ72B.mjs → chunk-NHDZWWMZ.mjs} +2 -2
- package/dist/libraries/react/{chunk-7PFOXY3Y.mjs → chunk-OUWRRLOI.mjs} +444 -441
- package/dist/libraries/react/{chunk-TJMYXANS.mjs → chunk-T3B4TVD4.mjs} +1 -1
- package/dist/libraries/react/{chunk-ZT5TN67S.mjs → chunk-TM6QWQLU.mjs} +7 -5
- package/dist/libraries/react/{chunk-KLSRAX2F.mjs → chunk-UOJ6NIVD.mjs} +3 -3
- package/dist/libraries/react/{chunk-33OTK7MB.mjs → chunk-WEKDMT3Y.mjs} +1 -1
- package/dist/libraries/react/{chunk-KZVVSY52.mjs → chunk-WH5MYLSM.mjs} +2 -2
- package/dist/libraries/react/{chunk-EK2RMWXP.mjs → chunk-WQXUZO6K.mjs} +28 -0
- package/dist/libraries/react/{chunk-I2A7PK2L.mjs → chunk-WT5K3J2K.mjs} +17 -17
- package/dist/libraries/react/{chunk-JGDTNJTR.mjs → chunk-YCDNQZT5.mjs} +2 -2
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -6
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -6
- package/dist/libraries/react/client/ReactAutumnClient.js +35 -1
- package/dist/libraries/react/client/ReactAutumnClient.mjs +2 -2
- package/dist/libraries/react/client/clientCompMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientCompMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientCusMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientCusMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientGenMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientGenMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientProdMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientProdMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -6
- package/dist/libraries/react/client/types/clientAttachTypes.d.mts +20 -20
- package/dist/libraries/react/client/types/clientAttachTypes.d.ts +20 -20
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +4 -4
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +4 -4
- package/dist/libraries/react/client/types/clientGenTypes.js +28 -0
- package/dist/libraries/react/client/types/clientGenTypes.mjs +1 -1
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.mts +2 -2
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.ts +2 -2
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.js +43 -4
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +27 -27
- package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.mts +2 -2
- package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.ts +2 -2
- package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.mts +1 -1
- package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.ts +1 -1
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.js +35 -1
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +27 -27
- 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 +43 -4
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +27 -27
- package/dist/libraries/react/components/ui/accordion.mjs +3 -3
- 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 +4 -4
- package/dist/libraries/react/components/ui/popover.mjs +5 -5
- package/dist/libraries/react/components/ui/switch.mjs +3 -3
- package/dist/libraries/react/{cusTypes-DINgmPwV.d.mts → cusTypes-CSmAk5io.d.mts} +5 -5
- package/dist/libraries/react/{cusTypes-D5d_cu-K.d.ts → cusTypes-DHjT-9rV.d.ts} +5 -5
- package/dist/libraries/react/{entTypes-DNW_l3s0.d.ts → entTypes-CoF9enrR.d.ts} +1 -1
- package/dist/libraries/react/{entTypes-biskqmpT.d.mts → entTypes-S4hkh1RG.d.mts} +1 -1
- package/dist/libraries/react/{genTypes-EyxQImzh.d.ts → genTypes-DsiuvyWS.d.ts} +5 -5
- package/dist/libraries/react/{genTypes-DSvR32on.d.mts → genTypes-fEH_nqSm.d.mts} +5 -5
- package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +6 -6
- package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +6 -6
- package/dist/libraries/react/hooks/helpers/handleCheck.js +28 -0
- package/dist/libraries/react/hooks/helpers/handleCheck.mjs +2 -2
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +7 -7
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +7 -7
- package/dist/libraries/react/hooks/helpers/useAutumnBase.js +33 -1
- package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +3 -3
- package/dist/libraries/react/hooks/useAnalytics.d.mts +2 -2
- package/dist/libraries/react/hooks/useAnalytics.d.ts +2 -2
- package/dist/libraries/react/hooks/useAnalytics.js +35 -1
- package/dist/libraries/react/hooks/useAnalytics.mjs +4 -4
- package/dist/libraries/react/hooks/useCustomer.d.mts +6 -6
- package/dist/libraries/react/hooks/useCustomer.d.ts +6 -6
- package/dist/libraries/react/hooks/useCustomer.js +40 -2
- package/dist/libraries/react/hooks/useCustomer.mjs +8 -8
- 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 +40 -2
- package/dist/libraries/react/hooks/useCustomerBase.mjs +7 -7
- package/dist/libraries/react/hooks/useEntity.d.mts +4 -4
- package/dist/libraries/react/hooks/useEntity.d.ts +4 -4
- package/dist/libraries/react/hooks/useEntity.js +40 -2
- package/dist/libraries/react/hooks/useEntity.mjs +8 -8
- package/dist/libraries/react/hooks/useEntityBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useEntityBase.d.ts +6 -6
- package/dist/libraries/react/hooks/useEntityBase.js +40 -2
- package/dist/libraries/react/hooks/useEntityBase.mjs +7 -7
- package/dist/libraries/react/hooks/usePaywall.d.mts +1 -1
- package/dist/libraries/react/hooks/usePaywall.d.ts +1 -1
- package/dist/libraries/react/hooks/usePaywall.js +35 -1
- package/dist/libraries/react/hooks/usePaywall.mjs +4 -4
- 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 +35 -1
- package/dist/libraries/react/hooks/usePricingTable.mjs +5 -5
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -6
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -6
- package/dist/libraries/react/hooks/usePricingTableBase.js +28 -0
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -2
- package/dist/libraries/react/hooks/useProductsBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useProductsBase.d.ts +6 -6
- package/dist/libraries/react/index.d.mts +2 -1
- package/dist/libraries/react/index.d.ts +2 -1
- package/dist/libraries/react/index.js +47 -6
- package/dist/libraries/react/index.mjs +47 -6
- package/dist/libraries/react/{prodTypes-Bmoibf-M.d.mts → prodTypes--VvnyGlN.d.mts} +5 -5
- package/dist/libraries/react/{prodTypes-Bmoibf-M.d.ts → prodTypes--VvnyGlN.d.ts} +5 -5
- package/dist/next/client/NextAutumnClient.d.mts +3 -1
- package/dist/next/client/NextAutumnClient.d.ts +3 -1
- package/dist/next/client/hooks/useEntity.d.mts +2 -2
- package/dist/next/client/hooks/useEntity.d.ts +2 -2
- 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 +82 -15
- package/dist/next/server/cusActions.d.ts +82 -15
- package/dist/next/server/genActions.d.mts +1 -1
- package/dist/next/server/genActions.d.ts +1 -1
- package/dist/sdk/index.d.mts +70 -3
- package/dist/sdk/index.d.ts +70 -3
- package/dist/sdk/index.js +28 -0
- package/dist/sdk/index.mjs +28 -0
- package/dist/utils/encryptUtils.js +28 -0
- package/dist/utils/encryptUtils.mjs +28 -0
- package/package.json +1 -1
- package/dist/libraries/react/{chunk-7TYAAD2T.mjs → chunk-KWNH6C27.mjs} +11 -11
- package/dist/next/server/{cusTypes-D38IpLCT.d.mts → cusTypes-DgoOZMIt.d.mts} +4 -4
- package/dist/next/server/{cusTypes-D38IpLCT.d.ts → cusTypes-DgoOZMIt.d.ts} +4 -4
package/dist/libraries/react/{ReactAutumnClient-CK8k8OA5.d.ts → ReactAutumnClient-BUq9E84_.d.ts}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CreateEntityParams, GetEntityParams } from './client/types/clientEntTypes.js';
|
|
2
2
|
import { OpenBillingPortalParams, SetupPaymentParams } from './client/types/clientGenTypes.js';
|
|
3
3
|
import { A as AutumnError } from './error-DHbclCVh.js';
|
|
4
|
-
import { a as CheckResult, S as SetupPaymentResult, Q as QueryResult } from './genTypes-
|
|
5
|
-
import { C as CheckoutResult } from './attachTypes-
|
|
6
|
-
import { R as Result, A as AutumnPromise, E as Entity, D as DeleteEntityResult } from './entTypes-
|
|
7
|
-
import {
|
|
8
|
-
import { C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResult } from './cusTypes-
|
|
4
|
+
import { a as CheckResult, S as SetupPaymentResult, Q as QueryResult } from './genTypes-DsiuvyWS.js';
|
|
5
|
+
import { C as CheckoutResult } from './attachTypes-CcB6xjSF.js';
|
|
6
|
+
import { R as Result, A as AutumnPromise, E as Entity, D as DeleteEntityResult } from './entTypes-CoF9enrR.js';
|
|
7
|
+
import { a as ProductItem, e as ProductScenario, P as Product } from './prodTypes--VvnyGlN.js';
|
|
8
|
+
import { C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResult } from './cusTypes-DHjT-9rV.js';
|
|
9
9
|
|
|
10
10
|
interface PricingTableProduct {
|
|
11
11
|
id: string;
|
|
@@ -48,6 +48,7 @@ interface AutumnClientConfig {
|
|
|
48
48
|
customerData?: CustomerData;
|
|
49
49
|
includeCredentials?: boolean;
|
|
50
50
|
betterAuthUrl?: string;
|
|
51
|
+
headers?: Record<string, string>;
|
|
51
52
|
}
|
|
52
53
|
declare class AutumnClient {
|
|
53
54
|
readonly backendUrl?: string;
|
|
@@ -55,7 +56,8 @@ declare class AutumnClient {
|
|
|
55
56
|
protected readonly customerData?: CustomerData;
|
|
56
57
|
protected includeCredentials?: boolean;
|
|
57
58
|
readonly prefix: string;
|
|
58
|
-
|
|
59
|
+
readonly headers?: Record<string, string>;
|
|
60
|
+
constructor({ backendUrl, getBearerToken, customerData, includeCredentials, betterAuthUrl, headers, }: AutumnClientConfig);
|
|
59
61
|
/**
|
|
60
62
|
* Detects if the backend supports CORS credentials by making an OPTIONS request
|
|
61
63
|
*/
|
|
@@ -81,41 +83,41 @@ declare class AutumnClient {
|
|
|
81
83
|
}, AutumnError>>;
|
|
82
84
|
attach: (params: {
|
|
83
85
|
options?: {
|
|
84
|
-
featureId: string;
|
|
85
86
|
quantity: number;
|
|
87
|
+
featureId: string;
|
|
86
88
|
}[] | undefined;
|
|
87
89
|
metadata?: Record<string, string> | undefined;
|
|
90
|
+
reward?: string | undefined;
|
|
88
91
|
productId?: string | undefined;
|
|
89
92
|
entityId?: string | undefined;
|
|
93
|
+
dialog?: any;
|
|
94
|
+
entityData?: any;
|
|
90
95
|
productIds?: string[] | undefined;
|
|
91
96
|
freeTrial?: boolean | undefined;
|
|
92
97
|
successUrl?: string | undefined;
|
|
93
98
|
forceCheckout?: boolean | undefined;
|
|
94
|
-
dialog?: any;
|
|
95
|
-
entityData?: any;
|
|
96
99
|
openInNewTab?: boolean | undefined;
|
|
97
|
-
reward?: string | undefined;
|
|
98
100
|
checkoutSessionParams?: Record<string, any> | undefined;
|
|
99
101
|
}) => AutumnPromise<{
|
|
100
102
|
customer_id: string;
|
|
101
103
|
code: string;
|
|
102
104
|
message: string;
|
|
103
105
|
product_ids: string[];
|
|
104
|
-
checkout_url?: string | undefined;
|
|
105
106
|
customer_data?: any;
|
|
107
|
+
checkout_url?: string | undefined;
|
|
106
108
|
}>;
|
|
107
109
|
checkout: (params: {
|
|
108
110
|
productId: string;
|
|
109
111
|
options?: {
|
|
110
|
-
featureId: string;
|
|
111
112
|
quantity: number;
|
|
113
|
+
featureId: string;
|
|
112
114
|
}[] | undefined;
|
|
115
|
+
reward?: string | undefined;
|
|
113
116
|
entityId?: string | undefined;
|
|
114
|
-
successUrl?: string | undefined;
|
|
115
117
|
dialog?: any;
|
|
116
118
|
entityData?: any;
|
|
119
|
+
successUrl?: string | undefined;
|
|
117
120
|
openInNewTab?: boolean | undefined;
|
|
118
|
-
reward?: string | undefined;
|
|
119
121
|
checkoutSessionParams?: Record<string, any> | undefined;
|
|
120
122
|
}) => AutumnPromise<CheckoutResult>;
|
|
121
123
|
cancel: (params: {
|
|
@@ -124,18 +126,18 @@ declare class AutumnClient {
|
|
|
124
126
|
cancelImmediately?: boolean | undefined;
|
|
125
127
|
}) => AutumnPromise<{
|
|
126
128
|
customer_id: string;
|
|
127
|
-
success: boolean;
|
|
128
129
|
product_id: string;
|
|
130
|
+
success: boolean;
|
|
129
131
|
}>;
|
|
130
132
|
check: (params: {
|
|
131
133
|
productId?: string | undefined;
|
|
132
134
|
entityId?: string | undefined;
|
|
133
135
|
featureId?: string | undefined;
|
|
134
|
-
dialog?: any;
|
|
135
|
-
entityData?: any;
|
|
136
136
|
requiredBalance?: number | undefined;
|
|
137
137
|
sendEvent?: boolean | undefined;
|
|
138
138
|
withPreview?: boolean | undefined;
|
|
139
|
+
dialog?: any;
|
|
140
|
+
entityData?: any;
|
|
139
141
|
}) => AutumnPromise<CheckResult>;
|
|
140
142
|
track: (params: {
|
|
141
143
|
value?: number | undefined;
|
|
@@ -145,9 +147,9 @@ declare class AutumnClient {
|
|
|
145
147
|
eventName?: string | undefined;
|
|
146
148
|
idempotencyKey?: string | undefined;
|
|
147
149
|
}) => AutumnPromise<{
|
|
148
|
-
id: string;
|
|
149
150
|
customer_id: string;
|
|
150
151
|
code: string;
|
|
152
|
+
id: string;
|
|
151
153
|
feature_id?: string | undefined;
|
|
152
154
|
event_name?: string | undefined;
|
|
153
155
|
}>;
|
package/dist/libraries/react/{ReactAutumnClient-CjaZ_g4X.d.mts → ReactAutumnClient-CpAGyyur.d.mts}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CreateEntityParams, GetEntityParams } from './client/types/clientEntTypes.mjs';
|
|
2
2
|
import { OpenBillingPortalParams, SetupPaymentParams } from './client/types/clientGenTypes.mjs';
|
|
3
3
|
import { A as AutumnError } from './error-DHbclCVh.mjs';
|
|
4
|
-
import { a as CheckResult, S as SetupPaymentResult, Q as QueryResult } from './genTypes-
|
|
5
|
-
import { C as CheckoutResult } from './attachTypes-
|
|
6
|
-
import { R as Result, A as AutumnPromise, E as Entity, D as DeleteEntityResult } from './entTypes-
|
|
7
|
-
import {
|
|
8
|
-
import { C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResult } from './cusTypes-
|
|
4
|
+
import { a as CheckResult, S as SetupPaymentResult, Q as QueryResult } from './genTypes-fEH_nqSm.mjs';
|
|
5
|
+
import { C as CheckoutResult } from './attachTypes-DqUN3q8s.mjs';
|
|
6
|
+
import { R as Result, A as AutumnPromise, E as Entity, D as DeleteEntityResult } from './entTypes-S4hkh1RG.mjs';
|
|
7
|
+
import { a as ProductItem, e as ProductScenario, P as Product } from './prodTypes--VvnyGlN.mjs';
|
|
8
|
+
import { C as CustomerData, a as CreateCustomerParams, b as Customer, B as BillingPortalResult } from './cusTypes-CSmAk5io.mjs';
|
|
9
9
|
|
|
10
10
|
interface PricingTableProduct {
|
|
11
11
|
id: string;
|
|
@@ -48,6 +48,7 @@ interface AutumnClientConfig {
|
|
|
48
48
|
customerData?: CustomerData;
|
|
49
49
|
includeCredentials?: boolean;
|
|
50
50
|
betterAuthUrl?: string;
|
|
51
|
+
headers?: Record<string, string>;
|
|
51
52
|
}
|
|
52
53
|
declare class AutumnClient {
|
|
53
54
|
readonly backendUrl?: string;
|
|
@@ -55,7 +56,8 @@ declare class AutumnClient {
|
|
|
55
56
|
protected readonly customerData?: CustomerData;
|
|
56
57
|
protected includeCredentials?: boolean;
|
|
57
58
|
readonly prefix: string;
|
|
58
|
-
|
|
59
|
+
readonly headers?: Record<string, string>;
|
|
60
|
+
constructor({ backendUrl, getBearerToken, customerData, includeCredentials, betterAuthUrl, headers, }: AutumnClientConfig);
|
|
59
61
|
/**
|
|
60
62
|
* Detects if the backend supports CORS credentials by making an OPTIONS request
|
|
61
63
|
*/
|
|
@@ -81,41 +83,41 @@ declare class AutumnClient {
|
|
|
81
83
|
}, AutumnError>>;
|
|
82
84
|
attach: (params: {
|
|
83
85
|
options?: {
|
|
84
|
-
featureId: string;
|
|
85
86
|
quantity: number;
|
|
87
|
+
featureId: string;
|
|
86
88
|
}[] | undefined;
|
|
87
89
|
metadata?: Record<string, string> | undefined;
|
|
90
|
+
reward?: string | undefined;
|
|
88
91
|
productId?: string | undefined;
|
|
89
92
|
entityId?: string | undefined;
|
|
93
|
+
dialog?: any;
|
|
94
|
+
entityData?: any;
|
|
90
95
|
productIds?: string[] | undefined;
|
|
91
96
|
freeTrial?: boolean | undefined;
|
|
92
97
|
successUrl?: string | undefined;
|
|
93
98
|
forceCheckout?: boolean | undefined;
|
|
94
|
-
dialog?: any;
|
|
95
|
-
entityData?: any;
|
|
96
99
|
openInNewTab?: boolean | undefined;
|
|
97
|
-
reward?: string | undefined;
|
|
98
100
|
checkoutSessionParams?: Record<string, any> | undefined;
|
|
99
101
|
}) => AutumnPromise<{
|
|
100
102
|
customer_id: string;
|
|
101
103
|
code: string;
|
|
102
104
|
message: string;
|
|
103
105
|
product_ids: string[];
|
|
104
|
-
checkout_url?: string | undefined;
|
|
105
106
|
customer_data?: any;
|
|
107
|
+
checkout_url?: string | undefined;
|
|
106
108
|
}>;
|
|
107
109
|
checkout: (params: {
|
|
108
110
|
productId: string;
|
|
109
111
|
options?: {
|
|
110
|
-
featureId: string;
|
|
111
112
|
quantity: number;
|
|
113
|
+
featureId: string;
|
|
112
114
|
}[] | undefined;
|
|
115
|
+
reward?: string | undefined;
|
|
113
116
|
entityId?: string | undefined;
|
|
114
|
-
successUrl?: string | undefined;
|
|
115
117
|
dialog?: any;
|
|
116
118
|
entityData?: any;
|
|
119
|
+
successUrl?: string | undefined;
|
|
117
120
|
openInNewTab?: boolean | undefined;
|
|
118
|
-
reward?: string | undefined;
|
|
119
121
|
checkoutSessionParams?: Record<string, any> | undefined;
|
|
120
122
|
}) => AutumnPromise<CheckoutResult>;
|
|
121
123
|
cancel: (params: {
|
|
@@ -124,18 +126,18 @@ declare class AutumnClient {
|
|
|
124
126
|
cancelImmediately?: boolean | undefined;
|
|
125
127
|
}) => AutumnPromise<{
|
|
126
128
|
customer_id: string;
|
|
127
|
-
success: boolean;
|
|
128
129
|
product_id: string;
|
|
130
|
+
success: boolean;
|
|
129
131
|
}>;
|
|
130
132
|
check: (params: {
|
|
131
133
|
productId?: string | undefined;
|
|
132
134
|
entityId?: string | undefined;
|
|
133
135
|
featureId?: string | undefined;
|
|
134
|
-
dialog?: any;
|
|
135
|
-
entityData?: any;
|
|
136
136
|
requiredBalance?: number | undefined;
|
|
137
137
|
sendEvent?: boolean | undefined;
|
|
138
138
|
withPreview?: boolean | undefined;
|
|
139
|
+
dialog?: any;
|
|
140
|
+
entityData?: any;
|
|
139
141
|
}) => AutumnPromise<CheckResult>;
|
|
140
142
|
track: (params: {
|
|
141
143
|
value?: number | undefined;
|
|
@@ -145,9 +147,9 @@ declare class AutumnClient {
|
|
|
145
147
|
eventName?: string | undefined;
|
|
146
148
|
idempotencyKey?: string | undefined;
|
|
147
149
|
}) => AutumnPromise<{
|
|
148
|
-
id: string;
|
|
149
150
|
customer_id: string;
|
|
150
151
|
code: string;
|
|
152
|
+
id: string;
|
|
151
153
|
feature_id?: string | undefined;
|
|
152
154
|
event_name?: string | undefined;
|
|
153
155
|
}>;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CustomerData } from './cusTypes-
|
|
3
|
-
import './prodTypes
|
|
2
|
+
import { C as CustomerData } from './cusTypes-CSmAk5io.mjs';
|
|
3
|
+
import './prodTypes--VvnyGlN.mjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
|
-
declare const ReactAutumnProvider: ({ children, getBearerToken, backendUrl, customerData, includeCredentials, betterAuthUrl, }: {
|
|
6
|
+
declare const ReactAutumnProvider: ({ children, getBearerToken, backendUrl, customerData, includeCredentials, betterAuthUrl, headers, }: {
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
getBearerToken?: () => Promise<string | null | undefined>;
|
|
9
9
|
backendUrl?: string;
|
|
10
10
|
customerData?: CustomerData;
|
|
11
11
|
includeCredentials?: boolean;
|
|
12
12
|
betterAuthUrl?: string;
|
|
13
|
+
headers?: Record<string, string>;
|
|
13
14
|
}) => react_jsx_runtime.JSX.Element;
|
|
14
15
|
|
|
15
16
|
export { ReactAutumnProvider };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CustomerData } from './cusTypes-
|
|
3
|
-
import './prodTypes
|
|
2
|
+
import { C as CustomerData } from './cusTypes-DHjT-9rV.js';
|
|
3
|
+
import './prodTypes--VvnyGlN.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
|
-
declare const ReactAutumnProvider: ({ children, getBearerToken, backendUrl, customerData, includeCredentials, betterAuthUrl, }: {
|
|
6
|
+
declare const ReactAutumnProvider: ({ children, getBearerToken, backendUrl, customerData, includeCredentials, betterAuthUrl, headers, }: {
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
getBearerToken?: () => Promise<string | null | undefined>;
|
|
9
9
|
backendUrl?: string;
|
|
10
10
|
customerData?: CustomerData;
|
|
11
11
|
includeCredentials?: boolean;
|
|
12
12
|
betterAuthUrl?: string;
|
|
13
|
+
headers?: Record<string, string>;
|
|
13
14
|
}) => react_jsx_runtime.JSX.Element;
|
|
14
15
|
|
|
15
16
|
export { ReactAutumnProvider };
|
|
@@ -434,6 +434,32 @@ var logger = {
|
|
|
434
434
|
}
|
|
435
435
|
};
|
|
436
436
|
|
|
437
|
+
// src/sdk/features/featureMethods.ts
|
|
438
|
+
var featureMethods = (instance) => {
|
|
439
|
+
return {
|
|
440
|
+
list: () => staticWrapper(listFeatures, instance, {})
|
|
441
|
+
};
|
|
442
|
+
};
|
|
443
|
+
var listFeatures = async ({
|
|
444
|
+
instance,
|
|
445
|
+
params
|
|
446
|
+
}) => {
|
|
447
|
+
let path = "/features";
|
|
448
|
+
if (params) {
|
|
449
|
+
const queryParams = new URLSearchParams();
|
|
450
|
+
for (const [key, value] of Object.entries(params)) {
|
|
451
|
+
if (value !== void 0) {
|
|
452
|
+
queryParams.append(key, String(value));
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
const queryString = queryParams.toString();
|
|
456
|
+
if (queryString) {
|
|
457
|
+
path += `?${queryString}`;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return instance.get(path);
|
|
461
|
+
};
|
|
462
|
+
|
|
437
463
|
// src/sdk/client.ts
|
|
438
464
|
var LATEST_API_VERSION = "1.2";
|
|
439
465
|
var Autumn = class {
|
|
@@ -491,10 +517,12 @@ var Autumn = class {
|
|
|
491
517
|
static products = productMethods();
|
|
492
518
|
static entities = entityMethods();
|
|
493
519
|
static referrals = referralMethods();
|
|
520
|
+
static features = featureMethods();
|
|
494
521
|
customers = customerMethods(this);
|
|
495
522
|
products = productMethods(this);
|
|
496
523
|
entities = entityMethods(this);
|
|
497
524
|
referrals = referralMethods(this);
|
|
525
|
+
features = featureMethods(this);
|
|
498
526
|
static checkout = (params) => staticWrapper(handleCheckout, void 0, { params });
|
|
499
527
|
async checkout(params) {
|
|
500
528
|
return handleCheckout({
|
|
@@ -901,12 +929,14 @@ var AutumnClient = class {
|
|
|
901
929
|
customerData;
|
|
902
930
|
includeCredentials;
|
|
903
931
|
prefix;
|
|
932
|
+
headers;
|
|
904
933
|
constructor({
|
|
905
934
|
backendUrl,
|
|
906
935
|
getBearerToken,
|
|
907
936
|
customerData,
|
|
908
937
|
includeCredentials,
|
|
909
|
-
betterAuthUrl
|
|
938
|
+
betterAuthUrl,
|
|
939
|
+
headers
|
|
910
940
|
}) {
|
|
911
941
|
this.backendUrl = backendUrl;
|
|
912
942
|
this.getBearerToken = getBearerToken;
|
|
@@ -917,6 +947,7 @@ var AutumnClient = class {
|
|
|
917
947
|
this.prefix = "/api/auth/autumn";
|
|
918
948
|
this.backendUrl = betterAuthUrl;
|
|
919
949
|
}
|
|
950
|
+
this.headers = headers;
|
|
920
951
|
}
|
|
921
952
|
/**
|
|
922
953
|
* Detects if the backend supports CORS credentials by making an OPTIONS request
|
|
@@ -982,6 +1013,9 @@ var AutumnClient = class {
|
|
|
982
1013
|
console.error(`Failed to call getToken() in AutumnProvider`);
|
|
983
1014
|
}
|
|
984
1015
|
}
|
|
1016
|
+
if (this.headers) {
|
|
1017
|
+
headers = { ...headers, ...this.headers };
|
|
1018
|
+
}
|
|
985
1019
|
return headers;
|
|
986
1020
|
}
|
|
987
1021
|
async handleFetch({
|
|
@@ -1337,7 +1371,11 @@ var useAutumnBase = ({
|
|
|
1337
1371
|
if (error) {
|
|
1338
1372
|
return { data, error };
|
|
1339
1373
|
}
|
|
1340
|
-
|
|
1374
|
+
const hasPrepaid = data.product.items.some(
|
|
1375
|
+
(item) => item.usage_model === "prepaid"
|
|
1376
|
+
);
|
|
1377
|
+
const showDialog = hasPrepaid && params.dialog;
|
|
1378
|
+
if (data.url && !showDialog) {
|
|
1341
1379
|
if (params.openInNewTab) {
|
|
1342
1380
|
window.open(data.url, "_blank");
|
|
1343
1381
|
} else {
|
|
@@ -1775,14 +1813,16 @@ var ReactAutumnProvider = ({
|
|
|
1775
1813
|
backendUrl,
|
|
1776
1814
|
customerData,
|
|
1777
1815
|
includeCredentials,
|
|
1778
|
-
betterAuthUrl
|
|
1816
|
+
betterAuthUrl,
|
|
1817
|
+
headers
|
|
1779
1818
|
}) => {
|
|
1780
1819
|
let client = new AutumnClient({
|
|
1781
1820
|
backendUrl: getBackendUrl(backendUrl),
|
|
1782
1821
|
getBearerToken,
|
|
1783
1822
|
customerData,
|
|
1784
1823
|
includeCredentials,
|
|
1785
|
-
betterAuthUrl
|
|
1824
|
+
betterAuthUrl,
|
|
1825
|
+
headers
|
|
1786
1826
|
});
|
|
1787
1827
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BaseAutumnProvider, { client, AutumnContext, children });
|
|
1788
1828
|
};
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
ReactAutumnProvider
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-TM6QWQLU.mjs";
|
|
6
|
+
import "./chunk-WEKDMT3Y.mjs";
|
|
7
7
|
import "./chunk-RFSQBGLO.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-UOJ6NIVD.mjs";
|
|
9
|
+
import "./chunk-MW2FSYG3.mjs";
|
|
10
|
+
import "./chunk-5OJIHAX7.mjs";
|
|
11
|
+
import "./chunk-JNR7QAPG.mjs";
|
|
12
|
+
import "./chunk-T3B4TVD4.mjs";
|
|
13
|
+
import "./chunk-IDSAD3KF.mjs";
|
|
14
|
+
import "./chunk-WQXUZO6K.mjs";
|
|
15
15
|
import "./chunk-V575SGOW.mjs";
|
|
16
16
|
import "./chunk-ZV4RPZTM.mjs";
|
|
17
17
|
import "./chunk-JVCOY7ZL.mjs";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as ProductItem, P as Product } from './prodTypes--VvnyGlN.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
|
-
quantity: number;
|
|
9
8
|
feature_id: string;
|
|
10
|
-
}, {
|
|
11
9
|
quantity: number;
|
|
10
|
+
}, {
|
|
12
11
|
feature_id: string;
|
|
12
|
+
quantity: number;
|
|
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
|
code: string;
|
|
25
25
|
message: string;
|
|
26
26
|
product_ids: string[];
|
|
27
|
-
checkout_url?: string | undefined;
|
|
28
27
|
customer_data?: any;
|
|
28
|
+
checkout_url?: string | undefined;
|
|
29
29
|
}, {
|
|
30
30
|
customer_id: string;
|
|
31
31
|
code: string;
|
|
32
32
|
message: string;
|
|
33
33
|
product_ids: string[];
|
|
34
|
-
checkout_url?: string | undefined;
|
|
35
34
|
customer_data?: any;
|
|
35
|
+
checkout_url?: string | undefined;
|
|
36
36
|
}>;
|
|
37
37
|
type AttachResult = z.infer<typeof AttachResultSchema>;
|
|
38
38
|
type CheckoutResult = {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as ProductItem, P as Product } from './prodTypes--VvnyGlN.mjs';
|
|
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
|
-
quantity: number;
|
|
9
8
|
feature_id: string;
|
|
10
|
-
}, {
|
|
11
9
|
quantity: number;
|
|
10
|
+
}, {
|
|
12
11
|
feature_id: string;
|
|
12
|
+
quantity: number;
|
|
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
|
code: string;
|
|
25
25
|
message: string;
|
|
26
26
|
product_ids: string[];
|
|
27
|
-
checkout_url?: string | undefined;
|
|
28
27
|
customer_data?: any;
|
|
28
|
+
checkout_url?: string | undefined;
|
|
29
29
|
}, {
|
|
30
30
|
customer_id: string;
|
|
31
31
|
code: string;
|
|
32
32
|
message: string;
|
|
33
33
|
product_ids: string[];
|
|
34
|
-
checkout_url?: string | undefined;
|
|
35
34
|
customer_data?: any;
|
|
35
|
+
checkout_url?: string | undefined;
|
|
36
36
|
}>;
|
|
37
37
|
type AttachResult = z.infer<typeof AttachResultSchema>;
|
|
38
38
|
type CheckoutResult = {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
useSize
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-M7SUFZ42.mjs";
|
|
6
6
|
import {
|
|
7
7
|
Combination_default,
|
|
8
8
|
DismissableLayer,
|
|
@@ -11,18 +11,18 @@ import {
|
|
|
11
11
|
hideOthers,
|
|
12
12
|
useCallbackRef,
|
|
13
13
|
useFocusGuards
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5K2M3CQZ.mjs";
|
|
15
15
|
import {
|
|
16
16
|
Presence,
|
|
17
17
|
useId
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-WT5K3J2K.mjs";
|
|
19
19
|
import {
|
|
20
20
|
Primitive,
|
|
21
21
|
composeEventHandlers,
|
|
22
22
|
createContextScope,
|
|
23
23
|
useControllableState,
|
|
24
24
|
useLayoutEffect2
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-KWNH6C27.mjs";
|
|
26
26
|
import {
|
|
27
27
|
createSlot,
|
|
28
28
|
useComposedRefs
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
usePricingTableBase
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JNR7QAPG.mjs";
|
|
6
6
|
|
|
7
7
|
// src/libraries/react/hooks/helpers/useAutumnBase.tsx
|
|
8
8
|
var useAutumnBase = ({
|
|
@@ -39,7 +39,11 @@ var useAutumnBase = ({
|
|
|
39
39
|
if (error) {
|
|
40
40
|
return { data, error };
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
const hasPrepaid = data.product.items.some(
|
|
43
|
+
(item) => item.usage_model === "prepaid"
|
|
44
|
+
);
|
|
45
|
+
const showDialog = hasPrepaid && params.dialog;
|
|
46
|
+
if (data.url && !showDialog) {
|
|
43
47
|
if (params.openInNewTab) {
|
|
44
48
|
window.open(data.url, "_blank");
|
|
45
49
|
} else {
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import {
|
|
4
4
|
handleCheck,
|
|
5
5
|
openDialog
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MW2FSYG3.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useAutumnBase
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5OJIHAX7.mjs";
|
|
10
10
|
import {
|
|
11
11
|
useAutumnContext
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-T3B4TVD4.mjs";
|
|
13
13
|
|
|
14
14
|
// src/libraries/react/hooks/useEntityBase.tsx
|
|
15
15
|
import useSWR from "swr";
|
|
@@ -7,21 +7,21 @@ import {
|
|
|
7
7
|
Portal,
|
|
8
8
|
hideOthers,
|
|
9
9
|
useFocusGuards
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5K2M3CQZ.mjs";
|
|
11
11
|
import {
|
|
12
12
|
X
|
|
13
13
|
} from "./chunk-QJPZFEVW.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Presence,
|
|
16
16
|
useId
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WT5K3J2K.mjs";
|
|
18
18
|
import {
|
|
19
19
|
Primitive,
|
|
20
20
|
composeEventHandlers,
|
|
21
21
|
createContext2,
|
|
22
22
|
createContextScope,
|
|
23
23
|
useControllableState
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-KWNH6C27.mjs";
|
|
25
25
|
import {
|
|
26
26
|
createSlot,
|
|
27
27
|
useComposedRefs
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
useCustomerBase
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UOJ6NIVD.mjs";
|
|
6
6
|
import {
|
|
7
7
|
AutumnContext
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-T3B4TVD4.mjs";
|
|
9
9
|
|
|
10
10
|
// src/libraries/react/hooks/useCustomer.tsx
|
|
11
11
|
var useCustomer = (params) => {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
usePricingTableBase
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JNR7QAPG.mjs";
|
|
6
6
|
import {
|
|
7
7
|
AutumnContext,
|
|
8
8
|
useAutumnContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-T3B4TVD4.mjs";
|
|
10
10
|
|
|
11
11
|
// src/libraries/react/hooks/usePricingTable.tsx
|
|
12
12
|
var usePricingTable = (params) => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
AutumnError,
|
|
5
5
|
toContainerResult
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WQXUZO6K.mjs";
|
|
7
7
|
import {
|
|
8
8
|
listProductsMethod
|
|
9
9
|
} from "./chunk-V575SGOW.mjs";
|
|
@@ -46,12 +46,14 @@ var AutumnClient = class {
|
|
|
46
46
|
customerData;
|
|
47
47
|
includeCredentials;
|
|
48
48
|
prefix;
|
|
49
|
+
headers;
|
|
49
50
|
constructor({
|
|
50
51
|
backendUrl,
|
|
51
52
|
getBearerToken,
|
|
52
53
|
customerData,
|
|
53
54
|
includeCredentials,
|
|
54
|
-
betterAuthUrl
|
|
55
|
+
betterAuthUrl,
|
|
56
|
+
headers
|
|
55
57
|
}) {
|
|
56
58
|
this.backendUrl = backendUrl;
|
|
57
59
|
this.getBearerToken = getBearerToken;
|
|
@@ -62,6 +64,7 @@ var AutumnClient = class {
|
|
|
62
64
|
this.prefix = "/api/auth/autumn";
|
|
63
65
|
this.backendUrl = betterAuthUrl;
|
|
64
66
|
}
|
|
67
|
+
this.headers = headers;
|
|
65
68
|
}
|
|
66
69
|
/**
|
|
67
70
|
* Detects if the backend supports CORS credentials by making an OPTIONS request
|
|
@@ -127,6 +130,9 @@ var AutumnClient = class {
|
|
|
127
130
|
console.error(`Failed to call getToken() in AutumnProvider`);
|
|
128
131
|
}
|
|
129
132
|
}
|
|
133
|
+
if (this.headers) {
|
|
134
|
+
headers = { ...headers, ...this.headers };
|
|
135
|
+
}
|
|
130
136
|
return headers;
|
|
131
137
|
}
|
|
132
138
|
async handleFetch({
|