@alepha/ui 0.15.4 → 0.15.5

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.
Files changed (99) hide show
  1. package/dist/admin/AdminApiKeys-DsmGnHNh.js +3 -0
  2. package/dist/admin/AdminApiKeys-GMORg-1l.js +442 -0
  3. package/dist/admin/AdminApiKeys-GMORg-1l.js.map +1 -0
  4. package/dist/admin/AdminAudits-8SM96viT.js +3 -0
  5. package/dist/admin/{AdminAudits-Oh7iAfQa.js → AdminAudits-pkWrjq1Z.js} +2 -2
  6. package/dist/admin/{AdminAudits-Oh7iAfQa.js.map → AdminAudits-pkWrjq1Z.js.map} +1 -1
  7. package/dist/admin/AdminFiles-B56ocq4H.js +3 -0
  8. package/dist/admin/{AdminFiles-Cu8GHgQ3.js → AdminFiles-WeQbsCsl.js} +2 -2
  9. package/dist/admin/{AdminFiles-Cu8GHgQ3.js.map → AdminFiles-WeQbsCsl.js.map} +1 -1
  10. package/dist/admin/AdminJobs-B-q9iGO3.js +697 -0
  11. package/dist/admin/AdminJobs-B-q9iGO3.js.map +1 -0
  12. package/dist/admin/AdminJobs-CED1syCn.js +3 -0
  13. package/dist/admin/AdminLayout-BX4FIpXv.css +143 -0
  14. package/dist/admin/AdminLayout-BX4FIpXv.css.map +1 -0
  15. package/dist/admin/{AdminLayout-QJLIesuG.js → AdminLayout-BqZiXx4H.js} +3 -2
  16. package/dist/admin/AdminLayout-BqZiXx4H.js.map +1 -0
  17. package/dist/admin/AdminNotifications-B0B1rdc4.js +3 -0
  18. package/dist/admin/{AdminNotifications-CgYkBuG_.js → AdminNotifications-Ds5Un0NJ.js} +2 -2
  19. package/dist/admin/{AdminNotifications-CgYkBuG_.js.map → AdminNotifications-Ds5Un0NJ.js.map} +1 -1
  20. package/dist/admin/{AdminParameters-Cl-R0nXt.js → AdminParameters-BU3lATdJ.js} +1 -1
  21. package/dist/admin/{AdminParameters-hjNG_KXb.js → AdminParameters-CfDUpc78.js} +4 -4
  22. package/dist/admin/{AdminParameters-hjNG_KXb.js.map → AdminParameters-CfDUpc78.js.map} +1 -1
  23. package/dist/admin/AdminSessions-BDGK2MS6.js +3 -0
  24. package/dist/admin/{AdminSessions-Bey9cuy1.js → AdminSessions-DzIOxM3b.js} +2 -2
  25. package/dist/admin/{AdminSessions-Bey9cuy1.js.map → AdminSessions-DzIOxM3b.js.map} +1 -1
  26. package/dist/admin/{AdminUserAudits-C7AN9jx7.js → AdminUserAudits-CiUPN2BC.js} +2 -2
  27. package/dist/admin/{AdminUserAudits-C7AN9jx7.js.map → AdminUserAudits-CiUPN2BC.js.map} +1 -1
  28. package/dist/admin/{AdminUserAudits-Cp_ERd2g.js → AdminUserAudits-Cj79gENT.js} +1 -1
  29. package/dist/admin/{AdminUserCreate-BVIm4JdN.js → AdminUserCreate-BwQKr4xE.js} +2 -2
  30. package/dist/admin/{AdminUserCreate-BVIm4JdN.js.map → AdminUserCreate-BwQKr4xE.js.map} +1 -1
  31. package/dist/admin/{AdminUserCreate-C1aInRDk.js → AdminUserCreate-Cq-mUmBs.js} +1 -1
  32. package/dist/admin/{AdminUserDetails-Dcn3OwMC.js → AdminUserDetails-DRjVAPFd.js} +1 -1
  33. package/dist/admin/{AdminUserDetails-yM4x8JE6.js → AdminUserDetails-uqtC5aJ1.js} +2 -2
  34. package/dist/admin/{AdminUserDetails-yM4x8JE6.js.map → AdminUserDetails-uqtC5aJ1.js.map} +1 -1
  35. package/dist/admin/{AdminUserLayout-gb-nbggz.js → AdminUserLayout-CGzmHHby.js} +1 -1
  36. package/dist/admin/{AdminUserLayout-BnfBC1gD.js → AdminUserLayout-CiPay35T.js} +2 -2
  37. package/dist/admin/{AdminUserLayout-BnfBC1gD.js.map → AdminUserLayout-CiPay35T.js.map} +1 -1
  38. package/dist/admin/{AdminUserSessions-kmkXG-xf.js → AdminUserSessions-DAE8Nf1F.js} +2 -2
  39. package/dist/admin/{AdminUserSessions-kmkXG-xf.js.map → AdminUserSessions-DAE8Nf1F.js.map} +1 -1
  40. package/dist/admin/AdminUserSessions-DcdzuNZ9.js +3 -0
  41. package/dist/admin/AdminUserSettings-D7V6-ceX.js +3 -0
  42. package/dist/admin/{AdminUserSettings-DZ9iWhJW.js → AdminUserSettings-EbahaV2a.js} +2 -2
  43. package/dist/admin/{AdminUserSettings-DZ9iWhJW.js.map → AdminUserSettings-EbahaV2a.js.map} +1 -1
  44. package/dist/admin/AdminUsers-D9nyzGqQ.js +3 -0
  45. package/dist/admin/{AdminUsers-D6Y5K8Am.js → AdminUsers-Dcjh0KNW.js} +2 -2
  46. package/dist/admin/{AdminUsers-D6Y5K8Am.js.map → AdminUsers-Dcjh0KNW.js.map} +1 -1
  47. package/dist/admin/index.d.ts +24 -36
  48. package/dist/admin/index.d.ts.map +1 -1
  49. package/dist/admin/index.js +52 -169
  50. package/dist/admin/index.js.map +1 -1
  51. package/dist/auth/AuthLayout-BaD7RD2h.css +143 -0
  52. package/dist/auth/AuthLayout-BaD7RD2h.css.map +1 -0
  53. package/dist/auth/AuthLayout-Dj5K4SIN.js.map +1 -1
  54. package/dist/auth/index.d.ts +9 -1
  55. package/dist/auth/index.d.ts.map +1 -1
  56. package/dist/auth/index.js +1 -2
  57. package/dist/auth/index.js.map +1 -1
  58. package/dist/core/index.d.ts +13 -21
  59. package/dist/core/index.d.ts.map +1 -1
  60. package/dist/core/index.js +26 -38
  61. package/dist/core/index.js.map +1 -1
  62. package/dist/demo/{DemoLogin-S-b15cmE.js → DemoLogin-CvCG2WVh.js} +3 -1
  63. package/dist/demo/{DemoLogin-S-b15cmE.js.map → DemoLogin-CvCG2WVh.js.map} +1 -1
  64. package/dist/demo/{DemoRegister-B29MdAaZ.js → DemoRegister-CmeHbOAs.js} +3 -1
  65. package/dist/demo/{DemoRegister-B29MdAaZ.js.map → DemoRegister-CmeHbOAs.js.map} +1 -1
  66. package/dist/demo/{DemoResetPassword-CPTy88iK.js → DemoResetPassword-CKO5iA_6.js} +3 -1
  67. package/dist/demo/{DemoResetPassword-CPTy88iK.js.map → DemoResetPassword-CKO5iA_6.js.map} +1 -1
  68. package/dist/demo/index.js +3 -3
  69. package/package.json +3 -3
  70. package/src/admin/AdminRouter.ts +34 -0
  71. package/src/admin/components/AdminLayout.tsx +2 -0
  72. package/src/admin/components/jobs/AdminJobs.tsx +733 -119
  73. package/src/admin/components/keys/AdminApiKeys.tsx +537 -0
  74. package/src/admin/components/parameters/AdminParameters.tsx +2 -3
  75. package/src/admin/index.ts +3 -5
  76. package/src/auth/AuthRouter.ts +1 -2
  77. package/src/auth/components/AuthLayout.tsx +1 -0
  78. package/src/core/components/buttons/ActionButton.tsx +15 -2
  79. package/src/core/components/buttons/DarkModeButton.css +6 -0
  80. package/src/core/components/buttons/DarkModeButton.tsx +18 -71
  81. package/src/core/components/buttons/LanguageButton.tsx +2 -7
  82. package/src/core/components/buttons/ThemeButton.tsx +2 -6
  83. package/src/core/components/layout/AdminShell.tsx +17 -1
  84. package/src/core/components/layout/AppBar.tsx +5 -8
  85. package/src/core/index.ts +0 -1
  86. package/src/core/styles.css +1 -0
  87. package/src/demo/components/auth/DemoLogin.tsx +2 -0
  88. package/src/demo/components/auth/DemoRegister.tsx +2 -0
  89. package/src/demo/components/auth/DemoResetPassword.tsx +2 -0
  90. package/dist/admin/AdminAudits-BU-p1g7A.js +0 -3
  91. package/dist/admin/AdminFiles-Bg9feLFH.js +0 -3
  92. package/dist/admin/AdminLayout-BfeFXiul.js +0 -3
  93. package/dist/admin/AdminLayout-QJLIesuG.js.map +0 -1
  94. package/dist/admin/AdminNotifications-DmfGPqHe.js +0 -3
  95. package/dist/admin/AdminSessions-Cn4_jB04.js +0 -3
  96. package/dist/admin/AdminUserSessions-rvA0ztxn.js +0 -3
  97. package/dist/admin/AdminUserSettings-Dg-wTRzN.js +0 -3
  98. package/dist/admin/AdminUsers-RCaxccEW.js +0 -3
  99. package/src/admin/MainRouter.ts +0 -23
