autumn-js 0.0.109 → 0.0.110
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/react/{chunk-WSB47D4U.mjs → chunk-2FMO4MDR.mjs} +1 -1
- package/dist/libraries/react/{chunk-BF36ZT6M.mjs → chunk-3GZZXL6J.mjs} +11 -2
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +8 -8
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +8 -8
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +8 -8
- 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/hooks/helpers/useAutumnBase.d.mts +1 -1
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +1 -1
- package/dist/libraries/react/hooks/useEntity.js +32 -1
- package/dist/libraries/react/hooks/useEntity.mjs +2 -2
- package/dist/libraries/react/hooks/useEntityBase.js +32 -1
- package/dist/libraries/react/hooks/useEntityBase.mjs +1 -1
- package/dist/libraries/react/index.js +9 -1
- package/dist/libraries/react/index.mjs +9 -1
- 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 +15 -15
- package/dist/next/server/cusActions.d.ts +15 -15
- package/dist/next/server/genActions.d.mts +1 -1
- package/dist/next/server/genActions.d.ts +1 -1
- package/package.json +1 -1
- package/dist/libraries/react/{chunk-VAWI6RK6.mjs → chunk-RMR7LP6D.mjs} +12 -12
- package/dist/next/server/{cusTypes-BpoYhIJ2.d.ts → cusTypes-d13IMtrx.d.mts} +4 -4
- package/dist/next/server/{cusTypes-BpoYhIJ2.d.mts → cusTypes-d13IMtrx.d.ts} +4 -4
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
handleCheck
|
|
4
|
+
handleCheck,
|
|
5
|
+
openDialog
|
|
5
6
|
} from "./chunk-3LLAOCW3.mjs";
|
|
6
7
|
import {
|
|
7
8
|
useAutumnBase
|
|
@@ -51,7 +52,15 @@ var useEntityBase = ({
|
|
|
51
52
|
cancel: cancelAutumn,
|
|
52
53
|
track: trackAutumn
|
|
53
54
|
} = useAutumnBase({ context, client });
|
|
54
|
-
const check = (params2) =>
|
|
55
|
+
const check = (params2) => {
|
|
56
|
+
const result = handleCheck({ customer: data, params: params2, isEntity: true });
|
|
57
|
+
openDialog({
|
|
58
|
+
result,
|
|
59
|
+
params: params2,
|
|
60
|
+
context
|
|
61
|
+
});
|
|
62
|
+
return result;
|
|
63
|
+
};
|
|
55
64
|
const attach = (params2) => attachAutumn({ ...params2, entityId: entityId || void 0 });
|
|
56
65
|
const cancel = (params2) => cancelAutumn({ ...params2, entityId: entityId || void 0 });
|
|
57
66
|
const track = (params2) => trackAutumn({ ...params2, entityId: entityId || void 0 });
|
|
@@ -5,27 +5,27 @@ import {
|
|
|
5
5
|
AttachDialog,
|
|
6
6
|
PriceItem,
|
|
7
7
|
PricingDialogButton
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-GUM4HIGI.mjs";
|
|
8
|
+
} from "../../chunk-RMR7LP6D.mjs";
|
|
9
|
+
import "../../chunk-HBCCTYA6.mjs";
|
|
11
10
|
import "../../chunk-UM3ZQPMU.mjs";
|
|
12
11
|
import "../../chunk-6EZVNJHQ.mjs";
|
|
13
12
|
import "../../chunk-O6TAJHK3.mjs";
|
|
14
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-URQMBRFZ.mjs";
|
|
15
14
|
import "../../chunk-JGRLRPKG.mjs";
|
|
16
15
|
import "../../chunk-EV5RNY5U.mjs";
|
|
17
16
|
import "../../chunk-W5N4PVQU.mjs";
|
|
18
17
|
import "../../chunk-KWNH6C27.mjs";
|
|
19
18
|
import "../../chunk-QJPZFEVW.mjs";
|
|
20
19
|
import "../../chunk-RPEGNKJH.mjs";
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
import "../../chunk-GUM4HIGI.mjs";
|
|
21
|
+
import "../../chunk-4J6OC4ZQ.mjs";
|
|
22
22
|
import "../../chunk-2H7G6M6Z.mjs";
|
|
23
23
|
import "../../chunk-OXPO56ZD.mjs";
|
|
24
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-WVKYZYFT.mjs";
|
|
25
25
|
import "../../chunk-PDCSW5VX.mjs";
|
|
26
26
|
import "../../chunk-FE5GYL7P.mjs";
|
|
27
|
-
import "../../chunk-
|
|
28
|
-
import "../../chunk-
|
|
27
|
+
import "../../chunk-2FMO4MDR.mjs";
|
|
28
|
+
import "../../chunk-3GZZXL6J.mjs";
|
|
29
29
|
import "../../chunk-T4Z5BKOW.mjs";
|
|
30
30
|
import "../../chunk-K7IJMDIV.mjs";
|
|
31
31
|
import "../../chunk-RFSQBGLO.mjs";
|
|
@@ -3,27 +3,27 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
import {
|
|
5
5
|
CheckDialog
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-GUM4HIGI.mjs";
|
|
6
|
+
} from "../../chunk-RMR7LP6D.mjs";
|
|
7
|
+
import "../../chunk-HBCCTYA6.mjs";
|
|
9
8
|
import "../../chunk-UM3ZQPMU.mjs";
|
|
10
9
|
import "../../chunk-6EZVNJHQ.mjs";
|
|
11
10
|
import "../../chunk-O6TAJHK3.mjs";
|
|
12
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-URQMBRFZ.mjs";
|
|
13
12
|
import "../../chunk-JGRLRPKG.mjs";
|
|
14
13
|
import "../../chunk-EV5RNY5U.mjs";
|
|
15
14
|
import "../../chunk-W5N4PVQU.mjs";
|
|
16
15
|
import "../../chunk-KWNH6C27.mjs";
|
|
17
16
|
import "../../chunk-QJPZFEVW.mjs";
|
|
18
17
|
import "../../chunk-RPEGNKJH.mjs";
|
|
19
|
-
import "../../chunk-
|
|
18
|
+
import "../../chunk-GUM4HIGI.mjs";
|
|
19
|
+
import "../../chunk-4J6OC4ZQ.mjs";
|
|
20
20
|
import "../../chunk-2H7G6M6Z.mjs";
|
|
21
21
|
import "../../chunk-OXPO56ZD.mjs";
|
|
22
|
-
import "../../chunk-
|
|
22
|
+
import "../../chunk-WVKYZYFT.mjs";
|
|
23
23
|
import "../../chunk-PDCSW5VX.mjs";
|
|
24
24
|
import "../../chunk-FE5GYL7P.mjs";
|
|
25
|
-
import "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
25
|
+
import "../../chunk-2FMO4MDR.mjs";
|
|
26
|
+
import "../../chunk-3GZZXL6J.mjs";
|
|
27
27
|
import "../../chunk-T4Z5BKOW.mjs";
|
|
28
28
|
import "../../chunk-K7IJMDIV.mjs";
|
|
29
29
|
import "../../chunk-RFSQBGLO.mjs";
|
|
@@ -9,27 +9,27 @@ import {
|
|
|
9
9
|
PricingTableContainer,
|
|
10
10
|
RecommendedBadge,
|
|
11
11
|
usePricingTableContext
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-GUM4HIGI.mjs";
|
|
12
|
+
} from "../../chunk-RMR7LP6D.mjs";
|
|
13
|
+
import "../../chunk-HBCCTYA6.mjs";
|
|
15
14
|
import "../../chunk-UM3ZQPMU.mjs";
|
|
16
15
|
import "../../chunk-6EZVNJHQ.mjs";
|
|
17
16
|
import "../../chunk-O6TAJHK3.mjs";
|
|
18
|
-
import "../../chunk-
|
|
17
|
+
import "../../chunk-URQMBRFZ.mjs";
|
|
19
18
|
import "../../chunk-JGRLRPKG.mjs";
|
|
20
19
|
import "../../chunk-EV5RNY5U.mjs";
|
|
21
20
|
import "../../chunk-W5N4PVQU.mjs";
|
|
22
21
|
import "../../chunk-KWNH6C27.mjs";
|
|
23
22
|
import "../../chunk-QJPZFEVW.mjs";
|
|
24
23
|
import "../../chunk-RPEGNKJH.mjs";
|
|
25
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-GUM4HIGI.mjs";
|
|
25
|
+
import "../../chunk-4J6OC4ZQ.mjs";
|
|
26
26
|
import "../../chunk-2H7G6M6Z.mjs";
|
|
27
27
|
import "../../chunk-OXPO56ZD.mjs";
|
|
28
|
-
import "../../chunk-
|
|
28
|
+
import "../../chunk-WVKYZYFT.mjs";
|
|
29
29
|
import "../../chunk-PDCSW5VX.mjs";
|
|
30
30
|
import "../../chunk-FE5GYL7P.mjs";
|
|
31
|
-
import "../../chunk-
|
|
32
|
-
import "../../chunk-
|
|
31
|
+
import "../../chunk-2FMO4MDR.mjs";
|
|
32
|
+
import "../../chunk-3GZZXL6J.mjs";
|
|
33
33
|
import "../../chunk-T4Z5BKOW.mjs";
|
|
34
34
|
import "../../chunk-K7IJMDIV.mjs";
|
|
35
35
|
import "../../chunk-RFSQBGLO.mjs";
|
|
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
6
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "sm" | "lg" | "default" | "icon" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -4,7 +4,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
6
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "sm" | "lg" | "default" | "icon" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -18,9 +18,9 @@ declare const useAutumnBase: ({ context, client, refetchCustomer, }: {
|
|
|
18
18
|
refetchCustomer?: () => Promise<any>;
|
|
19
19
|
}) => {
|
|
20
20
|
attach: (params: AttachParams) => Promise<Result<{
|
|
21
|
+
customer_id: string;
|
|
21
22
|
code: string;
|
|
22
23
|
message: string;
|
|
23
|
-
customer_id: string;
|
|
24
24
|
product_ids: string[];
|
|
25
25
|
customer_data?: any;
|
|
26
26
|
checkout_url?: string | undefined;
|
|
@@ -18,9 +18,9 @@ declare const useAutumnBase: ({ context, client, refetchCustomer, }: {
|
|
|
18
18
|
refetchCustomer?: () => Promise<any>;
|
|
19
19
|
}) => {
|
|
20
20
|
attach: (params: AttachParams) => Promise<Result<{
|
|
21
|
+
customer_id: string;
|
|
21
22
|
code: string;
|
|
22
23
|
message: string;
|
|
23
|
-
customer_id: string;
|
|
24
24
|
product_ids: string[];
|
|
25
25
|
customer_data?: any;
|
|
26
26
|
checkout_url?: string | undefined;
|
|
@@ -1132,6 +1132,29 @@ var handleProductCheck = ({
|
|
|
1132
1132
|
}
|
|
1133
1133
|
return result;
|
|
1134
1134
|
};
|
|
1135
|
+
var openDialog = ({
|
|
1136
|
+
result,
|
|
1137
|
+
params,
|
|
1138
|
+
context
|
|
1139
|
+
}) => {
|
|
1140
|
+
let open = result.allowed === false && params.dialog && context;
|
|
1141
|
+
if (!open) return;
|
|
1142
|
+
const isInRenderCycle = (() => {
|
|
1143
|
+
const stack = new Error().stack || "";
|
|
1144
|
+
return stack.includes("renderWithHooks") || stack.includes("updateFunctionComponent") || stack.includes("beginWork") || stack.includes("performUnitOfWork") || stack.includes("workLoop") || stack.includes("Component.render") || stack.includes("FunctionComponent");
|
|
1145
|
+
})();
|
|
1146
|
+
if (isInRenderCycle) {
|
|
1147
|
+
context.paywallRef.current = {
|
|
1148
|
+
component: params.dialog,
|
|
1149
|
+
open: true,
|
|
1150
|
+
props: params
|
|
1151
|
+
};
|
|
1152
|
+
} else {
|
|
1153
|
+
context.paywallDialog.setComponent(params.dialog);
|
|
1154
|
+
context.paywallDialog.setProps(params);
|
|
1155
|
+
context.paywallDialog.setOpen(true);
|
|
1156
|
+
}
|
|
1157
|
+
};
|
|
1135
1158
|
var handleCheck2 = ({
|
|
1136
1159
|
customer,
|
|
1137
1160
|
isEntity,
|
|
@@ -1533,7 +1556,15 @@ var useEntityBase = ({
|
|
|
1533
1556
|
cancel: cancelAutumn,
|
|
1534
1557
|
track: trackAutumn
|
|
1535
1558
|
} = useAutumnBase({ context, client });
|
|
1536
|
-
const check = (params2) =>
|
|
1559
|
+
const check = (params2) => {
|
|
1560
|
+
const result = handleCheck2({ customer: data, params: params2, isEntity: true });
|
|
1561
|
+
openDialog({
|
|
1562
|
+
result,
|
|
1563
|
+
params: params2,
|
|
1564
|
+
context
|
|
1565
|
+
});
|
|
1566
|
+
return result;
|
|
1567
|
+
};
|
|
1537
1568
|
const attach = (params2) => attachAutumn({ ...params2, entityId: entityId || void 0 });
|
|
1538
1569
|
const cancel = (params2) => cancelAutumn({ ...params2, entityId: entityId || void 0 });
|
|
1539
1570
|
const track = (params2) => trackAutumn({ ...params2, entityId: entityId || void 0 });
|
|
@@ -1130,6 +1130,29 @@ var handleProductCheck = ({
|
|
|
1130
1130
|
}
|
|
1131
1131
|
return result;
|
|
1132
1132
|
};
|
|
1133
|
+
var openDialog = ({
|
|
1134
|
+
result,
|
|
1135
|
+
params,
|
|
1136
|
+
context
|
|
1137
|
+
}) => {
|
|
1138
|
+
let open = result.allowed === false && params.dialog && context;
|
|
1139
|
+
if (!open) return;
|
|
1140
|
+
const isInRenderCycle = (() => {
|
|
1141
|
+
const stack = new Error().stack || "";
|
|
1142
|
+
return stack.includes("renderWithHooks") || stack.includes("updateFunctionComponent") || stack.includes("beginWork") || stack.includes("performUnitOfWork") || stack.includes("workLoop") || stack.includes("Component.render") || stack.includes("FunctionComponent");
|
|
1143
|
+
})();
|
|
1144
|
+
if (isInRenderCycle) {
|
|
1145
|
+
context.paywallRef.current = {
|
|
1146
|
+
component: params.dialog,
|
|
1147
|
+
open: true,
|
|
1148
|
+
props: params
|
|
1149
|
+
};
|
|
1150
|
+
} else {
|
|
1151
|
+
context.paywallDialog.setComponent(params.dialog);
|
|
1152
|
+
context.paywallDialog.setProps(params);
|
|
1153
|
+
context.paywallDialog.setOpen(true);
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1133
1156
|
var handleCheck2 = ({
|
|
1134
1157
|
customer,
|
|
1135
1158
|
isEntity,
|
|
@@ -1531,7 +1554,15 @@ var useEntityBase = ({
|
|
|
1531
1554
|
cancel: cancelAutumn,
|
|
1532
1555
|
track: trackAutumn
|
|
1533
1556
|
} = useAutumnBase({ context, client });
|
|
1534
|
-
const check = (params2) =>
|
|
1557
|
+
const check = (params2) => {
|
|
1558
|
+
const result = handleCheck2({ customer: data, params: params2, isEntity: true });
|
|
1559
|
+
openDialog({
|
|
1560
|
+
result,
|
|
1561
|
+
params: params2,
|
|
1562
|
+
context
|
|
1563
|
+
});
|
|
1564
|
+
return result;
|
|
1565
|
+
};
|
|
1535
1566
|
const attach = (params2) => attachAutumn({ ...params2, entityId: entityId || void 0 });
|
|
1536
1567
|
const cancel = (params2) => cancelAutumn({ ...params2, entityId: entityId || void 0 });
|
|
1537
1568
|
const track = (params2) => trackAutumn({ ...params2, entityId: entityId || void 0 });
|
|
@@ -1825,7 +1825,15 @@ var useEntityBase = ({
|
|
|
1825
1825
|
cancel: cancelAutumn,
|
|
1826
1826
|
track: trackAutumn
|
|
1827
1827
|
} = useAutumnBase({ context, client });
|
|
1828
|
-
const check = (params2) =>
|
|
1828
|
+
const check = (params2) => {
|
|
1829
|
+
const result = handleCheck2({ customer: data, params: params2, isEntity: true });
|
|
1830
|
+
openDialog({
|
|
1831
|
+
result,
|
|
1832
|
+
params: params2,
|
|
1833
|
+
context
|
|
1834
|
+
});
|
|
1835
|
+
return result;
|
|
1836
|
+
};
|
|
1829
1837
|
const attach = (params2) => attachAutumn({ ...params2, entityId: entityId || void 0 });
|
|
1830
1838
|
const cancel = (params2) => cancelAutumn({ ...params2, entityId: entityId || void 0 });
|
|
1831
1839
|
const track = (params2) => trackAutumn({ ...params2, entityId: entityId || void 0 });
|
|
@@ -1781,7 +1781,15 @@ var useEntityBase = ({
|
|
|
1781
1781
|
cancel: cancelAutumn,
|
|
1782
1782
|
track: trackAutumn
|
|
1783
1783
|
} = useAutumnBase({ context, client });
|
|
1784
|
-
const check = (params2) =>
|
|
1784
|
+
const check = (params2) => {
|
|
1785
|
+
const result = handleCheck2({ customer: data, params: params2, isEntity: true });
|
|
1786
|
+
openDialog({
|
|
1787
|
+
result,
|
|
1788
|
+
params: params2,
|
|
1789
|
+
context
|
|
1790
|
+
});
|
|
1791
|
+
return result;
|
|
1792
|
+
};
|
|
1785
1793
|
const attach = (params2) => attachAutumn({ ...params2, entityId: entityId || void 0 });
|
|
1786
1794
|
const cancel = (params2) => cancelAutumn({ ...params2, entityId: entityId || void 0 });
|
|
1787
1795
|
const track = (params2) => trackAutumn({ ...params2, entityId: entityId || void 0 });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CustomerData, a as CheckFeatureResult, b as CheckProductResult, P as ProductItem, c as Product, G as GetCustomerParams, d as Customer, e as CreateCustomerParams, U as UpdateCustomerParams, B as BillingPortalParams, f as BillingPortalResult, g as CreateProductParams, L as ListProductsParams, h as CustomerProduct, i as CustomerFeature, j as CustomerInvoice } from './cusTypes-
|
|
1
|
+
import { C as CustomerData, a as CheckFeatureResult, b as CheckProductResult, P as ProductItem, c as Product, G as GetCustomerParams, d as Customer, e as CreateCustomerParams, U as UpdateCustomerParams, B as BillingPortalParams, f as BillingPortalResult, g as CreateProductParams, L as ListProductsParams, h as CustomerProduct, i as CustomerFeature, j as CustomerInvoice } from './cusTypes-d13IMtrx.mjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { R as Result, A as AutumnError } from './response-eH4S4sg0.mjs';
|
|
4
4
|
|
|
@@ -30,18 +30,18 @@ declare const TrackParamsSchema: z.ZodObject<{
|
|
|
30
30
|
entity_data: z.ZodOptional<z.ZodAny>;
|
|
31
31
|
}, "strip", z.ZodTypeAny, {
|
|
32
32
|
customer_id: string;
|
|
33
|
-
value?: number | undefined;
|
|
34
33
|
feature_id?: string | undefined;
|
|
35
34
|
entity_id?: string | undefined;
|
|
35
|
+
value?: number | undefined;
|
|
36
36
|
customer_data?: any;
|
|
37
37
|
entity_data?: any;
|
|
38
38
|
event_name?: string | undefined;
|
|
39
39
|
idempotency_key?: string | undefined;
|
|
40
40
|
}, {
|
|
41
41
|
customer_id: string;
|
|
42
|
-
value?: number | undefined;
|
|
43
42
|
feature_id?: string | undefined;
|
|
44
43
|
entity_id?: string | undefined;
|
|
44
|
+
value?: number | undefined;
|
|
45
45
|
customer_data?: any;
|
|
46
46
|
entity_data?: any;
|
|
47
47
|
event_name?: string | undefined;
|
|
@@ -121,12 +121,12 @@ declare const QueryParamsSchema: z.ZodObject<{
|
|
|
121
121
|
feature_id: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
122
122
|
range: z.ZodOptional<z.ZodEnum<["24h", "7d", "30d", "90d", "last_cycle"]>>;
|
|
123
123
|
}, "strip", z.ZodTypeAny, {
|
|
124
|
-
customer_id: string;
|
|
125
124
|
feature_id: string | string[];
|
|
125
|
+
customer_id: string;
|
|
126
126
|
range?: "24h" | "7d" | "30d" | "90d" | "last_cycle" | undefined;
|
|
127
127
|
}, {
|
|
128
|
-
customer_id: string;
|
|
129
128
|
feature_id: string | string[];
|
|
129
|
+
customer_id: string;
|
|
130
130
|
range?: "24h" | "7d" | "30d" | "90d" | "last_cycle" | undefined;
|
|
131
131
|
}>;
|
|
132
132
|
type QueryParams = z.infer<typeof QueryParamsSchema>;
|
|
@@ -186,11 +186,11 @@ declare const AttachParamsSchema: z.ZodObject<{
|
|
|
186
186
|
reward: z.ZodOptional<z.ZodString>;
|
|
187
187
|
}, "strip", z.ZodTypeAny, {
|
|
188
188
|
customer_id: string;
|
|
189
|
+
entity_id?: string | undefined;
|
|
189
190
|
options?: {
|
|
190
191
|
feature_id: string;
|
|
191
192
|
quantity: number;
|
|
192
193
|
}[] | undefined;
|
|
193
|
-
entity_id?: string | undefined;
|
|
194
194
|
metadata?: Record<string, string> | undefined;
|
|
195
195
|
product_id?: string | undefined;
|
|
196
196
|
product_ids?: string[] | undefined;
|
|
@@ -207,11 +207,11 @@ declare const AttachParamsSchema: z.ZodObject<{
|
|
|
207
207
|
reward?: string | undefined;
|
|
208
208
|
}, {
|
|
209
209
|
customer_id: string;
|
|
210
|
+
entity_id?: string | undefined;
|
|
210
211
|
options?: {
|
|
211
212
|
feature_id: string;
|
|
212
213
|
quantity: number;
|
|
213
214
|
}[] | undefined;
|
|
214
|
-
entity_id?: string | undefined;
|
|
215
215
|
metadata?: Record<string, string> | undefined;
|
|
216
216
|
product_id?: string | undefined;
|
|
217
217
|
product_ids?: string[] | undefined;
|
|
@@ -259,11 +259,11 @@ declare const CheckoutParamsSchema: z.ZodObject<{
|
|
|
259
259
|
}, "strip", z.ZodTypeAny, {
|
|
260
260
|
customer_id: string;
|
|
261
261
|
product_id: string;
|
|
262
|
+
entity_id?: string | undefined;
|
|
262
263
|
options?: {
|
|
263
264
|
feature_id: string;
|
|
264
265
|
quantity: number;
|
|
265
266
|
}[] | undefined;
|
|
266
|
-
entity_id?: string | undefined;
|
|
267
267
|
success_url?: string | undefined;
|
|
268
268
|
customer_data?: {
|
|
269
269
|
name?: string | null | undefined;
|
|
@@ -273,11 +273,11 @@ declare const CheckoutParamsSchema: z.ZodObject<{
|
|
|
273
273
|
}, {
|
|
274
274
|
customer_id: string;
|
|
275
275
|
product_id: string;
|
|
276
|
+
entity_id?: string | undefined;
|
|
276
277
|
options?: {
|
|
277
278
|
feature_id: string;
|
|
278
279
|
quantity: number;
|
|
279
280
|
}[] | undefined;
|
|
280
|
-
entity_id?: string | undefined;
|
|
281
281
|
success_url?: string | undefined;
|
|
282
282
|
customer_data?: {
|
|
283
283
|
name?: string | null | undefined;
|
|
@@ -372,18 +372,18 @@ declare class Autumn {
|
|
|
372
372
|
static checkout: (params: CheckoutParams) => Promise<Result<CheckoutResult, AutumnError>>;
|
|
373
373
|
checkout(params: CheckoutParams): Promise<Result<CheckoutResult, AutumnError>>;
|
|
374
374
|
static attach: (params: AttachParams) => Promise<Result<{
|
|
375
|
+
customer_id: string;
|
|
375
376
|
code: string;
|
|
376
377
|
message: string;
|
|
377
|
-
customer_id: string;
|
|
378
378
|
product_ids: string[];
|
|
379
379
|
customer_data?: any;
|
|
380
380
|
checkout_url?: string | undefined;
|
|
381
381
|
}, AutumnError>>;
|
|
382
382
|
static usage: (params: UsageParams) => Promise<Result<UsageResult, AutumnError>>;
|
|
383
383
|
attach(params: AttachParams): Promise<Result<{
|
|
384
|
+
customer_id: string;
|
|
384
385
|
code: string;
|
|
385
386
|
message: string;
|
|
386
|
-
customer_id: string;
|
|
387
387
|
product_ids: string[];
|
|
388
388
|
customer_data?: any;
|
|
389
389
|
checkout_url?: string | undefined;
|
|
@@ -403,15 +403,15 @@ declare class Autumn {
|
|
|
403
403
|
static check: (params: CheckParams) => Promise<Result<CheckResult, AutumnError>>;
|
|
404
404
|
check(params: CheckParams): Promise<Result<CheckResult, AutumnError>>;
|
|
405
405
|
static track: (params: TrackParams) => Promise<Result<{
|
|
406
|
-
code: string;
|
|
407
406
|
customer_id: string;
|
|
407
|
+
code: string;
|
|
408
408
|
id: string;
|
|
409
409
|
feature_id?: string | undefined;
|
|
410
410
|
event_name?: string | undefined;
|
|
411
411
|
}, AutumnError>>;
|
|
412
412
|
track(params: TrackParams): Promise<Result<{
|
|
413
|
-
code: string;
|
|
414
413
|
customer_id: string;
|
|
414
|
+
code: string;
|
|
415
415
|
id: string;
|
|
416
416
|
feature_id?: string | undefined;
|
|
417
417
|
event_name?: string | undefined;
|
|
@@ -464,11 +464,11 @@ declare const RedeemReferralCodeParamsSchema: z.ZodObject<{
|
|
|
464
464
|
code: z.ZodString;
|
|
465
465
|
customer_id: z.ZodString;
|
|
466
466
|
}, "strip", z.ZodTypeAny, {
|
|
467
|
-
code: string;
|
|
468
467
|
customer_id: string;
|
|
469
|
-
}, {
|
|
470
468
|
code: string;
|
|
469
|
+
}, {
|
|
471
470
|
customer_id: string;
|
|
471
|
+
code: string;
|
|
472
472
|
}>;
|
|
473
473
|
type RedeemReferralCodeParams = z.infer<typeof RedeemReferralCodeParamsSchema>;
|
|
474
474
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CustomerData, a as CheckFeatureResult, b as CheckProductResult, P as ProductItem, c as Product, G as GetCustomerParams, d as Customer, e as CreateCustomerParams, U as UpdateCustomerParams, B as BillingPortalParams, f as BillingPortalResult, g as CreateProductParams, L as ListProductsParams, h as CustomerProduct, i as CustomerFeature, j as CustomerInvoice } from './cusTypes-
|
|
1
|
+
import { C as CustomerData, a as CheckFeatureResult, b as CheckProductResult, P as ProductItem, c as Product, G as GetCustomerParams, d as Customer, e as CreateCustomerParams, U as UpdateCustomerParams, B as BillingPortalParams, f as BillingPortalResult, g as CreateProductParams, L as ListProductsParams, h as CustomerProduct, i as CustomerFeature, j as CustomerInvoice } from './cusTypes-d13IMtrx.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { R as Result, A as AutumnError } from './response-eH4S4sg0.js';
|
|
4
4
|
|
|
@@ -30,18 +30,18 @@ declare const TrackParamsSchema: z.ZodObject<{
|
|
|
30
30
|
entity_data: z.ZodOptional<z.ZodAny>;
|
|
31
31
|
}, "strip", z.ZodTypeAny, {
|
|
32
32
|
customer_id: string;
|
|
33
|
-
value?: number | undefined;
|
|
34
33
|
feature_id?: string | undefined;
|
|
35
34
|
entity_id?: string | undefined;
|
|
35
|
+
value?: number | undefined;
|
|
36
36
|
customer_data?: any;
|
|
37
37
|
entity_data?: any;
|
|
38
38
|
event_name?: string | undefined;
|
|
39
39
|
idempotency_key?: string | undefined;
|
|
40
40
|
}, {
|
|
41
41
|
customer_id: string;
|
|
42
|
-
value?: number | undefined;
|
|
43
42
|
feature_id?: string | undefined;
|
|
44
43
|
entity_id?: string | undefined;
|
|
44
|
+
value?: number | undefined;
|
|
45
45
|
customer_data?: any;
|
|
46
46
|
entity_data?: any;
|
|
47
47
|
event_name?: string | undefined;
|
|
@@ -121,12 +121,12 @@ declare const QueryParamsSchema: z.ZodObject<{
|
|
|
121
121
|
feature_id: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
122
122
|
range: z.ZodOptional<z.ZodEnum<["24h", "7d", "30d", "90d", "last_cycle"]>>;
|
|
123
123
|
}, "strip", z.ZodTypeAny, {
|
|
124
|
-
customer_id: string;
|
|
125
124
|
feature_id: string | string[];
|
|
125
|
+
customer_id: string;
|
|
126
126
|
range?: "24h" | "7d" | "30d" | "90d" | "last_cycle" | undefined;
|
|
127
127
|
}, {
|
|
128
|
-
customer_id: string;
|
|
129
128
|
feature_id: string | string[];
|
|
129
|
+
customer_id: string;
|
|
130
130
|
range?: "24h" | "7d" | "30d" | "90d" | "last_cycle" | undefined;
|
|
131
131
|
}>;
|
|
132
132
|
type QueryParams = z.infer<typeof QueryParamsSchema>;
|
|
@@ -186,11 +186,11 @@ declare const AttachParamsSchema: z.ZodObject<{
|
|
|
186
186
|
reward: z.ZodOptional<z.ZodString>;
|
|
187
187
|
}, "strip", z.ZodTypeAny, {
|
|
188
188
|
customer_id: string;
|
|
189
|
+
entity_id?: string | undefined;
|
|
189
190
|
options?: {
|
|
190
191
|
feature_id: string;
|
|
191
192
|
quantity: number;
|
|
192
193
|
}[] | undefined;
|
|
193
|
-
entity_id?: string | undefined;
|
|
194
194
|
metadata?: Record<string, string> | undefined;
|
|
195
195
|
product_id?: string | undefined;
|
|
196
196
|
product_ids?: string[] | undefined;
|
|
@@ -207,11 +207,11 @@ declare const AttachParamsSchema: z.ZodObject<{
|
|
|
207
207
|
reward?: string | undefined;
|
|
208
208
|
}, {
|
|
209
209
|
customer_id: string;
|
|
210
|
+
entity_id?: string | undefined;
|
|
210
211
|
options?: {
|
|
211
212
|
feature_id: string;
|
|
212
213
|
quantity: number;
|
|
213
214
|
}[] | undefined;
|
|
214
|
-
entity_id?: string | undefined;
|
|
215
215
|
metadata?: Record<string, string> | undefined;
|
|
216
216
|
product_id?: string | undefined;
|
|
217
217
|
product_ids?: string[] | undefined;
|
|
@@ -259,11 +259,11 @@ declare const CheckoutParamsSchema: z.ZodObject<{
|
|
|
259
259
|
}, "strip", z.ZodTypeAny, {
|
|
260
260
|
customer_id: string;
|
|
261
261
|
product_id: string;
|
|
262
|
+
entity_id?: string | undefined;
|
|
262
263
|
options?: {
|
|
263
264
|
feature_id: string;
|
|
264
265
|
quantity: number;
|
|
265
266
|
}[] | undefined;
|
|
266
|
-
entity_id?: string | undefined;
|
|
267
267
|
success_url?: string | undefined;
|
|
268
268
|
customer_data?: {
|
|
269
269
|
name?: string | null | undefined;
|
|
@@ -273,11 +273,11 @@ declare const CheckoutParamsSchema: z.ZodObject<{
|
|
|
273
273
|
}, {
|
|
274
274
|
customer_id: string;
|
|
275
275
|
product_id: string;
|
|
276
|
+
entity_id?: string | undefined;
|
|
276
277
|
options?: {
|
|
277
278
|
feature_id: string;
|
|
278
279
|
quantity: number;
|
|
279
280
|
}[] | undefined;
|
|
280
|
-
entity_id?: string | undefined;
|
|
281
281
|
success_url?: string | undefined;
|
|
282
282
|
customer_data?: {
|
|
283
283
|
name?: string | null | undefined;
|
|
@@ -372,18 +372,18 @@ declare class Autumn {
|
|
|
372
372
|
static checkout: (params: CheckoutParams) => Promise<Result<CheckoutResult, AutumnError>>;
|
|
373
373
|
checkout(params: CheckoutParams): Promise<Result<CheckoutResult, AutumnError>>;
|
|
374
374
|
static attach: (params: AttachParams) => Promise<Result<{
|
|
375
|
+
customer_id: string;
|
|
375
376
|
code: string;
|
|
376
377
|
message: string;
|
|
377
|
-
customer_id: string;
|
|
378
378
|
product_ids: string[];
|
|
379
379
|
customer_data?: any;
|
|
380
380
|
checkout_url?: string | undefined;
|
|
381
381
|
}, AutumnError>>;
|
|
382
382
|
static usage: (params: UsageParams) => Promise<Result<UsageResult, AutumnError>>;
|
|
383
383
|
attach(params: AttachParams): Promise<Result<{
|
|
384
|
+
customer_id: string;
|
|
384
385
|
code: string;
|
|
385
386
|
message: string;
|
|
386
|
-
customer_id: string;
|
|
387
387
|
product_ids: string[];
|
|
388
388
|
customer_data?: any;
|
|
389
389
|
checkout_url?: string | undefined;
|
|
@@ -403,15 +403,15 @@ declare class Autumn {
|
|
|
403
403
|
static check: (params: CheckParams) => Promise<Result<CheckResult, AutumnError>>;
|
|
404
404
|
check(params: CheckParams): Promise<Result<CheckResult, AutumnError>>;
|
|
405
405
|
static track: (params: TrackParams) => Promise<Result<{
|
|
406
|
-
code: string;
|
|
407
406
|
customer_id: string;
|
|
407
|
+
code: string;
|
|
408
408
|
id: string;
|
|
409
409
|
feature_id?: string | undefined;
|
|
410
410
|
event_name?: string | undefined;
|
|
411
411
|
}, AutumnError>>;
|
|
412
412
|
track(params: TrackParams): Promise<Result<{
|
|
413
|
-
code: string;
|
|
414
413
|
customer_id: string;
|
|
414
|
+
code: string;
|
|
415
415
|
id: string;
|
|
416
416
|
feature_id?: string | undefined;
|
|
417
417
|
event_name?: string | undefined;
|
|
@@ -464,11 +464,11 @@ declare const RedeemReferralCodeParamsSchema: z.ZodObject<{
|
|
|
464
464
|
code: z.ZodString;
|
|
465
465
|
customer_id: z.ZodString;
|
|
466
466
|
}, "strip", z.ZodTypeAny, {
|
|
467
|
-
code: string;
|
|
468
467
|
customer_id: string;
|
|
469
|
-
}, {
|
|
470
468
|
code: string;
|
|
469
|
+
}, {
|
|
471
470
|
customer_id: string;
|
|
471
|
+
code: string;
|
|
472
472
|
}>;
|
|
473
473
|
type RedeemReferralCodeParams = z.infer<typeof RedeemReferralCodeParamsSchema>;
|
|
474
474
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
Input
|
|
8
|
-
} from "./chunk-GUM4HIGI.mjs";
|
|
4
|
+
getCheckContent
|
|
5
|
+
} from "./chunk-HBCCTYA6.mjs";
|
|
9
6
|
import {
|
|
10
7
|
Popover,
|
|
11
8
|
PopoverContent,
|
|
@@ -18,8 +15,8 @@ import {
|
|
|
18
15
|
getAttachContent
|
|
19
16
|
} from "./chunk-O6TAJHK3.mjs";
|
|
20
17
|
import {
|
|
21
|
-
|
|
22
|
-
} from "./chunk-
|
|
18
|
+
getPricingTableContent
|
|
19
|
+
} from "./chunk-URQMBRFZ.mjs";
|
|
23
20
|
import {
|
|
24
21
|
Accordion,
|
|
25
22
|
AccordionContent,
|
|
@@ -40,9 +37,11 @@ import {
|
|
|
40
37
|
LoaderCircle
|
|
41
38
|
} from "./chunk-QJPZFEVW.mjs";
|
|
42
39
|
import {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
Input
|
|
41
|
+
} from "./chunk-GUM4HIGI.mjs";
|
|
42
|
+
import {
|
|
43
|
+
cn
|
|
44
|
+
} from "./chunk-4J6OC4ZQ.mjs";
|
|
46
45
|
import {
|
|
47
46
|
usePaywall
|
|
48
47
|
} from "./chunk-2H7G6M6Z.mjs";
|
|
@@ -50,8 +49,9 @@ import {
|
|
|
50
49
|
usePricingTable
|
|
51
50
|
} from "./chunk-OXPO56ZD.mjs";
|
|
52
51
|
import {
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
loadingStyles,
|
|
53
|
+
spinnerStyles
|
|
54
|
+
} from "./chunk-WVKYZYFT.mjs";
|
|
55
55
|
import {
|
|
56
56
|
useCustomer
|
|
57
57
|
} from "./chunk-FE5GYL7P.mjs";
|
|
@@ -67,9 +67,9 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
|
|
|
67
67
|
credit_amount: number;
|
|
68
68
|
}>, "many">>;
|
|
69
69
|
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
customer_id: string;
|
|
71
70
|
allowed: boolean;
|
|
72
71
|
feature_id: string;
|
|
72
|
+
customer_id: string;
|
|
73
73
|
required_balance: number;
|
|
74
74
|
usage_limit?: number | undefined;
|
|
75
75
|
entity_id?: string | undefined;
|
|
@@ -92,9 +92,9 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
|
|
|
92
92
|
credit_amount: number;
|
|
93
93
|
}[] | undefined;
|
|
94
94
|
}, {
|
|
95
|
-
customer_id: string;
|
|
96
95
|
allowed: boolean;
|
|
97
96
|
feature_id: string;
|
|
97
|
+
customer_id: string;
|
|
98
98
|
required_balance: number;
|
|
99
99
|
usage_limit?: number | undefined;
|
|
100
100
|
entity_id?: string | undefined;
|
|
@@ -384,17 +384,17 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
|
|
|
384
384
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
385
385
|
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
|
|
386
386
|
}, "strip", z.ZodTypeAny, {
|
|
387
|
+
id?: string | null | undefined;
|
|
387
388
|
name?: string | null | undefined;
|
|
388
389
|
email?: string | null | undefined;
|
|
389
390
|
fingerprint?: string | null | undefined;
|
|
390
|
-
id?: string | null | undefined;
|
|
391
391
|
metadata?: Record<string, any> | undefined;
|
|
392
392
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
393
393
|
}, {
|
|
394
|
+
id?: string | null | undefined;
|
|
394
395
|
name?: string | null | undefined;
|
|
395
396
|
email?: string | null | undefined;
|
|
396
397
|
fingerprint?: string | null | undefined;
|
|
397
|
-
id?: string | null | undefined;
|
|
398
398
|
metadata?: Record<string, any> | undefined;
|
|
399
399
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
400
400
|
}>;
|
|
@@ -67,9 +67,9 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
|
|
|
67
67
|
credit_amount: number;
|
|
68
68
|
}>, "many">>;
|
|
69
69
|
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
customer_id: string;
|
|
71
70
|
allowed: boolean;
|
|
72
71
|
feature_id: string;
|
|
72
|
+
customer_id: string;
|
|
73
73
|
required_balance: number;
|
|
74
74
|
usage_limit?: number | undefined;
|
|
75
75
|
entity_id?: string | undefined;
|
|
@@ -92,9 +92,9 @@ declare const CheckFeatureResultSchema: z.ZodObject<{
|
|
|
92
92
|
credit_amount: number;
|
|
93
93
|
}[] | undefined;
|
|
94
94
|
}, {
|
|
95
|
-
customer_id: string;
|
|
96
95
|
allowed: boolean;
|
|
97
96
|
feature_id: string;
|
|
97
|
+
customer_id: string;
|
|
98
98
|
required_balance: number;
|
|
99
99
|
usage_limit?: number | undefined;
|
|
100
100
|
entity_id?: string | undefined;
|
|
@@ -384,17 +384,17 @@ declare const CreateCustomerParamsSchema: z.ZodObject<{
|
|
|
384
384
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
385
385
|
expand: z.ZodOptional<z.ZodArray<z.ZodEnum<["invoices", "rewards", "trials_used", "entities", "referrals", "payment_method"]>, "many">>;
|
|
386
386
|
}, "strip", z.ZodTypeAny, {
|
|
387
|
+
id?: string | null | undefined;
|
|
387
388
|
name?: string | null | undefined;
|
|
388
389
|
email?: string | null | undefined;
|
|
389
390
|
fingerprint?: string | null | undefined;
|
|
390
|
-
id?: string | null | undefined;
|
|
391
391
|
metadata?: Record<string, any> | undefined;
|
|
392
392
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
393
393
|
}, {
|
|
394
|
+
id?: string | null | undefined;
|
|
394
395
|
name?: string | null | undefined;
|
|
395
396
|
email?: string | null | undefined;
|
|
396
397
|
fingerprint?: string | null | undefined;
|
|
397
|
-
id?: string | null | undefined;
|
|
398
398
|
metadata?: Record<string, any> | undefined;
|
|
399
399
|
expand?: ("invoices" | "rewards" | "trials_used" | "entities" | "referrals" | "payment_method")[] | undefined;
|
|
400
400
|
}>;
|