@qwickapps/server 1.2.0 → 1.3.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.
Files changed (240) hide show
  1. package/README.md +238 -0
  2. package/dist/core/control-panel.d.ts +7 -2
  3. package/dist/core/control-panel.d.ts.map +1 -1
  4. package/dist/core/control-panel.js +92 -54
  5. package/dist/core/control-panel.js.map +1 -1
  6. package/dist/core/gateway.d.ts +159 -79
  7. package/dist/core/gateway.d.ts.map +1 -1
  8. package/dist/core/gateway.js +679 -319
  9. package/dist/core/gateway.js.map +1 -1
  10. package/dist/core/index.d.ts +3 -1
  11. package/dist/core/index.d.ts.map +1 -1
  12. package/dist/core/index.js +2 -0
  13. package/dist/core/index.js.map +1 -1
  14. package/dist/core/plugin-registry.d.ts +271 -0
  15. package/dist/core/plugin-registry.d.ts.map +1 -0
  16. package/dist/core/plugin-registry.js +326 -0
  17. package/dist/core/plugin-registry.js.map +1 -0
  18. package/dist/core/types.d.ts +16 -33
  19. package/dist/core/types.d.ts.map +1 -1
  20. package/dist/index.d.ts +8 -5
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +15 -7
  23. package/dist/index.js.map +1 -1
  24. package/dist/plugins/auth/adapters/auth0-adapter.d.ts +14 -0
  25. package/dist/plugins/auth/adapters/auth0-adapter.d.ts.map +1 -0
  26. package/dist/plugins/auth/adapters/auth0-adapter.js +179 -0
  27. package/dist/plugins/auth/adapters/auth0-adapter.js.map +1 -0
  28. package/dist/plugins/auth/adapters/basic-adapter.d.ts +13 -0
  29. package/dist/plugins/auth/adapters/basic-adapter.d.ts.map +1 -0
  30. package/dist/plugins/auth/adapters/basic-adapter.js +51 -0
  31. package/dist/plugins/auth/adapters/basic-adapter.js.map +1 -0
  32. package/dist/plugins/auth/adapters/index.d.ts +9 -0
  33. package/dist/plugins/auth/adapters/index.d.ts.map +1 -0
  34. package/dist/plugins/auth/adapters/index.js +9 -0
  35. package/dist/plugins/auth/adapters/index.js.map +1 -0
  36. package/dist/plugins/auth/adapters/supabase-adapter.d.ts +13 -0
  37. package/dist/plugins/auth/adapters/supabase-adapter.d.ts.map +1 -0
  38. package/dist/plugins/auth/adapters/supabase-adapter.js +109 -0
  39. package/dist/plugins/auth/adapters/supabase-adapter.js.map +1 -0
  40. package/dist/plugins/auth/auth-plugin.d.ts +40 -0
  41. package/dist/plugins/auth/auth-plugin.d.ts.map +1 -0
  42. package/dist/plugins/auth/auth-plugin.js +255 -0
  43. package/dist/plugins/auth/auth-plugin.js.map +1 -0
  44. package/dist/plugins/auth/auth-plugin.test.d.ts +9 -0
  45. package/dist/plugins/auth/auth-plugin.test.d.ts.map +1 -0
  46. package/dist/plugins/auth/auth-plugin.test.js +147 -0
  47. package/dist/plugins/auth/auth-plugin.test.js.map +1 -0
  48. package/dist/plugins/auth/index.d.ts +12 -0
  49. package/dist/plugins/auth/index.d.ts.map +1 -0
  50. package/dist/plugins/auth/index.js +13 -0
  51. package/dist/plugins/auth/index.js.map +1 -0
  52. package/dist/plugins/auth/types.d.ts +148 -0
  53. package/dist/plugins/auth/types.d.ts.map +1 -0
  54. package/dist/plugins/auth/types.js +14 -0
  55. package/dist/plugins/auth/types.js.map +1 -0
  56. package/dist/plugins/bans/bans-plugin.d.ts +59 -0
  57. package/dist/plugins/bans/bans-plugin.d.ts.map +1 -0
  58. package/dist/plugins/bans/bans-plugin.js +428 -0
  59. package/dist/plugins/bans/bans-plugin.js.map +1 -0
  60. package/dist/plugins/bans/index.d.ts +9 -0
  61. package/dist/plugins/bans/index.d.ts.map +1 -0
  62. package/dist/plugins/bans/index.js +10 -0
  63. package/dist/plugins/bans/index.js.map +1 -0
  64. package/dist/plugins/bans/stores/index.d.ts +7 -0
  65. package/dist/plugins/bans/stores/index.d.ts.map +1 -0
  66. package/dist/plugins/bans/stores/index.js +7 -0
  67. package/dist/plugins/bans/stores/index.js.map +1 -0
  68. package/dist/plugins/bans/stores/postgres-store.d.ts +29 -0
  69. package/dist/plugins/bans/stores/postgres-store.d.ts.map +1 -0
  70. package/dist/plugins/bans/stores/postgres-store.js +132 -0
  71. package/dist/plugins/bans/stores/postgres-store.js.map +1 -0
  72. package/dist/plugins/bans/types.d.ts +128 -0
  73. package/dist/plugins/bans/types.d.ts.map +1 -0
  74. package/dist/plugins/bans/types.js +11 -0
  75. package/dist/plugins/bans/types.js.map +1 -0
  76. package/dist/plugins/cache-plugin.d.ts +14 -3
  77. package/dist/plugins/cache-plugin.d.ts.map +1 -1
  78. package/dist/plugins/cache-plugin.js +27 -7
  79. package/dist/plugins/cache-plugin.js.map +1 -1
  80. package/dist/plugins/cache-plugin.test.js +96 -32
  81. package/dist/plugins/cache-plugin.test.js.map +1 -1
  82. package/dist/plugins/config-plugin.d.ts +3 -2
  83. package/dist/plugins/config-plugin.d.ts.map +1 -1
  84. package/dist/plugins/config-plugin.js +17 -10
  85. package/dist/plugins/config-plugin.js.map +1 -1
  86. package/dist/plugins/diagnostics-plugin.d.ts +2 -2
  87. package/dist/plugins/diagnostics-plugin.d.ts.map +1 -1
  88. package/dist/plugins/diagnostics-plugin.js +17 -10
  89. package/dist/plugins/diagnostics-plugin.js.map +1 -1
  90. package/dist/plugins/entitlements/entitlements-plugin.d.ts +95 -0
  91. package/dist/plugins/entitlements/entitlements-plugin.d.ts.map +1 -0
  92. package/dist/plugins/entitlements/entitlements-plugin.js +707 -0
  93. package/dist/plugins/entitlements/entitlements-plugin.js.map +1 -0
  94. package/dist/plugins/entitlements/index.d.ts +12 -0
  95. package/dist/plugins/entitlements/index.d.ts.map +1 -0
  96. package/dist/plugins/entitlements/index.js +16 -0
  97. package/dist/plugins/entitlements/index.js.map +1 -0
  98. package/dist/plugins/entitlements/sources/index.d.ts +9 -0
  99. package/dist/plugins/entitlements/sources/index.d.ts.map +1 -0
  100. package/dist/plugins/entitlements/sources/index.js +9 -0
  101. package/dist/plugins/entitlements/sources/index.js.map +1 -0
  102. package/dist/plugins/entitlements/sources/postgres-source.d.ts +29 -0
  103. package/dist/plugins/entitlements/sources/postgres-source.d.ts.map +1 -0
  104. package/dist/plugins/entitlements/sources/postgres-source.js +169 -0
  105. package/dist/plugins/entitlements/sources/postgres-source.js.map +1 -0
  106. package/dist/plugins/entitlements/types.d.ts +232 -0
  107. package/dist/plugins/entitlements/types.d.ts.map +1 -0
  108. package/dist/plugins/entitlements/types.js +11 -0
  109. package/dist/plugins/entitlements/types.js.map +1 -0
  110. package/dist/plugins/frontend-app-plugin.d.ts +9 -3
  111. package/dist/plugins/frontend-app-plugin.d.ts.map +1 -1
  112. package/dist/plugins/frontend-app-plugin.js +14 -9
  113. package/dist/plugins/frontend-app-plugin.js.map +1 -1
  114. package/dist/plugins/health-plugin.d.ts +5 -2
  115. package/dist/plugins/health-plugin.d.ts.map +1 -1
  116. package/dist/plugins/health-plugin.js +20 -5
  117. package/dist/plugins/health-plugin.js.map +1 -1
  118. package/dist/plugins/index.d.ts +8 -2
  119. package/dist/plugins/index.d.ts.map +1 -1
  120. package/dist/plugins/index.js +8 -2
  121. package/dist/plugins/index.js.map +1 -1
  122. package/dist/plugins/logs-plugin.d.ts +3 -2
  123. package/dist/plugins/logs-plugin.d.ts.map +1 -1
  124. package/dist/plugins/logs-plugin.js +21 -12
  125. package/dist/plugins/logs-plugin.js.map +1 -1
  126. package/dist/plugins/postgres-plugin.d.ts +3 -3
  127. package/dist/plugins/postgres-plugin.d.ts.map +1 -1
  128. package/dist/plugins/postgres-plugin.js +9 -7
  129. package/dist/plugins/postgres-plugin.js.map +1 -1
  130. package/dist/plugins/postgres-plugin.test.js +47 -29
  131. package/dist/plugins/postgres-plugin.test.js.map +1 -1
  132. package/dist/plugins/users/index.d.ts +12 -0
  133. package/dist/plugins/users/index.d.ts.map +1 -0
  134. package/dist/plugins/users/index.js +13 -0
  135. package/dist/plugins/users/index.js.map +1 -0
  136. package/dist/plugins/users/stores/index.d.ts +7 -0
  137. package/dist/plugins/users/stores/index.d.ts.map +1 -0
  138. package/dist/plugins/users/stores/index.js +7 -0
  139. package/dist/plugins/users/stores/index.js.map +1 -0
  140. package/dist/plugins/users/stores/postgres-store.d.ts +28 -0
  141. package/dist/plugins/users/stores/postgres-store.d.ts.map +1 -0
  142. package/dist/plugins/users/stores/postgres-store.js +157 -0
  143. package/dist/plugins/users/stores/postgres-store.js.map +1 -0
  144. package/dist/plugins/users/types.d.ts +189 -0
  145. package/dist/plugins/users/types.d.ts.map +1 -0
  146. package/dist/plugins/users/types.js +12 -0
  147. package/dist/plugins/users/types.js.map +1 -0
  148. package/dist/plugins/users/users-plugin.d.ts +39 -0
  149. package/dist/plugins/users/users-plugin.d.ts.map +1 -0
  150. package/dist/plugins/users/users-plugin.js +242 -0
  151. package/dist/plugins/users/users-plugin.js.map +1 -0
  152. package/dist-ui/assets/index-Bsp2ntcw.js +465 -0
  153. package/dist-ui/assets/index-Bsp2ntcw.js.map +1 -0
  154. package/dist-ui/index.html +1 -1
  155. package/dist-ui-lib/api/controlPanelApi.d.ts +232 -0
  156. package/dist-ui-lib/components/ControlPanelApp.d.ts +61 -0
  157. package/dist-ui-lib/components/index.d.ts +18 -0
  158. package/dist-ui-lib/config/AppConfig.d.ts +7 -0
  159. package/dist-ui-lib/dashboard/DashboardWidgetRegistry.d.ts +62 -0
  160. package/dist-ui-lib/dashboard/DashboardWidgetRenderer.d.ts +8 -0
  161. package/dist-ui-lib/dashboard/PluginWidgetRenderer.d.ts +19 -0
  162. package/dist-ui-lib/dashboard/WidgetComponentRegistry.d.ts +44 -0
  163. package/dist-ui-lib/dashboard/builtInWidgets.d.ts +19 -0
  164. package/dist-ui-lib/dashboard/index.d.ts +13 -0
  165. package/dist-ui-lib/dashboard/widgets/ServiceHealthWidget.d.ts +12 -0
  166. package/dist-ui-lib/dashboard/widgets/index.d.ts +6 -0
  167. package/dist-ui-lib/index.js +6441 -0
  168. package/dist-ui-lib/index.js.map +1 -0
  169. package/dist-ui-lib/pages/ConfigPage.d.ts +1 -0
  170. package/dist-ui-lib/pages/DashboardPage.d.ts +1 -0
  171. package/dist-ui-lib/pages/DiagnosticsPage.d.ts +1 -0
  172. package/dist-ui-lib/pages/EntitlementsPage.d.ts +17 -0
  173. package/dist-ui-lib/pages/LogsPage.d.ts +1 -0
  174. package/dist-ui-lib/pages/NotFoundPage.d.ts +1 -0
  175. package/dist-ui-lib/pages/PluginPage.d.ts +15 -0
  176. package/dist-ui-lib/pages/SystemPage.d.ts +1 -0
  177. package/dist-ui-lib/pages/UsersPage.d.ts +22 -0
  178. package/package.json +18 -6
  179. package/src/core/control-panel.ts +114 -61
  180. package/src/core/gateway.ts +863 -403
  181. package/src/core/index.ts +21 -2
  182. package/src/core/plugin-registry.ts +653 -0
  183. package/src/core/types.ts +31 -37
  184. package/src/index.ts +118 -19
  185. package/src/plugins/auth/adapters/auth0-adapter.ts +214 -0
  186. package/src/plugins/auth/adapters/basic-adapter.ts +61 -0
  187. package/src/plugins/auth/adapters/index.ts +9 -0
  188. package/src/plugins/auth/adapters/supabase-adapter.ts +141 -0
  189. package/src/plugins/auth/auth-plugin.test.ts +176 -0
  190. package/src/plugins/auth/auth-plugin.ts +303 -0
  191. package/src/plugins/auth/index.ts +33 -0
  192. package/src/plugins/auth/types.ts +165 -0
  193. package/src/plugins/bans/bans-plugin.ts +485 -0
  194. package/src/plugins/bans/index.ts +31 -0
  195. package/src/plugins/bans/stores/index.ts +7 -0
  196. package/src/plugins/bans/stores/postgres-store.ts +195 -0
  197. package/src/plugins/bans/types.ts +141 -0
  198. package/src/plugins/cache-plugin.test.ts +105 -32
  199. package/src/plugins/cache-plugin.ts +40 -9
  200. package/src/plugins/config-plugin.ts +23 -12
  201. package/src/plugins/diagnostics-plugin.ts +22 -12
  202. package/src/plugins/entitlements/entitlements-plugin.ts +820 -0
  203. package/src/plugins/entitlements/index.ts +51 -0
  204. package/src/plugins/entitlements/sources/index.ts +9 -0
  205. package/src/plugins/entitlements/sources/postgres-source.ts +253 -0
  206. package/src/plugins/entitlements/types.ts +256 -0
  207. package/src/plugins/frontend-app-plugin.ts +24 -12
  208. package/src/plugins/health-plugin.ts +27 -7
  209. package/src/plugins/index.ts +106 -4
  210. package/src/plugins/logs-plugin.ts +28 -14
  211. package/src/plugins/postgres-plugin.test.ts +49 -29
  212. package/src/plugins/postgres-plugin.ts +11 -9
  213. package/src/plugins/users/index.ts +35 -0
  214. package/src/plugins/users/stores/index.ts +7 -0
  215. package/src/plugins/users/stores/postgres-store.ts +225 -0
  216. package/src/plugins/users/types.ts +209 -0
  217. package/src/plugins/users/users-plugin.ts +281 -0
  218. package/ui/src/App.tsx +185 -31
  219. package/ui/src/api/controlPanelApi.ts +354 -1
  220. package/ui/src/components/ControlPanelApp.tsx +209 -0
  221. package/ui/src/components/index.ts +62 -0
  222. package/ui/src/dashboard/DashboardWidgetRegistry.tsx +129 -0
  223. package/ui/src/dashboard/DashboardWidgetRenderer.tsx +34 -0
  224. package/ui/src/dashboard/PluginWidgetRenderer.tsx +115 -0
  225. package/ui/src/dashboard/WidgetComponentRegistry.tsx +116 -0
  226. package/ui/src/dashboard/builtInWidgets.tsx +29 -0
  227. package/ui/src/dashboard/index.ts +35 -0
  228. package/ui/src/dashboard/widgets/ServiceHealthWidget.tsx +140 -0
  229. package/ui/src/dashboard/widgets/index.ts +7 -0
  230. package/ui/src/pages/DashboardPage.tsx +28 -149
  231. package/ui/src/pages/EntitlementsPage.tsx +557 -0
  232. package/ui/src/pages/LogsPage.tsx +174 -8
  233. package/ui/src/pages/PluginPage.tsx +148 -0
  234. package/ui/src/pages/SystemPage.tsx +445 -0
  235. package/ui/src/pages/UsersPage.tsx +837 -0
  236. package/ui/tsconfig.lib.json +11 -0
  237. package/ui/vite.lib.config.ts +51 -0
  238. package/dist-ui/assets/index-CW1BviRn.js +0 -465
  239. package/dist-ui/assets/index-CW1BviRn.js.map +0 -1
  240. package/ui/src/pages/HealthPage.tsx +0 -204
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Control Panel</title>
7
- <script type="module" crossorigin src="/assets/index-CW1BviRn.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-Bsp2ntcw.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-CiizQQnb.css">
9
9
  </head>