@@ -2,13 +2,15 @@ import { AdminShellProps } from "@alepha/ui";
2
2
  import { AuthRouter } from "@alepha/ui/auth";
3
3
  import * as alepha0 from "alepha";
4
4
  import { ReactAuth } from "alepha/react/auth";
5
- import * as alepha_react_router2 from "alepha/react/router";
5
+ import * as alepha_react_router0 from "alepha/react/router";
6
6
  import { ReactRouter, Redirection } from "alepha/react/router";
7
7
  import * as alepha_server_links0 from "alepha/server/links";
8
8
  import * as react_jsx_runtime0 from "react/jsx-runtime";
9
9
  import { FileController } from "alepha/api/files";
10
+ import { AdminJobController } from "alepha/api/jobs";
10
11
  import { AdminSessionController, AdminUserController } from "alepha/api/users";
11
12
  import { AdminAuditController } from "alepha/api/audits";
13
+ import { AdminApiKeyController } from "alepha/api/keys";
12
14
  import { AdminNotificationController } from "alepha/api/notifications";
13
15
  import { AdminConfigController } from "alepha/api/parameters";
14
16
 
@@ -23,29 +25,27 @@ declare class AdminRouter {
23
25
  protected readonly fileCtrl: alepha_server_links0.HttpVirtualClient<FileController>;
24
26
  protected readonly configCtrl: alepha_server_links0.HttpVirtualClient<AdminConfigController>;
25
27
  protected readonly auditCtrl: alepha_server_links0.HttpVirtualClient<AdminAuditController>;
28
+ protected readonly jobCtrl: alepha_server_links0.HttpVirtualClient<AdminJobController>;
29
+ protected readonly apiKeyCtrl: alepha_server_links0.HttpVirtualClient<AdminApiKeyController>;
26
30
  protected adminShellProps(): AdminShellProps;
27
31
  protected onNotAuthorized(url: URL): Redirection;
28
- readonly adminLayout: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, {}, alepha_react_router2.TPropsParentDefault>;
29
- readonly adminUsers: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, {}>;
30
- readonly adminUserCreate: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, {}>;
31
- readonly adminUserLayout: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, {}>;
32
- readonly adminUserDetails: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, any>;
33
- readonly adminUserSessions: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, any>;
34
- readonly adminUserSettings: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, any>;
35
- readonly adminUserAudits: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, any>;
36
- readonly adminAudits: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, {}>;
37
- readonly adminSessions: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, {}>;
38
- readonly adminNotifications: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, {}>;
39
- readonly adminFiles: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, {}>;
40
- readonly adminParameters: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, {}>;
32
+ readonly adminLayout: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, {}, alepha_react_router0.TPropsParentDefault>;
33
+ readonly adminUsers: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, {}>;
34
+ readonly adminUserCreate: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, {}>;
35
+ readonly adminUserLayout: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, {}>;
36
+ readonly adminUserDetails: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, any>;
37
+ readonly adminUserSessions: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, any>;
38
+ readonly adminUserSettings: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, any>;
39
+ readonly adminUserAudits: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, any>;
40
+ readonly adminAudits: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, {}>;
41
+ readonly adminSessions: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, {}>;
42
+ readonly adminNotifications: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, {}>;
43
+ readonly adminFiles: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, {}>;
44
+ readonly adminParameters: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, {}>;
45
+ readonly adminJobs: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, {}>;
46
+ readonly adminApiKeys: alepha_react_router0.PagePrimitive<alepha_react_router0.PageConfigSchema, any, {}>;
41
47
  }
