autumn-js 0.0.101 → 0.0.102
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/compose/index.d.mts +67 -93
- package/dist/compose/index.d.ts +67 -93
- package/dist/compose/index.js +14 -83
- package/dist/compose/index.mjs +14 -80
- package/dist/libraries/backend/better-auth.d.mts +18 -18
- package/dist/libraries/backend/better-auth.d.ts +18 -18
- package/dist/libraries/backend/elysia.d.mts +1 -1
- package/dist/libraries/backend/elysia.d.ts +1 -1
- package/dist/libraries/backend/express.d.mts +1 -1
- package/dist/libraries/backend/express.d.ts +1 -1
- package/dist/libraries/backend/next.js +94 -94
- package/dist/libraries/backend/next.mjs +94 -94
- package/dist/libraries/backend/{referralTypes-HAk2vTns.d.ts → referralTypes-D1Q2i3mG.d.ts} +28 -27
- package/dist/libraries/backend/{referralTypes-Dg9pRvI7.d.mts → referralTypes-Dfg6if8j.d.mts} +28 -27
- package/dist/libraries/backend/tanstack.js +2 -2
- package/dist/libraries/backend/tanstack.mjs +2 -2
- package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
- package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
- package/dist/libraries/react/AutumnContext.d.mts +4 -4
- package/dist/libraries/react/AutumnContext.d.ts +4 -4
- package/dist/libraries/react/AutumnContext.mjs +4 -4
- package/dist/libraries/react/BaseAutumnProvider.d.mts +4 -4
- package/dist/libraries/react/BaseAutumnProvider.d.ts +4 -4
- package/dist/libraries/react/BaseAutumnProvider.js +7 -2
- package/dist/libraries/react/BaseAutumnProvider.mjs +9 -9
- package/dist/libraries/react/{ReactAutumnClient-B4P_QjY1.d.ts → ReactAutumnClient-DBbq29Nn.d.ts} +3 -3
- package/dist/libraries/react/{ReactAutumnClient-DCdPx-ps.d.mts → ReactAutumnClient-YzfxjqPK.d.mts} +3 -3
- package/dist/libraries/react/ReactAutumnProvider.d.mts +1 -1
- package/dist/libraries/react/ReactAutumnProvider.d.ts +1 -1
- package/dist/libraries/react/ReactAutumnProvider.js +7 -2
- package/dist/libraries/react/ReactAutumnProvider.mjs +10 -10
- package/dist/libraries/react/{chunk-T5PIJ4HG.mjs → chunk-3VHO7VUQ.mjs} +4 -3
- package/dist/libraries/react/{chunk-DVMVIAZE.mjs → chunk-5NDO7C7R.mjs} +3 -3
- package/dist/libraries/react/{chunk-AOJCMXVS.mjs → chunk-5URK7LI3.mjs} +3 -3
- package/dist/libraries/react/{chunk-YLZ5NFYO.mjs → chunk-AL3VJLFU.mjs} +1 -1
- package/dist/libraries/react/{chunk-LVDONEVF.mjs → chunk-CE33P32V.mjs} +7 -3
- package/dist/libraries/react/{chunk-G3FBFZLU.mjs → chunk-GQ3TAHSV.mjs} +1 -1
- package/dist/libraries/react/{chunk-CAMHARUX.mjs → chunk-H2NGSCWI.mjs} +2 -2
- package/dist/libraries/react/{chunk-6CJ3FB74.mjs → chunk-JI7WQ6AC.mjs} +2 -2
- package/dist/libraries/react/{chunk-24EVX3BR.mjs → chunk-LKV32IPT.mjs} +20 -41
- package/dist/libraries/react/{chunk-RQG36YPD.mjs → chunk-LXSKONN2.mjs} +5 -9
- package/dist/libraries/react/{chunk-R46CJXF7.mjs → chunk-OAPUYXBO.mjs} +6 -6
- package/dist/libraries/react/{chunk-3CJSWXNT.mjs → chunk-OAWFFAKA.mjs} +6 -6
- package/dist/libraries/react/{chunk-CPITDC7S.mjs → chunk-SDMBKRAI.mjs} +37 -172
- package/dist/libraries/react/{chunk-APDR7D6A.mjs → chunk-SY5GNYZ7.mjs} +2 -2
- package/dist/libraries/react/{chunk-5G3DYUNT.mjs → chunk-T73WQC2X.mjs} +1 -1
- package/dist/libraries/react/{chunk-R4BYOLST.mjs → chunk-TPKQIL3N.mjs} +2 -2
- package/dist/libraries/react/{chunk-MZDRIPNS.mjs → chunk-X6RY6VG5.mjs} +2 -2
- package/dist/libraries/react/{chunk-RQEL7G2O.mjs → chunk-ZVQKDPUP.mjs} +3 -3
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +4 -4
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +4 -4
- package/dist/libraries/react/client/ReactAutumnClient.mjs +3 -3
- package/dist/libraries/react/client/clientCompMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientCompMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientCusMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientCusMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientEntityMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientEntityMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientGenMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientGenMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientProdMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientProdMethods.d.ts +4 -4
- package/dist/libraries/react/client/clientReferralMethods.d.mts +4 -4
- package/dist/libraries/react/client/clientReferralMethods.d.ts +4 -4
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.css +111 -116
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +1 -1
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +1 -1
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +76 -212
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +23 -23
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +1 -1
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +1 -1
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +1 -1
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +1 -1
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.js +47 -169
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +5 -5
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -1
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.css +111 -116
- 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 +76 -215
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +23 -23
- package/dist/libraries/react/components/ui/button.js +3 -3
- package/dist/libraries/react/components/ui/button.mjs +2 -2
- package/dist/libraries/react/components/ui/dialog.js +43 -157
- package/dist/libraries/react/components/ui/dialog.mjs +3 -3
- package/dist/libraries/react/components/ui/switch.js +12 -12
- package/dist/libraries/react/components/ui/switch.mjs +3 -3
- package/dist/libraries/react/{cusTypes-Bf1qr9iE.d.ts → cusTypes-CFofdxsA.d.mts} +2 -1
- package/dist/libraries/react/{cusTypes-Bf1qr9iE.d.mts → cusTypes-CFofdxsA.d.ts} +2 -1
- package/dist/libraries/react/{entTypes-CscyyE1A.d.mts → entTypes-BeWtfIqo.d.mts} +1 -1
- package/dist/libraries/react/{entTypes-O8YXxhrA.d.ts → entTypes-BhUZh8uE.d.ts} +1 -1
- package/dist/libraries/react/hooks/handleAllowed.d.mts +2 -2
- package/dist/libraries/react/hooks/handleAllowed.d.ts +2 -2
- package/dist/libraries/react/hooks/useAutumn.d.mts +2 -2
- package/dist/libraries/react/hooks/useAutumn.d.ts +2 -2
- package/dist/libraries/react/hooks/useAutumn.js +5 -1
- package/dist/libraries/react/hooks/useAutumn.mjs +7 -7
- package/dist/libraries/react/hooks/useAutumnBase.d.mts +6 -5
- package/dist/libraries/react/hooks/useAutumnBase.d.ts +6 -5
- package/dist/libraries/react/hooks/useAutumnBase.js +5 -1
- package/dist/libraries/react/hooks/useAutumnBase.mjs +6 -6
- package/dist/libraries/react/hooks/useCustomer.d.mts +4 -4
- package/dist/libraries/react/hooks/useCustomer.d.ts +4 -4
- package/dist/libraries/react/hooks/useCustomer.js +7 -2
- package/dist/libraries/react/hooks/useCustomer.mjs +8 -8
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +4 -4
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +4 -4
- package/dist/libraries/react/hooks/useCustomerBase.js +7 -2
- package/dist/libraries/react/hooks/useCustomerBase.mjs +7 -7
- package/dist/libraries/react/hooks/useEntity.d.mts +3 -3
- package/dist/libraries/react/hooks/useEntity.d.ts +3 -3
- package/dist/libraries/react/hooks/useEntity.js +5 -1
- package/dist/libraries/react/hooks/useEntity.mjs +8 -8
- package/dist/libraries/react/hooks/useEntityBase.d.mts +4 -4
- package/dist/libraries/react/hooks/useEntityBase.d.ts +4 -4
- package/dist/libraries/react/hooks/useEntityBase.js +5 -1
- package/dist/libraries/react/hooks/useEntityBase.mjs +7 -7
- 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.mjs +6 -6
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +4 -4
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +4 -4
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +5 -5
- package/dist/libraries/react/hooks/useProductsBase.mjs +4 -4
- package/dist/libraries/react/index.d.mts +1 -0
- package/dist/libraries/react/index.d.ts +1 -0
- package/dist/libraries/react/index.js +80 -222
- package/dist/libraries/react/index.mjs +65 -207
- package/dist/libraries/react/{response-B4VzjWEU.d.mts → response-AGK9KlYm.d.mts} +1 -1
- package/dist/libraries/react/{response-C3S90max.d.ts → response-CxMWdpyl.d.ts} +1 -1
- package/dist/next/{AutumnProvider-CCYZC_bN.d.mts → AutumnProvider-Xl1mqxls.d.mts} +1 -0
- package/dist/next/{AutumnProvider-CCYZC_bN.d.ts → AutumnProvider-Xl1mqxls.d.ts} +1 -0
- package/dist/next/AutumnProvider.d.mts +1 -1
- package/dist/next/AutumnProvider.d.ts +1 -1
- package/dist/next/client/NextAutumnClient.d.mts +10 -10
- package/dist/next/client/NextAutumnClient.d.ts +10 -10
- package/dist/next/client/NextAutumnProvider.d.mts +1 -1
- package/dist/next/client/NextAutumnProvider.d.ts +1 -1
- package/dist/next/client/{clientGenTypes-9ngy1q97.d.mts → clientGenTypes-BcRfHmUS.d.mts} +17 -17
- package/dist/next/client/{clientGenTypes-CxB4go6q.d.ts → clientGenTypes-D8f8BwMo.d.ts} +17 -17
- package/dist/next/client/clientUtils.d.mts +2 -2
- package/dist/next/client/clientUtils.d.ts +2 -2
- package/dist/next/client/{cusTypes-D8lhXGaX.d.mts → cusTypes-Gh2wfcmj.d.mts} +1 -0
- package/dist/next/client/{cusTypes-D8lhXGaX.d.ts → cusTypes-Gh2wfcmj.d.ts} +1 -0
- package/dist/next/client/{entTypes-Dq2mbehl.d.ts → entTypes-B_w6I3y-.d.ts} +1 -1
- package/dist/next/client/{entTypes-B-2_9hzP.d.mts → entTypes-C_xS1VPE.d.mts} +1 -1
- package/dist/next/client/hooks/useAutumn.d.mts +2 -2
- package/dist/next/client/hooks/useAutumn.d.ts +2 -2
- package/dist/next/client/hooks/useCustomer.d.mts +3 -3
- package/dist/next/client/hooks/useCustomer.d.ts +3 -3
- package/dist/next/client/hooks/useEntity.d.mts +5 -5
- package/dist/next/client/hooks/useEntity.d.ts +5 -5
- package/dist/next/client/hooks/usePricingTable.d.mts +1 -1
- package/dist/next/client/hooks/usePricingTable.d.ts +1 -1
- package/dist/next/client/types.d.mts +2 -2
- package/dist/next/client/types.d.ts +2 -2
- package/dist/next/index.d.mts +2 -2
- package/dist/next/index.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 +21 -21
- package/dist/next/server/cusActions.d.ts +21 -21
- package/dist/next/server/{cusTypes-DhOYtM7H.d.mts → cusTypes-DVA6iu7V.d.mts} +3 -2
- package/dist/next/server/{cusTypes-DhOYtM7H.d.ts → cusTypes-DVA6iu7V.d.ts} +3 -2
- package/dist/next/server/genActions.d.mts +1 -1
- package/dist/next/server/genActions.d.ts +1 -1
- package/dist/sdk/index.d.mts +1 -0
- package/dist/sdk/index.d.ts +1 -0
- package/dist/styles/global.css +111 -116
- package/package.json +9 -22
- package/tsup.config.ts +0 -1
- package/dist/libraries/react/{chunk-ALFXUHDD.mjs → chunk-ALIGIMSK.mjs} +6 -6
package/dist/compose/index.d.mts
CHANGED
|
@@ -1,44 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
declare enum ProductItemInterval {
|
|
4
|
-
Minute = "minute",
|
|
5
|
-
Hour = "hour",
|
|
6
|
-
Day = "day",
|
|
7
|
-
Week = "week",
|
|
8
|
-
Month = "month",
|
|
9
|
-
Quarter = "quarter",
|
|
10
|
-
SemiAnnual = "semi_annual",
|
|
11
|
-
Year = "year"
|
|
12
|
-
}
|
|
13
|
-
declare enum UsageModel {
|
|
14
|
-
Prepaid = "prepaid",
|
|
15
|
-
PayPerUse = "pay_per_use"
|
|
16
|
-
}
|
|
17
|
-
declare const ProductItemSchema: z.ZodObject<{
|
|
18
|
-
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["feature", "priced_feature"]>>>;
|
|
19
|
-
feature_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
-
included_usage: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodLiteral<"inf">]>>>;
|
|
21
|
-
interval: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof ProductItemInterval>>>;
|
|
22
|
-
usage_model: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof UsageModel>>>;
|
|
23
|
-
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
24
|
-
billing_units: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
25
|
-
}, "strip", z.ZodTypeAny, {
|
|
26
|
-
type?: "feature" | "priced_feature" | null | undefined;
|
|
27
|
-
feature_id?: string | null | undefined;
|
|
28
|
-
included_usage?: number | "inf" | null | undefined;
|
|
29
|
-
interval?: ProductItemInterval | null | undefined;
|
|
30
|
-
usage_model?: UsageModel | null | undefined;
|
|
31
|
-
price?: number | null | undefined;
|
|
32
|
-
billing_units?: number | null | undefined;
|
|
33
|
-
}, {
|
|
34
|
-
type?: "feature" | "priced_feature" | null | undefined;
|
|
35
|
-
feature_id?: string | null | undefined;
|
|
36
|
-
included_usage?: number | "inf" | null | undefined;
|
|
37
|
-
interval?: ProductItemInterval | null | undefined;
|
|
38
|
-
usage_model?: UsageModel | null | undefined;
|
|
39
|
-
price?: number | null | undefined;
|
|
40
|
-
billing_units?: number | null | undefined;
|
|
41
|
-
}>;
|
|
42
3
|
declare const ProductSchema: z.ZodObject<{
|
|
43
4
|
id: z.ZodString;
|
|
44
5
|
name: z.ZodString;
|
|
@@ -48,24 +9,24 @@ declare const ProductSchema: z.ZodObject<{
|
|
|
48
9
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["feature", "priced_feature"]>>>;
|
|
49
10
|
feature_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
11
|
included_usage: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodLiteral<"inf">]>>>;
|
|
51
|
-
interval: z.ZodOptional<z.ZodNullable<z.
|
|
52
|
-
usage_model: z.ZodOptional<z.ZodNullable<z.
|
|
12
|
+
interval: z.ZodOptional<z.ZodNullable<z.ZodEnum<["minute", "hour", "day", "week", "month", "quarter", "semi_annual", "year"]>>>;
|
|
13
|
+
usage_model: z.ZodOptional<z.ZodNullable<z.ZodEnum<["prepaid", "pay_per_use"]>>>;
|
|
53
14
|
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
54
15
|
billing_units: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
55
16
|
}, "strip", z.ZodTypeAny, {
|
|
56
17
|
type?: "feature" | "priced_feature" | null | undefined;
|
|
57
18
|
feature_id?: string | null | undefined;
|
|
58
19
|
included_usage?: number | "inf" | null | undefined;
|
|
59
|
-
interval?:
|
|
60
|
-
usage_model?:
|
|
20
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
21
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
61
22
|
price?: number | null | undefined;
|
|
62
23
|
billing_units?: number | null | undefined;
|
|
63
24
|
}, {
|
|
64
25
|
type?: "feature" | "priced_feature" | null | undefined;
|
|
65
26
|
feature_id?: string | null | undefined;
|
|
66
27
|
included_usage?: number | "inf" | null | undefined;
|
|
67
|
-
interval?:
|
|
68
|
-
usage_model?:
|
|
28
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
29
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
69
30
|
price?: number | null | undefined;
|
|
70
31
|
billing_units?: number | null | undefined;
|
|
71
32
|
}>, "many">;
|
|
@@ -76,8 +37,8 @@ declare const ProductSchema: z.ZodObject<{
|
|
|
76
37
|
type?: "feature" | "priced_feature" | null | undefined;
|
|
77
38
|
feature_id?: string | null | undefined;
|
|
78
39
|
included_usage?: number | "inf" | null | undefined;
|
|
79
|
-
interval?:
|
|
80
|
-
usage_model?:
|
|
40
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
41
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
81
42
|
price?: number | null | undefined;
|
|
82
43
|
billing_units?: number | null | undefined;
|
|
83
44
|
}[];
|
|
@@ -90,8 +51,8 @@ declare const ProductSchema: z.ZodObject<{
|
|
|
90
51
|
type?: "feature" | "priced_feature" | null | undefined;
|
|
91
52
|
feature_id?: string | null | undefined;
|
|
92
53
|
included_usage?: number | "inf" | null | undefined;
|
|
93
|
-
interval?:
|
|
94
|
-
usage_model?:
|
|
54
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
55
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
95
56
|
price?: number | null | undefined;
|
|
96
57
|
billing_units?: number | null | undefined;
|
|
97
58
|
}[];
|
|
@@ -101,17 +62,7 @@ declare const ProductSchema: z.ZodObject<{
|
|
|
101
62
|
declare const FeatureSchema: z.ZodObject<{
|
|
102
63
|
id: z.ZodString;
|
|
103
64
|
name: z.ZodString;
|
|
104
|
-
type: z.ZodEnum<["boolean", "
|
|
105
|
-
display: z.ZodObject<{
|
|
106
|
-
singular: z.ZodString;
|
|
107
|
-
plural: z.ZodString;
|
|
108
|
-
}, "strip", z.ZodTypeAny, {
|
|
109
|
-
singular: string;
|
|
110
|
-
plural: string;
|
|
111
|
-
}, {
|
|
112
|
-
singular: string;
|
|
113
|
-
plural: string;
|
|
114
|
-
}>;
|
|
65
|
+
type: z.ZodEnum<["boolean", "single_use", "continuous_use", "credit_system"]>;
|
|
115
66
|
credit_schema: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
116
67
|
metered_feature_id: z.ZodString;
|
|
117
68
|
credit_cost: z.ZodNumber;
|
|
@@ -123,41 +74,55 @@ declare const FeatureSchema: z.ZodObject<{
|
|
|
123
74
|
credit_cost: number;
|
|
124
75
|
}>, "many">>>;
|
|
125
76
|
}, "strip", z.ZodTypeAny, {
|
|
126
|
-
type: "boolean" | "continuous_use" | "credit_system" | "metered";
|
|
127
77
|
id: string;
|
|
128
78
|
name: string;
|
|
129
|
-
|
|
130
|
-
singular: string;
|
|
131
|
-
plural: string;
|
|
132
|
-
};
|
|
79
|
+
type: "boolean" | "single_use" | "continuous_use" | "credit_system";
|
|
133
80
|
credit_schema?: {
|
|
134
81
|
metered_feature_id: string;
|
|
135
82
|
credit_cost: number;
|
|
136
83
|
}[] | null | undefined;
|
|
137
84
|
}, {
|
|
138
|
-
type: "boolean" | "continuous_use" | "credit_system" | "metered";
|
|
139
85
|
id: string;
|
|
140
86
|
name: string;
|
|
141
|
-
|
|
142
|
-
singular: string;
|
|
143
|
-
plural: string;
|
|
144
|
-
};
|
|
87
|
+
type: "boolean" | "single_use" | "continuous_use" | "credit_system";
|
|
145
88
|
credit_schema?: {
|
|
146
89
|
metered_feature_id: string;
|
|
147
90
|
credit_cost: number;
|
|
148
91
|
}[] | null | undefined;
|
|
149
92
|
}>;
|
|
150
|
-
type ProductItem = z.infer<typeof ProductItemSchema>;
|
|
151
93
|
type Feature = z.infer<typeof FeatureSchema>;
|
|
152
94
|
type Product = z.infer<typeof ProductSchema>;
|
|
153
95
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
96
|
+
declare const ProductItemIntervalEnum: z.ZodEnum<["minute", "hour", "day", "week", "month", "quarter", "semi_annual", "year"]>;
|
|
97
|
+
declare const UsageModelEnum: z.ZodEnum<["prepaid", "pay_per_use"]>;
|
|
98
|
+
type ProductItemInterval = z.infer<typeof ProductItemIntervalEnum>;
|
|
99
|
+
type UsageModel = z.infer<typeof UsageModelEnum>;
|
|
100
|
+
declare const ProductItemSchema: z.ZodObject<{
|
|
101
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["feature", "priced_feature"]>>>;
|
|
102
|
+
feature_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
+
included_usage: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodLiteral<"inf">]>>>;
|
|
104
|
+
interval: z.ZodOptional<z.ZodNullable<z.ZodEnum<["minute", "hour", "day", "week", "month", "quarter", "semi_annual", "year"]>>>;
|
|
105
|
+
usage_model: z.ZodOptional<z.ZodNullable<z.ZodEnum<["prepaid", "pay_per_use"]>>>;
|
|
106
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
107
|
+
billing_units: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
type?: "feature" | "priced_feature" | null | undefined;
|
|
110
|
+
feature_id?: string | null | undefined;
|
|
111
|
+
included_usage?: number | "inf" | null | undefined;
|
|
112
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
113
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
114
|
+
price?: number | null | undefined;
|
|
115
|
+
billing_units?: number | null | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
type?: "feature" | "priced_feature" | null | undefined;
|
|
118
|
+
feature_id?: string | null | undefined;
|
|
119
|
+
included_usage?: number | "inf" | null | undefined;
|
|
120
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
121
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
122
|
+
price?: number | null | undefined;
|
|
123
|
+
billing_units?: number | null | undefined;
|
|
124
|
+
}>;
|
|
125
|
+
type ProductItem = z.infer<typeof ProductItemSchema>;
|
|
161
126
|
|
|
162
127
|
declare const product: (p: Product) => {
|
|
163
128
|
id: string;
|
|
@@ -166,36 +131,45 @@ declare const product: (p: Product) => {
|
|
|
166
131
|
type?: "feature" | "priced_feature" | null | undefined;
|
|
167
132
|
feature_id?: string | null | undefined;
|
|
168
133
|
included_usage?: number | "inf" | null | undefined;
|
|
169
|
-
interval?:
|
|
170
|
-
usage_model?:
|
|
134
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
135
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
171
136
|
price?: number | null | undefined;
|
|
172
137
|
billing_units?: number | null | undefined;
|
|
173
138
|
}[];
|
|
174
139
|
is_add_on?: boolean | undefined;
|
|
175
140
|
is_default?: boolean | undefined;
|
|
176
141
|
};
|
|
177
|
-
declare const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
142
|
+
declare const feature: (f: Feature) => {
|
|
143
|
+
id: string;
|
|
144
|
+
name: string;
|
|
145
|
+
type: "boolean" | "single_use" | "continuous_use" | "credit_system";
|
|
146
|
+
credit_schema?: {
|
|
147
|
+
metered_feature_id: string;
|
|
148
|
+
credit_cost: number;
|
|
149
|
+
}[] | null | undefined;
|
|
150
|
+
};
|
|
151
|
+
declare const featureItem: ({ feature_id, included_usage, interval, }: {
|
|
152
|
+
feature_id: string;
|
|
153
|
+
included_usage?: number;
|
|
154
|
+
interval?: ProductItemInterval;
|
|
155
|
+
}) => ProductItem;
|
|
181
156
|
declare const priceItem: ({ price, interval, }: {
|
|
182
157
|
price: number;
|
|
183
|
-
interval
|
|
158
|
+
interval?: ProductItemInterval;
|
|
184
159
|
}) => ProductItem;
|
|
185
160
|
declare const pricedFeatureItem: ({ feature_id, price, interval, included_usage, billing_units, usage_model, }: {
|
|
186
161
|
feature_id: string;
|
|
187
162
|
price: number;
|
|
188
|
-
interval
|
|
163
|
+
interval?: ProductItemInterval;
|
|
164
|
+
included_usage?: number;
|
|
189
165
|
billing_units?: number;
|
|
190
166
|
usage_model?: UsageModel;
|
|
191
|
-
included_usage?: number;
|
|
192
|
-
}) => ProductItem;
|
|
193
|
-
declare const featureItem: ({ feature_id, included_usage, interval, }: {
|
|
194
|
-
feature_id: string;
|
|
195
|
-
included_usage: number;
|
|
196
|
-
interval?: ProductItemInterval;
|
|
197
167
|
}) => ProductItem;
|
|
198
168
|
|
|
199
169
|
type Infinity = "infinity";
|
|
170
|
+
type AutumnConfig = {
|
|
171
|
+
products: Product[];
|
|
172
|
+
features: Feature[];
|
|
173
|
+
};
|
|
200
174
|
|
|
201
|
-
export { type Feature, type Infinity, type Product, type ProductItem,
|
|
175
|
+
export { type AutumnConfig, type Feature, type Infinity, type Product, type ProductItem, feature, featureItem, priceItem, pricedFeatureItem, product };
|
package/dist/compose/index.d.ts
CHANGED
|
@@ -1,44 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
declare enum ProductItemInterval {
|
|
4
|
-
Minute = "minute",
|
|
5
|
-
Hour = "hour",
|
|
6
|
-
Day = "day",
|
|
7
|
-
Week = "week",
|
|
8
|
-
Month = "month",
|
|
9
|
-
Quarter = "quarter",
|
|
10
|
-
SemiAnnual = "semi_annual",
|
|
11
|
-
Year = "year"
|
|
12
|
-
}
|
|
13
|
-
declare enum UsageModel {
|
|
14
|
-
Prepaid = "prepaid",
|
|
15
|
-
PayPerUse = "pay_per_use"
|
|
16
|
-
}
|
|
17
|
-
declare const ProductItemSchema: z.ZodObject<{
|
|
18
|
-
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["feature", "priced_feature"]>>>;
|
|
19
|
-
feature_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
-
included_usage: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodLiteral<"inf">]>>>;
|
|
21
|
-
interval: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof ProductItemInterval>>>;
|
|
22
|
-
usage_model: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof UsageModel>>>;
|
|
23
|
-
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
24
|
-
billing_units: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
25
|
-
}, "strip", z.ZodTypeAny, {
|
|
26
|
-
type?: "feature" | "priced_feature" | null | undefined;
|
|
27
|
-
feature_id?: string | null | undefined;
|
|
28
|
-
included_usage?: number | "inf" | null | undefined;
|
|
29
|
-
interval?: ProductItemInterval | null | undefined;
|
|
30
|
-
usage_model?: UsageModel | null | undefined;
|
|
31
|
-
price?: number | null | undefined;
|
|
32
|
-
billing_units?: number | null | undefined;
|
|
33
|
-
}, {
|
|
34
|
-
type?: "feature" | "priced_feature" | null | undefined;
|
|
35
|
-
feature_id?: string | null | undefined;
|
|
36
|
-
included_usage?: number | "inf" | null | undefined;
|
|
37
|
-
interval?: ProductItemInterval | null | undefined;
|
|
38
|
-
usage_model?: UsageModel | null | undefined;
|
|
39
|
-
price?: number | null | undefined;
|
|
40
|
-
billing_units?: number | null | undefined;
|
|
41
|
-
}>;
|
|
42
3
|
declare const ProductSchema: z.ZodObject<{
|
|
43
4
|
id: z.ZodString;
|
|
44
5
|
name: z.ZodString;
|
|
@@ -48,24 +9,24 @@ declare const ProductSchema: z.ZodObject<{
|
|
|
48
9
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["feature", "priced_feature"]>>>;
|
|
49
10
|
feature_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
11
|
included_usage: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodLiteral<"inf">]>>>;
|
|
51
|
-
interval: z.ZodOptional<z.ZodNullable<z.
|
|
52
|
-
usage_model: z.ZodOptional<z.ZodNullable<z.
|
|
12
|
+
interval: z.ZodOptional<z.ZodNullable<z.ZodEnum<["minute", "hour", "day", "week", "month", "quarter", "semi_annual", "year"]>>>;
|
|
13
|
+
usage_model: z.ZodOptional<z.ZodNullable<z.ZodEnum<["prepaid", "pay_per_use"]>>>;
|
|
53
14
|
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
54
15
|
billing_units: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
55
16
|
}, "strip", z.ZodTypeAny, {
|
|
56
17
|
type?: "feature" | "priced_feature" | null | undefined;
|
|
57
18
|
feature_id?: string | null | undefined;
|
|
58
19
|
included_usage?: number | "inf" | null | undefined;
|
|
59
|
-
interval?:
|
|
60
|
-
usage_model?:
|
|
20
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
21
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
61
22
|
price?: number | null | undefined;
|
|
62
23
|
billing_units?: number | null | undefined;
|
|
63
24
|
}, {
|
|
64
25
|
type?: "feature" | "priced_feature" | null | undefined;
|
|
65
26
|
feature_id?: string | null | undefined;
|
|
66
27
|
included_usage?: number | "inf" | null | undefined;
|
|
67
|
-
interval?:
|
|
68
|
-
usage_model?:
|
|
28
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
29
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
69
30
|
price?: number | null | undefined;
|
|
70
31
|
billing_units?: number | null | undefined;
|
|
71
32
|
}>, "many">;
|
|
@@ -76,8 +37,8 @@ declare const ProductSchema: z.ZodObject<{
|
|
|
76
37
|
type?: "feature" | "priced_feature" | null | undefined;
|
|
77
38
|
feature_id?: string | null | undefined;
|
|
78
39
|
included_usage?: number | "inf" | null | undefined;
|
|
79
|
-
interval?:
|
|
80
|
-
usage_model?:
|
|
40
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
41
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
81
42
|
price?: number | null | undefined;
|
|
82
43
|
billing_units?: number | null | undefined;
|
|
83
44
|
}[];
|
|
@@ -90,8 +51,8 @@ declare const ProductSchema: z.ZodObject<{
|
|
|
90
51
|
type?: "feature" | "priced_feature" | null | undefined;
|
|
91
52
|
feature_id?: string | null | undefined;
|
|
92
53
|
included_usage?: number | "inf" | null | undefined;
|
|
93
|
-
interval?:
|
|
94
|
-
usage_model?:
|
|
54
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
55
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
95
56
|
price?: number | null | undefined;
|
|
96
57
|
billing_units?: number | null | undefined;
|
|
97
58
|
}[];
|
|
@@ -101,17 +62,7 @@ declare const ProductSchema: z.ZodObject<{
|
|
|
101
62
|
declare const FeatureSchema: z.ZodObject<{
|
|
102
63
|
id: z.ZodString;
|
|
103
64
|
name: z.ZodString;
|
|
104
|
-
type: z.ZodEnum<["boolean", "
|
|
105
|
-
display: z.ZodObject<{
|
|
106
|
-
singular: z.ZodString;
|
|
107
|
-
plural: z.ZodString;
|
|
108
|
-
}, "strip", z.ZodTypeAny, {
|
|
109
|
-
singular: string;
|
|
110
|
-
plural: string;
|
|
111
|
-
}, {
|
|
112
|
-
singular: string;
|
|
113
|
-
plural: string;
|
|
114
|
-
}>;
|
|
65
|
+
type: z.ZodEnum<["boolean", "single_use", "continuous_use", "credit_system"]>;
|
|
115
66
|
credit_schema: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
116
67
|
metered_feature_id: z.ZodString;
|
|
117
68
|
credit_cost: z.ZodNumber;
|
|
@@ -123,41 +74,55 @@ declare const FeatureSchema: z.ZodObject<{
|
|
|
123
74
|
credit_cost: number;
|
|
124
75
|
}>, "many">>>;
|
|
125
76
|
}, "strip", z.ZodTypeAny, {
|
|
126
|
-
type: "boolean" | "continuous_use" | "credit_system" | "metered";
|
|
127
77
|
id: string;
|
|
128
78
|
name: string;
|
|
129
|
-
|
|
130
|
-
singular: string;
|
|
131
|
-
plural: string;
|
|
132
|
-
};
|
|
79
|
+
type: "boolean" | "single_use" | "continuous_use" | "credit_system";
|
|
133
80
|
credit_schema?: {
|
|
134
81
|
metered_feature_id: string;
|
|
135
82
|
credit_cost: number;
|
|
136
83
|
}[] | null | undefined;
|
|
137
84
|
}, {
|
|
138
|
-
type: "boolean" | "continuous_use" | "credit_system" | "metered";
|
|
139
85
|
id: string;
|
|
140
86
|
name: string;
|
|
141
|
-
|
|
142
|
-
singular: string;
|
|
143
|
-
plural: string;
|
|
144
|
-
};
|
|
87
|
+
type: "boolean" | "single_use" | "continuous_use" | "credit_system";
|
|
145
88
|
credit_schema?: {
|
|
146
89
|
metered_feature_id: string;
|
|
147
90
|
credit_cost: number;
|
|
148
91
|
}[] | null | undefined;
|
|
149
92
|
}>;
|
|
150
|
-
type ProductItem = z.infer<typeof ProductItemSchema>;
|
|
151
93
|
type Feature = z.infer<typeof FeatureSchema>;
|
|
152
94
|
type Product = z.infer<typeof ProductSchema>;
|
|
153
95
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
96
|
+
declare const ProductItemIntervalEnum: z.ZodEnum<["minute", "hour", "day", "week", "month", "quarter", "semi_annual", "year"]>;
|
|
97
|
+
declare const UsageModelEnum: z.ZodEnum<["prepaid", "pay_per_use"]>;
|
|
98
|
+
type ProductItemInterval = z.infer<typeof ProductItemIntervalEnum>;
|
|
99
|
+
type UsageModel = z.infer<typeof UsageModelEnum>;
|
|
100
|
+
declare const ProductItemSchema: z.ZodObject<{
|
|
101
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["feature", "priced_feature"]>>>;
|
|
102
|
+
feature_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
+
included_usage: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodLiteral<"inf">]>>>;
|
|
104
|
+
interval: z.ZodOptional<z.ZodNullable<z.ZodEnum<["minute", "hour", "day", "week", "month", "quarter", "semi_annual", "year"]>>>;
|
|
105
|
+
usage_model: z.ZodOptional<z.ZodNullable<z.ZodEnum<["prepaid", "pay_per_use"]>>>;
|
|
106
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
107
|
+
billing_units: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
type?: "feature" | "priced_feature" | null | undefined;
|
|
110
|
+
feature_id?: string | null | undefined;
|
|
111
|
+
included_usage?: number | "inf" | null | undefined;
|
|
112
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
113
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
114
|
+
price?: number | null | undefined;
|
|
115
|
+
billing_units?: number | null | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
type?: "feature" | "priced_feature" | null | undefined;
|
|
118
|
+
feature_id?: string | null | undefined;
|
|
119
|
+
included_usage?: number | "inf" | null | undefined;
|
|
120
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
121
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
122
|
+
price?: number | null | undefined;
|
|
123
|
+
billing_units?: number | null | undefined;
|
|
124
|
+
}>;
|
|
125
|
+
type ProductItem = z.infer<typeof ProductItemSchema>;
|
|
161
126
|
|
|
162
127
|
declare const product: (p: Product) => {
|
|
163
128
|
id: string;
|
|
@@ -166,36 +131,45 @@ declare const product: (p: Product) => {
|
|
|
166
131
|
type?: "feature" | "priced_feature" | null | undefined;
|
|
167
132
|
feature_id?: string | null | undefined;
|
|
168
133
|
included_usage?: number | "inf" | null | undefined;
|
|
169
|
-
interval?:
|
|
170
|
-
usage_model?:
|
|
134
|
+
interval?: "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | null | undefined;
|
|
135
|
+
usage_model?: "prepaid" | "pay_per_use" | null | undefined;
|
|
171
136
|
price?: number | null | undefined;
|
|
172
137
|
billing_units?: number | null | undefined;
|
|
173
138
|
}[];
|
|
174
139
|
is_add_on?: boolean | undefined;
|
|
175
140
|
is_default?: boolean | undefined;
|
|
176
141
|
};
|
|
177
|
-
declare const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
142
|
+
declare const feature: (f: Feature) => {
|
|
143
|
+
id: string;
|
|
144
|
+
name: string;
|
|
145
|
+
type: "boolean" | "single_use" | "continuous_use" | "credit_system";
|
|
146
|
+
credit_schema?: {
|
|
147
|
+
metered_feature_id: string;
|
|
148
|
+
credit_cost: number;
|
|
149
|
+
}[] | null | undefined;
|
|
150
|
+
};
|
|
151
|
+
declare const featureItem: ({ feature_id, included_usage, interval, }: {
|
|
152
|
+
feature_id: string;
|
|
153
|
+
included_usage?: number;
|
|
154
|
+
interval?: ProductItemInterval;
|
|
155
|
+
}) => ProductItem;
|
|
181
156
|
declare const priceItem: ({ price, interval, }: {
|
|
182
157
|
price: number;
|
|
183
|
-
interval
|
|
158
|
+
interval?: ProductItemInterval;
|
|
184
159
|
}) => ProductItem;
|
|
185
160
|
declare const pricedFeatureItem: ({ feature_id, price, interval, included_usage, billing_units, usage_model, }: {
|
|
186
161
|
feature_id: string;
|
|
187
162
|
price: number;
|
|
188
|
-
interval
|
|
163
|
+
interval?: ProductItemInterval;
|
|
164
|
+
included_usage?: number;
|
|
189
165
|
billing_units?: number;
|
|
190
166
|
usage_model?: UsageModel;
|
|
191
|
-
included_usage?: number;
|
|
192
|
-
}) => ProductItem;
|
|
193
|
-
declare const featureItem: ({ feature_id, included_usage, interval, }: {
|
|
194
|
-
feature_id: string;
|
|
195
|
-
included_usage: number;
|
|
196
|
-
interval?: ProductItemInterval;
|
|
197
167
|
}) => ProductItem;
|
|
198
168
|
|
|
199
169
|
type Infinity = "infinity";
|
|
170
|
+
type AutumnConfig = {
|
|
171
|
+
products: Product[];
|
|
172
|
+
features: Feature[];
|
|
173
|
+
};
|
|
200
174
|
|
|
201
|
-
export { type Feature, type Infinity, type Product, type ProductItem,
|
|
175
|
+
export { type AutumnConfig, type Feature, type Infinity, type Product, type ProductItem, feature, featureItem, priceItem, pricedFeatureItem, product };
|
package/dist/compose/index.js
CHANGED
|
@@ -20,9 +20,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/compose/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
-
ProductItemInterval: () => ProductItemInterval,
|
|
24
|
-
UsageModel: () => UsageModel,
|
|
25
|
-
auth: () => auth,
|
|
26
23
|
feature: () => feature,
|
|
27
24
|
featureItem: () => featureItem,
|
|
28
25
|
priceItem: () => priceItem,
|
|
@@ -31,72 +28,20 @@ __export(index_exports, {
|
|
|
31
28
|
});
|
|
32
29
|
module.exports = __toCommonJS(index_exports);
|
|
33
30
|
|
|
34
|
-
// src/compose/
|
|
35
|
-
var import_zod = require("zod");
|
|
36
|
-
var ProductItemInterval = /* @__PURE__ */ ((ProductItemInterval3) => {
|
|
37
|
-
ProductItemInterval3["Minute"] = "minute";
|
|
38
|
-
ProductItemInterval3["Hour"] = "hour";
|
|
39
|
-
ProductItemInterval3["Day"] = "day";
|
|
40
|
-
ProductItemInterval3["Week"] = "week";
|
|
41
|
-
ProductItemInterval3["Month"] = "month";
|
|
42
|
-
ProductItemInterval3["Quarter"] = "quarter";
|
|
43
|
-
ProductItemInterval3["SemiAnnual"] = "semi_annual";
|
|
44
|
-
ProductItemInterval3["Year"] = "year";
|
|
45
|
-
return ProductItemInterval3;
|
|
46
|
-
})(ProductItemInterval || {});
|
|
47
|
-
var UsageModel = /* @__PURE__ */ ((UsageModel2) => {
|
|
48
|
-
UsageModel2["Prepaid"] = "prepaid";
|
|
49
|
-
UsageModel2["PayPerUse"] = "pay_per_use";
|
|
50
|
-
return UsageModel2;
|
|
51
|
-
})(UsageModel || {});
|
|
52
|
-
var ProductItemSchema = import_zod.z.object({
|
|
53
|
-
// Feature stuff
|
|
54
|
-
type: import_zod.z.enum(["feature", "priced_feature"]).nullish(),
|
|
55
|
-
feature_id: import_zod.z.string().nullish(),
|
|
56
|
-
included_usage: import_zod.z.union([import_zod.z.number(), import_zod.z.literal("inf")]).nullish(),
|
|
57
|
-
interval: import_zod.z.nativeEnum(ProductItemInterval).nullish(),
|
|
58
|
-
// Price config
|
|
59
|
-
usage_model: import_zod.z.nativeEnum(UsageModel).nullish(),
|
|
60
|
-
price: import_zod.z.number().nullish(),
|
|
61
|
-
billing_units: import_zod.z.number().nullish()
|
|
62
|
-
// amount per billing unit (eg. $9 / 250 units)
|
|
63
|
-
});
|
|
64
|
-
var ProductSchema = import_zod.z.object({
|
|
65
|
-
id: import_zod.z.string().nonempty(),
|
|
66
|
-
name: import_zod.z.string().nonempty(),
|
|
67
|
-
is_add_on: import_zod.z.boolean().default(false).optional(),
|
|
68
|
-
is_default: import_zod.z.boolean().default(false).optional(),
|
|
69
|
-
items: import_zod.z.array(ProductItemSchema)
|
|
70
|
-
});
|
|
71
|
-
var FeatureSchema = import_zod.z.object({
|
|
72
|
-
id: import_zod.z.string().nonempty(),
|
|
73
|
-
name: import_zod.z.string().nonempty(),
|
|
74
|
-
type: import_zod.z.enum(["boolean", "continuous_use", "credit_system", "metered"]),
|
|
75
|
-
display: import_zod.z.object({
|
|
76
|
-
singular: import_zod.z.string(),
|
|
77
|
-
plural: import_zod.z.string()
|
|
78
|
-
}),
|
|
79
|
-
credit_schema: import_zod.z.array(
|
|
80
|
-
import_zod.z.object({
|
|
81
|
-
metered_feature_id: import_zod.z.string(),
|
|
82
|
-
credit_cost: import_zod.z.number()
|
|
83
|
-
})
|
|
84
|
-
).nullish()
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
// src/compose/builders/core.ts
|
|
31
|
+
// src/compose/builders/builderFunctions.ts
|
|
88
32
|
var product = (p) => p;
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
33
|
+
var feature = (f) => f;
|
|
34
|
+
var featureItem = ({
|
|
35
|
+
feature_id,
|
|
36
|
+
included_usage,
|
|
37
|
+
interval
|
|
38
|
+
}) => {
|
|
39
|
+
return {
|
|
40
|
+
included_usage,
|
|
41
|
+
feature_id,
|
|
42
|
+
interval
|
|
43
|
+
};
|
|
44
|
+
};
|
|
100
45
|
var priceItem = ({
|
|
101
46
|
price,
|
|
102
47
|
interval
|
|
@@ -112,7 +57,7 @@ var pricedFeatureItem = ({
|
|
|
112
57
|
interval,
|
|
113
58
|
included_usage = void 0,
|
|
114
59
|
billing_units = 1,
|
|
115
|
-
usage_model = "
|
|
60
|
+
usage_model = "pay_per_use"
|
|
116
61
|
}) => {
|
|
117
62
|
return {
|
|
118
63
|
price,
|
|
@@ -123,22 +68,8 @@ var pricedFeatureItem = ({
|
|
|
123
68
|
included_usage
|
|
124
69
|
};
|
|
125
70
|
};
|
|
126
|
-
var featureItem = ({
|
|
127
|
-
feature_id,
|
|
128
|
-
included_usage,
|
|
129
|
-
interval
|
|
130
|
-
}) => {
|
|
131
|
-
return {
|
|
132
|
-
included_usage,
|
|
133
|
-
interval,
|
|
134
|
-
feature_id
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
71
|
// Annotate the CommonJS export names for ESM import in node:
|
|
138
72
|
0 && (module.exports = {
|
|
139
|
-
ProductItemInterval,
|
|
140
|
-
UsageModel,
|
|
141
|
-
auth,
|
|
142
73
|
feature,
|
|
143
74
|
featureItem,
|
|
144
75
|
priceItem,
|