@greatapps/common 1.1.71 → 1.1.73
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/components/layouts/AppNavBar.mjs +0 -2
- package/dist/components/layouts/AppNavBar.mjs.map +1 -1
- package/dist/components/layouts/NotificationItem.mjs +4 -7
- package/dist/components/layouts/NotificationItem.mjs.map +1 -1
- package/dist/components/layouts/NotificationsPopover.mjs +22 -12
- package/dist/components/layouts/NotificationsPopover.mjs.map +1 -1
- package/dist/index.mjs +151 -21
- package/dist/index.mjs.map +1 -1
- package/dist/modules/auth/actions/login.action.mjs +1 -1
- package/dist/modules/auth/actions/login.action.mjs.map +1 -1
- package/dist/modules/auth/hooks/login.hook.mjs +5 -1
- package/dist/modules/auth/hooks/login.hook.mjs.map +1 -1
- package/dist/modules/auth/hooks/useUserQuery.mjs +2 -1
- package/dist/modules/auth/hooks/useUserQuery.mjs.map +1 -1
- package/dist/modules/auth/services/auth.service.mjs +2 -2
- package/dist/modules/auth/services/auth.service.mjs.map +1 -1
- package/dist/modules/users/action/list-messages.action.mjs +9 -0
- package/dist/modules/users/action/list-messages.action.mjs.map +1 -0
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs +9 -0
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +1 -0
- package/dist/modules/users/action/mark-message-as-read.action.mjs +9 -0
- package/dist/modules/users/action/mark-message-as-read.action.mjs.map +1 -0
- package/dist/modules/users/hooks/messages.hook.mjs +38 -0
- package/dist/modules/users/hooks/messages.hook.mjs.map +1 -0
- package/dist/modules/users/schema/messages.schema.mjs +21 -0
- package/dist/modules/users/schema/messages.schema.mjs.map +1 -0
- package/dist/modules/users/services/messages.service.mjs +35 -0
- package/dist/modules/users/services/messages.service.mjs.map +1 -0
- package/dist/providers/auth.provider.mjs +3 -5
- package/dist/providers/auth.provider.mjs.map +1 -1
- package/dist/utils/safeServerAction.mjs +22 -0
- package/dist/utils/safeServerAction.mjs.map +1 -0
- package/package.json +1 -1
- package/src/components/layouts/AppNavBar.tsx +0 -4
- package/src/components/layouts/NotificationItem.tsx +2 -2
- package/src/components/layouts/NotificationsPopover.tsx +25 -22
- package/src/index.ts +267 -117
- package/src/modules/auth/actions/login.action.ts +1 -1
- package/src/modules/auth/hooks/login.hook.tsx +6 -1
- package/src/modules/auth/hooks/useUserQuery.ts +2 -1
- package/src/modules/auth/schema.ts +6 -4
- package/src/modules/auth/services/auth.service.ts +2 -2
- package/src/modules/users/action/list-messages.action.ts +10 -0
- package/src/modules/users/action/mark-all-messages-as-read.action.ts +8 -0
- package/src/modules/users/action/mark-message-as-read.action.ts +8 -0
- package/src/modules/users/hooks/messages.hook.ts +39 -0
- package/src/modules/users/schema/messages.schema.ts +46 -0
- package/src/modules/users/services/messages.service.ts +48 -0
- package/src/providers/auth.provider.tsx +6 -9
- package/src/utils/safeServerAction.ts +27 -0
|
@@ -17,7 +17,6 @@ function AppNavBar({
|
|
|
17
17
|
onExpandClick,
|
|
18
18
|
menuItems = [],
|
|
19
19
|
onCreditsClick,
|
|
20
|
-
notifications,
|
|
21
20
|
onNotificationsViewAll
|
|
22
21
|
}) {
|
|
23
22
|
const router = useRouter();
|
|
@@ -53,7 +52,6 @@ function AppNavBar({
|
|
|
53
52
|
/* @__PURE__ */ jsx(
|
|
54
53
|
NotificationsPopover,
|
|
55
54
|
{
|
|
56
|
-
notifications,
|
|
57
55
|
onViewAll: onNotificationsViewAll
|
|
58
56
|
}
|
|
59
57
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/layouts/AppNavBar.tsx"],"sourcesContent":["'use client';\n\nimport Image from 'next/image';\nimport { useRouter } from 'next/navigation';\nimport { NavBar } from './NavBar';\nimport { ProfilePopover } from './ProfilePopover';\nimport { NotificationsPopover } from './NotificationsPopover';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../ui/overlay/Tooltip';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport type { ProfileMenuItem } from './ProfilePopover';\
|
|
1
|
+
{"version":3,"sources":["../../../src/components/layouts/AppNavBar.tsx"],"sourcesContent":["'use client';\n\nimport Image from 'next/image';\nimport { useRouter } from 'next/navigation';\nimport { NavBar } from './NavBar';\nimport { ProfilePopover } from './ProfilePopover';\nimport { NotificationsPopover } from './NotificationsPopover';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../ui/overlay/Tooltip';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport type { ProfileMenuItem } from './ProfilePopover';\n\nexport interface AppNavBarProps {\n onLogoClick?: () => void;\n logoIndicatorClassName?: string;\n appIconHref?: string;\n appIconActive?: boolean;\n /** Controls the left-side indicator bar on the app icon (opacity transition) */\n appIconIndicator?: boolean;\n showExpandButton?: boolean;\n onExpandClick?: () => void;\n menuItems?: ProfileMenuItem[];\n onCreditsClick?: () => void;\n onNotificationsViewAll?: () => void;\n}\n\nexport function AppNavBar({\n onLogoClick,\n logoIndicatorClassName,\n appIconHref = '/',\n appIconActive = false,\n appIconIndicator = false,\n showExpandButton = false,\n onExpandClick,\n menuItems = [],\n onCreditsClick,\n onNotificationsViewAll,\n}: AppNavBarProps) {\n const router = useRouter();\n const { openConfigurations } = useAccountModals();\n\n const handleLogoClick = onLogoClick ?? (() => router.push('/'));\n const handleAppIconClick = () => router.push(appIconHref);\n\n return (\n <NavBar\n onLogoClick={handleLogoClick}\n logoIndicatorClassName={logoIndicatorClassName}\n showExpandButton={showExpandButton}\n onExpandClick={onExpandClick}\n appIconSlot={\n <div className=\"relative\">\n <Tooltip>\n <TooltipTrigger asChild onClick={handleAppIconClick}>\n <div\n className={`size-10 flex items-center justify-center rounded-lg hover:bg-pages-100 cursor-pointer transition-colors duration-300 ${\n appIconActive ? 'bg-pages-300' : 'bg-pages-50'\n }`}\n >\n <Image src=\"/icons/icon-navbar.svg\" alt=\"GreatPages\" width={24} height={24} />\n </div>\n </TooltipTrigger>\n <TooltipContent side=\"right\">GreatPages</TooltipContent>\n </Tooltip>\n <div\n className={`absolute -left-4 top-1/2 -translate-y-1/2 w-[3px] h-5 bg-pages-300 rounded-r-xl transition-opacity duration-300 ${\n appIconIndicator ? 'opacity-100' : 'opacity-0'\n }`}\n />\n </div>\n }\n >\n <NotificationsPopover\n onViewAll={onNotificationsViewAll}\n />\n <ProfilePopover\n onEditProfile={() => openConfigurations()}\n onCreditsClick={onCreditsClick}\n menuItems={menuItems}\n />\n </NavBar>\n );\n}\n"],"mappings":";AAmDU,SAOM,KAPN;AAjDV,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AACvB,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,wBAAwB;AAiB1B,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB;AAAA,EACA,YAAY,CAAC;AAAA,EACb;AAAA,EACA;AACF,GAAmB;AACjB,QAAM,SAAS,UAAU;AACzB,QAAM,EAAE,mBAAmB,IAAI,iBAAiB;AAEhD,QAAM,kBAAkB,gBAAgB,MAAM,OAAO,KAAK,GAAG;AAC7D,QAAM,qBAAqB,MAAM,OAAO,KAAK,WAAW;AAExD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA,aACE,qBAAC,SAAI,WAAU,YACb;AAAA,6BAAC,WACC;AAAA,8BAAC,kBAAe,SAAO,MAAC,SAAS,oBAC/B;AAAA,YAAC;AAAA;AAAA,cACC,WAAW,wHACT,gBAAgB,iBAAiB,aACnC;AAAA,cAEA,8BAAC,SAAM,KAAI,0BAAyB,KAAI,cAAa,OAAO,IAAI,QAAQ,IAAI;AAAA;AAAA,UAC9E,GACF;AAAA,UACA,oBAAC,kBAAe,MAAK,SAAQ,wBAAU;AAAA,WACzC;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,mHACT,mBAAmB,gBAAgB,WACrC;AAAA;AAAA,QACF;AAAA,SACF;AAAA,MAGF;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA;AAAA,QACb;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,eAAe,MAAM,mBAAmB;AAAA,YACxC;AAAA,YACA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
function NotificationItem({ icon, iconBgColor, title, time, showBorder = true }) {
|
|
3
|
-
return /* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */ jsx("
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
|
|
7
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-xsmall-medium text-gray-500", children: time })
|
|
8
|
-
] })
|
|
9
|
-
] });
|
|
3
|
+
return /* @__PURE__ */ jsx("div", { className: `flex items-center gap-3 px-4 py-5 ${showBorder ? "border-b border-gray-200" : ""}`, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
4
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-semibold text-gray-950", children: title }),
|
|
5
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-xsmall-medium text-gray-500", children: time })
|
|
6
|
+
] }) });
|
|
10
7
|
}
|
|
11
8
|
export {
|
|
12
9
|
NotificationItem
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/layouts/NotificationItem.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\r\n\r\ntype NotificationItemProps = {\r\n icon: ReactNode;\r\n iconBgColor: string;\r\n title: string;\r\n time: string;\r\n showBorder?: boolean;\r\n}\r\n\r\nfunction NotificationItem({ icon, iconBgColor, title, time, showBorder = true }: NotificationItemProps) {\r\n return (\r\n <div className={`flex items-center gap-3 px-4 py-5 ${showBorder ? 'border-b border-gray-200' : ''}`}>\r\n <div className={`flex items-center justify-center rounded-full ${iconBgColor} size-10`}>\r\n {icon}\r\n </div
|
|
1
|
+
{"version":3,"sources":["../../../src/components/layouts/NotificationItem.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\r\n\r\ntype NotificationItemProps = {\r\n icon: ReactNode;\r\n iconBgColor: string;\r\n title: string;\r\n time: string;\r\n showBorder?: boolean;\r\n}\r\n\r\nfunction NotificationItem({ icon, iconBgColor, title, time, showBorder = true }: NotificationItemProps) {\r\n return (\r\n <div className={`flex items-center gap-3 px-4 py-5 ${showBorder ? 'border-b border-gray-200' : ''}`}>\r\n {/* <div className={`flex items-center justify-center rounded-full ${iconBgColor} size-10`}>\r\n {icon}\r\n </div> */}\r\n <div className=\"flex flex-col gap-1.5\">\r\n <span className=\"paragraph-small-semibold text-gray-950\">{title}</span>\r\n <span className=\"paragraph-xsmall-medium text-gray-500\">{time}</span>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nexport { NotificationItem };\r\nexport type { NotificationItemProps };\r\n"],"mappings":"AAgBY,SACI,KADJ;AANZ,SAAS,iBAAiB,EAAE,MAAM,aAAa,OAAO,MAAM,aAAa,KAAK,GAA0B;AACpG,SACI,oBAAC,SAAI,WAAW,qCAAqC,aAAa,6BAA6B,EAAE,IAI7F,+BAAC,SAAI,WAAU,yBACX;AAAA,wBAAC,UAAK,WAAU,0CAA0C,iBAAM;AAAA,IAChE,oBAAC,UAAK,WAAU,yCAAyC,gBAAK;AAAA,KAClE,GACJ;AAER;","names":[]}
|
|
@@ -7,8 +7,10 @@ import { Popover } from "../ui/overlay/Popover";
|
|
|
7
7
|
import { Button } from "../ui/buttons/Button";
|
|
8
8
|
import { NotificationItem } from "./NotificationItem";
|
|
9
9
|
import { cn } from "../../infra/utils/clsx";
|
|
10
|
+
import { useMessages, useMarkAllMessagesAsRead } from "../../modules/users/hooks/messages.hook";
|
|
11
|
+
import { formatDistanceToNow } from "date-fns";
|
|
12
|
+
import { ptBR } from "date-fns/locale";
|
|
10
13
|
function NotificationsPopover({
|
|
11
|
-
notifications = [],
|
|
12
14
|
onViewAll,
|
|
13
15
|
side,
|
|
14
16
|
align,
|
|
@@ -16,10 +18,15 @@ function NotificationsPopover({
|
|
|
16
18
|
badgeClassName = "bg-pages-400"
|
|
17
19
|
}) {
|
|
18
20
|
const [open, setOpen] = useState(false);
|
|
19
|
-
const
|
|
21
|
+
const { data: messagesData } = useMessages();
|
|
22
|
+
const { mutate: markAllAsRead } = useMarkAllMessagesAsRead();
|
|
23
|
+
const messages = messagesData?.data ?? [];
|
|
24
|
+
const totalUnread = messagesData?.totalUnread ?? 0;
|
|
20
25
|
const handleOpenChange = (isOpen) => {
|
|
21
26
|
setOpen(isOpen);
|
|
22
|
-
if (isOpen)
|
|
27
|
+
if (isOpen && totalUnread > 0) {
|
|
28
|
+
markAllAsRead();
|
|
29
|
+
}
|
|
23
30
|
};
|
|
24
31
|
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
25
32
|
/* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { className: "cursor-pointer", children: /* @__PURE__ */ jsxs(
|
|
@@ -28,7 +35,7 @@ function NotificationsPopover({
|
|
|
28
35
|
className: `relative rounded-full p-2.5 ${open ? "bg-gray-100" : "hover:bg-gray-100"}`,
|
|
29
36
|
children: [
|
|
30
37
|
/* @__PURE__ */ jsx(Bell, { size: 20, className: "text-gray-500" }),
|
|
31
|
-
|
|
38
|
+
totalUnread > 0 && /* @__PURE__ */ jsx(
|
|
32
39
|
"span",
|
|
33
40
|
{
|
|
34
41
|
className: cn(
|
|
@@ -44,7 +51,7 @@ function NotificationsPopover({
|
|
|
44
51
|
PopoverPrimitive.Content,
|
|
45
52
|
{
|
|
46
53
|
className: cn(
|
|
47
|
-
"absolute bottom-2 left-[26px] w-[308px] p-0 pt-4 bg-white rounded-2xl shadow-md border border-gray-200",
|
|
54
|
+
"absolute bottom-2 left-[26px] z-[9999] w-[308px] p-0 pt-4 bg-white rounded-2xl shadow-md border border-gray-200",
|
|
48
55
|
contentClassName
|
|
49
56
|
),
|
|
50
57
|
side,
|
|
@@ -52,16 +59,19 @@ function NotificationsPopover({
|
|
|
52
59
|
sideOffset: 8,
|
|
53
60
|
children: [
|
|
54
61
|
/* @__PURE__ */ jsx("span", { className: "paragraph-small-semibold text-gray-950 px-4", children: "\xDAltimas notifica\xE7\xF5es" }),
|
|
55
|
-
|
|
62
|
+
messages.length > 0 ? messages.map((message, index) => /* @__PURE__ */ jsx(
|
|
56
63
|
NotificationItem,
|
|
57
64
|
{
|
|
58
|
-
icon:
|
|
59
|
-
iconBgColor:
|
|
60
|
-
title:
|
|
61
|
-
time:
|
|
62
|
-
|
|
65
|
+
icon: /* @__PURE__ */ jsx(Bell, { size: 16 }),
|
|
66
|
+
iconBgColor: "bg-gray-100",
|
|
67
|
+
title: message.subject,
|
|
68
|
+
time: formatDistanceToNow(new Date(message.datetime_add), {
|
|
69
|
+
addSuffix: true,
|
|
70
|
+
locale: ptBR
|
|
71
|
+
}),
|
|
72
|
+
showBorder: index < messages.length - 1
|
|
63
73
|
},
|
|
64
|
-
|
|
74
|
+
message.id
|
|
65
75
|
)) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4 pt-[41.5px] pb-[33.5px]", children: [
|
|
66
76
|
/* @__PURE__ */ jsx("div", { className: "bg-gray-50 rounded-md p-2.5", children: /* @__PURE__ */ jsx(Bell, { size: 20, color: "var(--color-gray-950)" }) }),
|
|
67
77
|
/* @__PURE__ */ jsx("span", { className: "paragraph-small-medium text-gray-950", children: "Sem notifica\xE7\xF5es por enquanto" })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/layouts/NotificationsPopover.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/layouts/NotificationsPopover.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { useState } from \"react\";\r\nimport { Bell } from \"lucide-react\";\r\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\r\nimport { Popover } from \"../ui/overlay/Popover\";\r\nimport { Button } from \"../ui/buttons/Button\";\r\nimport { NotificationItem } from \"./NotificationItem\";\r\nimport { cn } from \"../../infra/utils/clsx\";\r\nimport { useMessages, useMarkAllMessagesAsRead } from \"../../modules/users/hooks/messages.hook\";\r\nimport { formatDistanceToNow } from \"date-fns\";\r\nimport { ptBR } from \"date-fns/locale\";\r\n\r\nexport interface NotificationsPopoverProps {\r\n onViewAll?: () => void;\r\n side?: \"top\" | \"bottom\" | \"left\" | \"right\";\r\n align?: \"start\" | \"center\" | \"end\";\r\n contentClassName?: string;\r\n badgeClassName?: string;\r\n}\r\n\r\nfunction NotificationsPopover({\r\n onViewAll,\r\n side,\r\n align,\r\n contentClassName,\r\n badgeClassName = \"bg-pages-400\",\r\n}: NotificationsPopoverProps) {\r\n const [open, setOpen] = useState(false);\r\n const { data: messagesData } = useMessages();\r\n const { mutate: markAllAsRead } = useMarkAllMessagesAsRead();\r\n\r\n const messages = messagesData?.data ?? [];\r\n const totalUnread = messagesData?.totalUnread ?? 0;\r\n\r\n const handleOpenChange = (isOpen: boolean) => {\r\n setOpen(isOpen);\r\n if (isOpen && totalUnread > 0) {\r\n markAllAsRead();\r\n }\r\n };\r\n\r\n return (\r\n <Popover open={open} onOpenChange={handleOpenChange}>\r\n <PopoverPrimitive.Trigger className=\"cursor-pointer\">\r\n <div\r\n className={`relative rounded-full p-2.5 ${open ? \"bg-gray-100\" : \"hover:bg-gray-100\"}`}\r\n >\r\n <Bell size={20} className=\"text-gray-500\" />\r\n {totalUnread > 0 && (\r\n <span\r\n className={cn(\r\n \"absolute top-2 right-2 size-2.5 rounded-full\",\r\n badgeClassName,\r\n )}\r\n />\r\n )}\r\n </div>\r\n </PopoverPrimitive.Trigger>\r\n <PopoverPrimitive.Portal>\r\n <PopoverPrimitive.Content\r\n className={cn(\r\n \"absolute bottom-2 left-[26px] z-[9999] w-[308px] p-0 pt-4 bg-white rounded-2xl shadow-md border border-gray-200\",\r\n contentClassName,\r\n )}\r\n side={side}\r\n align={align}\r\n sideOffset={8}\r\n >\r\n <span className=\"paragraph-small-semibold text-gray-950 px-4\">\r\n Últimas notificações\r\n </span>\r\n\r\n {messages.length > 0 ? (\r\n messages.map((message, index) => (\r\n <NotificationItem\r\n key={message.id}\r\n icon={<Bell size={16} />}\r\n iconBgColor=\"bg-gray-100\"\r\n title={message.subject}\r\n time={formatDistanceToNow(new Date(message.datetime_add), {\r\n addSuffix: true,\r\n locale: ptBR,\r\n })}\r\n showBorder={index < messages.length - 1}\r\n />\r\n ))\r\n ) : (\r\n <div className=\"flex flex-col items-center gap-4 pt-[41.5px] pb-[33.5px]\">\r\n <div className=\"bg-gray-50 rounded-md p-2.5\">\r\n <Bell size={20} color=\"var(--color-gray-950)\" />\r\n </div>\r\n <span className=\"paragraph-small-medium text-gray-950\">\r\n Sem notificações por enquanto\r\n </span>\r\n </div>\r\n )}\r\n\r\n {onViewAll && (\r\n <Button\r\n variant=\"secondary\"\r\n className=\"h-8! mt-2 mb-4 mx-4 paragraph-small-semibold\"\r\n onClick={onViewAll}\r\n >\r\n Todas as notificações\r\n </Button>\r\n )}\r\n </PopoverPrimitive.Content>\r\n </PopoverPrimitive.Portal>\r\n </Popover>\r\n );\r\n}\r\n\r\nexport { NotificationsPopover };\r\n"],"mappings":";AA6CQ,SAGE,KAHF;AA3CR,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,YAAY,sBAAsB;AAClC,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,wBAAwB;AACjC,SAAS,UAAU;AACnB,SAAS,aAAa,gCAAgC;AACtD,SAAS,2BAA2B;AACpC,SAAS,YAAY;AAUrB,SAAS,qBAAqB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAC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AAAA,YARjC,QAAQ;AAAA,UASf,CACD,IAED,qBAAC,SAAI,WAAU,4DACb;AAAA,gCAAC,SAAI,WAAU,+BACb,8BAAC,QAAK,MAAM,IAAI,OAAM,yBAAwB,GAChD;AAAA,YACA,oBAAC,UAAK,WAAU,wCAAuC,iDAEvD;AAAA,aACF;AAAA,UAGD,aACC;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,WAAU;AAAA,cACV,SAAS;AAAA,cACV;AAAA;AAAA,UAED;AAAA;AAAA;AAAA,IAEJ,GACF;AAAA,KACF;AAEJ;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -5,13 +5,34 @@ export * from "./infra/api/types";
|
|
|
5
5
|
export * from "./providers/query.provider";
|
|
6
6
|
export * from "./providers/auth.provider";
|
|
7
7
|
export * from "./providers/whitelabel.provider";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import {
|
|
9
|
+
useListProjectUsers,
|
|
10
|
+
LIST_PROJECT_USERS_QUERY_KEY,
|
|
11
|
+
LIST_PROJECT_USERS_BASE_KEY
|
|
12
|
+
} from "./modules/projects/hooks/list-project-users.hook";
|
|
13
|
+
import {
|
|
14
|
+
useListAvailableUsers,
|
|
15
|
+
LIST_AVAILABLE_USERS_QUERY_KEY,
|
|
16
|
+
LIST_AVAILABLE_USERS_BASE_KEY
|
|
17
|
+
} from "./modules/projects/hooks/list-available-users.hook";
|
|
18
|
+
import {
|
|
19
|
+
useUserQuery,
|
|
20
|
+
useUserValidateSession,
|
|
21
|
+
useInvalidateUser,
|
|
22
|
+
useSetUserData,
|
|
23
|
+
useTwoFactorVerify,
|
|
24
|
+
USER_QUERY_KEY
|
|
25
|
+
} from "./modules/auth/hooks/useUserQuery";
|
|
26
|
+
import {
|
|
27
|
+
useSubscriptions,
|
|
28
|
+
SUBSCRIPTIONS_QUERY_KEY
|
|
29
|
+
} from "./modules/subscriptions/hooks/list-subscriptions.hook";
|
|
12
30
|
import { useActiveSubscription } from "./modules/subscriptions/hooks/find-active-subscription.hook";
|
|
13
31
|
import { useIaCredits } from "./modules/ia-credits/hooks/ia-credits.hook";
|
|
14
|
-
import {
|
|
32
|
+
import {
|
|
33
|
+
SubscriptionSchema,
|
|
34
|
+
SubscriptionItemSchema
|
|
35
|
+
} from "./modules/subscriptions/types";
|
|
15
36
|
import { ADDON_IDS } from "./modules/subscriptions/constants/addons.constants";
|
|
16
37
|
import { QueryProvider } from "./providers/query.provider";
|
|
17
38
|
import { createAuthMiddleware } from "./middlewares/create-auth-middleware";
|
|
@@ -20,7 +41,12 @@ import { continueChain, stopChain } from "./middlewares/types";
|
|
|
20
41
|
import { cn } from "./infra/utils/clsx";
|
|
21
42
|
import { buildQueryParams } from "./infra/utils/params";
|
|
22
43
|
import { parseSchema, parseResult } from "./infra/utils/parser";
|
|
23
|
-
import {
|
|
44
|
+
import {
|
|
45
|
+
MainLayout,
|
|
46
|
+
MainLayoutContent,
|
|
47
|
+
MainLayoutSpacer,
|
|
48
|
+
MainLayoutMain
|
|
49
|
+
} from "./components/layouts/MainLayout";
|
|
24
50
|
import { NavBar } from "./components/layouts/NavBar";
|
|
25
51
|
import { AppNavBar } from "./components/layouts/AppNavBar";
|
|
26
52
|
import { AppMobileNavBar } from "./components/layouts/AppMobileNavBar";
|
|
@@ -34,44 +60,148 @@ import { NavBarItem } from "./components/layouts/NavBarItem";
|
|
|
34
60
|
import { Button, buttonVariants } from "./components/ui/buttons/Button";
|
|
35
61
|
import { CopyButton } from "./components/ui/buttons/CopyButton";
|
|
36
62
|
import { default as default2 } from "./components/ui/buttons/CancelButton";
|
|
37
|
-
import {
|
|
63
|
+
import {
|
|
64
|
+
Accordion,
|
|
65
|
+
AccordionItem,
|
|
66
|
+
AccordionTrigger,
|
|
67
|
+
AccordionContent
|
|
68
|
+
} from "./components/ui/data-display/Accordion";
|
|
38
69
|
import { Badge, badgeVariants } from "./components/ui/data-display/Badge";
|
|
39
|
-
import {
|
|
40
|
-
|
|
70
|
+
import {
|
|
71
|
+
Card,
|
|
72
|
+
CardHeader,
|
|
73
|
+
CardFooter,
|
|
74
|
+
CardTitle,
|
|
75
|
+
CardAction,
|
|
76
|
+
CardDescription,
|
|
77
|
+
CardContent
|
|
78
|
+
} from "./components/ui/data-display/Card";
|
|
79
|
+
import {
|
|
80
|
+
Pagination,
|
|
81
|
+
PaginationContent,
|
|
82
|
+
PaginationLink,
|
|
83
|
+
PaginationItem,
|
|
84
|
+
PaginationPrevious,
|
|
85
|
+
PaginationNext,
|
|
86
|
+
PaginationEllipsis
|
|
87
|
+
} from "./components/ui/data-display/Pagination";
|
|
41
88
|
import { ScrollArea, ScrollBar } from "./components/ui/data-display/ScrollArea";
|
|
42
89
|
import { Separator } from "./components/ui/data-display/Separator";
|
|
43
|
-
import {
|
|
44
|
-
|
|
90
|
+
import {
|
|
91
|
+
Table,
|
|
92
|
+
TableHeader,
|
|
93
|
+
TableBody,
|
|
94
|
+
TableFooter,
|
|
95
|
+
TableHead,
|
|
96
|
+
TableRow,
|
|
97
|
+
TableCell,
|
|
98
|
+
TableCaption
|
|
99
|
+
} from "./components/ui/data-display/Table";
|
|
100
|
+
import {
|
|
101
|
+
Tabs,
|
|
102
|
+
TabsList,
|
|
103
|
+
TabsTrigger,
|
|
104
|
+
TabsContent
|
|
105
|
+
} from "./components/ui/data-display/Tabs";
|
|
45
106
|
import { UserAvatar } from "./components/ui/data-display/UserAvatar";
|
|
46
107
|
import { default as default3 } from "./components/ui/feedback/CircularProgress";
|
|
47
108
|
import { default as default4 } from "./components/ui/feedback/DefaultCircularProgress";
|
|
48
109
|
import { Progress } from "./components/ui/feedback/Progress";
|
|
49
110
|
import { LoadingOverlay } from "./components/ui/feedback/LoadingOverlay";
|
|
50
|
-
import {
|
|
111
|
+
import {
|
|
112
|
+
Toast,
|
|
113
|
+
toastVariants,
|
|
114
|
+
toastIconContainerVariants
|
|
115
|
+
} from "./components/ui/feedback/Toast";
|
|
51
116
|
import { Calendar, CalendarDayButton } from "./components/ui/form/Calendar";
|
|
52
117
|
import { Checkbox } from "./components/ui/form/Checkbox";
|
|
53
118
|
import { DatePicker } from "./components/ui/form/DatePicker";
|
|
54
119
|
import { DateRangePicker } from "./components/ui/form/DateRangePicker";
|
|
55
120
|
import { Input } from "./components/ui/form/Input";
|
|
56
|
-
import {
|
|
121
|
+
import {
|
|
122
|
+
InputOTP,
|
|
123
|
+
InputOTPGroup,
|
|
124
|
+
InputOTPSlot,
|
|
125
|
+
InputOTPSeparator
|
|
126
|
+
} from "./components/ui/form/InputOtp";
|
|
57
127
|
import { RadioGroup, RadioGroupItem } from "./components/ui/form/RadioGroup";
|
|
58
|
-
import {
|
|
128
|
+
import {
|
|
129
|
+
Select,
|
|
130
|
+
SelectContent,
|
|
131
|
+
SelectGroup,
|
|
132
|
+
SelectItem,
|
|
133
|
+
SelectLabel,
|
|
134
|
+
SelectScrollDownButton,
|
|
135
|
+
SelectScrollUpButton,
|
|
136
|
+
SelectSeparator,
|
|
137
|
+
SelectTrigger,
|
|
138
|
+
SelectValue
|
|
139
|
+
} from "./components/ui/form/Select";
|
|
59
140
|
import { Switch } from "./components/ui/form/Switch";
|
|
60
141
|
import { Textarea } from "./components/ui/form/Textarea";
|
|
61
|
-
import {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
142
|
+
import {
|
|
143
|
+
Command,
|
|
144
|
+
CommandDialog,
|
|
145
|
+
CommandInput,
|
|
146
|
+
CommandList,
|
|
147
|
+
CommandEmpty,
|
|
148
|
+
CommandGroup,
|
|
149
|
+
CommandItem,
|
|
150
|
+
CommandShortcut,
|
|
151
|
+
CommandSeparator
|
|
152
|
+
} from "./components/ui/overlay/Command";
|
|
153
|
+
import {
|
|
154
|
+
Dialog,
|
|
155
|
+
DialogClose,
|
|
156
|
+
DialogContent,
|
|
157
|
+
DialogDescription,
|
|
158
|
+
DialogFooter,
|
|
159
|
+
DialogHeader,
|
|
160
|
+
DialogOverlay,
|
|
161
|
+
DialogPortal,
|
|
162
|
+
DialogTitle,
|
|
163
|
+
DialogTrigger
|
|
164
|
+
} from "./components/ui/overlay/Dialog";
|
|
165
|
+
import {
|
|
166
|
+
Popover,
|
|
167
|
+
PopoverTrigger,
|
|
168
|
+
PopoverContent,
|
|
169
|
+
PopoverAnchor
|
|
170
|
+
} from "./components/ui/overlay/Popover";
|
|
171
|
+
import {
|
|
172
|
+
Sheet,
|
|
173
|
+
SheetTrigger,
|
|
174
|
+
SheetClose,
|
|
175
|
+
SheetContent,
|
|
176
|
+
SheetHeader,
|
|
177
|
+
SheetFooter,
|
|
178
|
+
SheetTitle,
|
|
179
|
+
SheetDescription
|
|
180
|
+
} from "./components/ui/overlay/Sheet";
|
|
181
|
+
import {
|
|
182
|
+
Tooltip,
|
|
183
|
+
TooltipTrigger,
|
|
184
|
+
TooltipContent,
|
|
185
|
+
TooltipProvider
|
|
186
|
+
} from "./components/ui/overlay/Tooltip";
|
|
66
187
|
import { useMdSidebarStore } from "./store/useMdSidebarStore";
|
|
67
188
|
import { useModalManager } from "./store/useModalManager";
|
|
68
189
|
import { AccountSectionType } from "./enums/AccountSectionType";
|
|
69
190
|
import { default as default5 } from "./hooks/usePasswordVisibility";
|
|
70
191
|
import { default as default6 } from "./hooks/useCountdownTimer";
|
|
71
192
|
import { default as default7 } from "./hooks/useIsMobile";
|
|
72
|
-
import {
|
|
193
|
+
import {
|
|
194
|
+
formatPhone,
|
|
195
|
+
formatTimer,
|
|
196
|
+
formatFullName,
|
|
197
|
+
formatCPF,
|
|
198
|
+
formatCardNumber
|
|
199
|
+
} from "./utils/format/masks";
|
|
73
200
|
import { timezoneService } from "./modules/accounts/services/timezone.service";
|
|
74
|
-
import {
|
|
201
|
+
import {
|
|
202
|
+
buildLocaleOptions,
|
|
203
|
+
LANGUAGE_OPTIONS
|
|
204
|
+
} from "./utils/intl/locales";
|
|
75
205
|
import { copyToClipboard, readFromClipboard } from "./utils/browser/clipboard";
|
|
76
206
|
import { FormField } from "./components/ui/form/FormField";
|
|
77
207
|
import { SelectField } from "./components/ui/form/SelectField";
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Types\nexport * from './modules/auth/schema';\nexport * from './modules/users/schema';\nexport * from './modules/whitelabel/schema';\nexport * from './infra/api/types';\n\n// Contexts\nexport * from './providers/query.provider';\nexport * from './providers/auth.provider';\nexport * from './providers/whitelabel.provider';\n\n// Hooks\nexport { useListProjectUsers, LIST_PROJECT_USERS_QUERY_KEY, LIST_PROJECT_USERS_BASE_KEY } from './modules/projects/hooks/list-project-users.hook';\nexport { useListAvailableUsers, LIST_AVAILABLE_USERS_QUERY_KEY, LIST_AVAILABLE_USERS_BASE_KEY } from './modules/projects/hooks/list-available-users.hook';\nexport type { ProjectUser, AccountUser, AddRemoveProjectUsersParams, ListUsersParams, UsersPage } from './modules/projects/types';\nexport { useUserQuery, useUserValidateSession, useInvalidateUser, useSetUserData, useTwoFactorVerify, USER_QUERY_KEY } from './modules/auth/hooks/useUserQuery';\nexport { useSubscriptions, SUBSCRIPTIONS_QUERY_KEY } from './modules/subscriptions/hooks/list-subscriptions.hook';\nexport { useActiveSubscription } from './modules/subscriptions/hooks/find-active-subscription.hook';\nexport { useIaCredits } from './modules/ia-credits/hooks/ia-credits.hook';\nexport type { IaCreditsSummary, IaCreditOperation } from './modules/ia-credits/types';\nexport type { Subscription, SubscriptionItem, FindSubscriptionsParams } from './modules/subscriptions/types';\nexport { SubscriptionSchema, SubscriptionItemSchema } from './modules/subscriptions/types';\nexport { ADDON_IDS } from './modules/subscriptions/constants/addons.constants';\nexport type { AddonKindEnum } from './modules/subscriptions/constants/addons.constants';\n\n// Providers\nexport { QueryProvider } from './providers/query.provider';\n\n// Middleware\nexport { createAuthMiddleware } from './middlewares/create-auth-middleware';\nexport { createMiddlewareChain } from './middlewares/chain';\nexport { continueChain, stopChain } from './middlewares/types';\nexport type { MiddlewareFunction, MiddlewareConfig, MiddlewareResult } from './middlewares/types';\n\n// Utils\nexport { cn } from './infra/utils/clsx';\nexport { buildQueryParams } from './infra/utils/params';\nexport { parseSchema, parseResult } from './infra/utils/parser';\n\n// Layout\nexport { MainLayout, MainLayoutContent, MainLayoutSpacer, MainLayoutMain } from './components/layouts/MainLayout';\nexport { NavBar } from './components/layouts/NavBar';\nexport type { NavBarProps } from './components/layouts/NavBar';\nexport { AppNavBar } from './components/layouts/AppNavBar';\nexport type { AppNavBarProps } from './components/layouts/AppNavBar';\nexport { AppMobileNavBar } from './components/layouts/AppMobileNavBar';\nexport type { AppMobileNavBarProps } from './components/layouts/AppMobileNavBar';\nexport { SideBarNavigation } from './components/layouts/SideBarNavigation';\nexport { MdSideBarNavigation } from './components/layouts/MdSideBarNavigation';\nexport { NotificationItem } from './components/layouts/NotificationItem';\nexport type { NotificationItemProps } from './components/layouts/NotificationItem';\nexport { NotificationsPopover } from './components/layouts/NotificationsPopover';\nexport type { NotificationsPopoverProps, NotificationData } from './components/layouts/NotificationsPopover';\nexport { UsersSelectorPopover } from './components/layouts/UsersSelectorPopover';\nexport type { UsersSelectorPopoverProps } from './components/layouts/UsersSelectorPopover';\nexport { ProfilePopover } from './components/layouts/ProfilePopover';\nexport type { ProfilePopoverProps, ProfileMenuItem } from './components/layouts/ProfilePopover';\nexport { NavBarItem } from './components/layouts/NavBarItem';\nexport type { NavBarItemProps } from './components/layouts/NavBarItem';\n\n// UI - Buttons\nexport { Button, buttonVariants } from './components/ui/buttons/Button';\nexport { CopyButton } from './components/ui/buttons/CopyButton';\nexport { default as CancelButton } from './components/ui/buttons/CancelButton';\n\n// UI - Data Display\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from './components/ui/data-display/Accordion';\nexport { Badge, badgeVariants } from './components/ui/data-display/Badge';\nexport { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent } from './components/ui/data-display/Card';\nexport { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis } from './components/ui/data-display/Pagination';\nexport { ScrollArea, ScrollBar } from './components/ui/data-display/ScrollArea';\nexport { Separator } from './components/ui/data-display/Separator';\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption } from './components/ui/data-display/Table';\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from './components/ui/data-display/Tabs';\nexport { UserAvatar } from './components/ui/data-display/UserAvatar';\nexport type { UserAvatarProps } from './components/ui/data-display/UserAvatar';\n\n// UI - Feedback\nexport { default as CircularProgress } from './components/ui/feedback/CircularProgress';\nexport { default as DefaultCircularProgress } from './components/ui/feedback/DefaultCircularProgress';\nexport { Progress } from './components/ui/feedback/Progress';\nexport { LoadingOverlay } from './components/ui/feedback/LoadingOverlay';\nexport { Toast, toastVariants, toastIconContainerVariants } from './components/ui/feedback/Toast';\nexport type { ToastProps } from './components/ui/feedback/Toast';\n\n// UI - Form\nexport { Calendar, CalendarDayButton } from './components/ui/form/Calendar';\nexport { Checkbox } from './components/ui/form/Checkbox';\nexport { DatePicker } from './components/ui/form/DatePicker';\nexport { DateRangePicker } from './components/ui/form/DateRangePicker';\nexport { Input } from './components/ui/form/Input';\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator } from './components/ui/form/InputOtp';\nexport { RadioGroup, RadioGroupItem } from './components/ui/form/RadioGroup';\nexport { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from './components/ui/form/Select';\nexport { Switch } from './components/ui/form/Switch';\nexport { Textarea } from './components/ui/form/Textarea';\n\n// UI - Overlay\nexport { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator } from './components/ui/overlay/Command';\nexport { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from './components/ui/overlay/Dialog';\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from './components/ui/overlay/Popover';\nexport { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription } from './components/ui/overlay/Sheet';\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './components/ui/overlay/Tooltip';\n\n// Store\nexport { useMdSidebarStore } from './store/useMdSidebarStore';\nexport { useModalManager } from './store/useModalManager';\nexport type { ModalData } from './store/useModalManager';\n\n// Enums\nexport { AccountSectionType } from './enums/AccountSectionType';\n\n// Hooks\nexport { default as usePasswordVisibility } from './hooks/usePasswordVisibility';\nexport { default as useCountdownTimer } from './hooks/useCountdownTimer';\nexport { default as useIsMobile } from './hooks/useIsMobile';\n\n// Utils\nexport { formatPhone, formatTimer, formatFullName, formatCPF, formatCardNumber } from './utils/format/masks';\nexport { timezoneService } from './modules/accounts/services/timezone.service';\nexport type { TimezoneOption } from './modules/accounts/services/timezone.service';\nexport { buildLocaleOptions, LANGUAGE_OPTIONS as LOCALE_LANGUAGE_OPTIONS } from './utils/intl/locales';\nexport type { LocaleOption } from './utils/intl/locales';\nexport { copyToClipboard, readFromClipboard } from './utils/browser/clipboard';\n\n// UI - Form (new widgets)\nexport { FormField } from './components/ui/form/FormField';\nexport { SelectField } from './components/ui/form/SelectField';\nexport { ComboboxField } from './components/ui/form/ComboboxField';\nexport type { ComboboxOption } from './components/ui/form/ComboboxField';\nexport { default as PhoneInput } from './components/ui/form/PhoneInput';\nexport { default as SwitchOptionFieldWithIcon } from './components/ui/form/SwitchOptionFieldWithIcon';\nexport { TextAreaField } from './components/ui/form/TextAreaField';\n\n// Account Module - Hooks\nexport {\n useUpdateAccount,\n useUpdateAccountUser,\n useUpdateAccountUserById,\n useDeleteAccountUser,\n useDeleteAccount,\n} from './modules/accounts/hooks/useAccountManagement';\n\n// Account Types\nexport type {\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n ChangePasswordRequest,\n DeleteAccountActionResult,\n DeleteUserActionResult,\n UpdateAccountActionResult,\n UpdateUserActionResult,\n TwoFactorGenerateResult,\n TwoFactorActionResult,\n ContactResetResult,\n} from './modules/accounts/types';\n\nexport { default as AccountModals } from './components/account/AccountModals';\nexport { useAccountModals } from './store/useAccountModals';\nexport type { AccountModalsConfig } from './store/useAccountModals';\n\nexport { ModalManager } from './components/modals/ModalManager';\nexport { Modals } from './components/modals/Modals';\n\nexport { default as TwoFactorAuthModal } from './components/account/TwoFactorAuthModal';\nexport { default as DisableTwoFactorAuthModal } from './components/account/DisableTwoFactorAuthModal';\nexport { default as ConfirmGlobalPreferencesModal } from './components/account/ConfirmGlobalPreferencesModal';\nexport { MyProfileSection } from './components/account/sections/MyProfileSection';\nexport { PreferencesSection } from './components/account/sections/PreferencesSection';\nexport { SecuritySection } from './components/account/sections/SecuritySection';\nexport { ChangePasswordSection } from './components/account/sections/ChangePasswordSection';\nexport { ChangeEmailModal } from './components/account/sections/ChangeEmailModal';\nexport { ChangePhoneModal } from './components/account/sections/ChangePhoneModal';\n\n// Account Constants\nexport {\n GENDER_OPTIONS,\n CURRENCY_OPTIONS,\n TIME_FORMAT_OPTIONS,\n NOTIFICATION_TYPES,\n LANGUAGE_OPTIONS,\n} from './components/account/constants';\n"],"mappings":"AACA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,SAAS,qBAAqB,8BAA8B,mCAAmC;AAC/F,SAAS,uBAAuB,gCAAgC,qCAAqC;AAErG,SAAS,cAAc,wBAAwB,mBAAmB,gBAAgB,oBAAoB,sBAAsB;AAC5H,SAAS,kBAAkB,+BAA+B;AAC1D,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAG7B,SAAS,oBAAoB,8BAA8B;AAC3D,SAAS,iBAAiB;AAI1B,SAAS,qBAAqB;AAG9B,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,eAAe,iBAAiB;AAIzC,SAAS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th/schema\";\nexport * from \"./modules/users/schema\";\nexport * from \"./modules/whitelabel/schema\";\nexport * from \"./infra/api/types\";\n\n// Contexts\nexport * from \"./providers/query.provider\";\nexport * from \"./providers/auth.provider\";\nexport * from \"./providers/whitelabel.provider\";\n\n// Hooks\nexport {\n useListProjectUsers,\n LIST_PROJECT_USERS_QUERY_KEY,\n LIST_PROJECT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-project-users.hook\";\nexport {\n useListAvailableUsers,\n LIST_AVAILABLE_USERS_QUERY_KEY,\n LIST_AVAILABLE_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-available-users.hook\";\nexport type {\n ProjectUser,\n AccountUser,\n AddRemoveProjectUsersParams,\n ListUsersParams,\n UsersPage,\n} from \"./modules/projects/types\";\nexport {\n useUserQuery,\n useUserValidateSession,\n useInvalidateUser,\n useSetUserData,\n useTwoFactorVerify,\n USER_QUERY_KEY,\n} from \"./modules/auth/hooks/useUserQuery\";\nexport {\n useSubscriptions,\n SUBSCRIPTIONS_QUERY_KEY,\n} from \"./modules/subscriptions/hooks/list-subscriptions.hook\";\nexport { useActiveSubscription } from \"./modules/subscriptions/hooks/find-active-subscription.hook\";\nexport { useIaCredits } from \"./modules/ia-credits/hooks/ia-credits.hook\";\nexport type {\n IaCreditsSummary,\n IaCreditOperation,\n} from \"./modules/ia-credits/types\";\nexport type {\n Subscription,\n SubscriptionItem,\n FindSubscriptionsParams,\n} from \"./modules/subscriptions/types\";\nexport {\n SubscriptionSchema,\n SubscriptionItemSchema,\n} from \"./modules/subscriptions/types\";\nexport { ADDON_IDS } from \"./modules/subscriptions/constants/addons.constants\";\nexport type { AddonKindEnum } from \"./modules/subscriptions/constants/addons.constants\";\n\n// Providers\nexport { QueryProvider } from \"./providers/query.provider\";\n\n// Middleware\nexport { createAuthMiddleware } from \"./middlewares/create-auth-middleware\";\nexport { createMiddlewareChain } from \"./middlewares/chain\";\nexport { continueChain, stopChain } from \"./middlewares/types\";\nexport type {\n MiddlewareFunction,\n MiddlewareConfig,\n MiddlewareResult,\n} from \"./middlewares/types\";\n\n// Utils\nexport { cn } from \"./infra/utils/clsx\";\nexport { buildQueryParams } from \"./infra/utils/params\";\nexport { parseSchema, parseResult } from \"./infra/utils/parser\";\n\n// Layout\nexport {\n MainLayout,\n MainLayoutContent,\n MainLayoutSpacer,\n MainLayoutMain,\n} from \"./components/layouts/MainLayout\";\nexport { NavBar } from \"./components/layouts/NavBar\";\nexport type { NavBarProps } from \"./components/layouts/NavBar\";\nexport { AppNavBar } from \"./components/layouts/AppNavBar\";\nexport type { AppNavBarProps } from \"./components/layouts/AppNavBar\";\nexport { AppMobileNavBar } from \"./components/layouts/AppMobileNavBar\";\nexport type { AppMobileNavBarProps } from \"./components/layouts/AppMobileNavBar\";\nexport { SideBarNavigation } from \"./components/layouts/SideBarNavigation\";\nexport { MdSideBarNavigation } from \"./components/layouts/MdSideBarNavigation\";\nexport { NotificationItem } from \"./components/layouts/NotificationItem\";\nexport type { NotificationItemProps } from \"./components/layouts/NotificationItem\";\nexport { NotificationsPopover } from \"./components/layouts/NotificationsPopover\";\nexport type { NotificationsPopoverProps } from \"./components/layouts/NotificationsPopover\";\nexport { UsersSelectorPopover } from \"./components/layouts/UsersSelectorPopover\";\nexport type { UsersSelectorPopoverProps } from \"./components/layouts/UsersSelectorPopover\";\nexport { ProfilePopover } from \"./components/layouts/ProfilePopover\";\nexport type {\n ProfilePopoverProps,\n ProfileMenuItem,\n} from \"./components/layouts/ProfilePopover\";\nexport { NavBarItem } from \"./components/layouts/NavBarItem\";\nexport type { NavBarItemProps } from \"./components/layouts/NavBarItem\";\n\n// UI - Buttons\nexport { Button, buttonVariants } from \"./components/ui/buttons/Button\";\nexport { CopyButton } from \"./components/ui/buttons/CopyButton\";\nexport { default as CancelButton } from \"./components/ui/buttons/CancelButton\";\n\n// UI - Data Display\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from \"./components/ui/data-display/Accordion\";\nexport { Badge, badgeVariants } from \"./components/ui/data-display/Badge\";\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n} from \"./components/ui/data-display/Card\";\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n} from \"./components/ui/data-display/Pagination\";\nexport { ScrollArea, ScrollBar } from \"./components/ui/data-display/ScrollArea\";\nexport { Separator } from \"./components/ui/data-display/Separator\";\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from \"./components/ui/data-display/Table\";\nexport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n} from \"./components/ui/data-display/Tabs\";\nexport { UserAvatar } from \"./components/ui/data-display/UserAvatar\";\nexport type { UserAvatarProps } from \"./components/ui/data-display/UserAvatar\";\n\n// UI - Feedback\nexport { default as CircularProgress } from \"./components/ui/feedback/CircularProgress\";\nexport { default as DefaultCircularProgress } from \"./components/ui/feedback/DefaultCircularProgress\";\nexport { Progress } from \"./components/ui/feedback/Progress\";\nexport { LoadingOverlay } from \"./components/ui/feedback/LoadingOverlay\";\nexport {\n Toast,\n toastVariants,\n toastIconContainerVariants,\n} from \"./components/ui/feedback/Toast\";\nexport type { ToastProps } from \"./components/ui/feedback/Toast\";\n\n// UI - Form\nexport { Calendar, CalendarDayButton } from \"./components/ui/form/Calendar\";\nexport { Checkbox } from \"./components/ui/form/Checkbox\";\nexport { DatePicker } from \"./components/ui/form/DatePicker\";\nexport { DateRangePicker } from \"./components/ui/form/DateRangePicker\";\nexport { Input } from \"./components/ui/form/Input\";\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n} from \"./components/ui/form/InputOtp\";\nexport { RadioGroup, RadioGroupItem } from \"./components/ui/form/RadioGroup\";\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from \"./components/ui/form/Select\";\nexport { Switch } from \"./components/ui/form/Switch\";\nexport { Textarea } from \"./components/ui/form/Textarea\";\n\n// UI - Overlay\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n} from \"./components/ui/overlay/Command\";\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from \"./components/ui/overlay/Dialog\";\nexport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n PopoverAnchor,\n} from \"./components/ui/overlay/Popover\";\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n} from \"./components/ui/overlay/Sheet\";\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n} from \"./components/ui/overlay/Tooltip\";\n\n// Store\nexport { useMdSidebarStore } from \"./store/useMdSidebarStore\";\nexport { useModalManager } from \"./store/useModalManager\";\nexport type { ModalData } from \"./store/useModalManager\";\n\n// Enums\nexport { AccountSectionType } from \"./enums/AccountSectionType\";\n\n// Hooks\nexport { default as usePasswordVisibility } from \"./hooks/usePasswordVisibility\";\nexport { default as useCountdownTimer } from \"./hooks/useCountdownTimer\";\nexport { default as useIsMobile } from \"./hooks/useIsMobile\";\n\n// Utils\nexport {\n formatPhone,\n formatTimer,\n formatFullName,\n formatCPF,\n formatCardNumber,\n} from \"./utils/format/masks\";\nexport { timezoneService } from \"./modules/accounts/services/timezone.service\";\nexport type { TimezoneOption } from \"./modules/accounts/services/timezone.service\";\nexport {\n buildLocaleOptions,\n LANGUAGE_OPTIONS as LOCALE_LANGUAGE_OPTIONS,\n} from \"./utils/intl/locales\";\nexport type { LocaleOption } from \"./utils/intl/locales\";\nexport { copyToClipboard, readFromClipboard } from \"./utils/browser/clipboard\";\n\n// UI - Form (new widgets)\nexport { FormField } from \"./components/ui/form/FormField\";\nexport { SelectField } from \"./components/ui/form/SelectField\";\nexport { ComboboxField } from \"./components/ui/form/ComboboxField\";\nexport type { ComboboxOption } from \"./components/ui/form/ComboboxField\";\nexport { default as PhoneInput } from \"./components/ui/form/PhoneInput\";\nexport { default as SwitchOptionFieldWithIcon } from \"./components/ui/form/SwitchOptionFieldWithIcon\";\nexport { TextAreaField } from \"./components/ui/form/TextAreaField\";\n\n// Account Module - Hooks\nexport {\n useUpdateAccount,\n useUpdateAccountUser,\n useUpdateAccountUserById,\n useDeleteAccountUser,\n useDeleteAccount,\n} from \"./modules/accounts/hooks/useAccountManagement\";\n\n// Account Types\nexport type {\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n ChangePasswordRequest,\n DeleteAccountActionResult,\n DeleteUserActionResult,\n UpdateAccountActionResult,\n UpdateUserActionResult,\n TwoFactorGenerateResult,\n TwoFactorActionResult,\n ContactResetResult,\n} from \"./modules/accounts/types\";\n\nexport { default as AccountModals } from \"./components/account/AccountModals\";\nexport { useAccountModals } from \"./store/useAccountModals\";\nexport type { AccountModalsConfig } from \"./store/useAccountModals\";\n\nexport { ModalManager } from \"./components/modals/ModalManager\";\nexport { Modals } from \"./components/modals/Modals\";\n\nexport { default as TwoFactorAuthModal } from \"./components/account/TwoFactorAuthModal\";\nexport { default as DisableTwoFactorAuthModal } from \"./components/account/DisableTwoFactorAuthModal\";\nexport { default as ConfirmGlobalPreferencesModal } from \"./components/account/ConfirmGlobalPreferencesModal\";\nexport { MyProfileSection } from \"./components/account/sections/MyProfileSection\";\nexport { PreferencesSection } from \"./components/account/sections/PreferencesSection\";\nexport { SecuritySection } from \"./components/account/sections/SecuritySection\";\nexport { ChangePasswordSection } from \"./components/account/sections/ChangePasswordSection\";\nexport { ChangeEmailModal } from \"./components/account/sections/ChangeEmailModal\";\nexport { ChangePhoneModal } from \"./components/account/sections/ChangePhoneModal\";\n\n// Account Constants\nexport {\n GENDER_OPTIONS,\n CURRENCY_OPTIONS,\n TIME_FORMAT_OPTIONS,\n NOTIFICATION_TYPES,\n LANGUAGE_OPTIONS,\n} from \"./components/account/constants\";\n"],"mappings":"AACA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AAGd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAU7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAI1B,SAAS,qBAAqB;AAG9B,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,eAAe,iBAAiB;AAQzC,SAAS,UAAU;AACnB,SAAS,wBAAwB;AACjC,SAAS,aAAa,mBAAmB;AAGzC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AAEvB,SAAS,iBAAiB;AAE1B,SAAS,uBAAuB;AAEhC,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC,SAAS,wBAAwB;AAEjC,SAAS,4BAA4B;AAErC,SAAS,4BAA4B;AAErC,SAAS,sBAAsB;AAK/B,SAAS,kBAAkB;AAI3B,SAAS,QAAQ,sBAAsB;AACvC,SAAS,kBAAkB;AAC3B,SAAoB,WAAXA,gBAA+B;AAGxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,OAAO,qBAAqB;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,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A;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,yBAAyB;AAClC,SAAS,uBAAuB;AAIhC,SAAS,0BAA0B;AAGnC,SAAoB,WAAXA,gBAAwC;AACjD,SAAoB,WAAXA,gBAAoC;AAC7C,SAAoB,WAAXA,gBAA8B;AAGvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAEhC;AAAA,EACE;AAAA,EACoB;AAAA,OACf;AAEP,SAAS,iBAAiB,yBAAyB;AAGnD,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,SAAoB,WAAXA,gBAA6B;AACtC,SAAoB,WAAXA,gBAA4C;AACrD,SAAS,qBAAqB;AAG9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAgBP,SAAoB,WAAXA,iBAAgC;AACzC,SAAS,wBAAwB;AAGjC,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AAEvB,SAAoB,WAAXA,iBAAqC;AAC9C,SAAoB,WAAXA,iBAA4C;AACrD,SAAoB,WAAXA,iBAAgD;AACzD,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAGjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAAC;AAAA,OACK;","names":["default","LANGUAGE_OPTIONS"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/auth/actions/login.action.ts"],"sourcesContent":["\"use server\";\r\n\r\nimport { authService } from \"../services/auth.service\";\r\nimport { LoginRequest, LoginResponse } from \"../schema\";\r\nimport { getClientInfoFromRequest } from \"../../../infra/utils/client-info\";\r\nimport { ApiError } from \"../../../infra/api/types\";\r\n\r\nexport async function loginAction(\r\n credentials: LoginRequest\r\n): Promise<LoginResponse> {\r\n try {\r\n const clientInfo = await getClientInfoFromRequest();\r\n return await authService.login(credentials, clientInfo);\r\n } catch (error) {\r\n return {\r\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/auth/actions/login.action.ts"],"sourcesContent":["\"use server\";\r\n\r\nimport { authService } from \"../services/auth.service\";\r\nimport { LoginRequest, LoginResponse } from \"../schema\";\r\nimport { getClientInfoFromRequest } from \"../../../infra/utils/client-info\";\r\nimport { ApiError } from \"../../../infra/api/types\";\r\n\r\nexport async function loginAction(\r\n credentials: LoginRequest\r\n): Promise<LoginResponse> {\r\n try {\r\n const clientInfo = await getClientInfoFromRequest();\r\n return await authService.login(credentials, clientInfo);\r\n } catch (error) {\r\n return {\r\n result: 'error',\r\n message: (error as ApiError).message || \"An error occurred during login\",\r\n };\r\n }\r\n}\r\n"],"mappings":";AAEA,SAAS,mBAAmB;AAE5B,SAAS,gCAAgC;AAGzC,eAAsB,YACpB,aACwB;AACxB,MAAI;AACF,UAAM,aAAa,MAAM,yBAAyB;AAClD,WAAO,MAAM,YAAY,MAAM,aAAa,UAAU;AAAA,EACxD,SAAS,OAAO;AACd,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,SAAU,MAAmB,WAAW;AAAA,IAC1C;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useMutation } from "@tanstack/react-query";
|
|
3
3
|
import { loginAction } from "../actions/login.action";
|
|
4
|
+
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
4
5
|
function useLogin() {
|
|
5
6
|
return useMutation({
|
|
6
|
-
mutationFn:
|
|
7
|
+
mutationFn: async (credentials) => {
|
|
8
|
+
const data = await safeServerAction(loginAction, credentials);
|
|
9
|
+
return data;
|
|
10
|
+
}
|
|
7
11
|
});
|
|
8
12
|
}
|
|
9
13
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/auth/hooks/login.hook.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMutation } from \"@tanstack/react-query\";\nimport { loginAction } from \"../actions/login.action\";\n\nexport function useLogin() {\n return useMutation({\n mutationFn: loginAction,\n });\n}\n"],"mappings":";AAEA,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/auth/hooks/login.hook.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMutation } from \"@tanstack/react-query\";\nimport { loginAction } from \"../actions/login.action\";\nimport { safeServerAction } from \"../../../utils/safeServerAction\";\nimport { LoginRequest, LoginSuccessResponse } from \"../schema\";\n\nexport function useLogin() {\n return useMutation({\n mutationFn: async (credentials: LoginRequest): Promise<LoginSuccessResponse> => {\n const data = await safeServerAction(loginAction, credentials);\n return data as LoginSuccessResponse;\n },\n });\n}\n"],"mappings":";AAEA,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AAG1B,SAAS,WAAW;AACzB,SAAO,YAAY;AAAA,IACjB,YAAY,OAAO,gBAA6D;AAC9E,YAAM,OAAO,MAAM,iBAAiB,aAAa,WAAW;AAC5D,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
4
|
const USER_QUERY_KEY = ["user"];
|
|
4
5
|
async function fetchUser() {
|
|
5
6
|
const { findUserById: getUserDataAction } = await import("../../users/action/find-user-by-id.action");
|
|
@@ -35,7 +36,7 @@ function useTwoFactorVerify() {
|
|
|
35
36
|
return useMutation({
|
|
36
37
|
mutationFn: async ({ cookie, code }) => {
|
|
37
38
|
const { verifyTwoFactorAction } = await import("../actions/verify-two-factor.action");
|
|
38
|
-
return verifyTwoFactorAction
|
|
39
|
+
return safeServerAction(verifyTwoFactorAction, cookie, code);
|
|
39
40
|
},
|
|
40
41
|
onSuccess: () => {
|
|
41
42
|
queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/auth/hooks/useUserQuery.ts"],"sourcesContent":["'use client';\r\n\r\nimport { useMutation, useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query';\r\nimport { User } from '../../users/schema';\r\n\r\nexport const USER_QUERY_KEY = ['user'];\r\n\r\nasync function fetchUser(): Promise<User | null> {\r\n const { findUserById: getUserDataAction } = await import('../../users/action/find-user-by-id.action');\r\n const result = await getUserDataAction();\r\n return result.success && result.data ? result.data : null;\r\n}\r\n\r\nasync function validateUserSession(): Promise<boolean> {\r\n const { validateSessionAction } = await import('../actions/validate-session.action');\r\n return await validateSessionAction();\r\n}\r\n\r\nexport function useUserQuery() {\r\n return useQuery({\r\n queryKey: USER_QUERY_KEY,\r\n queryFn: fetchUser,\r\n staleTime: 5 * 60 * 1000,\r\n gcTime: 10 * 60 * 1000,\r\n retry: false,\r\n });\r\n}\r\n\r\nexport function useUserValidateSession(options?: UseQueryOptions) {\r\n return useQuery({\r\n queryKey: ['user-validate-session'],\r\n queryFn: validateUserSession,\r\n retry: false,\r\n staleTime: 5 * 60 * 1000,\r\n ...options,\r\n refetchOnMount: 'always',\r\n refetchOnWindowFocus: true,\r\n });\r\n}\r\n\r\nexport function useTwoFactorVerify() {\r\n const queryClient = useQueryClient();\r\n\r\n return useMutation({\r\n mutationFn: async ({ cookie, code }: { cookie: string; code: string }) => {\r\n const { verifyTwoFactorAction } = await import('../actions/verify-two-factor.action');\r\n return verifyTwoFactorAction
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/auth/hooks/useUserQuery.ts"],"sourcesContent":["'use client';\r\n\r\nimport { useMutation, useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query';\r\nimport { User } from '../../users/schema';\r\nimport { safeServerAction } from '../../../utils/safeServerAction';\r\n\r\nexport const USER_QUERY_KEY = ['user'];\r\n\r\nasync function fetchUser(): Promise<User | null> {\r\n const { findUserById: getUserDataAction } = await import('../../users/action/find-user-by-id.action');\r\n const result = await getUserDataAction();\r\n return result.success && result.data ? result.data : null;\r\n}\r\n\r\nasync function validateUserSession(): Promise<boolean> {\r\n const { validateSessionAction } = await import('../actions/validate-session.action');\r\n return await validateSessionAction();\r\n}\r\n\r\nexport function useUserQuery() {\r\n return useQuery({\r\n queryKey: USER_QUERY_KEY,\r\n queryFn: fetchUser,\r\n staleTime: 5 * 60 * 1000,\r\n gcTime: 10 * 60 * 1000,\r\n retry: false,\r\n });\r\n}\r\n\r\nexport function useUserValidateSession(options?: UseQueryOptions) {\r\n return useQuery({\r\n queryKey: ['user-validate-session'],\r\n queryFn: validateUserSession,\r\n retry: false,\r\n staleTime: 5 * 60 * 1000,\r\n ...options,\r\n refetchOnMount: 'always',\r\n refetchOnWindowFocus: true,\r\n });\r\n}\r\n\r\nexport function useTwoFactorVerify() {\r\n const queryClient = useQueryClient();\r\n\r\n return useMutation({\r\n mutationFn: async ({ cookie, code }: { cookie: string; code: string }) => {\r\n const { verifyTwoFactorAction } = await import('../actions/verify-two-factor.action');\r\n return safeServerAction(verifyTwoFactorAction, cookie, code);\r\n },\r\n onSuccess: () => {\r\n queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });\r\n queryClient.invalidateQueries({ queryKey: ['two-factor-pending'] });\r\n },\r\n });\r\n}\r\n\r\nexport function useInvalidateUser() {\r\n const queryClient = useQueryClient();\r\n return () => queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });\r\n}\r\n\r\nexport function useSetUserData() {\r\n const queryClient = useQueryClient();\r\n return (user: User | null) => queryClient.setQueryData(USER_QUERY_KEY, user);\r\n}\r\n"],"mappings":";AAEA,SAAS,aAAa,UAAU,sBAAuC;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AAC/B,QAAM,cAAc,eAAe;AACnC,SAAO,CAAC,SAAsB,YAAY,aAAa,gBAAgB,IAAI;AAC7E;","names":[]}
|
|
@@ -36,11 +36,11 @@ class AuthService {
|
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
if (response.two_factor_required) {
|
|
39
|
-
return {
|
|
39
|
+
return { result: "two_factor_required", cookie: response.cookie };
|
|
40
40
|
}
|
|
41
41
|
await this.setAuthCookie(response.cookie);
|
|
42
42
|
return {
|
|
43
|
-
|
|
43
|
+
result: "success",
|
|
44
44
|
user: {},
|
|
45
45
|
accessToken: response.cookie,
|
|
46
46
|
refreshToken: "",
|