42
48
  //#endregion
43
- //#region ../../src/admin/components/AdminLayout.d.ts
44
- interface AdminLayoutProps {
45
- adminShellProps?: AdminShellProps;
46
- }
47
- declare const AdminLayout: (props: AdminLayoutProps) => react_jsx_runtime0.JSX.Element;
48
- //#endregion
49
49
  //#region ../../src/admin/components/audits/AdminAudits.d.ts
50
50
  interface AdminAuditsProps {
51
51
  userRealmName?: string;
@@ -58,6 +58,9 @@ declare const AdminFiles: () => react_jsx_runtime0.JSX.Element;
58
58
  //#region ../../src/admin/components/jobs/AdminJobs.d.ts
59
59
  declare const AdminJobs: () => react_jsx_runtime0.JSX.Element;
60
60
  //#endregion
61
+ //#region ../../src/admin/components/keys/AdminApiKeys.d.ts
62
+ declare const AdminApiKeys: () => react_jsx_runtime0.JSX.Element;
63
+ //#endregion
61
64
  //#region ../../src/admin/components/notifications/AdminNotifications.d.ts
62
65
  declare const AdminNotifications: () => react_jsx_runtime0.JSX.Element;
63
66
  //#endregion
@@ -115,21 +118,6 @@ declare const AdminUsers: (props: AdminUsersProps) => react_jsx_runtime0.JSX.Ele
115
118
  //#region ../../src/admin/components/verifications/AdminVerifications.d.ts
116
119
  declare const AdminVerifications: () => react_jsx_runtime0.JSX.Element;
117
120
  //#endregion
118
- //#region ../../src/admin/MainRouter.d.ts
119
- /**
120
- * Main application router that combines Auth and Admin routers.
121
- *
122
- * We assume that the main application router will always have Admin and Auth routers.
123
- *
124
- * This is basically a convenience class to avoid having to inject these routers everywhere.
125
- * Code is lightweight enough that we can just copy it if needed.
126
- */
127
- declare class MainRouter {
128
- auth: AuthRouter;
129
- admin: AdminRouter;
130
- layout: alepha_react_router2.PagePrimitive<alepha_react_router2.PageConfigSchema, any, alepha_react_router2.TPropsParentDefault>;
131
- }
132
- //#endregion
133
121
  //#region ../../src/admin/index.d.ts
134
122
  /**
135
123
  * | type | quality | stability |
@@ -157,5 +145,5 @@ declare const AlephaUIAdmin: alepha0.Service<alepha0.Module>;
157
145
  */
158
146
  declare const $uiAdmin: () => AdminRouter;
159
147
  //#endregion
160
- export { $uiAdmin, AdminAudits, AdminFiles, AdminJobs, AdminLayout, AdminNotifications, AdminParameters, AdminRouter, AdminSessions, AdminUserAudits, AdminUserCreate, AdminUserDetails, AdminUserLayout, AdminUserSessions, AdminUserSettings, AdminUsers, AdminVerifications, AlephaUIAdmin, MainRouter };
148
+ export { $uiAdmin, AdminApiKeys, AdminAudits, AdminFiles, AdminJobs, AdminNotifications, AdminParameters, AdminRouter, AdminSessions, AdminUserAudits, AdminUserCreate, AdminUserDetails, AdminUserLayout, AdminUserSessions, AdminUserSettings, AdminUsers, AdminVerifications, AlephaUIAdmin };
161
149
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/admin/AdminRouter.ts","../../src/admin/components/AdminLayout.tsx","../../src/admin/components/audits/AdminAudits.tsx","../../src/admin/components/files/AdminFiles.tsx","../../src/admin/components/jobs/AdminJobs.tsx","../../src/admin/components/notifications/AdminNotifications.tsx","../../src/admin/components/parameters/AdminParameters.tsx","../../src/admin/components/sessions/AdminSessions.tsx","../../src/admin/components/users/AdminUserAudits.tsx","../../src/admin/components/users/AdminUserCreate.tsx","../../src/admin/components/users/AdminUserDetails.tsx","../../src/admin/components/users/AdminUserLayout.tsx","../../src/admin/components/users/AdminUserSessions.tsx","../../src/admin/components/users/AdminUserSettings.tsx","../../src/admin/components/users/AdminUsers.tsx","../../src/admin/components/verifications/AdminVerifications.tsx","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BAAA,KAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;UC9ErC,oBAAA;EACf,aAAA;AAAA;AAAA,cAGI,eAAA,GAAmB,KAAA,EAAO,oBAAA,KAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;UCVnC,sBAAA;EACf,aAAA;AAAA;AAAA,cAGI,iBAAA,GAAqB,KAAA,EAAO,sBAAA,KAAsB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;UCDvC,sBAAA;EACf,aAAA;AAAA;AAAA,cAGI,iBAAA,GAAqB,KAAA,EAAO,sBAAA,KAAsB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;UCRvC,eAAA;EACf,aAAA;AAAA;AAAA,cAGI,UAAA,GAAc,KAAA,EAAO,eAAA,KAAe,kBAAA,CAAA,GAAA,CAAA,OAAA;;;cCdpC,kBAAA,QAAkB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;;;;;cCUX,UAAA;EACX,IAAA,EAAI,UAAA;EACJ,KAAA,EAAK,WAAA;EAEL,MAAA,EAAM,oBAAA,CAAA,aAAA,CAFD,oBAAA,CAEC,gBAAA,OAAA,oBAAA,CAAA,mBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;cCuCK,aAAA,EAAa,OAAA,CAAA,OAAA,CAMxB,OAAA,CANwB,MAAA;;;;cAab,QAAA,QAAQ,WAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/admin/AdminRouter.ts","../../src/admin/components/audits/AdminAudits.tsx","../../src/admin/components/files/AdminFiles.tsx","../../src/admin/components/jobs/AdminJobs.tsx","../../src/admin/components/keys/AdminApiKeys.tsx","../../src/admin/components/notifications/AdminNotifications.tsx","../../src/admin/components/parameters/AdminParameters.tsx","../../src/admin/components/sessions/AdminSessions.tsx","../../src/admin/components/users/AdminUserAudits.tsx","../../src/admin/components/users/AdminUserCreate.tsx","../../src/admin/components/users/AdminUserDetails.tsx","../../src/admin/components/users/AdminUserLayout.tsx","../../src/admin/components/users/AdminUserSessions.tsx","../../src/admin/components/users/AdminUserSettings.tsx","../../src/admin/components/users/AdminUsers.tsx","../../src/admin/components/verifications/AdminVerifications.tsx","../../src/admin/index.ts"],"mappings":";;;;;;;;;;;;;;;;;cA6Ba,WAAA;EAAA,mBACQ,MAAA,EAAM,WAAA,CAAA,WAAA;EAAA,mBACN,UAAA,EAAU,UAAA;EAAA,mBACV,IAAA,EAAI,SAAA;EAAA,mBACJ,QAAA,EAAQ,oBAAA,CAAA,iBAAA,CAAA,mBAAA;EAAA,mBACR,WAAA,EAAW,oBAAA,CAAA,iBAAA,CAAA,sBAAA;EAAA,mBACX,gBAAA,EAAgB,oBAAA,CAAA,iBAAA,CAAA,2BAAA;EAAA,mBAChB,QAAA,EAAQ,oBAAA,CAAA,iBAAA,CAAA,cAAA;EAAA,mBACR,UAAA,EAAU,oBAAA,CAAA,iBAAA,CAAA,qBAAA;EAAA,mBACV,SAAA,EAAS,oBAAA,CAAA,iBAAA,CAAA,oBAAA;EAAA,mBACT,OAAA,EAAO,oBAAA,CAAA,iBAAA,CAAA,kBAAA;EAAA,mBACP,UAAA,EAAU,oBAAA,CAAA,iBAAA,CAAA,qBAAA;EAAA,UAEnB,eAAA,CAAA,GAAmB,eAAA;EAAA,UAInB,eAAA,CAAgB,GAAA,EAAK,GAAA,GAAG,WAAA;EAAA,SAclB,WAAA,EAAW,oBAAA,CAAA,aAAA,CAdO,oBAAA,CAcP,gBAAA,MAAA,oBAAA,CAAA,mBAAA;EAAA,SAoBX,UAAA,EAAU,oBAAA,CAAA,aAAA,CApBC,oBAAA,CAoBD,gBAAA;EAAA,SAUV,eAAA,EAAe,oBAAA,CAAA,aAAA,CAVL,oBAAA,CAUK,gBAAA;EAAA,SAUf,eAAA,EAAe,oBAAA,CAAA,aAAA,CAVA,oBAAA,CAUA,gBAAA;EAAA,SASf,gBAAA,EAAgB,oBAAA,CAAA,aAAA,CATD,oBAAA,CASC,gBAAA;EAAA,SAOhB,iBAAA,EAAiB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cAyBI,eAAA,GAAmB,MAAA,EAAQ,oBAAA,KAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;UC/BpC,oBAAA;EACf,aAAA;AAAA;AAAA,cAGI,eAAA,GAAmB,KAAA,EAAO,oBAAA,KAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;UCqBnC,qBAAA;EACf,aAAA;AAAA;AAAA,cAgEI,gBAAA,GAAoB,KAAA,EAAO,qBAAA,KAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;UC9ErC,oBAAA;EACf,aAAA;AAAA;AAAA,cAGI,eAAA,GAAmB,KAAA,EAAO,oBAAA,KAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;UCVnC,sBAAA;EACf,aAAA;AAAA;AAAA,cAGI,iBAAA,GAAqB,KAAA,EAAO,sBAAA,KAAsB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;UCDvC,sBAAA;EACf,aAAA;AAAA;AAAA,cAGI,iBAAA,GAAqB,KAAA,EAAO,sBAAA,KAAsB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;UCRvC,eAAA;EACf,aAAA;AAAA;AAAA,cAGI,UAAA,GAAc,KAAA,EAAO,eAAA,KAAe,kBAAA,CAAA,GAAA,CAAA,OAAA;;;cCdpC,kBAAA,QAAkB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;AfyBxB;;;;;;;;;;;;;;;;;;;;AAAA,cgB0Ba,aAAA,EAAa,OAAA,CAAA,OAAA,CAMxB,OAAA,CANwB,MAAA;;;;cAab,QAAA,QAAQ,WAAA"}
@@ -1,28 +1,26 @@
1
- import { t as AdminLayout_default } from "./AdminLayout-QJLIesuG.js";
2
- import { t as AdminAudits_default } from "./AdminAudits-Oh7iAfQa.js";
3
- import { t as AdminFiles_default } from "./AdminFiles-Cu8GHgQ3.js";
4
- import { t as AdminNotifications_default } from "./AdminNotifications-CgYkBuG_.js";
5
- import { t as AdminParameters_default } from "./AdminParameters-hjNG_KXb.js";
6
- import { t as AdminSessions_default } from "./AdminSessions-Bey9cuy1.js";
7
- import { t as AdminUserAudits_default } from "./AdminUserAudits-C7AN9jx7.js";
8
- import { t as AdminUserCreate_default } from "./AdminUserCreate-BVIm4JdN.js";
9
- import { t as AdminUserDetails_default } from "./AdminUserDetails-yM4x8JE6.js";
10
- import { t as AdminUserLayout_default } from "./AdminUserLayout-BnfBC1gD.js";
11
- import { t as AdminUserSessions_default } from "./AdminUserSessions-kmkXG-xf.js";
12
- import { t as AdminUserSettings_default } from "./AdminUserSettings-DZ9iWhJW.js";
13
- import { t as AdminUsers_default } from "./AdminUsers-D6Y5K8Am.js";
14
- import { AlephaMantineProvider, AlephaUI, DataTable, Flex, Text } from "@alepha/ui";
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, t } from "alepha";
17
- import { IconBell, IconCheck, IconClock, IconDevices, IconFile, IconHistory, IconPlayerPlay, IconPlus, IconSettings, IconShieldCheck, IconUser, IconUsers, IconX } from "@tabler/icons-react";
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,6 +33,8 @@ var AdminRouter = class {
35
33
  fileCtrl = $client();
36
34
  configCtrl = $client();
37
35
  auditCtrl = $client();
36
+ jobCtrl = $client();
37
+ apiKeyCtrl = $client();
38
38
  adminShellProps() {
39
39
  return {};
40
40
  }
@@ -45,7 +45,7 @@ var AdminRouter = class {
45
45
  path: "/admin",
46
46
  label: "Admin",
47
47
  can: () => this.userCtrl.findUsers.can(),
48
- lazy: () => import("./AdminLayout-BfeFXiul.js"),
48
+ lazy: () => import("./AdminLayout-BqZiXx4H.js"),
49
49
  props: () => ({ adminShellProps: this.adminShellProps() }),
50
50
  loader: ({ user, url }) => {
51
51
  if (!user) throw this.onNotAuthorized(url);
@@ -58,7 +58,7 @@ var AdminRouter = class {
58
58
  path: "/users",
59
59
  label: "Users",
60
60
  description: "Manage application users and their roles.",
61
- lazy: () => import("./AdminUsers-RCaxccEW.js"),
61
+ lazy: () => import("./AdminUsers-D9nyzGqQ.js"),
62
62
  can: () => this.userCtrl.findUsers.can()
63
63
  });
64
64
  adminUserCreate = $page({
@@ -67,7 +67,7 @@ var AdminRouter = class {
67
67
  path: "/users/create",
68
68
  label: "Create User",
69
69
  description: "Create a new user account",
70
- lazy: () => import("./AdminUserCreate-C1aInRDk.js"),
70
+ lazy: () => import("./AdminUserCreate-Cq-mUmBs.js"),
71
71
  can: () => this.userCtrl.createUser.can()
72
72
  });
73
73
  adminUserLayout = $page({
@@ -75,32 +75,32 @@ var AdminRouter = class {
75
75
  parent: this.adminLayout,
76
76
  path: "/users/:userId",
77
77
  label: "User",
78
- lazy: () => import("./AdminUserLayout-gb-nbggz.js"),
78
+ lazy: () => import("./AdminUserLayout-CGzmHHby.js"),
79
79
  can: () => this.userCtrl.getUser.can()
80
80
  });
81
81
  adminUserDetails = $page({
82
82
  parent: this.adminUserLayout,
83
83
  path: "/details",
84
84
  label: "Details",
85
- lazy: () => import("./AdminUserDetails-Dcn3OwMC.js")
85
+ lazy: () => import("./AdminUserDetails-DRjVAPFd.js")
86
86
  });
87
87
  adminUserSessions = $page({
88
88
  parent: this.adminUserLayout,
89
89
  path: "/sessions",
90
90
  label: "Sessions",
91
- lazy: () => import("./AdminUserSessions-rvA0ztxn.js")
91
+ lazy: () => import("./AdminUserSessions-DcdzuNZ9.js")
92
92
  });
93
93
  adminUserSettings = $page({
94
94
  parent: this.adminUserLayout,
95
95
  path: "/settings",
96
96
  label: "Settings",
97
- lazy: () => import("./AdminUserSettings-Dg-wTRzN.js")
97
+ lazy: () => import("./AdminUserSettings-D7V6-ceX.js")
98
98
  });
99
99
  adminUserAudits = $page({
100
100
  parent: this.adminUserLayout,
101
101
  path: "/audits",
102
102
  label: "Audit Log",
103
- lazy: () => import("./AdminUserAudits-Cp_ERd2g.js"),
103
+ lazy: () => import("./AdminUserAudits-Cj79gENT.js"),
104
104
  can: () => this.auditCtrl.findByUser.can()
105
105
  });
106
106
  adminAudits = $page({
@@ -109,7 +109,7 @@ var AdminRouter = class {
109
109
  path: "/audits",
110
110
  label: "Audit Log",
111
111
  description: "View system-wide audit trail and activity logs.",
112
- lazy: () => import("./AdminAudits-BU-p1g7A.js"),
112
+ lazy: () => import("./AdminAudits-8SM96viT.js"),
113
113
  can: () => this.auditCtrl.findAudits.can()
114
114
  });
115
115
  adminSessions = $page({
@@ -118,7 +118,7 @@ var AdminRouter = class {
118
118
  path: "/sessions",
119
119
  label: "Sessions",
120
120
  description: "View and manage all active sessions.",
121
- lazy: () => import("./AdminSessions-Cn4_jB04.js"),
121
+ lazy: () => import("./AdminSessions-BDGK2MS6.js"),
122
122
  can: () => this.sessionCtrl.findSessions.can()
123
123
  });
124
124
  adminNotifications = $page({
@@ -127,7 +127,7 @@ var AdminRouter = class {
127
127
  path: "/notifications",
128
128
  label: "Notifications",
129
129
  description: "View notification history and status.",
130
- lazy: () => import("./AdminNotifications-DmfGPqHe.js"),
130
+ lazy: () => import("./AdminNotifications-B0B1rdc4.js"),
131
131
  can: () => this.notificationCtrl.findNotifications.can()
132
132
  });
133
133
  adminFiles = $page({
@@ -136,7 +136,7 @@ var AdminRouter = class {
136
136
  path: "/files",
137
137
  label: "Files",
138
138
  description: "Manage uploaded files and storage.",
139
- lazy: () => import("./AdminFiles-Bg9feLFH.js"),
139
+ lazy: () => import("./AdminFiles-B56ocq4H.js"),
140
140
  can: () => this.fileCtrl.findFiles.can()
141
141
  });
142
142
  adminParameters = $page({
@@ -145,144 +145,28 @@ var AdminRouter = class {
145
145
  path: "/parameters",
146
146
  label: "Parameters",
147
147
  description: "View and manage application configuration parameters.",
148
- lazy: () => import("./AdminParameters-Cl-R0nXt.js"),
148
+ lazy: () => import("./AdminParameters-BU3lATdJ.js"),
149
149
  can: () => this.configCtrl.getConfigTree.can()
150
150
  });
151
- };
152
-
153
- //#endregion
154
- //#region ../../src/admin/MainRouter.ts
155
- /**
156
- * Main application router that combines Auth and Admin routers.
157
- *
158
- * We assume that the main application router will always have Admin and Auth routers.
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
- ]))
184
- });
185
- const getStatusColor = (status) => {
186
- switch (status) {
187
- case "COMPLETED": return "green";
188
- case "FAILED": return "red";
189
- case "STARTED": return "blue";
190
- default: return "gray";
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
- })
151
+ adminJobs = $page({
152
+ icon: IconTerminal2,
153
+ parent: this.adminLayout,
154
+ path: "/jobs",
155
+ label: "Jobs",
156
+ description: "Monitor and manage background jobs and scheduled tasks.",
157
+ lazy: () => import("./AdminJobs-CED1syCn.js"),
158
+ can: () => this.jobCtrl.getJobs.can()
159
+ });
160
+ adminApiKeys = $page({
161
+ icon: IconKey,
162
+ parent: this.adminLayout,
163
+ path: "/api-keys",
164
+ label: "API Keys",
165
+ description: "View and manage API keys for programmatic access.",
166
+ lazy: () => import("./AdminApiKeys-DsmGnHNh.js"),
167
+ can: () => this.apiKeyCtrl.findApiKeys.can()
283
168
  });
284
169
  };
285
- var AdminJobs_default = AdminJobs;
286
170
 
287
171
  //#endregion
288
172
  //#region ../../src/admin/components/verifications/AdminVerifications.tsx
@@ -344,8 +228,7 @@ const AlephaUIAdmin = $module({
344
228
  services: [
345
229
  AlephaUI,
346
230
  AlephaUIAuth,
347
- AdminRouter,
348
- MainRouter
231
+ AdminRouter
349
232
  ],
350
233
  register: (alepha) => {
351
234
  alepha.with(AdminRouter);
@@ -360,5 +243,5 @@ const $uiAdmin = () => {
360
243
  };
361
244
 
362
245
  //#endregion
363
- export { $uiAdmin, AdminAudits_default as AdminAudits, AdminFiles_default as AdminFiles, AdminJobs_default as AdminJobs, AdminLayout_default as AdminLayout, 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, MainRouter };
246
+ 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
247
  //# sourceMappingURL=index.js.map
@@ -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;CA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;KACP,KAAK;KACL,QAAQ,SACN,oBAAC;MAAK,MAAK;MAAK,GAAE;gBACf,EAAE,KAAK,WAAW,EAAE,MAAM,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/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 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 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 // ─────────────────────────────────────────────────────────────────────────────\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 { AlephaUI } from \"@alepha/ui\";\nimport { AlephaUIAuth } from \"@alepha/ui/auth\";\nimport { $context, $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\";\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],\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":";;;;;;;;;;;;;;;;;;;;;;;;;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,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,YAA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