@hed-hog/core 0.0.295 → 0.0.296
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/auth/auth.controller.d.ts +4 -4
- package/dist/auth/auth.service.d.ts +4 -4
- package/dist/challenge/challenge.service.d.ts +2 -2
- package/dist/core.module.d.ts.map +1 -1
- package/dist/core.module.js +4 -1
- package/dist/core.module.js.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts +2 -2
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/integration/index.d.ts +4 -0
- package/dist/integration/index.d.ts.map +1 -0
- package/dist/integration/index.js +20 -0
- package/dist/integration/index.js.map +1 -0
- package/dist/integration/integration-api.validation.d.ts +2 -0
- package/dist/integration/integration-api.validation.d.ts.map +1 -0
- package/dist/integration/integration-api.validation.js +126 -0
- package/dist/integration/integration-api.validation.js.map +1 -0
- package/dist/integration/integration.module.d.ts +3 -0
- package/dist/integration/integration.module.d.ts.map +1 -0
- package/dist/integration/integration.module.js +54 -0
- package/dist/integration/integration.module.js.map +1 -0
- package/dist/integration/services/domain-event.publisher.d.ts +31 -0
- package/dist/integration/services/domain-event.publisher.d.ts.map +1 -0
- package/dist/integration/services/domain-event.publisher.js +79 -0
- package/dist/integration/services/domain-event.publisher.js.map +1 -0
- package/dist/integration/services/event-subscriber.registry.d.ts +37 -0
- package/dist/integration/services/event-subscriber.registry.d.ts.map +1 -0
- package/dist/integration/services/event-subscriber.registry.js +86 -0
- package/dist/integration/services/event-subscriber.registry.js.map +1 -0
- package/dist/integration/services/inbox.service.d.ts +55 -0
- package/dist/integration/services/inbox.service.d.ts.map +1 -0
- package/dist/integration/services/inbox.service.js +173 -0
- package/dist/integration/services/inbox.service.js.map +1 -0
- package/dist/integration/services/index.d.ts +12 -0
- package/dist/integration/services/index.d.ts.map +1 -0
- package/dist/integration/services/index.js +28 -0
- package/dist/integration/services/index.js.map +1 -0
- package/dist/integration/services/integration-developer-api.service.d.ts +30 -0
- package/dist/integration/services/integration-developer-api.service.d.ts.map +1 -0
- package/dist/integration/services/integration-developer-api.service.js +55 -0
- package/dist/integration/services/integration-developer-api.service.js.map +1 -0
- package/dist/integration/services/integration-link.service.d.ts +52 -0
- package/dist/integration/services/integration-link.service.d.ts.map +1 -0
- package/dist/integration/services/integration-link.service.js +128 -0
- package/dist/integration/services/integration-link.service.js.map +1 -0
- package/dist/integration/services/integration-settings.service.d.ts +23 -0
- package/dist/integration/services/integration-settings.service.d.ts.map +1 -0
- package/dist/integration/services/integration-settings.service.js +81 -0
- package/dist/integration/services/integration-settings.service.js.map +1 -0
- package/dist/integration/services/outbox-polling.coordinator.d.ts +45 -0
- package/dist/integration/services/outbox-polling.coordinator.d.ts.map +1 -0
- package/dist/integration/services/outbox-polling.coordinator.js +143 -0
- package/dist/integration/services/outbox-polling.coordinator.js.map +1 -0
- package/dist/integration/services/outbox.notifier.d.ts +30 -0
- package/dist/integration/services/outbox.notifier.d.ts.map +1 -0
- package/dist/integration/services/outbox.notifier.js +57 -0
- package/dist/integration/services/outbox.notifier.js.map +1 -0
- package/dist/integration/services/outbox.processor.d.ts +42 -0
- package/dist/integration/services/outbox.processor.d.ts.map +1 -0
- package/dist/integration/services/outbox.processor.job.d.ts +43 -0
- package/dist/integration/services/outbox.processor.job.d.ts.map +1 -0
- package/dist/integration/services/outbox.processor.job.js +100 -0
- package/dist/integration/services/outbox.processor.job.js.map +1 -0
- package/dist/integration/services/outbox.processor.js +208 -0
- package/dist/integration/services/outbox.processor.js.map +1 -0
- package/dist/integration/services/outbox.service.d.ts +53 -0
- package/dist/integration/services/outbox.service.d.ts.map +1 -0
- package/dist/integration/services/outbox.service.js +149 -0
- package/dist/integration/services/outbox.service.js.map +1 -0
- package/dist/integration/types/event.types.d.ts +88 -0
- package/dist/integration/types/event.types.d.ts.map +1 -0
- package/dist/integration/types/event.types.js +35 -0
- package/dist/integration/types/event.types.js.map +1 -0
- package/dist/integration/types/index.d.ts +3 -0
- package/dist/integration/types/index.d.ts.map +1 -0
- package/dist/integration/types/index.js +19 -0
- package/dist/integration/types/index.js.map +1 -0
- package/dist/integration/types/subscriber.types.d.ts +31 -0
- package/dist/integration/types/subscriber.types.d.ts.map +1 -0
- package/dist/integration/types/subscriber.types.js +3 -0
- package/dist/integration/types/subscriber.types.js.map +1 -0
- package/dist/oauth/oauth.controller.js.map +1 -1
- package/dist/oauth/oauth.service.d.ts +3 -3
- package/dist/oauth/oauth.service.d.ts.map +1 -1
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/profile/profile.controller.d.ts +3 -3
- package/dist/profile/profile.service.d.ts +3 -3
- package/dist/setting/setting.controller.d.ts +12 -8
- package/dist/setting/setting.controller.d.ts.map +1 -1
- package/dist/setting/setting.service.d.ts +12 -8
- package/dist/setting/setting.service.d.ts.map +1 -1
- package/dist/setting/setting.service.js +21 -1
- package/dist/setting/setting.service.js.map +1 -1
- package/dist/user/user.controller.d.ts +4 -4
- package/dist/user/user.service.d.ts +9 -9
- package/hedhog/data/dashboard_component_role.yaml +223 -223
- package/hedhog/data/dashboard_role.yaml +18 -18
- package/hedhog/data/route.yaml +2 -0
- package/hedhog/data/setting_group.yaml +955 -470
- package/hedhog/data/setting_subgroup.yaml +303 -0
- package/hedhog/frontend/app/configurations/[slug]/components/setting-field.tsx.ejs +44 -18
- package/hedhog/frontend/app/configurations/[slug]/page.tsx.ejs +134 -27
- package/hedhog/frontend/app/configurations/layout.tsx.ejs +84 -23
- package/hedhog/frontend/app/dashboard/components/widgets/permissions-chart.tsx.ejs +62 -62
- package/hedhog/frontend/app/dashboard/page.tsx.ejs +29 -29
- package/hedhog/frontend/app/preferences/page.tsx.ejs +2 -5
- package/hedhog/table/inbox_event.yaml +40 -0
- package/hedhog/table/integration_link.yaml +33 -0
- package/hedhog/table/outbox_event.yaml +45 -0
- package/hedhog/table/setting.yaml +7 -0
- package/hedhog/table/setting_subgroup.yaml +19 -0
- package/package.json +8 -8
- package/src/ai/ai.service.ts +3 -3
- package/src/auth/auth.controller.ts +11 -11
- package/src/auth/auth.service.ts +8 -8
- package/src/core.module.ts +4 -1
- package/src/index.ts +15 -0
- package/src/integration/README.md +397 -0
- package/src/integration/USAGE_EXAMPLE.md +279 -0
- package/src/integration/index.ts +4 -0
- package/src/integration/integration-api.validation.ts +154 -0
- package/src/integration/integration.module.ts +53 -0
- package/src/integration/services/domain-event.publisher.ts +136 -0
- package/src/integration/services/event-subscriber.registry.ts +89 -0
- package/src/integration/services/inbox.service.ts +218 -0
- package/src/integration/services/index.ts +12 -0
- package/src/integration/services/integration-developer-api.service.ts +96 -0
- package/src/integration/services/integration-link.service.ts +154 -0
- package/src/integration/services/integration-settings.service.ts +128 -0
- package/src/integration/services/outbox-polling.coordinator.ts +146 -0
- package/src/integration/services/outbox.notifier.ts +48 -0
- package/src/integration/services/outbox.processor.job.ts +97 -0
- package/src/integration/services/outbox.processor.ts +266 -0
- package/src/integration/services/outbox.service.ts +209 -0
- package/src/integration/types/event.types.ts +93 -0
- package/src/integration/types/index.ts +3 -0
- package/src/integration/types/subscriber.types.ts +37 -0
- package/src/oauth/oauth.controller.ts +17 -17
- package/src/oauth/oauth.service.ts +20 -20
- package/src/setting/setting.service.ts +27 -2
- package/src/task/task.service.ts +5 -5
|
@@ -18,6 +18,14 @@ import {
|
|
|
18
18
|
DropdownMenuItem,
|
|
19
19
|
DropdownMenuTrigger,
|
|
20
20
|
} from '@/components/ui/dropdown-menu';
|
|
21
|
+
import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area';
|
|
22
|
+
import {
|
|
23
|
+
Select,
|
|
24
|
+
SelectContent,
|
|
25
|
+
SelectItem,
|
|
26
|
+
SelectTrigger,
|
|
27
|
+
SelectValue,
|
|
28
|
+
} from '@/components/ui/select';
|
|
21
29
|
import { cn } from '@/lib/utils';
|
|
22
30
|
import { PaginatedResult } from '@/types/pagination-result';
|
|
23
31
|
import { SettingGroup } from '@hed-hog/api-types';
|
|
@@ -25,8 +33,8 @@ import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
|
25
33
|
import { Download, MenuIcon, Upload } from 'lucide-react';
|
|
26
34
|
import { useTranslations } from 'next-intl';
|
|
27
35
|
import Link from 'next/link';
|
|
28
|
-
import { usePathname } from 'next/navigation';
|
|
29
|
-
import { useCallback, useRef, useState } from 'react';
|
|
36
|
+
import { usePathname, useRouter } from 'next/navigation';
|
|
37
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
30
38
|
|
|
31
39
|
interface SettingsValidation {
|
|
32
40
|
totalSettings: number;
|
|
@@ -43,6 +51,7 @@ interface IProps {
|
|
|
43
51
|
export default function ConfigurationsLayout({ children }: IProps) {
|
|
44
52
|
const t = useTranslations('core.Configurations');
|
|
45
53
|
const pathname = usePathname();
|
|
54
|
+
const router = useRouter();
|
|
46
55
|
const { request, currentLocaleCode, showToastHandler } = useApp();
|
|
47
56
|
|
|
48
57
|
const { data: settingGroups, refetch } = useQuery<
|
|
@@ -62,6 +71,24 @@ export default function ConfigurationsLayout({ children }: IProps) {
|
|
|
62
71
|
const [importDialogOpen, setImportDialogOpen] = useState(false);
|
|
63
72
|
const [importData, setImportData] = useState<SettingsValidation | null>(null);
|
|
64
73
|
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
74
|
+
const tabsContainerRef = useRef<HTMLDivElement>(null);
|
|
75
|
+
|
|
76
|
+
const groups = settingGroups?.data || [];
|
|
77
|
+
const activeGroup = groups.find(
|
|
78
|
+
(item) => pathname === `/core/configurations/${item.slug}`
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
const activeTab = tabsContainerRef.current?.querySelector<HTMLElement>(
|
|
83
|
+
'[data-active="true"]'
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
activeTab?.scrollIntoView({
|
|
87
|
+
behavior: 'smooth',
|
|
88
|
+
inline: 'center',
|
|
89
|
+
block: 'nearest',
|
|
90
|
+
});
|
|
91
|
+
}, [pathname, groups.length]);
|
|
65
92
|
|
|
66
93
|
const handleExport = (includeSecrets: boolean) => {
|
|
67
94
|
request<Blob>({
|
|
@@ -144,7 +171,7 @@ export default function ConfigurationsLayout({ children }: IProps) {
|
|
|
144
171
|
}, [importData, request, refetch, showToastHandler, t]);
|
|
145
172
|
|
|
146
173
|
return (
|
|
147
|
-
<div className="flex flex-col
|
|
174
|
+
<div className="flex min-w-0 flex-col overflow-x-hidden px-4">
|
|
148
175
|
<PageHeader
|
|
149
176
|
breadcrumbs={[
|
|
150
177
|
{ label: t('breadcrumbHome'), href: '/' },
|
|
@@ -280,29 +307,63 @@ export default function ConfigurationsLayout({ children }: IProps) {
|
|
|
280
307
|
}
|
|
281
308
|
/>
|
|
282
309
|
|
|
283
|
-
<div className="border-b border-border
|
|
284
|
-
<
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
)
|
|
310
|
+
<div className="sticky top-0 z-20 -mx-4 mb-6 border-b border-border bg-background/95 px-4 backdrop-blur supports-[backdrop-filter]:bg-background/80">
|
|
311
|
+
<div className="min-w-0 overflow-x-hidden">
|
|
312
|
+
<div className="pb-4 pt-2 md:hidden">
|
|
313
|
+
<Select
|
|
314
|
+
value={activeGroup?.slug}
|
|
315
|
+
onValueChange={(value) =>
|
|
316
|
+
router.push(`/core/configurations/${value}`)
|
|
317
|
+
}
|
|
318
|
+
>
|
|
319
|
+
<SelectTrigger className="w-full bg-background">
|
|
320
|
+
<SelectValue placeholder={activeGroup?.name || t('title')} />
|
|
321
|
+
</SelectTrigger>
|
|
322
|
+
<SelectContent>
|
|
323
|
+
{groups.map((item: SettingGroup) => (
|
|
324
|
+
<SelectItem key={item.slug} value={item.slug}>
|
|
325
|
+
{item.name}
|
|
326
|
+
</SelectItem>
|
|
327
|
+
))}
|
|
328
|
+
</SelectContent>
|
|
329
|
+
</Select>
|
|
330
|
+
</div>
|
|
331
|
+
|
|
332
|
+
<div className="hidden min-w-0 overflow-x-hidden md:block">
|
|
333
|
+
<ScrollArea className="w-full min-w-0" type="auto">
|
|
334
|
+
<nav
|
|
335
|
+
ref={tabsContainerRef}
|
|
336
|
+
className="flex min-w-max gap-2"
|
|
337
|
+
aria-label="Configuration tabs"
|
|
297
338
|
>
|
|
298
|
-
{item
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
339
|
+
{groups.map((item: SettingGroup) => {
|
|
340
|
+
const isActive =
|
|
341
|
+
pathname === `/core/configurations/${item.slug}`;
|
|
342
|
+
|
|
343
|
+
return (
|
|
344
|
+
<Link
|
|
345
|
+
key={item.slug}
|
|
346
|
+
href={item.slug}
|
|
347
|
+
data-active={isActive}
|
|
348
|
+
className={cn(
|
|
349
|
+
'shrink-0 border-b-2 px-3 py-3 text-sm font-medium whitespace-nowrap transition-colors',
|
|
350
|
+
isActive
|
|
351
|
+
? 'border-primary text-primary'
|
|
352
|
+
: 'border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground'
|
|
353
|
+
)}
|
|
354
|
+
>
|
|
355
|
+
{item.name}
|
|
356
|
+
</Link>
|
|
357
|
+
);
|
|
358
|
+
})}
|
|
359
|
+
</nav>
|
|
360
|
+
<ScrollBar orientation="horizontal" />
|
|
361
|
+
</ScrollArea>
|
|
362
|
+
</div>
|
|
363
|
+
</div>
|
|
303
364
|
</div>
|
|
304
365
|
|
|
305
|
-
<div className="pb-
|
|
366
|
+
<div className="min-w-0 pb-25">{children}</div>
|
|
306
367
|
|
|
307
368
|
<input
|
|
308
369
|
ref={fileInputRef}
|
|
@@ -37,24 +37,24 @@ function CustomTooltip({
|
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
interface PermissionsChartProps {
|
|
41
|
-
widget?: {
|
|
42
|
-
name?: string;
|
|
43
|
-
} | null;
|
|
44
|
-
onRemove?: () => void;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
interface PermissionDistributionItem {
|
|
48
|
-
name: string;
|
|
49
|
-
value: number;
|
|
50
|
-
color: string;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
interface UserStatsData {
|
|
54
|
-
charts?: {
|
|
55
|
-
permissionDistribution?: PermissionDistributionItem[];
|
|
56
|
-
};
|
|
57
|
-
}
|
|
40
|
+
interface PermissionsChartProps {
|
|
41
|
+
widget?: {
|
|
42
|
+
name?: string;
|
|
43
|
+
} | null;
|
|
44
|
+
onRemove?: () => void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface PermissionDistributionItem {
|
|
48
|
+
name: string;
|
|
49
|
+
value: number;
|
|
50
|
+
color: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface UserStatsData {
|
|
54
|
+
charts?: {
|
|
55
|
+
permissionDistribution?: PermissionDistributionItem[];
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
58
|
|
|
59
59
|
export default function PermissionsChart({
|
|
60
60
|
widget,
|
|
@@ -70,10 +70,10 @@ export default function PermissionsChart({
|
|
|
70
70
|
} = useWidgetData<UserStatsData>({
|
|
71
71
|
endpoint: '/dashboard-core/stats/overview/users',
|
|
72
72
|
queryKey: 'dashboard-stats-users',
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
const data = statsData?.charts?.permissionDistribution || [];
|
|
76
|
-
const total = data.reduce((sum, item) => sum + item.value, 0);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const data = statsData?.charts?.permissionDistribution || [];
|
|
76
|
+
const total = data.reduce((sum, item) => sum + item.value, 0);
|
|
77
77
|
|
|
78
78
|
return (
|
|
79
79
|
<WidgetWrapper
|
|
@@ -90,19 +90,19 @@ export default function PermissionsChart({
|
|
|
90
90
|
>
|
|
91
91
|
<IconGripVertical className="text-muted-foreground/50 size-4 shrink-0" />
|
|
92
92
|
</div>
|
|
93
|
-
<CardHeader className="pb-2 pt-4 pl-10">
|
|
94
|
-
<CardTitle className="text-base font-semibold">
|
|
95
|
-
{t('permissionsDistributionTitle')}
|
|
96
|
-
</CardTitle>
|
|
93
|
+
<CardHeader className="pb-2 pt-4 pl-10">
|
|
94
|
+
<CardTitle className="text-base font-semibold">
|
|
95
|
+
{t('permissionsDistributionTitle')}
|
|
96
|
+
</CardTitle>
|
|
97
97
|
<CardDescription>
|
|
98
98
|
{t('permissionsDistributionDescription')}
|
|
99
99
|
</CardDescription>
|
|
100
|
-
</CardHeader>
|
|
101
|
-
<CardContent className="flex-1 pt-0">
|
|
102
|
-
<div className="flex h-full items-center justify-between gap-4 overflow-hidden">
|
|
103
|
-
<div className="relative h-[280px] w-[280px] shrink-0">
|
|
104
|
-
<ResponsiveContainer width="100%" height="100%">
|
|
105
|
-
<PieChart>
|
|
100
|
+
</CardHeader>
|
|
101
|
+
<CardContent className="flex-1 pt-0">
|
|
102
|
+
<div className="flex h-full items-center justify-between gap-4 overflow-hidden">
|
|
103
|
+
<div className="relative h-[280px] w-[280px] shrink-0">
|
|
104
|
+
<ResponsiveContainer width="100%" height="100%">
|
|
105
|
+
<PieChart>
|
|
106
106
|
<Pie
|
|
107
107
|
data={data}
|
|
108
108
|
cx="50%"
|
|
@@ -110,14 +110,14 @@ export default function PermissionsChart({
|
|
|
110
110
|
innerRadius={70}
|
|
111
111
|
outerRadius={110}
|
|
112
112
|
paddingAngle={4}
|
|
113
|
-
dataKey="value"
|
|
114
|
-
animationDuration={1200}
|
|
115
|
-
strokeWidth={0}
|
|
116
|
-
>
|
|
117
|
-
{data.map((entry, index: number) => (
|
|
118
|
-
<Cell key={`cell-${index}`} fill={entry.color} />
|
|
119
|
-
))}
|
|
120
|
-
</Pie>
|
|
113
|
+
dataKey="value"
|
|
114
|
+
animationDuration={1200}
|
|
115
|
+
strokeWidth={0}
|
|
116
|
+
>
|
|
117
|
+
{data.map((entry, index: number) => (
|
|
118
|
+
<Cell key={`cell-${index}`} fill={entry.color} />
|
|
119
|
+
))}
|
|
120
|
+
</Pie>
|
|
121
121
|
<Tooltip content={<CustomTooltip />} />
|
|
122
122
|
</PieChart>
|
|
123
123
|
</ResponsiveContainer>
|
|
@@ -125,28 +125,28 @@ export default function PermissionsChart({
|
|
|
125
125
|
<span className="text-2xl font-bold text-foreground">
|
|
126
126
|
{total}
|
|
127
127
|
</span>
|
|
128
|
-
<span className="text-[10px] text-muted-foreground">
|
|
129
|
-
{t('total')}
|
|
130
|
-
</span>
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
<div className="grid max-h-[280px] min-w-0 flex-1 grid-cols-2 content-start gap-x-4 gap-y-2 overflow-y-auto pr-2">
|
|
134
|
-
{data.map((item) => (
|
|
135
|
-
<div key={item.name} className="flex min-w-0 items-start gap-2.5">
|
|
136
|
-
<div
|
|
137
|
-
className="mt-1 h-2.5 w-2.5 shrink-0 rounded-sm"
|
|
138
|
-
style={{ backgroundColor: item.color }}
|
|
139
|
-
/>
|
|
140
|
-
<div className="flex min-w-0 flex-col">
|
|
141
|
-
<span className="break-words text-xs font-medium leading-tight text-foreground">
|
|
142
|
-
{item.name}
|
|
143
|
-
</span>
|
|
144
|
-
<span className="text-[11px] text-muted-foreground">
|
|
145
|
-
{item.value} ({total ? Math.round((item.value / total) * 100) : 0}%)
|
|
146
|
-
</span>
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
))}
|
|
128
|
+
<span className="text-[10px] text-muted-foreground">
|
|
129
|
+
{t('total')}
|
|
130
|
+
</span>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
<div className="grid max-h-[280px] min-w-0 flex-1 grid-cols-2 content-start gap-x-4 gap-y-2 overflow-y-auto pr-2">
|
|
134
|
+
{data.map((item) => (
|
|
135
|
+
<div key={item.name} className="flex min-w-0 items-start gap-2.5">
|
|
136
|
+
<div
|
|
137
|
+
className="mt-1 h-2.5 w-2.5 shrink-0 rounded-sm"
|
|
138
|
+
style={{ backgroundColor: item.color }}
|
|
139
|
+
/>
|
|
140
|
+
<div className="flex min-w-0 flex-col">
|
|
141
|
+
<span className="break-words text-xs font-medium leading-tight text-foreground">
|
|
142
|
+
{item.name}
|
|
143
|
+
</span>
|
|
144
|
+
<span className="text-[11px] text-muted-foreground">
|
|
145
|
+
{item.value} ({total ? Math.round((item.value / total) * 100) : 0}%)
|
|
146
|
+
</span>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
))}
|
|
150
150
|
</div>
|
|
151
151
|
</div>
|
|
152
152
|
</CardContent>
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Dashboard } from '@hed-hog/api-types';
|
|
4
|
-
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
5
|
-
import { useRouter } from 'next/navigation';
|
|
6
|
-
import { useEffect } from 'react';
|
|
7
|
-
|
|
8
|
-
export default function DashboardRedirectPage() {
|
|
9
|
-
const router = useRouter();
|
|
10
|
-
const { request, currentLocaleCode } = useApp();
|
|
11
|
-
|
|
12
|
-
const { data: dashboardData, isLoading } = useQuery<Dashboard | null>({
|
|
13
|
-
queryKey: ['dashboard-home-redirect', currentLocaleCode],
|
|
14
|
-
queryFn: async () => {
|
|
15
|
-
const response = await request<Dashboard>({
|
|
16
|
-
url: '/dashboard-core/home',
|
|
17
|
-
});
|
|
18
|
-
return response.data ?? null;
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (isLoading) return;
|
|
24
|
-
|
|
25
|
-
router.replace(`/core/dashboard/${dashboardData?.slug ?? 'default'}`);
|
|
26
|
-
}, [dashboardData?.slug, isLoading, router]);
|
|
27
|
-
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Dashboard } from '@hed-hog/api-types';
|
|
4
|
+
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
5
|
+
import { useRouter } from 'next/navigation';
|
|
6
|
+
import { useEffect } from 'react';
|
|
7
|
+
|
|
8
|
+
export default function DashboardRedirectPage() {
|
|
9
|
+
const router = useRouter();
|
|
10
|
+
const { request, currentLocaleCode } = useApp();
|
|
11
|
+
|
|
12
|
+
const { data: dashboardData, isLoading } = useQuery<Dashboard | null>({
|
|
13
|
+
queryKey: ['dashboard-home-redirect', currentLocaleCode],
|
|
14
|
+
queryFn: async () => {
|
|
15
|
+
const response = await request<Dashboard>({
|
|
16
|
+
url: '/dashboard-core/home',
|
|
17
|
+
});
|
|
18
|
+
return response.data ?? null;
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (isLoading) return;
|
|
24
|
+
|
|
25
|
+
router.replace(`/core/dashboard/${dashboardData?.slug ?? 'default'}`);
|
|
26
|
+
}, [dashboardData?.slug, isLoading, router]);
|
|
27
|
+
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
@@ -109,10 +109,7 @@ export default function PreferencesPage() {
|
|
|
109
109
|
} catch {
|
|
110
110
|
setCurrentTheme(previousTheme);
|
|
111
111
|
|
|
112
|
-
if (
|
|
113
|
-
typeof window !== 'undefined' &&
|
|
114
|
-
previousThemeSource !== 'explicit'
|
|
115
|
-
) {
|
|
112
|
+
if (typeof window !== 'undefined' && previousThemeSource !== 'explicit') {
|
|
116
113
|
window.localStorage.removeItem(THEME_SOURCE_STORAGE_KEY);
|
|
117
114
|
}
|
|
118
115
|
|
|
@@ -132,7 +129,7 @@ export default function PreferencesPage() {
|
|
|
132
129
|
data: { language: code },
|
|
133
130
|
});
|
|
134
131
|
await refetchUser();
|
|
135
|
-
} catch {
|
|
132
|
+
} catch (error) {
|
|
136
133
|
showToastHandler(
|
|
137
134
|
'error',
|
|
138
135
|
t('languageUpdateError') || 'Failed to update language'
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: outbox_event_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: outbox_event
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: CASCADE
|
|
9
|
+
- name: consumer_name
|
|
10
|
+
length: 255
|
|
11
|
+
- name: status
|
|
12
|
+
type: enum
|
|
13
|
+
enum:
|
|
14
|
+
- received
|
|
15
|
+
- processing
|
|
16
|
+
- processed
|
|
17
|
+
- failed
|
|
18
|
+
- skipped
|
|
19
|
+
default: received
|
|
20
|
+
- name: attempt_count
|
|
21
|
+
type: int
|
|
22
|
+
default: 0
|
|
23
|
+
- name: last_error
|
|
24
|
+
length: 1023
|
|
25
|
+
isNullable: true
|
|
26
|
+
- name: processed_at
|
|
27
|
+
type: timestamptz
|
|
28
|
+
isNullable: true
|
|
29
|
+
- type: created_at
|
|
30
|
+
- type: updated_at
|
|
31
|
+
|
|
32
|
+
indexes:
|
|
33
|
+
- columns:
|
|
34
|
+
- outbox_event_id
|
|
35
|
+
- consumer_name
|
|
36
|
+
isUnique: true
|
|
37
|
+
- columns:
|
|
38
|
+
- status
|
|
39
|
+
- columns:
|
|
40
|
+
- created_at
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: source_module
|
|
4
|
+
length: 127
|
|
5
|
+
- name: source_entity_type
|
|
6
|
+
length: 127
|
|
7
|
+
- name: source_entity_id
|
|
8
|
+
length: 36
|
|
9
|
+
- name: target_module
|
|
10
|
+
length: 127
|
|
11
|
+
- name: target_entity_type
|
|
12
|
+
length: 127
|
|
13
|
+
- name: target_entity_id
|
|
14
|
+
length: 36
|
|
15
|
+
- name: link_type
|
|
16
|
+
length: 63
|
|
17
|
+
- name: metadata
|
|
18
|
+
type: json
|
|
19
|
+
isNullable: true
|
|
20
|
+
- type: created_at
|
|
21
|
+
- type: updated_at
|
|
22
|
+
|
|
23
|
+
indexes:
|
|
24
|
+
- columns:
|
|
25
|
+
- source_module
|
|
26
|
+
- source_entity_type
|
|
27
|
+
- source_entity_id
|
|
28
|
+
- columns:
|
|
29
|
+
- target_module
|
|
30
|
+
- target_entity_type
|
|
31
|
+
- target_entity_id
|
|
32
|
+
- columns:
|
|
33
|
+
- link_type
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: event_name
|
|
4
|
+
length: 255
|
|
5
|
+
- name: source_module
|
|
6
|
+
length: 127
|
|
7
|
+
- name: aggregate_type
|
|
8
|
+
length: 127
|
|
9
|
+
- name: aggregate_id
|
|
10
|
+
length: 36
|
|
11
|
+
- name: payload
|
|
12
|
+
type: json
|
|
13
|
+
- name: status
|
|
14
|
+
type: enum
|
|
15
|
+
enum:
|
|
16
|
+
- pending
|
|
17
|
+
- processing
|
|
18
|
+
- processed
|
|
19
|
+
- failed
|
|
20
|
+
- dead_letter
|
|
21
|
+
default: pending
|
|
22
|
+
- name: attempt_count
|
|
23
|
+
type: int
|
|
24
|
+
default: 0
|
|
25
|
+
- name: last_error
|
|
26
|
+
length: 1023
|
|
27
|
+
isNullable: true
|
|
28
|
+
- name: available_at
|
|
29
|
+
type: timestamptz
|
|
30
|
+
- name: processed_at
|
|
31
|
+
type: timestamptz
|
|
32
|
+
isNullable: true
|
|
33
|
+
- type: created_at
|
|
34
|
+
- type: updated_at
|
|
35
|
+
|
|
36
|
+
indexes:
|
|
37
|
+
- columns:
|
|
38
|
+
- status
|
|
39
|
+
- available_at
|
|
40
|
+
- columns:
|
|
41
|
+
- source_module
|
|
42
|
+
- aggregate_type
|
|
43
|
+
- aggregate_id
|
|
44
|
+
- columns:
|
|
45
|
+
- created_at
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- type: slug
|
|
4
|
+
- name: name
|
|
5
|
+
type: locale_varchar
|
|
6
|
+
length: 63
|
|
7
|
+
isNullable: true
|
|
8
|
+
locale:
|
|
9
|
+
en: Name
|
|
10
|
+
pt: Nome
|
|
11
|
+
- name: description
|
|
12
|
+
type: locale_varchar
|
|
13
|
+
length: 255
|
|
14
|
+
isNullable: true
|
|
15
|
+
locale:
|
|
16
|
+
en: Description
|
|
17
|
+
pt: Descrição
|
|
18
|
+
- type: created_at
|
|
19
|
+
- type: updated_at
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hed-hog/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.296",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"sharp": "^0.34.2",
|
|
31
31
|
"speakeasy": "^2.0.0",
|
|
32
32
|
"uuid": "^11.1.0",
|
|
33
|
-
"@hed-hog/api-locale": "0.0.
|
|
34
|
-
"@hed-hog/api
|
|
35
|
-
"@hed-hog/api": "0.0.
|
|
36
|
-
"@hed-hog/api-prisma": "0.0.
|
|
37
|
-
"@hed-hog/api-
|
|
38
|
-
"@hed-hog/api-
|
|
33
|
+
"@hed-hog/api-locale": "0.0.14",
|
|
34
|
+
"@hed-hog/api": "0.0.6",
|
|
35
|
+
"@hed-hog/api-mail": "0.0.9",
|
|
36
|
+
"@hed-hog/api-prisma": "0.0.6",
|
|
37
|
+
"@hed-hog/api-pagination": "0.0.7",
|
|
38
|
+
"@hed-hog/api-types": "0.0.1"
|
|
39
39
|
},
|
|
40
40
|
"exports": {
|
|
41
41
|
".": {
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"_dev": "pnpm build --watch",
|
|
77
77
|
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
|
|
78
78
|
"clean": "rimraf dist tsconfig.production.tsbuildinfo",
|
|
79
|
-
"prebuild": "pnpm run clean && pnpm exec ts-node
|
|
79
|
+
"prebuild": "pnpm run clean && pnpm --dir ../.. exec ts-node ./scripts/build-dependencies.ts libraries/core",
|
|
80
80
|
"build": "tsc --project tsconfig.production.json && pnpm run copy:templates",
|
|
81
81
|
"copy:templates": "node -e \"require('fs').cpSync('src/file/templates', 'dist/file/templates', {recursive: true})\"",
|
|
82
82
|
"patch": "pnpm exec ts-node ../../scripts/patch.ts libraries/core",
|
package/src/ai/ai.service.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PaginationDTO } from '@hed-hog/api-pagination';
|
|
2
|
-
import { Prisma, PrismaService } from '@hed-hog/api-prisma';
|
|
1
|
+
import { PaginationDTO } from '@hed-hog/api-pagination';
|
|
2
|
+
import { Prisma, PrismaService } from '@hed-hog/api-prisma';
|
|
3
3
|
import {
|
|
4
4
|
BadRequestException,
|
|
5
5
|
forwardRef,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
Logger,
|
|
9
9
|
NotFoundException,
|
|
10
10
|
} from '@nestjs/common';
|
|
11
|
-
import axios from 'axios';
|
|
11
|
+
import axios from 'axios';
|
|
12
12
|
import { createHash } from 'crypto';
|
|
13
13
|
import pdfParse from 'pdf-parse';
|
|
14
14
|
import { DeleteDTO } from '../dto/delete.dto';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Public, Role, User, UserOptional } from '@hed-hog/api';
|
|
2
2
|
import { Locale } from '@hed-hog/api-locale';
|
|
3
|
-
import {
|
|
4
|
-
BadRequestException,
|
|
5
|
-
Body,
|
|
6
|
-
Controller,
|
|
7
|
-
forwardRef,
|
|
3
|
+
import {
|
|
4
|
+
BadRequestException,
|
|
5
|
+
Body,
|
|
6
|
+
Controller,
|
|
7
|
+
forwardRef,
|
|
8
8
|
Get,
|
|
9
9
|
Headers,
|
|
10
10
|
Inject,
|
|
11
|
-
Ip,
|
|
12
|
-
Post,
|
|
13
|
-
Req,
|
|
14
|
-
Res,
|
|
15
|
-
UnauthorizedException,
|
|
16
|
-
} from '@nestjs/common';
|
|
11
|
+
Ip,
|
|
12
|
+
Post,
|
|
13
|
+
Req,
|
|
14
|
+
Res,
|
|
15
|
+
UnauthorizedException,
|
|
16
|
+
} from '@nestjs/common';
|
|
17
17
|
import { TokenService } from '../token/token.service';
|
|
18
18
|
import { CreateWithEmailAndPasswordDTO } from '../user/dto/create-with-email-and-password.dto';
|
|
19
19
|
import { UserService } from '../user/user.service';
|
package/src/auth/auth.service.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { getLocaleText } from '@hed-hog/api-locale';
|
|
2
2
|
import { PrismaService } from '@hed-hog/api-prisma';
|
|
3
3
|
import { User } from '@hed-hog/api-types';
|
|
4
|
-
import {
|
|
5
|
-
BadRequestException,
|
|
6
|
-
forwardRef,
|
|
7
|
-
Inject,
|
|
8
|
-
Injectable,
|
|
9
|
-
NotFoundException,
|
|
10
|
-
UnauthorizedException,
|
|
11
|
-
} from '@nestjs/common';
|
|
4
|
+
import {
|
|
5
|
+
BadRequestException,
|
|
6
|
+
forwardRef,
|
|
7
|
+
Inject,
|
|
8
|
+
Injectable,
|
|
9
|
+
NotFoundException,
|
|
10
|
+
UnauthorizedException,
|
|
11
|
+
} from '@nestjs/common';
|
|
12
12
|
import { ChallengeService } from '../challenge/challenge.service';
|
|
13
13
|
import { MailService as MailManagerService } from '../mail/mail.service';
|
|
14
14
|
import { SecurityService } from '../security/security.service';
|