@m5kdev/web-ui 0.8.4 → 0.8.6
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/packages/backend/dist/src/modules/billing/billing.repository.d.mts +10 -10
- package/dist/packages/backend/dist/src/modules/billing/billing.service.d.mts +6 -6
- package/dist/src/components/Calendar.mjs +11 -2
- package/dist/src/components/Calendar.mjs.map +1 -1
- package/dist/src/components/ui/badge.d.mts +1 -1
- package/dist/src/components/ui/button.d.mts +1 -1
- package/package.json +5 -5
|
@@ -2714,7 +2714,7 @@ declare const schema: {
|
|
|
2714
2714
|
type Schema = typeof schema;
|
|
2715
2715
|
type Orm = LibSQLDatabase<Schema>;
|
|
2716
2716
|
declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<string, never>, Schema["subscriptions"]> {
|
|
2717
|
-
stripe: Stripe;
|
|
2717
|
+
stripe: Stripe$1;
|
|
2718
2718
|
plans: StripePlan[];
|
|
2719
2719
|
trial?: StripePlan;
|
|
2720
2720
|
constructor(options: {
|
|
@@ -2722,7 +2722,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2722
2722
|
schema: Schema;
|
|
2723
2723
|
table: Schema["subscriptions"];
|
|
2724
2724
|
libs: {
|
|
2725
|
-
stripe: Stripe;
|
|
2725
|
+
stripe: Stripe$1;
|
|
2726
2726
|
};
|
|
2727
2727
|
config: {
|
|
2728
2728
|
trial?: StripePlan;
|
|
@@ -2731,7 +2731,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2731
2731
|
});
|
|
2732
2732
|
hasTrial(): boolean;
|
|
2733
2733
|
getPlanByPriceId(priceId: string): StripePlan | undefined;
|
|
2734
|
-
getCustomerByEmail(email: string): ServerResultAsync<Stripe.Customer | null>;
|
|
2734
|
+
getCustomerByEmail(email: string): ServerResultAsync<Stripe$1.Customer | null>;
|
|
2735
2735
|
getUserByCustomerId(customerId: string): ServerResultAsync<InferSelectModel<Schema["users"]> | null>;
|
|
2736
2736
|
createCustomer({
|
|
2737
2737
|
email,
|
|
@@ -2741,8 +2741,8 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2741
2741
|
email: string;
|
|
2742
2742
|
name?: string;
|
|
2743
2743
|
userId: string;
|
|
2744
|
-
}): ServerResultAsync<Stripe.Customer>;
|
|
2745
|
-
createTrialSubscription(customerId: string): ServerResultAsync<Stripe.Subscription>;
|
|
2744
|
+
}): ServerResultAsync<Stripe$1.Customer>;
|
|
2745
|
+
createTrialSubscription(customerId: string): ServerResultAsync<Stripe$1.Subscription>;
|
|
2746
2746
|
createSubscription({
|
|
2747
2747
|
customerId,
|
|
2748
2748
|
priceId,
|
|
@@ -2753,7 +2753,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2753
2753
|
priceId: string;
|
|
2754
2754
|
quantity?: number;
|
|
2755
2755
|
trialDays?: number;
|
|
2756
|
-
}): ServerResultAsync<Stripe.Subscription>;
|
|
2756
|
+
}): ServerResultAsync<Stripe$1.Subscription>;
|
|
2757
2757
|
updateUserCustomerId({
|
|
2758
2758
|
userId,
|
|
2759
2759
|
customerId
|
|
@@ -2763,7 +2763,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2763
2763
|
}): ServerResultAsync<InferSelectModel<Schema["users"]>>;
|
|
2764
2764
|
getLatestSubscription(referenceId: string): ServerResultAsync<BillingSchema | null>;
|
|
2765
2765
|
getActiveSubscription(referenceId: string): ServerResultAsync<BillingSchema | null>;
|
|
2766
|
-
listInvoices(customerId: string): ServerResultAsync<Stripe.Invoice[]>;
|
|
2766
|
+
listInvoices(customerId: string): ServerResultAsync<Stripe$1.Invoice[]>;
|
|
2767
2767
|
createCheckoutSession({
|
|
2768
2768
|
customerId,
|
|
2769
2769
|
priceId,
|
|
@@ -2772,8 +2772,8 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2772
2772
|
customerId: string;
|
|
2773
2773
|
priceId: string;
|
|
2774
2774
|
userId: string;
|
|
2775
|
-
}): ServerResultAsync<Stripe.Checkout.Session>;
|
|
2776
|
-
createBillingPortalSession(customerId: string): ServerResultAsync<Stripe.BillingPortal.Session>;
|
|
2775
|
+
}): ServerResultAsync<Stripe$1.Checkout.Session>;
|
|
2776
|
+
createBillingPortalSession(customerId: string): ServerResultAsync<Stripe$1.BillingPortal.Session>;
|
|
2777
2777
|
syncStripeData({
|
|
2778
2778
|
customerId,
|
|
2779
2779
|
userId
|
|
@@ -2781,7 +2781,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2781
2781
|
customerId: string;
|
|
2782
2782
|
userId: string;
|
|
2783
2783
|
}): ServerResultAsync<boolean>;
|
|
2784
|
-
constructEvent(body: Buffer | string, signature: string, secret: string): ServerResult<Stripe.Event>;
|
|
2784
|
+
constructEvent(body: Buffer | string, signature: string, secret: string): ServerResult<Stripe$1.Event>;
|
|
2785
2785
|
} //#endregion
|
|
2786
2786
|
//#endregion
|
|
2787
2787
|
export { BillingRepository };
|
|
@@ -18,7 +18,7 @@ declare class BillingService extends BaseService<{
|
|
|
18
18
|
email: string;
|
|
19
19
|
name?: string;
|
|
20
20
|
};
|
|
21
|
-
}): ServerResultAsync<Stripe
|
|
21
|
+
}): ServerResultAsync<Stripe.Customer>;
|
|
22
22
|
createUserHook({
|
|
23
23
|
user
|
|
24
24
|
}: {
|
|
@@ -29,7 +29,7 @@ declare class BillingService extends BaseService<{
|
|
|
29
29
|
};
|
|
30
30
|
}): ServerResultAsync<boolean>;
|
|
31
31
|
getActiveSubscription(ctx: Context): ServerResultAsync<BillingSchema | null>;
|
|
32
|
-
listInvoices(ctx: Context): ServerResultAsync<Stripe
|
|
32
|
+
listInvoices(ctx: Context): ServerResultAsync<Stripe.Invoice[]>;
|
|
33
33
|
createCheckoutSession({
|
|
34
34
|
priceId
|
|
35
35
|
}: {
|
|
@@ -38,15 +38,15 @@ declare class BillingService extends BaseService<{
|
|
|
38
38
|
user
|
|
39
39
|
}: {
|
|
40
40
|
user: User;
|
|
41
|
-
}): ServerResultAsync<Stripe
|
|
41
|
+
}): ServerResultAsync<Stripe.Checkout.Session>;
|
|
42
42
|
createBillingPortalSession({
|
|
43
43
|
user
|
|
44
44
|
}: {
|
|
45
45
|
user: User;
|
|
46
|
-
}): ServerResultAsync<Stripe
|
|
47
|
-
constructEvent(body: Buffer | string, signature: string): ServerResult<Stripe
|
|
46
|
+
}): ServerResultAsync<Stripe.BillingPortal.Session>;
|
|
47
|
+
constructEvent(body: Buffer | string, signature: string): ServerResult<Stripe.Event>;
|
|
48
48
|
syncStripeData(customerId: string, eventType?: string): ServerResultAsync<boolean>;
|
|
49
|
-
processEvent(event: Stripe
|
|
49
|
+
processEvent(event: Stripe.Event): ServerResultAsync<boolean>;
|
|
50
50
|
} //#endregion
|
|
51
51
|
//#endregion
|
|
52
52
|
export { BillingService };
|
|
@@ -2,10 +2,19 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
4
|
import { Calendar as Calendar$1, dayjsLocalizer } from "react-big-calendar";
|
|
5
|
-
import
|
|
5
|
+
import * as dragAndDropModule from "react-big-calendar/lib/addons/dragAndDrop/index.js";
|
|
6
6
|
import "react-big-calendar/lib/addons/dragAndDrop/styles.css";
|
|
7
7
|
//#region src/components/Calendar.tsx
|
|
8
|
-
|
|
8
|
+
/** react-big-calendar's DnD addon ships as CJS; Vite/Rollup default interop can nest `.default`. */
|
|
9
|
+
function resolveWithDragAndDrop(mod) {
|
|
10
|
+
if (typeof mod === "function") return mod;
|
|
11
|
+
if (typeof mod !== "object" || mod === null) throw new Error("@m5kdev/web-ui Calendar: invalid react-big-calendar drag-and-drop module (expected object).");
|
|
12
|
+
const exported = mod.default;
|
|
13
|
+
if (typeof exported === "function") return exported;
|
|
14
|
+
if (exported !== null && typeof exported === "object" && "default" in exported && typeof exported.default === "function") return exported.default;
|
|
15
|
+
throw new Error("@m5kdev/web-ui Calendar: could not load react-big-calendar drag-and-drop addon (CJS/ESM interop).");
|
|
16
|
+
}
|
|
17
|
+
const DnDCalendar = resolveWithDragAndDrop(dragAndDropModule)(Calendar$1);
|
|
9
18
|
const localizer = dayjsLocalizer(dayjs);
|
|
10
19
|
const TypedDnDCalendar = DnDCalendar;
|
|
11
20
|
const Calendar = (props) => /* @__PURE__ */ jsx(TypedDnDCalendar, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.mjs","names":["BigCalendar"],"sources":["../../../src/components/Calendar.tsx"],"sourcesContent":["import dayjs from \"dayjs\";\r\nimport type React from \"react\";\r\nimport { Calendar as BigCalendar, type CalendarProps, dayjsLocalizer } from \"react-big-calendar\";\r\nimport
|
|
1
|
+
{"version":3,"file":"Calendar.mjs","names":["BigCalendar"],"sources":["../../../src/components/Calendar.tsx"],"sourcesContent":["import dayjs from \"dayjs\";\r\nimport type React from \"react\";\r\nimport { Calendar as BigCalendar, type CalendarProps, dayjsLocalizer } from \"react-big-calendar\";\r\nimport * as dragAndDropModule from \"react-big-calendar/lib/addons/dragAndDrop\";\r\nimport \"react-big-calendar/lib/addons/dragAndDrop/styles.css\";\r\nimport \"./Calendar.css\";\r\n// FIXME: react-big calendar as peer dependency\r\ntype DragAndDropHoc = (Cal: typeof BigCalendar) => React.ComponentType<CalendarProps>;\r\n\r\n/** react-big-calendar's DnD addon ships as CJS; Vite/Rollup default interop can nest `.default`. */\r\nfunction resolveWithDragAndDrop(mod: unknown): DragAndDropHoc {\r\n if (typeof mod === \"function\") {\r\n return mod as DragAndDropHoc;\r\n }\r\n if (typeof mod !== \"object\" || mod === null) {\r\n throw new Error(\r\n \"@m5kdev/web-ui Calendar: invalid react-big-calendar drag-and-drop module (expected object).\"\r\n );\r\n }\r\n const exported = (mod as { default?: unknown }).default;\r\n if (typeof exported === \"function\") {\r\n return exported as DragAndDropHoc;\r\n }\r\n if (\r\n exported !== null &&\r\n typeof exported === \"object\" &&\r\n \"default\" in exported &&\r\n typeof (exported as { default: unknown }).default === \"function\"\r\n ) {\r\n return (exported as { default: DragAndDropHoc }).default;\r\n }\r\n throw new Error(\r\n \"@m5kdev/web-ui Calendar: could not load react-big-calendar drag-and-drop addon (CJS/ESM interop).\"\r\n );\r\n}\r\n\r\nconst withDragAndDrop = resolveWithDragAndDrop(dragAndDropModule);\r\nconst DnDCalendar = withDragAndDrop(BigCalendar);\r\nconst localizer = dayjsLocalizer(dayjs);\r\n\r\ntype CalendarComponents = NonNullable<CalendarProps[\"components\"]>;\r\nexport type CalendarEventRenderer = CalendarComponents extends { event?: infer T }\r\n ? Exclude<T, undefined>\r\n : never;\r\n\r\ninterface DragAndDropCalendarProps extends Omit<CalendarProps, \"localizer\"> {\r\n onEventDrop?: (args: { event: unknown; start: Date; end: Date }) => void;\r\n onEventResize?: (args: { event: unknown; start: Date; end: Date }) => void;\r\n onDragStart?: (args: { event: unknown; action: \"move\" | \"resize\"; direction?: unknown }) => void;\r\n dragFromOutsideItem?: () => unknown;\r\n onDropFromOutside?: (args: { start: Date; end: Date; allDay?: boolean }) => void;\r\n onDragOverFromOutside?: (event: React.DragEvent) => void;\r\n resizable?: boolean;\r\n}\r\n\r\nconst TypedDnDCalendar = DnDCalendar as React.ComponentType<\r\n DragAndDropCalendarProps & { localizer: typeof localizer }\r\n>;\r\n\r\nexport const Calendar = (props: DragAndDropCalendarProps) => (\r\n <TypedDnDCalendar {...props} localizer={localizer} />\r\n);\r\n"],"mappings":";;;;;;;;AAUA,SAAS,uBAAuB,KAA8B;AAC5D,KAAI,OAAO,QAAQ,WACjB,QAAO;AAET,KAAI,OAAO,QAAQ,YAAY,QAAQ,KACrC,OAAM,IAAI,MACR,8FACD;CAEH,MAAM,WAAY,IAA8B;AAChD,KAAI,OAAO,aAAa,WACtB,QAAO;AAET,KACE,aAAa,QACb,OAAO,aAAa,YACpB,aAAa,YACb,OAAQ,SAAkC,YAAY,WAEtD,QAAQ,SAAyC;AAEnD,OAAM,IAAI,MACR,oGACD;;AAIH,MAAM,cADkB,uBAAuB,kBAAkB,CAC7BA,WAAY;AAChD,MAAM,YAAY,eAAe,MAAM;AAiBvC,MAAM,mBAAmB;AAIzB,MAAa,YAAY,UACvB,oBAAC,kBAAD;CAAkB,GAAI;CAAkB;CAAa,CAAA"}
|
|
@@ -5,7 +5,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
|
|
|
5
5
|
|
|
6
6
|
//#region src/components/ui/badge.d.ts
|
|
7
7
|
declare const badgeVariants: (props?: ({
|
|
8
|
-
variant?: "default" | "destructive" | "
|
|
8
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | null | undefined;
|
|
9
9
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
10
|
interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
|
11
11
|
declare function Badge({
|
|
@@ -4,7 +4,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/ui/button.d.ts
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
|
-
variant?: "link" | "default" | "destructive" | "
|
|
7
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
8
8
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
9
9
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
10
|
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m5kdev/web-ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
4
4
|
"license": "GPL-3.0-only",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"zod": "4.2.1",
|
|
68
68
|
"@tanstack/react-query": "5.83.0",
|
|
69
69
|
"@trpc/tanstack-react-query": "11.4.3",
|
|
70
|
-
"@m5kdev/commons": "0.8.
|
|
71
|
-
"@m5kdev/frontend": "0.8.
|
|
70
|
+
"@m5kdev/commons": "0.8.6",
|
|
71
|
+
"@m5kdev/frontend": "0.8.6"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@tsdown/css": "0.21.7",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"globals": "16.3.0",
|
|
81
81
|
"tsdown": "0.21.7",
|
|
82
82
|
"vite": "7.0.4",
|
|
83
|
-
"@m5kdev/
|
|
84
|
-
"@m5kdev/
|
|
83
|
+
"@m5kdev/backend": "0.8.6",
|
|
84
|
+
"@m5kdev/config": "0.8.6"
|
|
85
85
|
},
|
|
86
86
|
"exports": {
|
|
87
87
|
"./components/*": {
|