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/sdk/index.d.ts
CHANGED
|
@@ -212,7 +212,7 @@ interface PriceTier {
|
|
|
212
212
|
to: number;
|
|
213
213
|
amount: number | "inf";
|
|
214
214
|
}
|
|
215
|
-
interface Feature {
|
|
215
|
+
interface Feature$1 {
|
|
216
216
|
id: string;
|
|
217
217
|
name: string;
|
|
218
218
|
type: "boolean" | "continuous_use" | "single_use" | "credit_system";
|
|
@@ -222,7 +222,7 @@ interface ProductItem {
|
|
|
222
222
|
feature_id?: string;
|
|
223
223
|
included_usage?: number | typeof Infinite;
|
|
224
224
|
interval?: ProductItemIntervalType;
|
|
225
|
-
feature?: Feature;
|
|
225
|
+
feature?: Feature$1;
|
|
226
226
|
usage_model?: UsageModel;
|
|
227
227
|
price?: number;
|
|
228
228
|
billing_units?: number;
|
|
@@ -887,6 +887,63 @@ type CheckoutResult = {
|
|
|
887
887
|
};
|
|
888
888
|
};
|
|
889
889
|
|
|
890
|
+
declare enum FeatureType {
|
|
891
|
+
Boolean = "boolean",
|
|
892
|
+
SingleUse = "single_use",
|
|
893
|
+
ContinuousUse = "continuous_use",
|
|
894
|
+
CreditSystem = "credit_system"
|
|
895
|
+
}
|
|
896
|
+
declare const FeatureSchema: z.ZodObject<{
|
|
897
|
+
id: z.ZodString;
|
|
898
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
899
|
+
type: z.ZodNativeEnum<typeof FeatureType>;
|
|
900
|
+
display: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
901
|
+
singular: z.ZodString;
|
|
902
|
+
plural: z.ZodString;
|
|
903
|
+
}, "strip", z.ZodTypeAny, {
|
|
904
|
+
singular: string;
|
|
905
|
+
plural: string;
|
|
906
|
+
}, {
|
|
907
|
+
singular: string;
|
|
908
|
+
plural: string;
|
|
909
|
+
}>>>;
|
|
910
|
+
credit_schema: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
911
|
+
metered_feature_id: z.ZodString;
|
|
912
|
+
credit_cost: z.ZodNumber;
|
|
913
|
+
}, "strip", z.ZodTypeAny, {
|
|
914
|
+
metered_feature_id: string;
|
|
915
|
+
credit_cost: number;
|
|
916
|
+
}, {
|
|
917
|
+
metered_feature_id: string;
|
|
918
|
+
credit_cost: number;
|
|
919
|
+
}>, "many">>>;
|
|
920
|
+
}, "strip", z.ZodTypeAny, {
|
|
921
|
+
type: FeatureType;
|
|
922
|
+
id: string;
|
|
923
|
+
credit_schema?: {
|
|
924
|
+
metered_feature_id: string;
|
|
925
|
+
credit_cost: number;
|
|
926
|
+
}[] | null | undefined;
|
|
927
|
+
name?: string | null | undefined;
|
|
928
|
+
display?: {
|
|
929
|
+
singular: string;
|
|
930
|
+
plural: string;
|
|
931
|
+
} | null | undefined;
|
|
932
|
+
}, {
|
|
933
|
+
type: FeatureType;
|
|
934
|
+
id: string;
|
|
935
|
+
credit_schema?: {
|
|
936
|
+
metered_feature_id: string;
|
|
937
|
+
credit_cost: number;
|
|
938
|
+
}[] | null | undefined;
|
|
939
|
+
name?: string | null | undefined;
|
|
940
|
+
display?: {
|
|
941
|
+
singular: string;
|
|
942
|
+
plural: string;
|
|
943
|
+
} | null | undefined;
|
|
944
|
+
}>;
|
|
945
|
+
type Feature = z.infer<typeof FeatureSchema>;
|
|
946
|
+
|
|
890
947
|
type Success<T> = {
|
|
891
948
|
data: T;
|
|
892
949
|
error: null;
|
|
@@ -947,6 +1004,11 @@ declare class Autumn {
|
|
|
947
1004
|
createCode: (params: CreateReferralCodeParams) => Promise<Result<any, AutumnError>>;
|
|
948
1005
|
redeemCode: (params: RedeemReferralCodeParams) => Promise<Result<any, AutumnError>>;
|
|
949
1006
|
};
|
|
1007
|
+
static features: {
|
|
1008
|
+
list: () => Promise<Result<{
|
|
1009
|
+
list: Feature[];
|
|
1010
|
+
}, AutumnError>>;
|
|
1011
|
+
};
|
|
950
1012
|
customers: {
|
|
951
1013
|
get: (id: string, params?: GetCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
952
1014
|
create: (params?: CreateCustomerParams) => Promise<Result<Customer, AutumnError>>;
|
|
@@ -972,6 +1034,11 @@ declare class Autumn {
|
|
|
972
1034
|
createCode: (params: CreateReferralCodeParams) => Promise<Result<any, AutumnError>>;
|
|
973
1035
|
redeemCode: (params: RedeemReferralCodeParams) => Promise<Result<any, AutumnError>>;
|
|
974
1036
|
};
|
|
1037
|
+
features: {
|
|
1038
|
+
list: () => Promise<Result<{
|
|
1039
|
+
list: Feature[];
|
|
1040
|
+
}, AutumnError>>;
|
|
1041
|
+
};
|
|
975
1042
|
static checkout: (params: CheckoutParams) => Promise<Result<CheckoutResult, AutumnError>>;
|
|
976
1043
|
checkout(params: CheckoutParams): Promise<Result<CheckoutResult, AutumnError>>;
|
|
977
1044
|
static attach: (params: AttachParams) => Promise<Result<{
|
|
@@ -1140,4 +1207,4 @@ interface RedeemReferralCodeResult {
|
|
|
1140
1207
|
applied: boolean;
|
|
1141
1208
|
}
|
|
1142
1209
|
|
|
1143
|
-
export { AppEnv, type AttachFeatureOptions, AttachFeatureOptionsSchema, type AttachParams, AttachParamsSchema, type AttachResult, AttachResultSchema, Autumn, AutumnError, type AutumnPromise, type BillingPortalParams, BillingPortalParamsSchema, type BillingPortalResult, type CancelParams, CancelParamsSchema, type CancelResult, CancelResultSchema, type CheckFeaturePreview, type CheckFeatureResult, CheckFeatureResultSchema, type CheckFeatureScenario, type CheckParams, CheckParamsSchema, type CheckProductPreview, type CheckProductResult, type CheckResult, type CheckoutParams, CheckoutParamsSchema, type CheckoutResult, CoreCusFeatureSchema, type CoreCustomerFeature, type CreateCustomerParams, CreateCustomerParamsSchema, type CreateEntityParams, type CreateEntityResult, type CreateProductParams, type CreateReferralCodeParams, CreateReferralCodeParamsSchema, type CreateReferralCodeResult, type Customer, type CustomerData, CustomerDataSchema, CustomerExpandEnum, type CustomerExpandOption, type CustomerFeature, type CustomerInvoice, type CustomerProduct, type DeleteEntityResult, type Entity, type EntityData, EntityDataSchema, type EntityExpandOption, type ErrorResponse, type Feature, type FreeTrial, FreeTrialDuration, type GetCustomerParams, type GetEntityParams, type GetPricingTableParams, Infinite, type ListProductsParams, type PriceTier, type PricingTableProduct, type Product, type ProductItem, ProductItemInterval, type ProductItemIntervalType, type ProductScenario, ProductStatus, type QueryParams, QueryParamsSchema, QueryRangeEnum, type QueryResult, type RedeemReferralCodeParams, RedeemReferralCodeParamsSchema, type RedeemReferralCodeResult, type SetupPaymentParams, type SetupPaymentResult, type TrackParams, TrackParamsSchema, type TrackResult, TrackResultSchema, type TransferProductParams, TransferProductParamsSchema, type TransferProductResult, type UpdateBalancesParams, UpdateBalancesParamsSchema, type UpdateBalancesResult, type UpdateCustomerParams, UsageModel, type UsageModelType, type UsageParams, type UsageResult, fetchPricingTable, toContainerResult };
|
|
1210
|
+
export { AppEnv, type AttachFeatureOptions, AttachFeatureOptionsSchema, type AttachParams, AttachParamsSchema, type AttachResult, AttachResultSchema, Autumn, AutumnError, type AutumnPromise, type BillingPortalParams, BillingPortalParamsSchema, type BillingPortalResult, type CancelParams, CancelParamsSchema, type CancelResult, CancelResultSchema, type CheckFeaturePreview, type CheckFeatureResult, CheckFeatureResultSchema, type CheckFeatureScenario, type CheckParams, CheckParamsSchema, type CheckProductPreview, type CheckProductResult, type CheckResult, type CheckoutParams, CheckoutParamsSchema, type CheckoutResult, CoreCusFeatureSchema, type CoreCustomerFeature, type CreateCustomerParams, CreateCustomerParamsSchema, type CreateEntityParams, type CreateEntityResult, type CreateProductParams, type CreateReferralCodeParams, CreateReferralCodeParamsSchema, type CreateReferralCodeResult, type Customer, type CustomerData, CustomerDataSchema, CustomerExpandEnum, type CustomerExpandOption, type CustomerFeature, type CustomerInvoice, type CustomerProduct, type DeleteEntityResult, type Entity, type EntityData, EntityDataSchema, type EntityExpandOption, type ErrorResponse, type Feature$1 as Feature, type FreeTrial, FreeTrialDuration, type GetCustomerParams, type GetEntityParams, type GetPricingTableParams, Infinite, type ListProductsParams, type PriceTier, type PricingTableProduct, type Product, type ProductItem, ProductItemInterval, type ProductItemIntervalType, type ProductScenario, ProductStatus, type QueryParams, QueryParamsSchema, QueryRangeEnum, type QueryResult, type RedeemReferralCodeParams, RedeemReferralCodeParamsSchema, type RedeemReferralCodeResult, type SetupPaymentParams, type SetupPaymentResult, type TrackParams, TrackParamsSchema, type TrackResult, TrackResultSchema, type TransferProductParams, TransferProductParamsSchema, type TransferProductResult, type UpdateBalancesParams, UpdateBalancesParamsSchema, type UpdateBalancesResult, type UpdateCustomerParams, UsageModel, type UsageModelType, type UsageParams, type UsageResult, fetchPricingTable, toContainerResult };
|
package/dist/sdk/index.js
CHANGED
|
@@ -349,6 +349,32 @@ var logger = {
|
|
|
349
349
|
}
|
|
350
350
|
};
|
|
351
351
|
|
|
352
|
+
// src/sdk/features/featureMethods.ts
|
|
353
|
+
var featureMethods = (instance) => {
|
|
354
|
+
return {
|
|
355
|
+
list: () => staticWrapper(listFeatures, instance, {})
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
var listFeatures = async ({
|
|
359
|
+
instance,
|
|
360
|
+
params
|
|
361
|
+
}) => {
|
|
362
|
+
let path = "/features";
|
|
363
|
+
if (params) {
|
|
364
|
+
const queryParams = new URLSearchParams();
|
|
365
|
+
for (const [key, value] of Object.entries(params)) {
|
|
366
|
+
if (value !== void 0) {
|
|
367
|
+
queryParams.append(key, String(value));
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
const queryString = queryParams.toString();
|
|
371
|
+
if (queryString) {
|
|
372
|
+
path += `?${queryString}`;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return instance.get(path);
|
|
376
|
+
};
|
|
377
|
+
|
|
352
378
|
// src/sdk/client.ts
|
|
353
379
|
var LATEST_API_VERSION = "1.2";
|
|
354
380
|
var Autumn = class {
|
|
@@ -362,6 +388,7 @@ var Autumn = class {
|
|
|
362
388
|
__publicField(this, "products", productMethods(this));
|
|
363
389
|
__publicField(this, "entities", entityMethods(this));
|
|
364
390
|
__publicField(this, "referrals", referralMethods(this));
|
|
391
|
+
__publicField(this, "features", featureMethods(this));
|
|
365
392
|
try {
|
|
366
393
|
this.secretKey = options?.secretKey || process.env.AUTUMN_SECRET_KEY;
|
|
367
394
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
@@ -459,6 +486,7 @@ __publicField(Autumn, "customers", customerMethods());
|
|
|
459
486
|
__publicField(Autumn, "products", productMethods());
|
|
460
487
|
__publicField(Autumn, "entities", entityMethods());
|
|
461
488
|
__publicField(Autumn, "referrals", referralMethods());
|
|
489
|
+
__publicField(Autumn, "features", featureMethods());
|
|
462
490
|
__publicField(Autumn, "checkout", (params) => staticWrapper(handleCheckout, void 0, { params }));
|
|
463
491
|
__publicField(Autumn, "attach", (params) => staticWrapper(handleAttach, void 0, { params }));
|
|
464
492
|
__publicField(Autumn, "usage", (params) => staticWrapper(handleUsage, void 0, { params }));
|
package/dist/sdk/index.mjs
CHANGED
|
@@ -347,6 +347,32 @@ var logger = {
|
|
|
347
347
|
}
|
|
348
348
|
};
|
|
349
349
|
|
|
350
|
+
// src/sdk/features/featureMethods.ts
|
|
351
|
+
var featureMethods = (instance) => {
|
|
352
|
+
return {
|
|
353
|
+
list: () => staticWrapper(listFeatures, instance, {})
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
var listFeatures = async ({
|
|
357
|
+
instance,
|
|
358
|
+
params
|
|
359
|
+
}) => {
|
|
360
|
+
let path = "/features";
|
|
361
|
+
if (params) {
|
|
362
|
+
const queryParams = new URLSearchParams();
|
|
363
|
+
for (const [key, value] of Object.entries(params)) {
|
|
364
|
+
if (value !== void 0) {
|
|
365
|
+
queryParams.append(key, String(value));
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
const queryString = queryParams.toString();
|
|
369
|
+
if (queryString) {
|
|
370
|
+
path += `?${queryString}`;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return instance.get(path);
|
|
374
|
+
};
|
|
375
|
+
|
|
350
376
|
// src/sdk/client.ts
|
|
351
377
|
var LATEST_API_VERSION = "1.2";
|
|
352
378
|
var Autumn = class {
|
|
@@ -360,6 +386,7 @@ var Autumn = class {
|
|
|
360
386
|
__publicField(this, "products", productMethods(this));
|
|
361
387
|
__publicField(this, "entities", entityMethods(this));
|
|
362
388
|
__publicField(this, "referrals", referralMethods(this));
|
|
389
|
+
__publicField(this, "features", featureMethods(this));
|
|
363
390
|
try {
|
|
364
391
|
this.secretKey = options?.secretKey || process.env.AUTUMN_SECRET_KEY;
|
|
365
392
|
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
@@ -457,6 +484,7 @@ __publicField(Autumn, "customers", customerMethods());
|
|
|
457
484
|
__publicField(Autumn, "products", productMethods());
|
|
458
485
|
__publicField(Autumn, "entities", entityMethods());
|
|
459
486
|
__publicField(Autumn, "referrals", referralMethods());
|
|
487
|
+
__publicField(Autumn, "features", featureMethods());
|
|
460
488
|
__publicField(Autumn, "checkout", (params) => staticWrapper(handleCheckout, void 0, { params }));
|
|
461
489
|
__publicField(Autumn, "attach", (params) => staticWrapper(handleAttach, void 0, { params }));
|
|
462
490
|
__publicField(Autumn, "usage", (params) => staticWrapper(handleUsage, void 0, { params }));
|
|
@@ -395,6 +395,32 @@ var logger = {
|
|
|
395
395
|
}
|
|
396
396
|
};
|
|
397
397
|
|
|
398
|
+
// src/sdk/features/featureMethods.ts
|
|
399
|
+
var featureMethods = (instance) => {
|
|
400
|
+
return {
|
|
401
|
+
list: () => staticWrapper(listFeatures, instance, {})
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
var listFeatures = async ({
|
|
405
|
+
instance,
|
|
406
|
+
params
|
|
407
|
+
}) => {
|
|
408
|
+
let path = "/features";
|
|
409
|
+
if (params) {
|
|
410
|
+
const queryParams = new URLSearchParams();
|
|
411
|
+
for (const [key, value] of Object.entries(params)) {
|
|
412
|
+
if (value !== void 0) {
|
|
413
|
+
queryParams.append(key, String(value));
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
const queryString = queryParams.toString();
|
|
417
|
+
if (queryString) {
|
|
418
|
+
path += `?${queryString}`;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
return instance.get(path);
|
|
422
|
+
};
|
|
423
|
+
|
|
398
424
|
// src/sdk/client.ts
|
|
399
425
|
var LATEST_API_VERSION = "1.2";
|
|
400
426
|
var Autumn = class {
|
|
@@ -452,10 +478,12 @@ var Autumn = class {
|
|
|
452
478
|
static products = productMethods();
|
|
453
479
|
static entities = entityMethods();
|
|
454
480
|
static referrals = referralMethods();
|
|
481
|
+
static features = featureMethods();
|
|
455
482
|
customers = customerMethods(this);
|
|
456
483
|
products = productMethods(this);
|
|
457
484
|
entities = entityMethods(this);
|
|
458
485
|
referrals = referralMethods(this);
|
|
486
|
+
features = featureMethods(this);
|
|
459
487
|
static checkout = (params) => staticWrapper(handleCheckout, void 0, { params });
|
|
460
488
|
async checkout(params) {
|
|
461
489
|
return handleCheckout({
|
|
@@ -327,6 +327,32 @@ var toContainerResult = async ({
|
|
|
327
327
|
}
|
|
328
328
|
};
|
|
329
329
|
|
|
330
|
+
// src/sdk/features/featureMethods.ts
|
|
331
|
+
var featureMethods = (instance) => {
|
|
332
|
+
return {
|
|
333
|
+
list: () => staticWrapper(listFeatures, instance, {})
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
var listFeatures = async ({
|
|
337
|
+
instance,
|
|
338
|
+
params
|
|
339
|
+
}) => {
|
|
340
|
+
let path = "/features";
|
|
341
|
+
if (params) {
|
|
342
|
+
const queryParams = new URLSearchParams();
|
|
343
|
+
for (const [key, value] of Object.entries(params)) {
|
|
344
|
+
if (value !== void 0) {
|
|
345
|
+
queryParams.append(key, String(value));
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
const queryString = queryParams.toString();
|
|
349
|
+
if (queryString) {
|
|
350
|
+
path += `?${queryString}`;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return instance.get(path);
|
|
354
|
+
};
|
|
355
|
+
|
|
330
356
|
// src/sdk/client.ts
|
|
331
357
|
var LATEST_API_VERSION = "1.2";
|
|
332
358
|
var Autumn = class {
|
|
@@ -384,10 +410,12 @@ var Autumn = class {
|
|
|
384
410
|
static products = productMethods();
|
|
385
411
|
static entities = entityMethods();
|
|
386
412
|
static referrals = referralMethods();
|
|
413
|
+
static features = featureMethods();
|
|
387
414
|
customers = customerMethods(this);
|
|
388
415
|
products = productMethods(this);
|
|
389
416
|
entities = entityMethods(this);
|
|
390
417
|
referrals = referralMethods(this);
|
|
418
|
+
features = featureMethods(this);
|
|
391
419
|
static checkout = (params) => staticWrapper(handleCheckout, void 0, { params });
|
|
392
420
|
async checkout(params) {
|
|
393
421
|
return handleCheckout({
|
package/package.json
CHANGED
|
@@ -4,6 +4,16 @@ import {
|
|
|
4
4
|
createSlot
|
|
5
5
|
} from "./chunk-RPEGNKJH.mjs";
|
|
6
6
|
|
|
7
|
+
// ../node_modules/.pnpm/@radix-ui+primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.mjs
|
|
8
|
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
9
|
+
return function handleEvent(event) {
|
|
10
|
+
originalEventHandler?.(event);
|
|
11
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
12
|
+
return ourEventHandler?.(event);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
7
17
|
// ../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
8
18
|
import * as React from "react";
|
|
9
19
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -81,16 +91,6 @@ function composeContextScopes(...scopes) {
|
|
|
81
91
|
return createScope;
|
|
82
92
|
}
|
|
83
93
|
|
|
84
|
-
// ../node_modules/.pnpm/@radix-ui+primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.mjs
|
|
85
|
-
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
86
|
-
return function handleEvent(event) {
|
|
87
|
-
originalEventHandler?.(event);
|
|
88
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
89
|
-
return ourEventHandler?.(event);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
94
|
// ../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.1.8_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
95
95
|
import * as React3 from "react";
|
|
96
96
|
|
|
@@ -208,9 +208,9 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
export {
|
|
211
|
+
composeEventHandlers,
|
|
211
212
|
createContext2,
|
|
212
213
|
createContextScope,
|
|
213
|
-
composeEventHandlers,
|
|
214
214
|
useLayoutEffect2,
|
|
215
215
|
useControllableState,
|
|
216
216
|
Primitive,
|
|
@@ -77,9 +77,9 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
|
|
|
77
77
|
credit_amount: number;
|
|
78
78
|
}>, "many">>;
|
|
79
79
|
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
customer_id: string;
|
|
80
81
|
allowed: boolean;
|
|
81
82
|
feature_id: string;
|
|
82
|
-
customer_id: string;
|
|
83
83
|
required_balance: number;
|
|
84
84
|
usage_limit?: number | undefined;
|
|
85
85
|
entity_id?: string | undefined;
|
|
@@ -106,9 +106,9 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
|
|
|
106
106
|
credit_amount: number;
|
|
107
107
|
}[] | undefined;
|
|
108
108
|
}, {
|
|
109
|
+
customer_id: string;
|
|
109
110
|
allowed: boolean;
|
|
110
111
|
feature_id: string;
|
|
111
|
-
customer_id: string;
|
|
112
112
|
required_balance: number;
|
|
113
113
|
usage_limit?: number | undefined;
|
|
114
114
|
entity_id?: string | undefined;
|
|
@@ -420,17 +420,17 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
|
|
|
420
420
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
421
421
|
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
|
|
422
422
|
}, "strip", z.ZodTypeAny, {
|
|
423
|
-
id?: string | null | undefined;
|
|
424
423
|
name?: string | null | undefined;
|
|
425
424
|
email?: string | null | undefined;
|
|
426
425
|
fingerprint?: string | null | undefined;
|
|
426
|
+
id?: string | null | undefined;
|
|
427
427
|
metadata?: Record<string, any> | undefined;
|
|
428
428
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
429
429
|
}, {
|
|
430
|
-
id?: string | null | undefined;
|
|
431
430
|
name?: string | null | undefined;
|
|
432
431
|
email?: string | null | undefined;
|
|
433
432
|
fingerprint?: string | null | undefined;
|
|
433
|
+
id?: string | null | undefined;
|
|
434
434
|
metadata?: Record<string, any> | undefined;
|
|
435
435
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
436
436
|
}>;
|
|
@@ -77,9 +77,9 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
|
|
|
77
77
|
credit_amount: number;
|
|
78
78
|
}>, "many">>;
|
|
79
79
|
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
customer_id: string;
|
|
80
81
|
allowed: boolean;
|
|
81
82
|
feature_id: string;
|
|
82
|
-
customer_id: string;
|
|
83
83
|
required_balance: number;
|
|
84
84
|
usage_limit?: number | undefined;
|
|
85
85
|
entity_id?: string | undefined;
|
|
@@ -106,9 +106,9 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
|
|
|
106
106
|
credit_amount: number;
|
|
107
107
|
}[] | undefined;
|
|
108
108
|
}, {
|
|
109
|
+
customer_id: string;
|
|
109
110
|
allowed: boolean;
|
|
110
111
|
feature_id: string;
|
|
111
|
-
customer_id: string;
|
|
112
112
|
required_balance: number;
|
|
113
113
|
usage_limit?: number | undefined;
|
|
114
114
|
entity_id?: string | undefined;
|
|
@@ -420,17 +420,17 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
|
|
|
420
420
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
421
421
|
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
|
|
422
422
|
}, "strip", z.ZodTypeAny, {
|
|
423
|
-
id?: string | null | undefined;
|
|
424
423
|
name?: string | null | undefined;
|
|
425
424
|
email?: string | null | undefined;
|
|
426
425
|
fingerprint?: string | null | undefined;
|
|
426
|
+
id?: string | null | undefined;
|
|
427
427
|
metadata?: Record<string, any> | undefined;
|
|
428
428
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
429
429
|
}, {
|
|
430
|
-
id?: string | null | undefined;
|
|
431
430
|
name?: string | null | undefined;
|
|
432
431
|
email?: string | null | undefined;
|
|
433
432
|
fingerprint?: string | null | undefined;
|
|
433
|
+
id?: string | null | undefined;
|
|
434
434
|
metadata?: Record<string, any> | undefined;
|
|
435
435
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
436
436
|
}>;
|