@alepha/ui 0.15.4 → 0.16.0
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/admin/AdminApiKeys-DsmGnHNh.js +3 -0
- package/dist/admin/AdminApiKeys-GMORg-1l.js +442 -0
- package/dist/admin/AdminApiKeys-GMORg-1l.js.map +1 -0
- package/dist/admin/AdminAudits-8SM96viT.js +3 -0
- package/dist/admin/{AdminAudits-Oh7iAfQa.js → AdminAudits-pkWrjq1Z.js} +2 -2
- package/dist/admin/{AdminAudits-Oh7iAfQa.js.map → AdminAudits-pkWrjq1Z.js.map} +1 -1
- package/dist/admin/AdminFiles-B56ocq4H.js +3 -0
- package/dist/admin/{AdminFiles-Cu8GHgQ3.js → AdminFiles-WeQbsCsl.js} +2 -2
- package/dist/admin/{AdminFiles-Cu8GHgQ3.js.map → AdminFiles-WeQbsCsl.js.map} +1 -1
- package/dist/admin/AdminJobs-B-q9iGO3.js +697 -0
- package/dist/admin/AdminJobs-B-q9iGO3.js.map +1 -0
- package/dist/admin/AdminJobs-CED1syCn.js +3 -0
- package/dist/admin/{AdminLayout-QJLIesuG.js → AdminLayout-D8yZ-8lG.js} +4 -2
- package/dist/admin/AdminLayout-D8yZ-8lG.js.map +1 -0
- package/dist/admin/AdminNotifications-B0B1rdc4.js +3 -0
- package/dist/admin/{AdminNotifications-CgYkBuG_.js → AdminNotifications-Ds5Un0NJ.js} +2 -2
- package/dist/admin/{AdminNotifications-CgYkBuG_.js.map → AdminNotifications-Ds5Un0NJ.js.map} +1 -1
- package/dist/admin/{AdminParameters-Cl-R0nXt.js → AdminParameters-BU3lATdJ.js} +1 -1
- package/dist/admin/{AdminParameters-hjNG_KXb.js → AdminParameters-CfDUpc78.js} +4 -4
- package/dist/admin/{AdminParameters-hjNG_KXb.js.map → AdminParameters-CfDUpc78.js.map} +1 -1
- package/dist/admin/AdminSessions-BDGK2MS6.js +3 -0
- package/dist/admin/{AdminSessions-Bey9cuy1.js → AdminSessions-DzIOxM3b.js} +2 -2
- package/dist/admin/{AdminSessions-Bey9cuy1.js.map → AdminSessions-DzIOxM3b.js.map} +1 -1
- package/dist/admin/{AdminUserAudits-C7AN9jx7.js → AdminUserAudits-CiUPN2BC.js} +2 -2
- package/dist/admin/{AdminUserAudits-C7AN9jx7.js.map → AdminUserAudits-CiUPN2BC.js.map} +1 -1
- package/dist/admin/{AdminUserAudits-Cp_ERd2g.js → AdminUserAudits-Cj79gENT.js} +1 -1
- package/dist/admin/{AdminUserCreate-BVIm4JdN.js → AdminUserCreate-BwQKr4xE.js} +2 -2
- package/dist/admin/{AdminUserCreate-BVIm4JdN.js.map → AdminUserCreate-BwQKr4xE.js.map} +1 -1
- package/dist/admin/{AdminUserCreate-C1aInRDk.js → AdminUserCreate-Cq-mUmBs.js} +1 -1
- package/dist/admin/{AdminUserDetails-Dcn3OwMC.js → AdminUserDetails-DRjVAPFd.js} +1 -1
- package/dist/admin/{AdminUserDetails-yM4x8JE6.js → AdminUserDetails-uqtC5aJ1.js} +2 -2
- package/dist/admin/{AdminUserDetails-yM4x8JE6.js.map → AdminUserDetails-uqtC5aJ1.js.map} +1 -1
- package/dist/admin/{AdminUserLayout-gb-nbggz.js → AdminUserLayout-CGzmHHby.js} +1 -1
- package/dist/admin/{AdminUserLayout-BnfBC1gD.js → AdminUserLayout-CiPay35T.js} +2 -2
- package/dist/admin/{AdminUserLayout-BnfBC1gD.js.map → AdminUserLayout-CiPay35T.js.map} +1 -1
- package/dist/admin/{AdminUserSessions-kmkXG-xf.js → AdminUserSessions-DAE8Nf1F.js} +2 -2
- package/dist/admin/{AdminUserSessions-kmkXG-xf.js.map → AdminUserSessions-DAE8Nf1F.js.map} +1 -1
- package/dist/admin/AdminUserSessions-DcdzuNZ9.js +3 -0
- package/dist/admin/AdminUserSettings-D7V6-ceX.js +3 -0
- package/dist/admin/{AdminUserSettings-DZ9iWhJW.js → AdminUserSettings-EbahaV2a.js} +2 -2
- package/dist/admin/{AdminUserSettings-DZ9iWhJW.js.map → AdminUserSettings-EbahaV2a.js.map} +1 -1
- package/dist/admin/AdminUsers-D9nyzGqQ.js +3 -0
- package/dist/admin/{AdminUsers-D6Y5K8Am.js → AdminUsers-Dcjh0KNW.js} +2 -2
- package/dist/admin/{AdminUsers-D6Y5K8Am.js.map → AdminUsers-Dcjh0KNW.js.map} +1 -1
- package/dist/admin/index.d.ts +33 -41
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +129 -179
- package/dist/admin/index.js.map +1 -1
- package/dist/auth/{AuthLayout-Dj5K4SIN.js → AuthLayout-mFOWbiSP.js} +2 -1
- package/dist/auth/AuthLayout-mFOWbiSP.js.map +1 -0
- package/dist/auth/index.d.ts +18 -8
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +22 -17
- package/dist/auth/index.js.map +1 -1
- package/dist/core/index.d.ts +16 -24
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +34 -43
- package/dist/core/index.js.map +1 -1
- package/dist/demo/{DemoLogin-S-b15cmE.js → DemoLogin-CvCG2WVh.js} +3 -1
- package/dist/demo/{DemoLogin-S-b15cmE.js.map → DemoLogin-CvCG2WVh.js.map} +1 -1
- package/dist/demo/{DemoRegister-B29MdAaZ.js → DemoRegister-CmeHbOAs.js} +3 -1
- package/dist/demo/{DemoRegister-B29MdAaZ.js.map → DemoRegister-CmeHbOAs.js.map} +1 -1
- package/dist/demo/{DemoResetPassword-CPTy88iK.js → DemoResetPassword-CKO5iA_6.js} +3 -1
- package/dist/demo/{DemoResetPassword-CPTy88iK.js.map → DemoResetPassword-CKO5iA_6.js.map} +1 -1
- package/dist/demo/index.js +3 -3
- package/package.json +11 -11
- package/src/admin/AdminRouter.ts +111 -2
- package/src/admin/components/AdminLayout.tsx +2 -0
- package/src/admin/components/jobs/AdminJobs.tsx +733 -119
- package/src/admin/components/keys/AdminApiKeys.tsx +537 -0
- package/src/admin/components/parameters/AdminParameters.tsx +2 -3
- package/src/admin/index.ts +8 -17
- package/src/admin/primitives/$uiAdmin.ts +17 -0
- package/src/auth/AuthRouter.ts +14 -6
- package/src/auth/components/AuthLayout.tsx +1 -0
- package/src/auth/index.ts +5 -14
- package/src/auth/primitives/$uiAuth.ts +10 -0
- package/src/core/components/buttons/ActionButton.tsx +15 -2
- package/src/core/components/buttons/DarkModeButton.css +6 -0
- package/src/core/components/buttons/DarkModeButton.tsx +18 -71
- package/src/core/components/buttons/LanguageButton.tsx +2 -7
- package/src/core/components/buttons/ThemeButton.tsx +2 -6
- package/src/core/components/layout/AdminShell.tsx +17 -1
- package/src/core/components/layout/AlephaMantineProvider.tsx +2 -1
- package/src/core/components/layout/AppBar.tsx +5 -8
- package/src/core/components/layout/Sidebar.tsx +10 -0
- package/src/core/index.ts +3 -4
- package/src/core/styles.css +1 -0
- package/src/demo/components/auth/DemoLogin.tsx +2 -0
- package/src/demo/components/auth/DemoRegister.tsx +2 -0
- package/src/demo/components/auth/DemoResetPassword.tsx +2 -0
- package/dist/admin/AdminAudits-BU-p1g7A.js +0 -3
- package/dist/admin/AdminFiles-Bg9feLFH.js +0 -3
- package/dist/admin/AdminLayout-BfeFXiul.js +0 -3
- package/dist/admin/AdminLayout-QJLIesuG.js.map +0 -1
- package/dist/admin/AdminNotifications-DmfGPqHe.js +0 -3
- package/dist/admin/AdminSessions-Cn4_jB04.js +0 -3
- package/dist/admin/AdminUserSessions-rvA0ztxn.js +0 -3
- package/dist/admin/AdminUserSettings-Dg-wTRzN.js +0 -3
- package/dist/admin/AdminUsers-RCaxccEW.js +0 -3
- package/dist/auth/AuthLayout-Dj5K4SIN.js.map +0 -1
- package/src/admin/MainRouter.ts +0 -23
package/dist/admin/index.js
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import {
|
|
1
|
+
import { t as AdminAudits_default } from "./AdminAudits-pkWrjq1Z.js";
|
|
2
|
+
import { t as AdminFiles_default } from "./AdminFiles-WeQbsCsl.js";
|
|
3
|
+
import { t as AdminJobs_default } from "./AdminJobs-B-q9iGO3.js";
|
|
4
|
+
import { t as AdminApiKeys_default } from "./AdminApiKeys-GMORg-1l.js";
|
|
5
|
+
import { t as AdminNotifications_default } from "./AdminNotifications-Ds5Un0NJ.js";
|
|
6
|
+
import { t as AdminParameters_default } from "./AdminParameters-CfDUpc78.js";
|
|
7
|
+
import { t as AdminSessions_default } from "./AdminSessions-DzIOxM3b.js";
|
|
8
|
+
import { t as AdminUserAudits_default } from "./AdminUserAudits-CiUPN2BC.js";
|
|
9
|
+
import { t as AdminUserCreate_default } from "./AdminUserCreate-BwQKr4xE.js";
|
|
10
|
+
import { t as AdminUserDetails_default } from "./AdminUserDetails-uqtC5aJ1.js";
|
|
11
|
+
import { t as AdminUserLayout_default } from "./AdminUserLayout-CiPay35T.js";
|
|
12
|
+
import { t as AdminUserSessions_default } from "./AdminUserSessions-DAE8Nf1F.js";
|
|
13
|
+
import { t as AdminUserSettings_default } from "./AdminUserSettings-EbahaV2a.js";
|
|
14
|
+
import { t as AdminUsers_default } from "./AdminUsers-Dcjh0KNW.js";
|
|
15
|
+
import { AlephaUI, Flex, Text } from "@alepha/ui";
|
|
15
16
|
import { AlephaUIAuth, AuthRouter } from "@alepha/ui/auth";
|
|
16
|
-
import { $context, $inject, $module
|
|
17
|
-
import { IconBell,
|
|
17
|
+
import { $context, $inject, $module } from "alepha";
|
|
18
|
+
import { IconBell, IconDevices, IconFile, IconHistory, IconKey, IconPlus, IconSettings, IconShieldCheck, IconTerminal2, IconUser, IconUsers } from "@tabler/icons-react";
|
|
18
19
|
import { ReactAuth } from "alepha/react/auth";
|
|
19
20
|
import { $page, ReactRouter, Redirection } from "alepha/react/router";
|
|
20
21
|
import { $client } from "alepha/server/links";
|
|
22
|
+
import { Stack } from "@mantine/core";
|
|
21
23
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
-
import { Badge, Stack } from "@mantine/core";
|
|
23
|
-
import { useClient } from "alepha/react";
|
|
24
|
-
import { useI18n } from "alepha/react/i18n";
|
|
25
|
-
import { jobExecutions } from "alepha/api/jobs";
|
|
26
24
|
|
|
27
25
|
//#region ../../src/admin/AdminRouter.ts
|
|
28
26
|
var AdminRouter = class {
|
|
@@ -35,7 +33,71 @@ var AdminRouter = class {
|
|
|
35
33
|
fileCtrl = $client();
|
|
36
34
|
configCtrl = $client();
|
|
37
35
|
auditCtrl = $client();
|
|
36
|
+
jobCtrl = $client();
|
|
37
|
+
apiKeyCtrl = $client();
|
|
38
|
+
configFn = () => {
|
|
39
|
+
return {
|
|
40
|
+
sidebarResizable: true,
|
|
41
|
+
sidebarProps: { items: this.getDefaultSidebarItems() }
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
getDefaultSidebarItems() {
|
|
45
|
+
return [
|
|
46
|
+
{
|
|
47
|
+
label: "Identity",
|
|
48
|
+
icon: IconUsers,
|
|
49
|
+
children: [
|
|
50
|
+
{
|
|
51
|
+
...this.router.node(this.adminUsers.name),
|
|
52
|
+
can: () => this.userCtrl.findUsers.can()
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
...this.router.node(this.adminSessions.name),
|
|
56
|
+
can: () => this.sessionCtrl.findSessions.can()
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
...this.router.node(this.adminApiKeys.name),
|
|
60
|
+
can: () => this.apiKeyCtrl.findApiKeys.can()
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: "Content",
|
|
66
|
+
icon: IconFile,
|
|
67
|
+
children: [{
|
|
68
|
+
...this.router.node(this.adminFiles.name),
|
|
69
|
+
can: () => this.fileCtrl.findFiles.can()
|
|
70
|
+
}, {
|
|
71
|
+
...this.router.node(this.adminNotifications.name),
|
|
72
|
+
can: () => this.notificationCtrl.findNotifications.can()
|
|
73
|
+
}]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: "System",
|
|
77
|
+
icon: IconSettings,
|
|
78
|
+
children: [
|
|
79
|
+
{
|
|
80
|
+
...this.router.node(this.adminJobs.name),
|
|
81
|
+
can: () => this.jobCtrl.getJobs.can()
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
...this.router.node(this.adminAudits.name),
|
|
85
|
+
can: () => this.auditCtrl.findAudits.can()
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
...this.router.node(this.adminParameters.name),
|
|
89
|
+
can: () => this.configCtrl.getConfigTree.can()
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: "toggle",
|
|
95
|
+
position: "bottom"
|
|
96
|
+
}
|
|
97
|
+
];
|
|
98
|
+
}
|
|
38
99
|
adminShellProps() {
|
|
100
|
+
if (this.configFn) return this.configFn(this);
|
|
39
101
|
return {};
|
|
40
102
|
}
|
|
41
103
|
onNotAuthorized(url) {
|
|
@@ -44,8 +106,8 @@ var AdminRouter = class {
|
|
|
44
106
|
adminLayout = $page({
|
|
45
107
|
path: "/admin",
|
|
46
108
|
label: "Admin",
|
|
47
|
-
can: () => this.
|
|
48
|
-
lazy: () => import("./AdminLayout-
|
|
109
|
+
can: () => this.auth.can("admin:*"),
|
|
110
|
+
lazy: () => import("./AdminLayout-D8yZ-8lG.js"),
|
|
49
111
|
props: () => ({ adminShellProps: this.adminShellProps() }),
|
|
50
112
|
loader: ({ user, url }) => {
|
|
51
113
|
if (!user) throw this.onNotAuthorized(url);
|
|
@@ -58,7 +120,7 @@ var AdminRouter = class {
|
|
|
58
120
|
path: "/users",
|
|
59
121
|
label: "Users",
|
|
60
122
|
description: "Manage application users and their roles.",
|
|
61
|
-
lazy: () => import("./AdminUsers-
|
|
123
|
+
lazy: () => import("./AdminUsers-D9nyzGqQ.js"),
|
|
62
124
|
can: () => this.userCtrl.findUsers.can()
|
|
63
125
|
});
|
|
64
126
|
adminUserCreate = $page({
|
|
@@ -67,7 +129,7 @@ var AdminRouter = class {
|
|
|
67
129
|
path: "/users/create",
|
|
68
130
|
label: "Create User",
|
|
69
131
|
description: "Create a new user account",
|
|
70
|
-
lazy: () => import("./AdminUserCreate-
|
|
132
|
+
lazy: () => import("./AdminUserCreate-Cq-mUmBs.js"),
|
|
71
133
|
can: () => this.userCtrl.createUser.can()
|
|
72
134
|
});
|
|
73
135
|
adminUserLayout = $page({
|
|
@@ -75,32 +137,32 @@ var AdminRouter = class {
|
|
|
75
137
|
parent: this.adminLayout,
|
|
76
138
|
path: "/users/:userId",
|
|
77
139
|
label: "User",
|
|
78
|
-
lazy: () => import("./AdminUserLayout-
|
|
140
|
+
lazy: () => import("./AdminUserLayout-CGzmHHby.js"),
|
|
79
141
|
can: () => this.userCtrl.getUser.can()
|
|
80
142
|
});
|
|
81
143
|
adminUserDetails = $page({
|
|
82
144
|
parent: this.adminUserLayout,
|
|
83
145
|
path: "/details",
|
|
84
146
|
label: "Details",
|
|
85
|
-
lazy: () => import("./AdminUserDetails-
|
|
147
|
+
lazy: () => import("./AdminUserDetails-DRjVAPFd.js")
|
|
86
148
|
});
|
|
87
149
|
adminUserSessions = $page({
|
|
88
150
|
parent: this.adminUserLayout,
|
|
89
151
|
path: "/sessions",
|
|
90
152
|
label: "Sessions",
|
|
91
|
-
lazy: () => import("./AdminUserSessions-
|
|
153
|
+
lazy: () => import("./AdminUserSessions-DcdzuNZ9.js")
|
|
92
154
|
});
|
|
93
155
|
adminUserSettings = $page({
|
|
94
156
|
parent: this.adminUserLayout,
|
|
95
157
|
path: "/settings",
|
|
96
158
|
label: "Settings",
|
|
97
|
-
lazy: () => import("./AdminUserSettings-
|
|
159
|
+
lazy: () => import("./AdminUserSettings-D7V6-ceX.js")
|
|
98
160
|
});
|
|
99
161
|
adminUserAudits = $page({
|
|
100
162
|
parent: this.adminUserLayout,
|
|
101
163
|
path: "/audits",
|
|
102
164
|
label: "Audit Log",
|
|
103
|
-
lazy: () => import("./AdminUserAudits-
|
|
165
|
+
lazy: () => import("./AdminUserAudits-Cj79gENT.js"),
|
|
104
166
|
can: () => this.auditCtrl.findByUser.can()
|
|
105
167
|
});
|
|
106
168
|
adminAudits = $page({
|
|
@@ -109,7 +171,7 @@ var AdminRouter = class {
|
|
|
109
171
|
path: "/audits",
|
|
110
172
|
label: "Audit Log",
|
|
111
173
|
description: "View system-wide audit trail and activity logs.",
|
|
112
|
-
lazy: () => import("./AdminAudits-
|
|
174
|
+
lazy: () => import("./AdminAudits-8SM96viT.js"),
|
|
113
175
|
can: () => this.auditCtrl.findAudits.can()
|
|
114
176
|
});
|
|
115
177
|
adminSessions = $page({
|
|
@@ -118,7 +180,7 @@ var AdminRouter = class {
|
|
|
118
180
|
path: "/sessions",
|
|
119
181
|
label: "Sessions",
|
|
120
182
|
description: "View and manage all active sessions.",
|
|
121
|
-
lazy: () => import("./AdminSessions-
|
|
183
|
+
lazy: () => import("./AdminSessions-BDGK2MS6.js"),
|
|
122
184
|
can: () => this.sessionCtrl.findSessions.can()
|
|
123
185
|
});
|
|
124
186
|
adminNotifications = $page({
|
|
@@ -127,7 +189,7 @@ var AdminRouter = class {
|
|
|
127
189
|
path: "/notifications",
|
|
128
190
|
label: "Notifications",
|
|
129
191
|
description: "View notification history and status.",
|
|
130
|
-
lazy: () => import("./AdminNotifications-
|
|
192
|
+
lazy: () => import("./AdminNotifications-B0B1rdc4.js"),
|
|
131
193
|
can: () => this.notificationCtrl.findNotifications.can()
|
|
132
194
|
});
|
|
133
195
|
adminFiles = $page({
|
|
@@ -136,7 +198,7 @@ var AdminRouter = class {
|
|
|
136
198
|
path: "/files",
|
|
137
199
|
label: "Files",
|
|
138
200
|
description: "Manage uploaded files and storage.",
|
|
139
|
-
lazy: () => import("./AdminFiles-
|
|
201
|
+
lazy: () => import("./AdminFiles-B56ocq4H.js"),
|
|
140
202
|
can: () => this.fileCtrl.findFiles.can()
|
|
141
203
|
});
|
|
142
204
|
adminParameters = $page({
|
|
@@ -145,144 +207,28 @@ var AdminRouter = class {
|
|
|
145
207
|
path: "/parameters",
|
|
146
208
|
label: "Parameters",
|
|
147
209
|
description: "View and manage application configuration parameters.",
|
|
148
|
-
lazy: () => import("./AdminParameters-
|
|
210
|
+
lazy: () => import("./AdminParameters-BU3lATdJ.js"),
|
|
149
211
|
can: () => this.configCtrl.getConfigTree.can()
|
|
150
212
|
});
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
*
|
|
160
|
-
* This is basically a convenience class to avoid having to inject these routers everywhere.
|
|
161
|
-
* Code is lightweight enough that we can just copy it if needed.
|
|
162
|
-
*/
|
|
163
|
-
var MainRouter = class {
|
|
164
|
-
auth = $inject(AuthRouter);
|
|
165
|
-
admin = $inject(AdminRouter);
|
|
166
|
-
layout = $page({
|
|
167
|
-
component: AlephaMantineProvider,
|
|
168
|
-
children: () => [this.auth.layout, this.admin.adminLayout]
|
|
169
|
-
});
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region ../../src/admin/components/jobs/AdminJobs.tsx
|
|
174
|
-
const AdminJobs = () => {
|
|
175
|
-
const client = useClient();
|
|
176
|
-
const { l } = useI18n();
|
|
177
|
-
const filters = t.object({
|
|
178
|
-
job: t.optional(t.string({ $control: { query: t.pick(jobExecutions.schema, ["job"]) } })),
|
|
179
|
-
status: t.optional(t.enum([
|
|
180
|
-
"STARTED",
|
|
181
|
-
"FAILED",
|
|
182
|
-
"COMPLETED"
|
|
183
|
-
]))
|
|
213
|
+
adminJobs = $page({
|
|
214
|
+
icon: IconTerminal2,
|
|
215
|
+
parent: this.adminLayout,
|
|
216
|
+
path: "/jobs",
|
|
217
|
+
label: "Jobs",
|
|
218
|
+
description: "Monitor and manage background jobs and scheduled tasks.",
|
|
219
|
+
lazy: () => import("./AdminJobs-CED1syCn.js"),
|
|
220
|
+
can: () => this.jobCtrl.getJobs.can()
|
|
184
221
|
});
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const getStatusIcon = (status) => {
|
|
194
|
-
switch (status) {
|
|
195
|
-
case "COMPLETED": return /* @__PURE__ */ jsx(IconCheck, { size: 12 });
|
|
196
|
-
case "FAILED": return /* @__PURE__ */ jsx(IconX, { size: 12 });
|
|
197
|
-
case "STARTED": return /* @__PURE__ */ jsx(IconPlayerPlay, { size: 12 });
|
|
198
|
-
default: return /* @__PURE__ */ jsx(IconClock, { size: 12 });
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
const formatDuration = (start, end) => {
|
|
202
|
-
const startTime = new Date(start).getTime();
|
|
203
|
-
const duration = (end ? new Date(end).getTime() : Date.now()) - startTime;
|
|
204
|
-
if (duration < 1e3) return `${duration}ms`;
|
|
205
|
-
if (duration < 6e4) return `${(duration / 1e3).toFixed(1)}s`;
|
|
206
|
-
return `${Math.floor(duration / 6e4)}m ${Math.floor(duration % 6e4 / 1e3)}s`;
|
|
207
|
-
};
|
|
208
|
-
return /* @__PURE__ */ jsx(Flex, {
|
|
209
|
-
flex: 1,
|
|
210
|
-
direction: "column",
|
|
211
|
-
children: /* @__PURE__ */ jsx(DataTable, {
|
|
212
|
-
submitOnInit: true,
|
|
213
|
-
defaultSize: 10,
|
|
214
|
-
typeFormProps: {
|
|
215
|
-
skipSubmitButton: true,
|
|
216
|
-
columns: 3
|
|
217
|
-
},
|
|
218
|
-
tableProps: {
|
|
219
|
-
horizontalSpacing: "xs",
|
|
220
|
-
verticalSpacing: "xs"
|
|
221
|
-
},
|
|
222
|
-
onFilterChange: (key, _value, form) => {
|
|
223
|
-
if (key === "job" || key === "status") return form.submit();
|
|
224
|
-
},
|
|
225
|
-
filters,
|
|
226
|
-
items: async (filters) => {
|
|
227
|
-
return await client.getJobExecutions({ query: filters });
|
|
228
|
-
},
|
|
229
|
-
columns: {
|
|
230
|
-
job: {
|
|
231
|
-
label: "Job",
|
|
232
|
-
value: (item) => /* @__PURE__ */ jsx(Text, {
|
|
233
|
-
size: "sm",
|
|
234
|
-
fw: 500,
|
|
235
|
-
children: item.job
|
|
236
|
-
})
|
|
237
|
-
},
|
|
238
|
-
status: {
|
|
239
|
-
label: "Status",
|
|
240
|
-
fit: true,
|
|
241
|
-
value: (item) => /* @__PURE__ */ jsx(Badge, {
|
|
242
|
-
size: "sm",
|
|
243
|
-
variant: "light",
|
|
244
|
-
color: getStatusColor(item.status),
|
|
245
|
-
leftSection: getStatusIcon(item.status),
|
|
246
|
-
children: item.status
|
|
247
|
-
})
|
|
248
|
-
},
|
|
249
|
-
duration: {
|
|
250
|
-
label: "Duration",
|
|
251
|
-
fit: true,
|
|
252
|
-
value: (item) => /* @__PURE__ */ jsx(Text, {
|
|
253
|
-
size: "xs",
|
|
254
|
-
c: "dimmed",
|
|
255
|
-
ff: "monospace",
|
|
256
|
-
children: formatDuration(item.createdAt, item.finishedAt)
|
|
257
|
-
})
|
|
258
|
-
},
|
|
259
|
-
error: {
|
|
260
|
-
label: "Error",
|
|
261
|
-
value: (item) => item.error ? /* @__PURE__ */ jsx(Text, {
|
|
262
|
-
size: "xs",
|
|
263
|
-
c: "red",
|
|
264
|
-
lineClamp: 1,
|
|
265
|
-
children: item.error
|
|
266
|
-
}) : /* @__PURE__ */ jsx(Text, {
|
|
267
|
-
size: "xs",
|
|
268
|
-
c: "dimmed",
|
|
269
|
-
children: "-"
|
|
270
|
-
})
|
|
271
|
-
},
|
|
272
|
-
createdAt: {
|
|
273
|
-
label: "Started",
|
|
274
|
-
fit: true,
|
|
275
|
-
value: (item) => /* @__PURE__ */ jsx(Text, {
|
|
276
|
-
size: "xs",
|
|
277
|
-
c: "dimmed",
|
|
278
|
-
children: l(item.createdAt, { date: "fromNow" })
|
|
279
|
-
})
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
})
|
|
222
|
+
adminApiKeys = $page({
|
|
223
|
+
icon: IconKey,
|
|
224
|
+
parent: this.adminLayout,
|
|
225
|
+
path: "/api-keys",
|
|
226
|
+
label: "API Keys",
|
|
227
|
+
description: "View and manage API keys for programmatic access.",
|
|
228
|
+
lazy: () => import("./AdminApiKeys-DsmGnHNh.js"),
|
|
229
|
+
can: () => this.apiKeyCtrl.findApiKeys.can()
|
|
283
230
|
});
|
|
284
231
|
};
|
|
285
|
-
var AdminJobs_default = AdminJobs;
|
|
286
232
|
|
|
287
233
|
//#endregion
|
|
288
234
|
//#region ../../src/admin/components/verifications/AdminVerifications.tsx
|
|
@@ -317,12 +263,24 @@ const AdminVerifications = () => {
|
|
|
317
263
|
};
|
|
318
264
|
var AdminVerifications_default = AdminVerifications;
|
|
319
265
|
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region ../../src/admin/primitives/$uiAdmin.ts
|
|
268
|
+
/**
|
|
269
|
+
* Register Admin UI components and get the AdminRouter instance.
|
|
270
|
+
*/
|
|
271
|
+
const $uiAdmin = (optsFn) => {
|
|
272
|
+
const { alepha } = $context();
|
|
273
|
+
const adminRouter = alepha.inject(AdminRouter);
|
|
274
|
+
if (optsFn) adminRouter.configFn = optsFn;
|
|
275
|
+
return adminRouter;
|
|
276
|
+
};
|
|
277
|
+
|
|
320
278
|
//#endregion
|
|
321
279
|
//#region ../../src/admin/index.ts
|
|
322
280
|
/**
|
|
323
|
-
* |
|
|
324
|
-
*
|
|
325
|
-
* |
|
|
281
|
+
* | Stability | Since | Runtime |
|
|
282
|
+
* |-----------|-------|---------|
|
|
283
|
+
* | 2 - beta | 0.12.0 | node, bun, workerd, browser|
|
|
326
284
|
*
|
|
327
285
|
* Admin panel UI components.
|
|
328
286
|
*
|
|
@@ -344,21 +302,13 @@ const AlephaUIAdmin = $module({
|
|
|
344
302
|
services: [
|
|
345
303
|
AlephaUI,
|
|
346
304
|
AlephaUIAuth,
|
|
347
|
-
AdminRouter
|
|
348
|
-
MainRouter
|
|
305
|
+
AdminRouter
|
|
349
306
|
],
|
|
350
307
|
register: (alepha) => {
|
|
351
308
|
alepha.with(AdminRouter);
|
|
352
309
|
}
|
|
353
310
|
});
|
|
354
|
-
/**
|
|
355
|
-
* Register Admin UI components and get the AdminRouter instance.
|
|
356
|
-
*/
|
|
357
|
-
const $uiAdmin = () => {
|
|
358
|
-
const { alepha } = $context();
|
|
359
|
-
return alepha.inject(AdminRouter);
|
|
360
|
-
};
|
|
361
311
|
|
|
362
312
|
//#endregion
|
|
363
|
-
export { $uiAdmin, AdminAudits_default as AdminAudits, AdminFiles_default as AdminFiles, AdminJobs_default as AdminJobs,
|
|
313
|
+
export { $uiAdmin, AdminApiKeys_default as AdminApiKeys, AdminAudits_default as AdminAudits, AdminFiles_default as AdminFiles, AdminJobs_default as AdminJobs, AdminNotifications_default as AdminNotifications, AdminParameters_default as AdminParameters, AdminRouter, AdminSessions_default as AdminSessions, AdminUserAudits_default as AdminUserAudits, AdminUserCreate_default as AdminUserCreate, AdminUserDetails_default as AdminUserDetails, AdminUserLayout_default as AdminUserLayout, AdminUserSessions_default as AdminUserSessions, AdminUserSettings_default as AdminUserSettings, AdminUsers_default as AdminUsers, AdminVerifications_default as AdminVerifications, AlephaUIAdmin };
|
|
364
314
|
//# sourceMappingURL=index.js.map
|
package/dist/admin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/admin/AdminRouter.ts","../../src/admin/MainRouter.ts","../../src/admin/components/jobs/AdminJobs.tsx","../../src/admin/components/verifications/AdminVerifications.tsx","../../src/admin/index.ts"],"sourcesContent":["import type { AdminShellProps } from \"@alepha/ui\";\nimport { AuthRouter } from \"@alepha/ui/auth\";\nimport {\n IconBell,\n IconDevices,\n IconFile,\n IconHistory,\n IconPlus,\n IconSettings,\n IconUser,\n IconUsers,\n} from \"@tabler/icons-react\";\nimport { $inject } from \"alepha\";\nimport type { AdminAuditController } from \"alepha/api/audits\";\nimport type { FileController } from \"alepha/api/files\";\nimport type { AdminNotificationController } from \"alepha/api/notifications\";\nimport type { AdminConfigController } from \"alepha/api/parameters\";\nimport type {\n AdminSessionController,\n AdminUserController,\n} from \"alepha/api/users\";\nimport { ReactAuth } from \"alepha/react/auth\";\nimport { $page, ReactRouter, Redirection } from \"alepha/react/router\";\nimport { $client } from \"alepha/server/links\";\n\nexport class AdminRouter {\n protected readonly router = $inject(ReactRouter<AdminRouter>);\n protected readonly authRouter = $inject(AuthRouter);\n protected readonly auth = $inject(ReactAuth);\n protected readonly userCtrl = $client<AdminUserController>();\n protected readonly sessionCtrl = $client<AdminSessionController>();\n protected readonly notificationCtrl = $client<AdminNotificationController>();\n protected readonly fileCtrl = $client<FileController>();\n protected readonly configCtrl = $client<AdminConfigController>();\n protected readonly auditCtrl = $client<AdminAuditController>();\n\n protected adminShellProps(): AdminShellProps {\n return {};\n }\n\n protected onNotAuthorized(url: URL) {\n return new Redirection(\n this.router.path(this.authRouter.login.name, {\n query: {\n r: url.pathname,\n },\n }),\n );\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Layout\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminLayout = $page({\n path: \"/admin\",\n label: \"Admin\",\n can: () => this.userCtrl.findUsers.can(),\n lazy: () => import(\"./components/AdminLayout.tsx\"),\n props: () => ({\n adminShellProps: this.adminShellProps(),\n }),\n loader: ({ user, url }) => {\n if (!user) {\n throw this.onNotAuthorized(url);\n }\n return {};\n },\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Users\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminUsers = $page({\n icon: IconUsers,\n parent: this.adminLayout,\n path: \"/users\",\n label: \"Users\",\n description: \"Manage application users and their roles.\",\n lazy: () => import(\"./components/users/AdminUsers.tsx\"),\n can: () => this.userCtrl.findUsers.can(),\n });\n\n public readonly adminUserCreate = $page({\n icon: IconPlus,\n parent: this.adminLayout,\n path: \"/users/create\",\n label: \"Create User\",\n description: \"Create a new user account\",\n lazy: () => import(\"./components/users/AdminUserCreate.tsx\"),\n can: () => this.userCtrl.createUser.can(),\n });\n\n public readonly adminUserLayout = $page({\n icon: IconUser,\n parent: this.adminLayout,\n path: \"/users/:userId\",\n label: \"User\",\n lazy: () => import(\"./components/users/AdminUserLayout.tsx\"),\n can: () => this.userCtrl.getUser.can(),\n });\n\n public readonly adminUserDetails = $page({\n parent: this.adminUserLayout,\n path: \"/details\",\n label: \"Details\",\n lazy: () => import(\"./components/users/AdminUserDetails.tsx\"),\n });\n\n public readonly adminUserSessions = $page({\n parent: this.adminUserLayout,\n path: \"/sessions\",\n label: \"Sessions\",\n lazy: () => import(\"./components/users/AdminUserSessions.tsx\"),\n });\n\n public readonly adminUserSettings = $page({\n parent: this.adminUserLayout,\n path: \"/settings\",\n label: \"Settings\",\n lazy: () => import(\"./components/users/AdminUserSettings.tsx\"),\n });\n\n public readonly adminUserAudits = $page({\n parent: this.adminUserLayout,\n path: \"/audits\",\n label: \"Audit Log\",\n lazy: () => import(\"./components/users/AdminUserAudits.tsx\"),\n can: () => this.auditCtrl.findByUser.can(),\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Audits (Global)\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminAudits = $page({\n icon: IconHistory,\n parent: this.adminLayout,\n path: \"/audits\",\n label: \"Audit Log\",\n description: \"View system-wide audit trail and activity logs.\",\n lazy: () => import(\"./components/audits/AdminAudits.tsx\"),\n can: () => this.auditCtrl.findAudits.can(),\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Sessions\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminSessions = $page({\n icon: IconDevices,\n parent: this.adminLayout,\n path: \"/sessions\",\n label: \"Sessions\",\n description: \"View and manage all active sessions.\",\n lazy: () => import(\"./components/sessions/AdminSessions.tsx\"),\n can: () => this.sessionCtrl.findSessions.can(),\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Notifications\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminNotifications = $page({\n icon: IconBell,\n parent: this.adminLayout,\n path: \"/notifications\",\n label: \"Notifications\",\n description: \"View notification history and status.\",\n lazy: () => import(\"./components/notifications/AdminNotifications.tsx\"),\n can: () => this.notificationCtrl.findNotifications.can(),\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Files\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminFiles = $page({\n icon: IconFile,\n parent: this.adminLayout,\n path: \"/files\",\n label: \"Files\",\n description: \"Manage uploaded files and storage.\",\n lazy: () => import(\"./components/files/AdminFiles.tsx\"),\n can: () => this.fileCtrl.findFiles.can(),\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Parameters\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminParameters = $page({\n icon: IconSettings,\n parent: this.adminLayout,\n path: \"/parameters\",\n label: \"Parameters\",\n description: \"View and manage application configuration parameters.\",\n lazy: () => import(\"./components/parameters/AdminParameters.tsx\"),\n can: () => this.configCtrl.getConfigTree.can(),\n });\n}\n","import { AlephaMantineProvider } from \"@alepha/ui\";\nimport { AuthRouter } from \"@alepha/ui/auth\";\nimport { $inject } from \"alepha\";\nimport { $page } from \"alepha/react/router\";\nimport { AdminRouter } from \"./AdminRouter.ts\";\n\n/**\n * Main application router that combines Auth and Admin routers.\n *\n * We assume that the main application router will always have Admin and Auth routers.\n *\n * This is basically a convenience class to avoid having to inject these routers everywhere.\n * Code is lightweight enough that we can just copy it if needed.\n */\nexport class MainRouter {\n auth = $inject(AuthRouter);\n admin = $inject(AdminRouter);\n\n layout = $page({\n component: AlephaMantineProvider,\n children: () => [this.auth.layout, this.admin.adminLayout],\n });\n}\n","import { DataTable, Flex, Text } from \"@alepha/ui\";\nimport { Badge } from \"@mantine/core\";\nimport {\n IconCheck,\n IconClock,\n IconPlayerPlay,\n IconX,\n} from \"@tabler/icons-react\";\nimport { type Page, t } from \"alepha\";\nimport {\n type AdminJobController,\n type JobExecutionEntity,\n jobExecutions,\n} from \"alepha/api/jobs\";\nimport { useClient } from \"alepha/react\";\nimport { useI18n } from \"alepha/react/i18n\";\n\nconst AdminJobs = () => {\n const client = useClient<AdminJobController>();\n const { l } = useI18n();\n\n const filters = t.object({\n job: t.optional(\n t.string({\n $control: {\n query: t.pick(jobExecutions.schema, [\"job\"]),\n },\n }),\n ),\n status: t.optional(t.enum([\"STARTED\", \"FAILED\", \"COMPLETED\"])),\n });\n\n const getStatusColor = (status: string) => {\n switch (status) {\n case \"COMPLETED\":\n return \"green\";\n case \"FAILED\":\n return \"red\";\n case \"STARTED\":\n return \"blue\";\n default:\n return \"gray\";\n }\n };\n\n const getStatusIcon = (status: string) => {\n switch (status) {\n case \"COMPLETED\":\n return <IconCheck size={12} />;\n case \"FAILED\":\n return <IconX size={12} />;\n case \"STARTED\":\n return <IconPlayerPlay size={12} />;\n default:\n return <IconClock size={12} />;\n }\n };\n\n const formatDuration = (\n start: Date | string,\n end?: Date | string | null,\n ): string => {\n const startTime = new Date(start).getTime();\n const endTime = end ? new Date(end).getTime() : Date.now();\n const duration = endTime - startTime;\n\n if (duration < 1000) return `${duration}ms`;\n if (duration < 60000) return `${(duration / 1000).toFixed(1)}s`;\n return `${Math.floor(duration / 60000)}m ${Math.floor((duration % 60000) / 1000)}s`;\n };\n\n return (\n <Flex flex={1} direction={\"column\"}>\n <DataTable<JobExecutionEntity, typeof filters>\n submitOnInit\n defaultSize={10}\n typeFormProps={{\n skipSubmitButton: true,\n columns: 3,\n }}\n tableProps={{\n horizontalSpacing: \"xs\",\n verticalSpacing: \"xs\",\n }}\n onFilterChange={(key, _value, form) => {\n if (key === \"job\" || key === \"status\") {\n return form.submit();\n }\n }}\n filters={filters}\n items={async (filters) => {\n const response = await client.getJobExecutions({\n query: filters,\n });\n\n return response as Page<JobExecutionEntity>;\n }}\n columns={{\n job: {\n label: \"Job\",\n value: (item) => (\n <Text size=\"sm\" fw={500}>\n {item.job}\n </Text>\n ),\n },\n status: {\n label: \"Status\",\n fit: true,\n value: (item) => (\n <Badge\n size=\"sm\"\n variant=\"light\"\n color={getStatusColor(item.status)}\n leftSection={getStatusIcon(item.status)}\n >\n {item.status}\n </Badge>\n ),\n },\n duration: {\n label: \"Duration\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\" ff=\"monospace\">\n {formatDuration(item.createdAt, item.finishedAt)}\n </Text>\n ),\n },\n error: {\n label: \"Error\",\n value: (item) =>\n item.error ? (\n <Text size=\"xs\" c=\"red\" lineClamp={1}>\n {item.error}\n </Text>\n ) : (\n <Text size=\"xs\" c=\"dimmed\">\n -\n </Text>\n ),\n },\n createdAt: {\n label: \"Started\",\n fit: true,\n value: (item) => (\n <Text size=\"xs\" c=\"dimmed\">\n {l(item.createdAt, { date: \"fromNow\" })}\n </Text>\n ),\n },\n }}\n />\n </Flex>\n );\n};\n\nexport default AdminJobs;\n","import { Flex, Text } from \"@alepha/ui\";\nimport { Stack } from \"@mantine/core\";\nimport { IconShieldCheck } from \"@tabler/icons-react\";\n\nconst AdminVerifications = () => {\n return (\n <Flex flex={1} justify=\"center\" align=\"center\">\n <Stack align=\"center\" gap=\"xs\">\n <IconShieldCheck\n size={48}\n stroke={1.5}\n color=\"var(--mantine-color-dimmed)\"\n />\n <Text c=\"dimmed\">Verification Management</Text>\n <Text size=\"xs\" c=\"dimmed\" ta=\"center\" maw={400}>\n Verifications are automatically managed by the system. Email and SMS\n verification codes are generated and validated through the\n verification API endpoints.\n </Text>\n </Stack>\n </Flex>\n );\n};\n\nexport default AdminVerifications;\n","import { AlephaUI } from \"@alepha/ui\";\nimport { AlephaUIAuth } from \"@alepha/ui/auth\";\nimport { $context, $module } from \"alepha\";\nimport { AdminRouter } from \"./AdminRouter.ts\";\nimport { MainRouter } from \"./MainRouter.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport { AdminRouter } from \"./AdminRouter.ts\";\n// Layout\nexport { default as AdminLayout } from \"./components/AdminLayout.tsx\";\n// Audits\nexport { default as AdminAudits } from \"./components/audits/AdminAudits.tsx\";\n// Files\nexport { default as AdminFiles } from \"./components/files/AdminFiles.tsx\";\n// Jobs\nexport { default as AdminJobs } from \"./components/jobs/AdminJobs.tsx\";\n// Notifications\nexport { default as AdminNotifications } from \"./components/notifications/AdminNotifications.tsx\";\n// Parameters\nexport { default as AdminParameters } from \"./components/parameters/AdminParameters.tsx\";\n// Sessions\nexport { default as AdminSessions } from \"./components/sessions/AdminSessions.tsx\";\n// Users\nexport { default as AdminUserAudits } from \"./components/users/AdminUserAudits.tsx\";\nexport { default as AdminUserCreate } from \"./components/users/AdminUserCreate.tsx\";\nexport { default as AdminUserDetails } from \"./components/users/AdminUserDetails.tsx\";\nexport { default as AdminUserLayout } from \"./components/users/AdminUserLayout.tsx\";\nexport { default as AdminUserSessions } from \"./components/users/AdminUserSessions.tsx\";\nexport { default as AdminUserSettings } from \"./components/users/AdminUserSettings.tsx\";\nexport { default as AdminUsers } from \"./components/users/AdminUsers.tsx\";\n// Verifications\nexport { default as AdminVerifications } from \"./components/verifications/AdminVerifications.tsx\";\nexport { MainRouter } from \"./MainRouter.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * | type | quality | stability |\n * |------|---------|-----------|\n * | frontend | rare | experimental |\n *\n * Admin panel UI components.\n *\n * **Features:**\n * - AdminLayout for admin pages\n * - AdminUsers with user list, create, details, settings, sessions, audits\n * - AdminFiles for file management\n * - AdminJobs for job monitoring\n * - AdminNotifications for notification management\n * - AdminParameters for configuration management\n * - AdminSessions for session management\n * - AdminAudits for audit log viewing\n * - AdminVerifications for verification management\n *\n * @module alepha.ui.admin\n */\nexport const AlephaUIAdmin = $module({\n name: \"alepha.ui.admin\",\n services: [AlephaUI, AlephaUIAuth, AdminRouter, MainRouter],\n register: (alepha) => {\n alepha.with(AdminRouter);\n },\n});\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Register Admin UI components and get the AdminRouter instance.\n */\nexport const $uiAdmin = () => {\n const { alepha } = $context();\n return alepha.inject(AdminRouter);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAa,cAAb,MAAyB;CACvB,AAAmB,SAAS,QAAQ,YAAyB;CAC7D,AAAmB,aAAa,QAAQ,WAAW;CACnD,AAAmB,OAAO,QAAQ,UAAU;CAC5C,AAAmB,WAAW,SAA8B;CAC5D,AAAmB,cAAc,SAAiC;CAClE,AAAmB,mBAAmB,SAAsC;CAC5E,AAAmB,WAAW,SAAyB;CACvD,AAAmB,aAAa,SAAgC;CAChE,AAAmB,YAAY,SAA+B;CAE9D,AAAU,kBAAmC;AAC3C,SAAO,EAAE;;CAGX,AAAU,gBAAgB,KAAU;AAClC,SAAO,IAAI,YACT,KAAK,OAAO,KAAK,KAAK,WAAW,MAAM,MAAM,EAC3C,OAAO,EACL,GAAG,IAAI,UACR,EACF,CAAC,CACH;;CAOH,AAAgB,cAAc,MAAM;EAClC,MAAM;EACN,OAAO;EACP,WAAW,KAAK,SAAS,UAAU,KAAK;EACxC,YAAY,OAAO;EACnB,cAAc,EACZ,iBAAiB,KAAK,iBAAiB,EACxC;EACD,SAAS,EAAE,MAAM,UAAU;AACzB,OAAI,CAAC,KACH,OAAM,KAAK,gBAAgB,IAAI;AAEjC,UAAO,EAAE;;EAEZ,CAAC;CAMF,AAAgB,aAAa,MAAM;EACjC,MAAM;EACN,QAAQ,KAAK;EACb,MAAM;EACN,OAAO;EACP,aAAa;EACb,YAAY,OAAO;EACnB,WAAW,KAAK,SAAS,UAAU,KAAK;EACzC,CAAC;CAEF,AAAgB,kBAAkB,MAAM;EACtC,MAAM;EACN,QAAQ,KAAK;EACb,MAAM;EACN,OAAO;EACP,aAAa;EACb,YAA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WAAW,CAAC;OAClC;KAEV;IACF;IACD;GACG;;AAIX,wBAAe;;;;ACzJf,MAAM,2BAA2B;AAC/B,QACE,oBAAC;EAAK,MAAM;EAAG,SAAQ;EAAS,OAAM;YACpC,qBAAC;GAAM,OAAM;GAAS,KAAI;;IACxB,oBAAC;KACC,MAAM;KACN,QAAQ;KACR,OAAM;MACN;IACF,oBAAC;KAAK,GAAE;eAAS;MAA8B;IAC/C,oBAAC;KAAK,MAAK;KAAK,GAAE;KAAS,IAAG;KAAS,KAAK;eAAK;MAI1C;;IACD;GACH;;AAIX,iCAAe;;;;;;;;;;;;;;;;;;;;;;;;ACiCf,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,UAAU;EAAC;EAAU;EAAc;EAAa;EAAW;CAC3D,WAAW,WAAW;AACpB,SAAO,KAAK,YAAY;;CAE3B,CAAC;;;;AAOF,MAAa,iBAAiB;CAC5B,MAAM,EAAE,WAAW,UAAU;AAC7B,QAAO,OAAO,OAAO,YAAY"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/admin/AdminRouter.ts","../../src/admin/components/verifications/AdminVerifications.tsx","../../src/admin/primitives/$uiAdmin.ts","../../src/admin/index.ts"],"sourcesContent":["import type { AdminShellProps, SidebarNode } from \"@alepha/ui\";\nimport { AuthRouter } from \"@alepha/ui/auth\";\nimport {\n IconBell,\n IconDevices,\n IconFile,\n IconHistory,\n IconKey,\n IconPlus,\n IconSettings,\n IconTerminal2,\n IconUser,\n IconUsers,\n} from \"@tabler/icons-react\";\nimport { $inject } from \"alepha\";\nimport type { AdminAuditController } from \"alepha/api/audits\";\nimport type { FileController } from \"alepha/api/files\";\nimport type { AdminJobController } from \"alepha/api/jobs\";\nimport type { AdminApiKeyController } from \"alepha/api/keys\";\nimport type { AdminNotificationController } from \"alepha/api/notifications\";\nimport type { AdminConfigController } from \"alepha/api/parameters\";\nimport type {\n AdminSessionController,\n AdminUserController,\n} from \"alepha/api/users\";\nimport { ReactAuth } from \"alepha/react/auth\";\nimport { $page, ReactRouter, Redirection } from \"alepha/react/router\";\nimport { $client } from \"alepha/server/links\";\n\nexport class AdminRouter {\n protected readonly router = $inject(ReactRouter<AdminRouter>);\n protected readonly authRouter = $inject(AuthRouter);\n protected readonly auth = $inject(ReactAuth);\n protected readonly userCtrl = $client<AdminUserController>();\n protected readonly sessionCtrl = $client<AdminSessionController>();\n protected readonly notificationCtrl = $client<AdminNotificationController>();\n protected readonly fileCtrl = $client<FileController>();\n protected readonly configCtrl = $client<AdminConfigController>();\n protected readonly auditCtrl = $client<AdminAuditController>();\n protected readonly jobCtrl = $client<AdminJobController>();\n protected readonly apiKeyCtrl = $client<AdminApiKeyController>();\n\n public configFn?: (adminRouter: AdminRouter) => AdminShellProps = () => {\n return {\n sidebarResizable: true,\n sidebarProps: {\n items: this.getDefaultSidebarItems(),\n },\n };\n };\n\n public getDefaultSidebarItems(): SidebarNode[] {\n return [\n // Identity & Access\n {\n label: \"Identity\",\n icon: IconUsers,\n children: [\n {\n ...this.router.node(this.adminUsers.name),\n can: () => this.userCtrl.findUsers.can(),\n },\n {\n ...this.router.node(this.adminSessions.name),\n can: () => this.sessionCtrl.findSessions.can(),\n },\n {\n ...this.router.node(this.adminApiKeys.name),\n can: () => this.apiKeyCtrl.findApiKeys.can(),\n },\n ],\n },\n\n // Content & Storage\n {\n label: \"Content\",\n icon: IconFile,\n children: [\n {\n ...this.router.node(this.adminFiles.name),\n can: () => this.fileCtrl.findFiles.can(),\n },\n {\n ...this.router.node(this.adminNotifications.name),\n can: () => this.notificationCtrl.findNotifications.can(),\n },\n ],\n },\n\n // System\n {\n label: \"System\",\n icon: IconSettings,\n children: [\n {\n ...this.router.node(this.adminJobs.name),\n can: () => this.jobCtrl.getJobs.can(),\n },\n {\n ...this.router.node(this.adminAudits.name),\n can: () => this.auditCtrl.findAudits.can(),\n },\n {\n ...this.router.node(this.adminParameters.name),\n can: () => this.configCtrl.getConfigTree.can(),\n },\n ],\n },\n\n // Bottom\n { type: \"toggle\", position: \"bottom\" },\n ];\n }\n\n protected adminShellProps(): AdminShellProps {\n if (this.configFn) {\n return this.configFn(this);\n }\n return {};\n }\n\n protected onNotAuthorized(url: URL) {\n return new Redirection(\n this.router.path(this.authRouter.login.name, {\n query: {\n r: url.pathname,\n },\n }),\n );\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Layout\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminLayout = $page({\n path: \"/admin\",\n label: \"Admin\",\n can: () => this.auth.can(\"admin:*\"),\n lazy: () => import(\"./components/AdminLayout.tsx\"),\n props: () => ({\n adminShellProps: this.adminShellProps(),\n }),\n loader: ({ user, url }) => {\n if (!user) {\n throw this.onNotAuthorized(url);\n }\n return {};\n },\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Users\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminUsers = $page({\n icon: IconUsers,\n parent: this.adminLayout,\n path: \"/users\",\n label: \"Users\",\n description: \"Manage application users and their roles.\",\n lazy: () => import(\"./components/users/AdminUsers.tsx\"),\n can: () => this.userCtrl.findUsers.can(),\n });\n\n public readonly adminUserCreate = $page({\n icon: IconPlus,\n parent: this.adminLayout,\n path: \"/users/create\",\n label: \"Create User\",\n description: \"Create a new user account\",\n lazy: () => import(\"./components/users/AdminUserCreate.tsx\"),\n can: () => this.userCtrl.createUser.can(),\n });\n\n public readonly adminUserLayout = $page({\n icon: IconUser,\n parent: this.adminLayout,\n path: \"/users/:userId\",\n label: \"User\",\n lazy: () => import(\"./components/users/AdminUserLayout.tsx\"),\n can: () => this.userCtrl.getUser.can(),\n });\n\n public readonly adminUserDetails = $page({\n parent: this.adminUserLayout,\n path: \"/details\",\n label: \"Details\",\n lazy: () => import(\"./components/users/AdminUserDetails.tsx\"),\n });\n\n public readonly adminUserSessions = $page({\n parent: this.adminUserLayout,\n path: \"/sessions\",\n label: \"Sessions\",\n lazy: () => import(\"./components/users/AdminUserSessions.tsx\"),\n });\n\n public readonly adminUserSettings = $page({\n parent: this.adminUserLayout,\n path: \"/settings\",\n label: \"Settings\",\n lazy: () => import(\"./components/users/AdminUserSettings.tsx\"),\n });\n\n public readonly adminUserAudits = $page({\n parent: this.adminUserLayout,\n path: \"/audits\",\n label: \"Audit Log\",\n lazy: () => import(\"./components/users/AdminUserAudits.tsx\"),\n can: () => this.auditCtrl.findByUser.can(),\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Audits (Global)\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminAudits = $page({\n icon: IconHistory,\n parent: this.adminLayout,\n path: \"/audits\",\n label: \"Audit Log\",\n description: \"View system-wide audit trail and activity logs.\",\n lazy: () => import(\"./components/audits/AdminAudits.tsx\"),\n can: () => this.auditCtrl.findAudits.can(),\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Sessions\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminSessions = $page({\n icon: IconDevices,\n parent: this.adminLayout,\n path: \"/sessions\",\n label: \"Sessions\",\n description: \"View and manage all active sessions.\",\n lazy: () => import(\"./components/sessions/AdminSessions.tsx\"),\n can: () => this.sessionCtrl.findSessions.can(),\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Notifications\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminNotifications = $page({\n icon: IconBell,\n parent: this.adminLayout,\n path: \"/notifications\",\n label: \"Notifications\",\n description: \"View notification history and status.\",\n lazy: () => import(\"./components/notifications/AdminNotifications.tsx\"),\n can: () => this.notificationCtrl.findNotifications.can(),\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Files\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminFiles = $page({\n icon: IconFile,\n parent: this.adminLayout,\n path: \"/files\",\n label: \"Files\",\n description: \"Manage uploaded files and storage.\",\n lazy: () => import(\"./components/files/AdminFiles.tsx\"),\n can: () => this.fileCtrl.findFiles.can(),\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Parameters\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminParameters = $page({\n icon: IconSettings,\n parent: this.adminLayout,\n path: \"/parameters\",\n label: \"Parameters\",\n description: \"View and manage application configuration parameters.\",\n lazy: () => import(\"./components/parameters/AdminParameters.tsx\"),\n can: () => this.configCtrl.getConfigTree.can(),\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Jobs\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminJobs = $page({\n icon: IconTerminal2,\n parent: this.adminLayout,\n path: \"/jobs\",\n label: \"Jobs\",\n description: \"Monitor and manage background jobs and scheduled tasks.\",\n lazy: () => import(\"./components/jobs/AdminJobs.tsx\"),\n can: () => this.jobCtrl.getJobs.can(),\n });\n\n // ─────────────────────────────────────────────────────────────────────────────\n // API Keys\n // ─────────────────────────────────────────────────────────────────────────────\n\n public readonly adminApiKeys = $page({\n icon: IconKey,\n parent: this.adminLayout,\n path: \"/api-keys\",\n label: \"API Keys\",\n description: \"View and manage API keys for programmatic access.\",\n lazy: () => import(\"./components/keys/AdminApiKeys.tsx\"),\n can: () => this.apiKeyCtrl.findApiKeys.can(),\n });\n}\n","import { Flex, Text } from \"@alepha/ui\";\nimport { Stack } from \"@mantine/core\";\nimport { IconShieldCheck } from \"@tabler/icons-react\";\n\nconst AdminVerifications = () => {\n return (\n <Flex flex={1} justify=\"center\" align=\"center\">\n <Stack align=\"center\" gap=\"xs\">\n <IconShieldCheck\n size={48}\n stroke={1.5}\n color=\"var(--mantine-color-dimmed)\"\n />\n <Text c=\"dimmed\">Verification Management</Text>\n <Text size=\"xs\" c=\"dimmed\" ta=\"center\" maw={400}>\n Verifications are automatically managed by the system. Email and SMS\n verification codes are generated and validated through the\n verification API endpoints.\n </Text>\n </Stack>\n </Flex>\n );\n};\n\nexport default AdminVerifications;\n","import type { AdminShellProps } from \"@alepha/ui\";\nimport { $context } from \"alepha\";\nimport { AdminRouter } from \"../AdminRouter.ts\";\n\n/**\n * Register Admin UI components and get the AdminRouter instance.\n */\nexport const $uiAdmin = (optsFn?: (a: AdminRouter) => AdminShellProps) => {\n const { alepha } = $context();\n const adminRouter = alepha.inject(AdminRouter);\n\n if (optsFn) {\n adminRouter.configFn = optsFn;\n }\n\n return adminRouter;\n};\n","import { AlephaUI } from \"@alepha/ui\";\nimport { AlephaUIAuth } from \"@alepha/ui/auth\";\nimport { $module } from \"alepha\";\nimport { AdminRouter } from \"./AdminRouter.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport { AdminRouter } from \"./AdminRouter.ts\";\n// Audits\nexport { default as AdminAudits } from \"./components/audits/AdminAudits.tsx\";\n// Files\nexport { default as AdminFiles } from \"./components/files/AdminFiles.tsx\";\n// Jobs\nexport { default as AdminJobs } from \"./components/jobs/AdminJobs.tsx\";\n// API Keys\nexport { default as AdminApiKeys } from \"./components/keys/AdminApiKeys.tsx\";\n// Notifications\nexport { default as AdminNotifications } from \"./components/notifications/AdminNotifications.tsx\";\n// Parameters\nexport { default as AdminParameters } from \"./components/parameters/AdminParameters.tsx\";\n// Sessions\nexport { default as AdminSessions } from \"./components/sessions/AdminSessions.tsx\";\n// Users\nexport { default as AdminUserAudits } from \"./components/users/AdminUserAudits.tsx\";\nexport { default as AdminUserCreate } from \"./components/users/AdminUserCreate.tsx\";\nexport { default as AdminUserDetails } from \"./components/users/AdminUserDetails.tsx\";\nexport { default as AdminUserLayout } from \"./components/users/AdminUserLayout.tsx\";\nexport { default as AdminUserSessions } from \"./components/users/AdminUserSessions.tsx\";\nexport { default as AdminUserSettings } from \"./components/users/AdminUserSettings.tsx\";\nexport { default as AdminUsers } from \"./components/users/AdminUsers.tsx\";\n// Verifications\nexport { default as AdminVerifications } from \"./components/verifications/AdminVerifications.tsx\";\nexport * from \"./primitives/$uiAdmin.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * | Stability | Since | Runtime |\n * |-----------|-------|---------|\n * | 2 - beta | 0.12.0 | node, bun, workerd, browser|\n *\n * Admin panel UI components.\n *\n * **Features:**\n * - AdminLayout for admin pages\n * - AdminUsers with user list, create, details, settings, sessions, audits\n * - AdminFiles for file management\n * - AdminJobs for job monitoring\n * - AdminNotifications for notification management\n * - AdminParameters for configuration management\n * - AdminSessions for session management\n * - AdminAudits for audit log viewing\n * - AdminVerifications for verification management\n *\n * @module alepha.ui.admin\n */\nexport const AlephaUIAdmin = $module({\n name: \"alepha.ui.admin\",\n services: [AlephaUI, AlephaUIAuth, AdminRouter],\n register: (alepha) => {\n alepha.with(AdminRouter);\n },\n});\n\n// ---------------------------------------------------------------------------------------------------------------------\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAa,cAAb,MAAyB;CACvB,AAAmB,SAAS,QAAQ,YAAyB;CAC7D,AAAmB,aAAa,QAAQ,WAAW;CACnD,AAAmB,OAAO,QAAQ,UAAU;CAC5C,AAAmB,WAAW,SAA8B;CAC5D,AAAmB,cAAc,SAAiC;CAClE,AAAmB,mBAAmB,SAAsC;CAC5E,AAAmB,WAAW,SAAyB;CACvD,AAAmB,aAAa,SAAgC;CAChE,AAAmB,YAAY,SAA+B;CAC9D,AAAmB,UAAU,SAA6B;CAC1D,AAAmB,aAAa,SAAgC;CAEhE,AAAO,iBAAiE;AACtE,SAAO;GACL,kBAAkB;GAClB,cAAc,EACZ,OAAO,KAAK,wBAAwB,EACrC;GACF;;CAGH,AAAO,yBAAwC;AAC7C,SAAO;GAEL;IACE,OAAO;IACP,MAAM;IACN,UAAU;KACR;MACE,GAAG,KAAK,OAAO,KAAK,KAAK,WAAW,KAAK;MACzC,WAAW,KAAK,SAAS,UAAU,KAAK;MACzC;KACD;MACE,GAAG,KAAK,OAAO,KAAK,KAAK,cAAc,KAAK;MAC5C,WAAW,KAAK,YAAY,aAAa,KAAK;MAC/C;KACD;MACE,GAAG,KAAK,OAAO,KAAK,KAAK,aAAa,KAAK;MAC3C,WAAW,KAAK,WAAW,YAAY,KAAK;MAC7C;KACF;IACF;GAGD;IAC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AC"}
|
|
@@ -2,6 +2,7 @@ import { AlephaMantineProvider } from "@alepha/ui";
|
|
|
2
2
|
import { NestedView } from "alepha/react/router";
|
|
3
3
|
import { Flex } from "@mantine/core";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import "@alepha/ui/styles";
|
|
5
6
|
|
|
6
7
|
//#region ../../src/auth/components/AuthLayout.tsx
|
|
7
8
|
const AuthLayout = () => {
|
|
@@ -20,4 +21,4 @@ var AuthLayout_default = AuthLayout;
|
|
|
20
21
|
|
|
21
22
|
//#endregion
|
|
22
23
|
export { AuthLayout_default as default };
|
|
23
|
-
//# sourceMappingURL=AuthLayout-
|
|
24
|
+
//# sourceMappingURL=AuthLayout-mFOWbiSP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthLayout-mFOWbiSP.js","names":[],"sources":["../../src/auth/components/AuthLayout.tsx"],"sourcesContent":["import { AlephaMantineProvider } from \"@alepha/ui\";\nimport { Flex } from \"@mantine/core\";\nimport { NestedView } from \"alepha/react/router\";\nimport \"@alepha/ui/styles\";\n\nconst AuthLayout = () => {\n return (\n <AlephaMantineProvider omnibar={false}>\n <Flex flex={1} align={\"center\"} h={\"100vh\"} justify={\"center\"}>\n <NestedView />\n </Flex>\n </AlephaMantineProvider>\n );\n};\n\nexport default AuthLayout;\n"],"mappings":";;;;;;;AAKA,MAAM,mBAAmB;AACvB,QACE,oBAAC;EAAsB,SAAS;YAC9B,oBAAC;GAAK,MAAM;GAAG,OAAO;GAAU,GAAG;GAAS,SAAS;aACnD,oBAAC,eAAa;IACT;GACe;;AAI5B,yBAAe"}
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { RealmConfig, RealmController } from "alepha/api/users";
|
|
|
11
11
|
declare class AuthRouter {
|
|
12
12
|
protected readonly realmClient: alepha_server_links0.HttpVirtualClient<RealmController>;
|
|
13
13
|
protected readonly auth: ReactAuth;
|
|
14
|
-
|
|
14
|
+
authLayout: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, alepha_react_router0.TPropsParentDefault>;
|
|
15
15
|
login: alepha_react_router0.PagePrimitive<{
|
|
16
16
|
query: alepha1.TObject<{
|
|
17
17
|
r: alepha1.TOptional<alepha1.TString>;
|
|
@@ -37,6 +37,8 @@ declare class AuthRouter {
|
|
|
37
37
|
firstNameLastNameEnabled: boolean;
|
|
38
38
|
firstNameLastNameRequired: boolean;
|
|
39
39
|
resetPasswordAllowed: boolean;
|
|
40
|
+
adminEmails: string[];
|
|
41
|
+
adminUsernames: string[];
|
|
40
42
|
passwordPolicy: {
|
|
41
43
|
minLength: number;
|
|
42
44
|
requireUppercase: boolean;
|
|
@@ -76,6 +78,8 @@ declare class AuthRouter {
|
|
|
76
78
|
firstNameLastNameEnabled: boolean;
|
|
77
79
|
firstNameLastNameRequired: boolean;
|
|
78
80
|
resetPasswordAllowed: boolean;
|
|
81
|
+
adminEmails: string[];
|
|
82
|
+
adminUsernames: string[];
|
|
79
83
|
passwordPolicy: {
|
|
80
84
|
minLength: number;
|
|
81
85
|
requireUppercase: boolean;
|
|
@@ -115,6 +119,8 @@ declare class AuthRouter {
|
|
|
115
119
|
firstNameLastNameEnabled: boolean;
|
|
116
120
|
firstNameLastNameRequired: boolean;
|
|
117
121
|
resetPasswordAllowed: boolean;
|
|
122
|
+
adminEmails: string[];
|
|
123
|
+
adminUsernames: string[];
|
|
118
124
|
passwordPolicy: {
|
|
119
125
|
minLength: number;
|
|
120
126
|
requireUppercase: boolean;
|
|
@@ -156,6 +162,8 @@ declare class AuthRouter {
|
|
|
156
162
|
firstNameLastNameEnabled: boolean;
|
|
157
163
|
firstNameLastNameRequired: boolean;
|
|
158
164
|
resetPasswordAllowed: boolean;
|
|
165
|
+
adminEmails: string[];
|
|
166
|
+
adminUsernames: string[];
|
|
159
167
|
passwordPolicy: {
|
|
160
168
|
minLength: number;
|
|
161
169
|
requireUppercase: boolean;
|
|
@@ -218,11 +226,17 @@ declare const ResetPassword: (props: ResetPasswordProps) => react_jsx_runtime0.J
|
|
|
218
226
|
type VerifyEmailProps = {};
|
|
219
227
|
declare const VerifyEmail: (_props: VerifyEmailProps) => react_jsx_runtime0.JSX.Element;
|
|
220
228
|
//#endregion
|
|
229
|
+
//#region ../../src/auth/primitives/$uiAuth.d.ts
|
|
230
|
+
/**
|
|
231
|
+
* Register Auth UI components and get the AuthRouter instance.
|
|
232
|
+
*/
|
|
233
|
+
declare const $uiAuth: () => AuthRouter;
|
|
234
|
+
//#endregion
|
|
221
235
|
//#region ../../src/auth/index.d.ts
|
|
222
236
|
/**
|
|
223
|
-
* |
|
|
224
|
-
*
|
|
225
|
-
* |
|
|
237
|
+
* | Stability | Since | Runtime |
|
|
238
|
+
* |-----------|-------|---------|
|
|
239
|
+
* | 2 - beta | 0.12.0 | node, bun, workerd, browser|
|
|
226
240
|
*
|
|
227
241
|
* Authentication UI components.
|
|
228
242
|
*
|
|
@@ -236,10 +250,6 @@ declare const VerifyEmail: (_props: VerifyEmailProps) => react_jsx_runtime0.JSX.
|
|
|
236
250
|
* @module alepha.ui.auth
|
|
237
251
|
*/
|
|
238
252
|
declare const AlephaUIAuth: alepha1.Service<alepha1.Module>;
|
|
239
|
-
/**
|
|
240
|
-
* Register Auth UI components and get the AuthRouter instance.
|
|
241
|
-
*/
|
|
242
|
-
declare const $uiAuth: () => AuthRouter;
|
|
243
253
|
//#endregion
|
|
244
254
|
export { $uiAuth, AlephaUIAuth, AuthRouter, Login, Register, ResetPassword, UserButton, type UserButtonProps, VerifyEmail };
|
|
245
255
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/auth/AuthRouter.ts","../../src/auth/components/buttons/UserButton.tsx","../../src/auth/components/Login.tsx","../../src/auth/components/Register.tsx","../../src/auth/components/ResetPassword.tsx","../../src/auth/components/VerifyEmail.tsx","../../src/auth/index.ts"],"mappings":";;;;;;;;;;cAwBa,UAAA;EAAA,mBACQ,WAAA,EAAW,oBAAA,CAAA,iBAAA,CAAA,eAAA;EAAA,mBACX,IAAA,EAAI,SAAA;EAEvB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/auth/AuthRouter.ts","../../src/auth/components/buttons/UserButton.tsx","../../src/auth/components/Login.tsx","../../src/auth/components/Register.tsx","../../src/auth/components/ResetPassword.tsx","../../src/auth/components/VerifyEmail.tsx","../../src/auth/primitives/$uiAuth.ts","../../src/auth/index.ts"],"mappings":";;;;;;;;;;cAwBa,UAAA;EAAA,mBACQ,WAAA,EAAW,oBAAA,CAAA,iBAAA,CAAA,eAAA;EAAA,mBACX,IAAA,EAAI,SAAA;EAEvB,UAAA,EAAU,oBAAA,CAAA,aAAA,CAFa,oBAAA,CAEb,gBAAA,OAAA,oBAAA,CAAA,mBAAA;EAYV,KAAA,uBAAK,aAAA;;2BAZK,OAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCV,QAAA,uBAAQ,aAAA;;2BApBH,OAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCL,aAAA,uBAAa,aAAA;;2BApBL,OAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCR,WAAA,uBAAW,aAAA;;+BApBE,OAAA,CAAA,OAAA;;;;EAkCb,MAAA,EAAM,oBAAA,CAAA,aAAA,CAdK,oBAAA,CAcL,gBAAA,MAAA,oBAAA,CAAA,mBAAA;EAaN,OAAA,EAAO,oBAAA,CAAA,aAAA,CAbD,oBAAA,CAaC,gBAAA,OAAA,oBAAA,CAAA,mBAAA;EAAA,UAUS,eAAA,CAAgB,SAAA,YAAkB,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCpHnC,eAAA,SACP,IAAA,CAAK,WAAA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