10
10
  <body>
@@ -0,0 +1,232 @@
1
+ /**
2
+ * Control Panel API Client
3
+ *
4
+ * Communicates with the backend Express API
5
+ */
6
+ export interface HealthCheck {
7
+ status: 'healthy' | 'degraded' | 'unhealthy';
8
+ latency?: number;
9
+ lastChecked: string;
10
+ error?: string;
11
+ }
12
+ export interface HealthResponse {
13
+ status: 'healthy' | 'degraded' | 'unhealthy';
14
+ timestamp: string;
15
+ uptime: number;
16
+ checks: Record<string, HealthCheck>;
17
+ }
18
+ export interface InfoResponse {
19
+ product: string;
20
+ logoName: string;
21
+ logoIconUrl?: string;
22
+ version: string;
23
+ uptime: number;
24
+ links: Array<{
25
+ label: string;
26
+ url: string;
27
+ external?: boolean;
28
+ }>;
29
+ branding?: {
30
+ primaryColor?: string;
31
+ };
32
+ }
33
+ export interface DiagnosticsResponse {
34
+ timestamp: string;
35
+ product: string;
36
+ version?: string;
37
+ /** @qwickapps/server framework version */
38
+ frameworkVersion?: string;
39
+ uptime: number;
40
+ health: Record<string, HealthCheck>;
41
+ system: {
42
+ nodeVersion: string;
43
+ platform: string;
44
+ arch: string;
45
+ memory: {
46
+ total: number;
47
+ used: number;
48
+ free: number;
49
+ };
50
+ cpu: {
51
+ usage: number;
52
+ };
53
+ };
54
+ }
55
+ export interface ConfigResponse {
56
+ config: Record<string, string | number | boolean>;
57
+ masked: string[];
58
+ }
59
+ export interface LogEntry {
60
+ timestamp: string;
61
+ level: string;
62
+ message: string;
63
+ namespace?: string;
64
+ }
65
+ export interface LogsResponse {
66
+ logs: LogEntry[];
67
+ total: number;
68
+ page: number;
69
+ limit: number;
70
+ }
71
+ export interface LogSource {
72
+ name: string;
73
+ type: 'file' | 'api';
74
+ available: boolean;
75
+ }
76
+ export interface User {
77
+ id: string;
78
+ email: string;
79
+ name?: string;
80
+ created_at?: string;
81
+ updated_at?: string;
82
+ last_login?: string;
83
+ metadata?: Record<string, unknown>;
84
+ }
85
+ export interface UsersResponse {
86
+ users: User[];
87
+ total: number;
88
+ page: number;
89
+ limit: number;
90
+ }
91
+ export interface Ban {
92
+ id: string;
93
+ user_id?: string;
94
+ email: string;
95
+ reason: string;
96
+ banned_at: string;
97
+ banned_by: string;
98
+ expires_at?: string;
99
+ }
100
+ export interface BansResponse {
101
+ bans: Ban[];
102
+ total: number;
103
+ }
104
+ export interface EntitlementDefinition {
105
+ id: string;
106
+ name: string;
107
+ category?: string;
108
+ description?: string;
109
+ }
110
+ export interface EntitlementResult {
111
+ identifier: string;
112
+ entitlements: string[];
113
+ source: string;
114
+ cached?: boolean;
115
+ cachedAt?: string;
116
+ expiresAt?: string;
117
+ }
118
+ export interface EntitlementSourceInfo {
119
+ name: string;
120
+ description?: string;
121
+ readonly: boolean;
122
+ primary: boolean;
123
+ }
124
+ export interface EntitlementsStatus {
125
+ readonly: boolean;
126
+ writeEnabled: boolean;
127
+ cacheEnabled: boolean;
128
+ cacheTtl: number;
129
+ sources: EntitlementSourceInfo[];
130
+ }
131
+ export interface PluginFeatures {
132
+ users: boolean;
133
+ bans: boolean;
134
+ entitlements: boolean;
135
+ entitlementsReadonly?: boolean;
136
+ }
137
+ export interface MenuContribution {
138
+ id: string;
139
+ label: string;
140
+ icon?: string;
141
+ route: string;
142
+ order?: number;
143
+ pluginId: string;
144
+ parent?: string;
145
+ }
146
+ export interface PageContribution {
147
+ id: string;
148
+ route: string;
149
+ title: string;
150
+ pluginId: string;
151
+ }
152
+ export interface WidgetContribution {
153
+ id: string;
154
+ title: string;
155
+ /** Component name to render (matched by frontend widget registry) */
156
+ component: string;
157
+ /** Priority for ordering (lower = first, default: 100) */
158
+ priority?: number;
159
+ /** Whether this widget is shown by default */
160
+ showByDefault?: boolean;
161
+ pluginId: string;
162
+ }
163
+ export interface UiContributionsResponse {
164
+ menuItems: MenuContribution[];
165
+ pages: PageContribution[];
166
+ widgets: WidgetContribution[];
167
+ plugins: Array<{
168
+ id: string;
169
+ name: string;
170
+ version?: string;
171
+ status: string;
172
+ }>;
173
+ }
174
+ declare class ControlPanelApi {
175
+ private baseUrl;
176
+ constructor(baseUrl?: string);
177
+ /**
178
+ * Set the base URL for API requests.
179
+ * Call this when the control panel is mounted at a custom path.
180
+ */
181
+ setBaseUrl(baseUrl: string): void;
182
+ /**
183
+ * Detect which user management plugins are available by probing their endpoints
184
+ */
185
+ detectFeatures(): Promise<PluginFeatures>;
186
+ private checkEndpoint;
187
+ getUsers(options?: {
188
+ limit?: number;
189
+ page?: number;
190
+ search?: string;
191
+ }): Promise<UsersResponse>;
192
+ getUserById(id: string): Promise<User>;
193
+ getBans(): Promise<BansResponse>;
194
+ banUser(email: string, reason: string, expiresAt?: string): Promise<void>;
195
+ unbanUser(email: string): Promise<void>;
196
+ checkBan(email: string): Promise<{
197
+ banned: boolean;
198
+ ban?: Ban;
199
+ }>;
200
+ getEntitlements(email: string): Promise<EntitlementResult>;
201
+ refreshEntitlements(email: string): Promise<EntitlementResult>;
202
+ checkEntitlement(email: string, entitlement: string): Promise<{
203
+ has: boolean;
204
+ }>;
205
+ getAvailableEntitlements(): Promise<EntitlementDefinition[]>;
206
+ grantEntitlement(email: string, entitlement: string): Promise<void>;
207
+ revokeEntitlement(email: string, entitlement: string): Promise<void>;
208
+ invalidateEntitlementCache(email: string): Promise<void>;
209
+ getEntitlementsStatus(): Promise<EntitlementsStatus>;
210
+ getHealth(): Promise<HealthResponse>;
211
+ getInfo(): Promise<InfoResponse>;
212
+ getDiagnostics(): Promise<DiagnosticsResponse>;
213
+ getConfig(): Promise<ConfigResponse>;
214
+ getLogs(options?: {
215
+ source?: string;
216
+ level?: string;
217
+ search?: string;
218
+ limit?: number;
219
+ page?: number;
220
+ }): Promise<LogsResponse>;
221
+ getLogSources(): Promise<LogSource[]>;
222
+ getPlugins(): Promise<{
223
+ plugins: Array<{
224
+ id: string;
225
+ name: string;
226
+ version?: string;
227
+ }>;
228
+ }>;
229
+ getUiContributions(): Promise<UiContributionsResponse>;
230
+ }
231
+ export declare const api: ControlPanelApi;
232
+ export {};
@@ -0,0 +1,61 @@
1
+ /**
2
+ * ControlPanelApp Component
3
+ *
4
+ * A wrapper around QwickApp that provides control panel functionality.
5
+ * Injects base control panel routes (Dashboard, Health, Logs, System)
6
+ * and allows consumers to add custom routes.
7
+ *
8
+ * Usage:
9
+ * ```tsx
10
+ * import { ControlPanelApp } from '@qwickapps/server/ui';
11
+ *
12
+ * function App() {
13
+ * return (
14
+ * <ControlPanelApp
15
+ * productName="My Service"
16
+ * logo={<MyLogo />}
17
+ * customDashboard={<MyDashboard />}
18
+ * >
19
+ * <Route path="/users" element={<UsersPage />} />
20
+ * <Route path="/settings" element={<SettingsPage />} />
21
+ * </ControlPanelApp>
22
+ * );
23
+ * }
24
+ * ```
25
+ *
26
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
27
+ */
28
+ import { ReactNode } from 'react';
29
+ import { type MenuItem } from '@qwickapps/react-framework';
30
+ import { type DashboardWidget, type WidgetComponent } from '../dashboard';
31
+ export interface ControlPanelAppProps {
32
+ /** Product name displayed in the header */
33
+ productName?: string;
34
+ /** Custom logo component */
35
+ logo?: ReactNode;
36
+ /** Custom footer content (replaces default) */
37
+ footerContent?: ReactNode;
38
+ /** Initial dashboard widgets to register (legacy context-based system) */
39
+ dashboardWidgets?: DashboardWidget[];
40
+ /**
41
+ * Widget components to register for the plugin-based widget system.
42
+ * These map component names (from server WidgetContribution) to React components.
43
+ * Built-in widgets (ServiceHealthWidget, etc.) are registered automatically.
44
+ */
45
+ widgetComponents?: WidgetComponent[];
46
+ /** Additional navigation items to add to the base control panel nav */
47
+ navigationItems?: MenuItem[];
48
+ /** Whether to show the base control panel navigation (Dashboard, Health, etc.) */
49
+ showBaseNavigation?: boolean;
50
+ /** Base navigation item IDs to hide (e.g., ['health'] to hide the Health page) */
51
+ hideBaseNavItems?: string[];
52
+ /** Whether to show theme switcher in settings */
53
+ showThemeSwitcher?: boolean;
54
+ /** Whether to show palette switcher in settings */
55
+ showPaletteSwitcher?: boolean;
56
+ /** Base path for the control panel (e.g., '/cpanel') */
57
+ basePath?: string;
58
+ /** Custom routes to add (as Route elements) */
59
+ children?: ReactNode;
60
+ }
61
+ export declare function ControlPanelApp({ productName, logo, footerContent, dashboardWidgets, widgetComponents, navigationItems, showBaseNavigation, hideBaseNavItems, showThemeSwitcher, showPaletteSwitcher, basePath, children, }: ControlPanelAppProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Control Panel UI Components
3
+ *
4
+ * Re-exports all public UI components for use by consumers.
5
+ *
6
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
7
+ */
8
+ export { ControlPanelApp, type ControlPanelAppProps } from './ControlPanelApp';
9
+ export type { MenuItem } from '@qwickapps/react-framework';
10
+ export { DashboardPage } from '../pages/DashboardPage';
11
+ export { LogsPage } from '../pages/LogsPage';
12
+ export { SystemPage } from '../pages/SystemPage';
13
+ export { NotFoundPage } from '../pages/NotFoundPage';
14
+ export { UsersPage, type UsersPageProps } from '../pages/UsersPage';
15
+ export { EntitlementsPage, type EntitlementsPageProps } from '../pages/EntitlementsPage';
16
+ export { DashboardWidgetProvider, useDashboardWidgets, useRegisterWidget, DashboardWidgetRenderer, type DashboardWidget, type DashboardWidgetProviderProps, WidgetComponentRegistryProvider, useWidgetComponentRegistry, PluginWidgetRenderer, getBuiltInWidgetComponents, ServiceHealthWidget, type WidgetComponent, type WidgetComponentRegistryProviderProps, } from '../dashboard';
17
+ export { api } from '../api/controlPanelApi';
18
+ export type { HealthCheck, HealthResponse, InfoResponse, DiagnosticsResponse, ConfigResponse, LogEntry, LogsResponse, LogSource, User, UsersResponse, Ban, BansResponse, EntitlementDefinition, EntitlementResult, EntitlementSourceInfo, EntitlementsStatus, PluginFeatures, } from '../api/controlPanelApi';
@@ -0,0 +1,7 @@
1
+ import { AppConfigBuilder } from '@qwickapps/react-framework';
2
+ /**
3
+ * Default control panel configuration
4
+ * Consumers can override this by passing their own config
5
+ */
6
+ export declare const defaultConfig: import("@qwickapps/react-framework").AppConfig;
7
+ export type ControlPanelUIConfig = ReturnType<typeof AppConfigBuilder.prototype.build>;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Dashboard Widget Registry
3
+ *
4
+ * A context-based registry for dashboard widgets that allows:
5
+ * - Registration of widgets at runtime
6
+ * - Dynamic adding/removing of widgets
7
+ * - Priority-based ordering of widgets
8
+ *
9
+ * Usage:
10
+ * ```tsx
11
+ * // In your app setup:
12
+ * const { registerWidget } = useDashboardWidgets();
13
+ * registerWidget({
14
+ * id: 'user-stats',
15
+ * title: 'User Statistics',
16
+ * component: <UserStatsWidget />,
17
+ * priority: 10,
18
+ * });
19
+ *
20
+ * // Or via the provider:
21
+ * <DashboardWidgetProvider initialWidgets={[...]} />
22
+ * ```
23
+ *
24
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
25
+ */
26
+ import { ReactNode } from 'react';
27
+ export interface DashboardWidget {
28
+ /** Unique identifier for the widget */
29
+ id: string;
30
+ /** Display title for the widget section */
31
+ title?: string;
32
+ /** The widget component to render */
33
+ component: ReactNode;
34
+ /** Priority for ordering (lower = first, default: 100) */
35
+ priority?: number;
36
+ /** Whether the widget is visible */
37
+ visible?: boolean;
38
+ }
39
+ interface DashboardWidgetContextValue {
40
+ /** All registered widgets */
41
+ widgets: DashboardWidget[];
42
+ /** Register a new widget */
43
+ registerWidget: (widget: DashboardWidget) => void;
44
+ /** Unregister a widget by ID */
45
+ unregisterWidget: (id: string) => void;
46
+ /** Toggle widget visibility */
47
+ toggleWidget: (id: string, visible?: boolean) => void;
48
+ /** Get visible widgets sorted by priority */
49
+ getVisibleWidgets: () => DashboardWidget[];
50
+ }
51
+ export interface DashboardWidgetProviderProps {
52
+ /** Initial widgets to register */
53
+ initialWidgets?: DashboardWidget[];
54
+ children: ReactNode;
55
+ }
56
+ export declare function DashboardWidgetProvider({ initialWidgets, children }: DashboardWidgetProviderProps): import("react/jsx-runtime").JSX.Element;
57
+ export declare function useDashboardWidgets(): DashboardWidgetContextValue;
58
+ /**
59
+ * Hook to register a widget on mount and unregister on unmount
60
+ */
61
+ export declare function useRegisterWidget(widget: DashboardWidget): () => void;
62
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Dashboard Widget Renderer
3
+ *
4
+ * Renders all visible dashboard widgets from the registry.
5
+ *
6
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
7
+ */
8
+ export declare function DashboardWidgetRenderer(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Plugin Widget Renderer
3
+ *
4
+ * Fetches widget contributions from the server API and renders them using
5
+ * the WidgetComponentRegistry to resolve component names to React components.
6
+ *
7
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
+ */
9
+ interface PluginWidgetRendererProps {
10
+ /** Only show widgets marked as showByDefault (default: true) */
11
+ defaultOnly?: boolean;
12
+ /** Additional widget IDs to show (beyond showByDefault) */
13
+ additionalWidgetIds?: string[];
14
+ }
15
+ /**
16
+ * Renders widgets from plugins that have registered them via the server API
17
+ */
18
+ export declare function PluginWidgetRenderer({ defaultOnly, additionalWidgetIds, }: PluginWidgetRendererProps): import("react/jsx-runtime").JSX.Element | null;
19
+ export {};
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Widget Component Registry
3
+ *
4
+ * Maps widget component names (from server-side WidgetContribution) to actual React components.
5
+ * Plugins register their widgets here so the dashboard can render them.
6
+ *
7
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
+ */
9
+ import { ReactNode } from 'react';
10
+ /**
11
+ * Widget component definition
12
+ */
13
+ export interface WidgetComponent {
14
+ /** Component name (must match server-side WidgetContribution.component) */
15
+ name: string;
16
+ /** The React component to render */
17
+ component: ReactNode;
18
+ }
19
+ interface WidgetComponentRegistryContextValue {
20
+ /** Register a widget component */
21
+ registerComponent: (name: string, component: ReactNode) => void;
22
+ /** Register multiple widget components */
23
+ registerComponents: (components: WidgetComponent[]) => void;
24
+ /** Get a component by name */
25
+ getComponent: (name: string) => ReactNode | null;
26
+ /** Check if a component is registered */
27
+ hasComponent: (name: string) => boolean;
28
+ /** Get all registered component names */
29
+ getRegisteredNames: () => string[];
30
+ }
31
+ export interface WidgetComponentRegistryProviderProps {
32
+ /** Initial components to register */
33
+ initialComponents?: WidgetComponent[];
34
+ children: ReactNode;
35
+ }
36
+ /**
37
+ * Provider for the widget component registry
38
+ */
39
+ export declare function WidgetComponentRegistryProvider({ initialComponents, children, }: WidgetComponentRegistryProviderProps): import("react/jsx-runtime").JSX.Element;
40
+ /**
41
+ * Hook to access the widget component registry
42
+ */
43
+ export declare function useWidgetComponentRegistry(): WidgetComponentRegistryContextValue;
44
+ export {};
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Built-in Widget Components
3
+ *
4
+ * Maps built-in widget component names to their React components.
5
+ * These are the widgets that qwickapps-server provides out of the box.
6
+ *
7
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
+ */
9
+ import type { WidgetComponent } from './WidgetComponentRegistry';
10
+ /**
11
+ * Map of built-in widget component names to their React component functions.
12
+ * Use this when you need to look up a component by name.
13
+ */
14
+ export declare const builtInWidgetComponents: Record<string, React.ComponentType>;
15
+ /**
16
+ * Get built-in widget components as WidgetComponent array with JSX elements.
17
+ * Use this when registering with WidgetComponentRegistryProvider.
18
+ */
19
+ export declare function getBuiltInWidgetComponents(): WidgetComponent[];
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Dashboard Module
3
+ *
4
+ * Exports the dashboard widget system for dynamic dashboard customization.
5
+ *
6
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
7
+ */
8
+ export { DashboardWidgetProvider, useDashboardWidgets, useRegisterWidget, type DashboardWidget, type DashboardWidgetProviderProps, } from './DashboardWidgetRegistry';
9
+ export { DashboardWidgetRenderer } from './DashboardWidgetRenderer';
10
+ export { WidgetComponentRegistryProvider, useWidgetComponentRegistry, type WidgetComponent, type WidgetComponentRegistryProviderProps, } from './WidgetComponentRegistry';
11
+ export { PluginWidgetRenderer } from './PluginWidgetRenderer';
12
+ export { ServiceHealthWidget } from './widgets';
13
+ export { builtInWidgetComponents, getBuiltInWidgetComponents } from './builtInWidgets';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Service Health Widget
3
+ *
4
+ * Displays health check status with latency for all registered health checks.
5
+ * This is a built-in widget provided by qwickapps-server.
6
+ *
7
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
+ */
9
+ /**
10
+ * Service Health Widget Component
11
+ */
12
+ export declare function ServiceHealthWidget(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Built-in Dashboard Widgets
3
+ *
4
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
5
+ */
6
+ export { ServiceHealthWidget } from './ServiceHealthWidget';