@qwickapps/server 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +311 -0
- package/dist/core/control-panel.d.ts.map +1 -1
- package/dist/core/control-panel.js +144 -2
- package/dist/core/control-panel.js.map +1 -1
- package/dist/core/plugin-registry.d.ts +36 -0
- package/dist/core/plugin-registry.d.ts.map +1 -1
- package/dist/core/plugin-registry.js +26 -0
- package/dist/core/plugin-registry.js.map +1 -1
- package/dist/core/types.d.ts +19 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/plugins/auth/adapter-wrapper.d.ts +47 -0
- package/dist/plugins/auth/adapter-wrapper.d.ts.map +1 -0
- package/dist/plugins/auth/adapter-wrapper.js +166 -0
- package/dist/plugins/auth/adapter-wrapper.js.map +1 -0
- package/dist/plugins/auth/adapter-wrapper.test.d.ts +7 -0
- package/dist/plugins/auth/adapter-wrapper.test.d.ts.map +1 -0
- package/dist/plugins/auth/adapter-wrapper.test.js +303 -0
- package/dist/plugins/auth/adapter-wrapper.test.js.map +1 -0
- package/dist/plugins/auth/adapters/index.d.ts +1 -0
- package/dist/plugins/auth/adapters/index.d.ts.map +1 -1
- package/dist/plugins/auth/adapters/index.js +1 -0
- package/dist/plugins/auth/adapters/index.js.map +1 -1
- package/dist/plugins/auth/adapters/supabase-adapter.d.ts.map +1 -1
- package/dist/plugins/auth/adapters/supabase-adapter.js.map +1 -1
- package/dist/plugins/auth/adapters/supertokens-adapter.d.ts +18 -0
- package/dist/plugins/auth/adapters/supertokens-adapter.d.ts.map +1 -0
- package/dist/plugins/auth/adapters/supertokens-adapter.js +267 -0
- package/dist/plugins/auth/adapters/supertokens-adapter.js.map +1 -0
- package/dist/plugins/auth/config-store.d.ts +11 -0
- package/dist/plugins/auth/config-store.d.ts.map +1 -0
- package/dist/plugins/auth/config-store.js +232 -0
- package/dist/plugins/auth/config-store.js.map +1 -0
- package/dist/plugins/auth/config-store.test.d.ts +7 -0
- package/dist/plugins/auth/config-store.test.d.ts.map +1 -0
- package/dist/plugins/auth/config-store.test.js +299 -0
- package/dist/plugins/auth/config-store.test.js.map +1 -0
- package/dist/plugins/auth/env-config.d.ts +138 -0
- package/dist/plugins/auth/env-config.d.ts.map +1 -0
- package/dist/plugins/auth/env-config.js +1122 -0
- package/dist/plugins/auth/env-config.js.map +1 -0
- package/dist/plugins/auth/index.d.ts +7 -1
- package/dist/plugins/auth/index.d.ts.map +1 -1
- package/dist/plugins/auth/index.js +7 -0
- package/dist/plugins/auth/index.js.map +1 -1
- package/dist/plugins/auth/supertokens-adapter.test.d.ts +10 -0
- package/dist/plugins/auth/supertokens-adapter.test.d.ts.map +1 -0
- package/dist/plugins/auth/supertokens-adapter.test.js +486 -0
- package/dist/plugins/auth/supertokens-adapter.test.js.map +1 -0
- package/dist/plugins/auth/types.d.ts +176 -0
- package/dist/plugins/auth/types.d.ts.map +1 -1
- package/dist/plugins/auth/types.js.map +1 -1
- package/dist/plugins/cache-plugin.test.js +3 -0
- package/dist/plugins/cache-plugin.test.js.map +1 -1
- package/dist/plugins/index.d.ts +6 -2
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +5 -1
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/postgres-plugin.test.js +3 -0
- package/dist/plugins/postgres-plugin.test.js.map +1 -1
- package/dist/plugins/preferences/__tests__/deep-merge.test.d.ts +7 -0
- package/dist/plugins/preferences/__tests__/deep-merge.test.d.ts.map +1 -0
- package/dist/plugins/preferences/__tests__/deep-merge.test.js +215 -0
- package/dist/plugins/preferences/__tests__/deep-merge.test.js.map +1 -0
- package/dist/plugins/preferences/__tests__/preferences-plugin.test.d.ts +7 -0
- package/dist/plugins/preferences/__tests__/preferences-plugin.test.d.ts.map +1 -0
- package/dist/plugins/preferences/__tests__/preferences-plugin.test.js +265 -0
- package/dist/plugins/preferences/__tests__/preferences-plugin.test.js.map +1 -0
- package/dist/plugins/preferences/index.d.ts +12 -0
- package/dist/plugins/preferences/index.d.ts.map +1 -0
- package/dist/plugins/preferences/index.js +13 -0
- package/dist/plugins/preferences/index.js.map +1 -0
- package/dist/plugins/preferences/preferences-plugin.d.ts +39 -0
- package/dist/plugins/preferences/preferences-plugin.d.ts.map +1 -0
- package/dist/plugins/preferences/preferences-plugin.js +226 -0
- package/dist/plugins/preferences/preferences-plugin.js.map +1 -0
- package/dist/plugins/preferences/stores/index.d.ts +9 -0
- package/dist/plugins/preferences/stores/index.d.ts.map +1 -0
- package/dist/plugins/preferences/stores/index.js +9 -0
- package/dist/plugins/preferences/stores/index.js.map +1 -0
- package/dist/plugins/preferences/stores/postgres-store.d.ts +41 -0
- package/dist/plugins/preferences/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/preferences/stores/postgres-store.js +181 -0
- package/dist/plugins/preferences/stores/postgres-store.js.map +1 -0
- package/dist/plugins/preferences/types.d.ts +91 -0
- package/dist/plugins/preferences/types.d.ts.map +1 -0
- package/dist/plugins/preferences/types.js +10 -0
- package/dist/plugins/preferences/types.js.map +1 -0
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.d.ts +7 -0
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.d.ts.map +1 -0
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.js +220 -0
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.js.map +1 -0
- package/dist/plugins/rate-limit/cleanup.d.ts +40 -0
- package/dist/plugins/rate-limit/cleanup.d.ts.map +1 -0
- package/dist/plugins/rate-limit/cleanup.js +72 -0
- package/dist/plugins/rate-limit/cleanup.js.map +1 -0
- package/dist/plugins/rate-limit/env-config.d.ts +91 -0
- package/dist/plugins/rate-limit/env-config.d.ts.map +1 -0
- package/dist/plugins/rate-limit/env-config.js +318 -0
- package/dist/plugins/rate-limit/env-config.js.map +1 -0
- package/dist/plugins/rate-limit/index.d.ts +76 -0
- package/dist/plugins/rate-limit/index.d.ts.map +1 -0
- package/dist/plugins/rate-limit/index.js +79 -0
- package/dist/plugins/rate-limit/index.js.map +1 -0
- package/dist/plugins/rate-limit/middleware.d.ts +40 -0
- package/dist/plugins/rate-limit/middleware.d.ts.map +1 -0
- package/dist/plugins/rate-limit/middleware.js +169 -0
- package/dist/plugins/rate-limit/middleware.js.map +1 -0
- package/dist/plugins/rate-limit/rate-limit-plugin.d.ts +44 -0
- package/dist/plugins/rate-limit/rate-limit-plugin.d.ts.map +1 -0
- package/dist/plugins/rate-limit/rate-limit-plugin.js +354 -0
- package/dist/plugins/rate-limit/rate-limit-plugin.js.map +1 -0
- package/dist/plugins/rate-limit/rate-limit-service.d.ts +110 -0
- package/dist/plugins/rate-limit/rate-limit-service.d.ts.map +1 -0
- package/dist/plugins/rate-limit/rate-limit-service.js +172 -0
- package/dist/plugins/rate-limit/rate-limit-service.js.map +1 -0
- package/dist/plugins/rate-limit/stores/cache-store.d.ts +33 -0
- package/dist/plugins/rate-limit/stores/cache-store.d.ts.map +1 -0
- package/dist/plugins/rate-limit/stores/cache-store.js +225 -0
- package/dist/plugins/rate-limit/stores/cache-store.js.map +1 -0
- package/dist/plugins/rate-limit/stores/index.d.ts +8 -0
- package/dist/plugins/rate-limit/stores/index.d.ts.map +1 -0
- package/dist/plugins/rate-limit/stores/index.js +8 -0
- package/dist/plugins/rate-limit/stores/index.js.map +1 -0
- package/dist/plugins/rate-limit/stores/postgres-store.d.ts +34 -0
- package/dist/plugins/rate-limit/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/rate-limit/stores/postgres-store.js +320 -0
- package/dist/plugins/rate-limit/stores/postgres-store.js.map +1 -0
- package/dist/plugins/rate-limit/strategies/fixed-window.d.ts +21 -0
- package/dist/plugins/rate-limit/strategies/fixed-window.d.ts.map +1 -0
- package/dist/plugins/rate-limit/strategies/fixed-window.js +97 -0
- package/dist/plugins/rate-limit/strategies/fixed-window.js.map +1 -0
- package/dist/plugins/rate-limit/strategies/index.d.ts +14 -0
- package/dist/plugins/rate-limit/strategies/index.d.ts.map +1 -0
- package/dist/plugins/rate-limit/strategies/index.js +27 -0
- package/dist/plugins/rate-limit/strategies/index.js.map +1 -0
- package/dist/plugins/rate-limit/strategies/sliding-window.d.ts +22 -0
- package/dist/plugins/rate-limit/strategies/sliding-window.d.ts.map +1 -0
- package/dist/plugins/rate-limit/strategies/sliding-window.js +122 -0
- package/dist/plugins/rate-limit/strategies/sliding-window.js.map +1 -0
- package/dist/plugins/rate-limit/strategies/token-bucket.d.ts +28 -0
- package/dist/plugins/rate-limit/strategies/token-bucket.d.ts.map +1 -0
- package/dist/plugins/rate-limit/strategies/token-bucket.js +121 -0
- package/dist/plugins/rate-limit/strategies/token-bucket.js.map +1 -0
- package/dist/plugins/rate-limit/types.d.ts +265 -0
- package/dist/plugins/rate-limit/types.d.ts.map +1 -0
- package/dist/plugins/rate-limit/types.js +9 -0
- package/dist/plugins/rate-limit/types.js.map +1 -0
- package/dist/plugins/users/__tests__/users-plugin.test.d.ts +9 -0
- package/dist/plugins/users/__tests__/users-plugin.test.d.ts.map +1 -0
- package/dist/plugins/users/__tests__/users-plugin.test.js +546 -0
- package/dist/plugins/users/__tests__/users-plugin.test.js.map +1 -0
- package/dist/plugins/users/index.d.ts +2 -2
- package/dist/plugins/users/index.d.ts.map +1 -1
- package/dist/plugins/users/index.js +1 -1
- package/dist/plugins/users/index.js.map +1 -1
- package/dist/plugins/users/types.d.ts +36 -0
- package/dist/plugins/users/types.d.ts.map +1 -1
- package/dist/plugins/users/users-plugin.d.ts +8 -2
- package/dist/plugins/users/users-plugin.d.ts.map +1 -1
- package/dist/plugins/users/users-plugin.js +122 -5
- package/dist/plugins/users/users-plugin.js.map +1 -1
- package/dist-ui/assets/index-D7DoZ9rL.js +478 -0
- package/dist-ui/assets/index-D7DoZ9rL.js.map +1 -0
- package/dist-ui/index.html +1 -1
- package/dist-ui-lib/api/controlPanelApi.d.ts +194 -7
- package/dist-ui-lib/dashboard/WidgetComponentRegistry.d.ts +9 -5
- package/dist-ui-lib/dashboard/builtInWidgets.d.ts +7 -1
- package/dist-ui-lib/dashboard/widgets/AuthStatusWidget.d.ts +9 -0
- package/dist-ui-lib/dashboard/widgets/IntegrationStatusWidget.d.ts +9 -0
- package/dist-ui-lib/dashboard/widgets/index.d.ts +2 -0
- package/dist-ui-lib/index.js +3665 -3945
- package/dist-ui-lib/index.js.map +1 -1
- package/dist-ui-lib/pages/AuthPage.d.ts +1 -0
- package/dist-ui-lib/pages/IntegrationsPage.d.ts +1 -0
- package/dist-ui-lib/pages/PluginsPage.d.ts +1 -0
- package/dist-ui-lib/pages/RateLimitPage.d.ts +1 -0
- package/package.json +7 -2
- package/src/core/control-panel.ts +161 -2
- package/src/core/plugin-registry.ts +63 -0
- package/src/core/types.ts +17 -0
- package/src/index.ts +45 -0
- package/src/plugins/auth/adapter-wrapper.test.ts +395 -0
- package/src/plugins/auth/adapter-wrapper.ts +205 -0
- package/src/plugins/auth/adapters/index.ts +1 -0
- package/src/plugins/auth/adapters/supabase-adapter.ts +22 -14
- package/src/plugins/auth/adapters/supertokens-adapter.ts +326 -0
- package/src/plugins/auth/config-store.test.ts +417 -0
- package/src/plugins/auth/config-store.ts +305 -0
- package/src/plugins/auth/env-config.ts +1279 -0
- package/src/plugins/auth/index.ts +30 -0
- package/src/plugins/auth/supertokens-adapter.test.ts +621 -0
- package/src/plugins/auth/types.ts +218 -0
- package/src/plugins/cache-plugin.test.ts +3 -0
- package/src/plugins/index.ts +75 -0
- package/src/plugins/postgres-plugin.test.ts +3 -0
- package/src/plugins/preferences/__tests__/deep-merge.test.ts +242 -0
- package/src/plugins/preferences/__tests__/preferences-plugin.test.ts +350 -0
- package/src/plugins/preferences/index.ts +30 -0
- package/src/plugins/preferences/preferences-plugin.ts +270 -0
- package/src/plugins/preferences/stores/index.ts +9 -0
- package/src/plugins/preferences/stores/postgres-store.ts +252 -0
- package/src/plugins/preferences/types.ts +100 -0
- package/src/plugins/rate-limit/__tests__/rate-limit-plugin.test.ts +259 -0
- package/src/plugins/rate-limit/cleanup.ts +117 -0
- package/src/plugins/rate-limit/env-config.ts +400 -0
- package/src/plugins/rate-limit/index.ts +128 -0
- package/src/plugins/rate-limit/middleware.ts +212 -0
- package/src/plugins/rate-limit/rate-limit-plugin.ts +400 -0
- package/src/plugins/rate-limit/rate-limit-service.ts +228 -0
- package/src/plugins/rate-limit/stores/cache-store.ts +261 -0
- package/src/plugins/rate-limit/stores/index.ts +8 -0
- package/src/plugins/rate-limit/stores/postgres-store.ts +402 -0
- package/src/plugins/rate-limit/strategies/fixed-window.ts +116 -0
- package/src/plugins/rate-limit/strategies/index.ts +30 -0
- package/src/plugins/rate-limit/strategies/sliding-window.ts +157 -0
- package/src/plugins/rate-limit/strategies/token-bucket.ts +154 -0
- package/src/plugins/rate-limit/types.ts +338 -0
- package/src/plugins/users/__tests__/users-plugin.test.ts +690 -0
- package/src/plugins/users/index.ts +3 -0
- package/src/plugins/users/types.ts +38 -0
- package/src/plugins/users/users-plugin.ts +142 -5
- package/ui/src/App.tsx +35 -14
- package/ui/src/api/controlPanelApi.ts +326 -1
- package/ui/src/components/ControlPanelApp.tsx +3 -0
- package/ui/src/dashboard/PluginWidgetRenderer.tsx +13 -10
- package/ui/src/dashboard/WidgetComponentRegistry.tsx +13 -9
- package/ui/src/dashboard/builtInWidgets.tsx +13 -3
- package/ui/src/dashboard/widgets/AuthStatusWidget.tsx +143 -0
- package/ui/src/dashboard/widgets/IntegrationStatusWidget.tsx +135 -0
- package/ui/src/dashboard/widgets/index.ts +2 -0
- package/ui/src/pages/AuthPage.tsx +1103 -0
- package/ui/src/pages/IntegrationsPage.tsx +288 -0
- package/ui/src/pages/PluginsPage.tsx +394 -0
- package/ui/src/pages/RateLimitPage.tsx +292 -0
- package/ui/vite.lib.config.ts +5 -0
- package/dist-ui/assets/index-Bsp2ntcw.js +0 -465
- package/dist-ui/assets/index-Bsp2ntcw.js.map +0 -1
package/dist-ui/index.html
CHANGED
|
@@ -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-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-D7DoZ9rL.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-CiizQQnb.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
@@ -171,6 +171,163 @@ export interface UiContributionsResponse {
|
|
|
171
171
|
status: string;
|
|
172
172
|
}>;
|
|
173
173
|
}
|
|
174
|
+
export interface ConfigContribution {
|
|
175
|
+
id: string;
|
|
176
|
+
component: string;
|
|
177
|
+
title?: string;
|
|
178
|
+
pluginId: string;
|
|
179
|
+
}
|
|
180
|
+
export interface PluginContributions {
|
|
181
|
+
routes: Array<{
|
|
182
|
+
method: string;
|
|
183
|
+
path: string;
|
|
184
|
+
}>;
|
|
185
|
+
menuItems: MenuContribution[];
|
|
186
|
+
pages: PageContribution[];
|
|
187
|
+
widgets: WidgetContribution[];
|
|
188
|
+
config?: ConfigContribution;
|
|
189
|
+
}
|
|
190
|
+
export interface PluginInfo {
|
|
191
|
+
id: string;
|
|
192
|
+
name: string;
|
|
193
|
+
version?: string;
|
|
194
|
+
status: 'starting' | 'active' | 'stopped' | 'error';
|
|
195
|
+
error?: string;
|
|
196
|
+
contributionCounts: {
|
|
197
|
+
routes: number;
|
|
198
|
+
menuItems: number;
|
|
199
|
+
pages: number;
|
|
200
|
+
widgets: number;
|
|
201
|
+
hasConfig: boolean;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
export interface PluginsResponse {
|
|
205
|
+
plugins: PluginInfo[];
|
|
206
|
+
}
|
|
207
|
+
export interface PluginDetailResponse {
|
|
208
|
+
id: string;
|
|
209
|
+
name: string;
|
|
210
|
+
version?: string;
|
|
211
|
+
status: 'starting' | 'active' | 'stopped' | 'error';
|
|
212
|
+
error?: string;
|
|
213
|
+
contributions: PluginContributions;
|
|
214
|
+
}
|
|
215
|
+
export type AuthPluginState = 'disabled' | 'enabled' | 'error';
|
|
216
|
+
export type AuthAdapterType = 'auth0' | 'supabase' | 'supertokens' | 'basic';
|
|
217
|
+
export interface AuthConfigStatus {
|
|
218
|
+
state: AuthPluginState;
|
|
219
|
+
adapter: string | null;
|
|
220
|
+
error?: string;
|
|
221
|
+
missingVars?: string[];
|
|
222
|
+
config?: Record<string, string>;
|
|
223
|
+
/** Runtime config from database (if available) */
|
|
224
|
+
runtimeConfig?: RuntimeAuthConfig;
|
|
225
|
+
}
|
|
226
|
+
export interface RuntimeAuthConfig {
|
|
227
|
+
adapter: AuthAdapterType | null;
|
|
228
|
+
config: {
|
|
229
|
+
auth0?: Auth0AdapterConfig;
|
|
230
|
+
supabase?: SupabaseAdapterConfig;
|
|
231
|
+
supertokens?: SupertokensAdapterConfig;
|
|
232
|
+
basic?: BasicAdapterConfig;
|
|
233
|
+
};
|
|
234
|
+
settings: {
|
|
235
|
+
authRequired?: boolean;
|
|
236
|
+
excludePaths?: string[];
|
|
237
|
+
debug?: boolean;
|
|
238
|
+
};
|
|
239
|
+
updatedAt: string;
|
|
240
|
+
updatedBy?: string;
|
|
241
|
+
}
|
|
242
|
+
export interface Auth0AdapterConfig {
|
|
243
|
+
domain: string;
|
|
244
|
+
clientId: string;
|
|
245
|
+
clientSecret: string;
|
|
246
|
+
baseUrl: string;
|
|
247
|
+
secret: string;
|
|
248
|
+
audience?: string;
|
|
249
|
+
scopes?: string[];
|
|
250
|
+
allowedRoles?: string[];
|
|
251
|
+
allowedDomains?: string[];
|
|
252
|
+
}
|
|
253
|
+
export interface SupabaseAdapterConfig {
|
|
254
|
+
url: string;
|
|
255
|
+
anonKey: string;
|
|
256
|
+
}
|
|
257
|
+
export interface BasicAdapterConfig {
|
|
258
|
+
username: string;
|
|
259
|
+
password: string;
|
|
260
|
+
realm?: string;
|
|
261
|
+
}
|
|
262
|
+
export interface SupertokensAdapterConfig {
|
|
263
|
+
connectionUri: string;
|
|
264
|
+
apiKey?: string;
|
|
265
|
+
appName: string;
|
|
266
|
+
apiDomain: string;
|
|
267
|
+
websiteDomain: string;
|
|
268
|
+
apiBasePath?: string;
|
|
269
|
+
websiteBasePath?: string;
|
|
270
|
+
enableEmailPassword?: boolean;
|
|
271
|
+
socialProviders?: {
|
|
272
|
+
google?: {
|
|
273
|
+
clientId: string;
|
|
274
|
+
clientSecret: string;
|
|
275
|
+
};
|
|
276
|
+
apple?: {
|
|
277
|
+
clientId: string;
|
|
278
|
+
clientSecret: string;
|
|
279
|
+
keyId: string;
|
|
280
|
+
teamId: string;
|
|
281
|
+
};
|
|
282
|
+
github?: {
|
|
283
|
+
clientId: string;
|
|
284
|
+
clientSecret: string;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
export interface UpdateAuthConfigRequest {
|
|
289
|
+
adapter: AuthAdapterType;
|
|
290
|
+
config: Record<string, unknown>;
|
|
291
|
+
settings?: {
|
|
292
|
+
authRequired?: boolean;
|
|
293
|
+
excludePaths?: string[];
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
export interface TestProviderRequest {
|
|
297
|
+
adapter: AuthAdapterType;
|
|
298
|
+
config: Record<string, unknown>;
|
|
299
|
+
provider?: 'google' | 'github' | 'apple';
|
|
300
|
+
}
|
|
301
|
+
export interface TestProviderResponse {
|
|
302
|
+
success: boolean;
|
|
303
|
+
message: string;
|
|
304
|
+
details?: {
|
|
305
|
+
latency?: number;
|
|
306
|
+
version?: string;
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
export type RateLimitStrategy = 'sliding-window' | 'fixed-window' | 'token-bucket';
|
|
310
|
+
export interface RateLimitConfig {
|
|
311
|
+
windowMs: number;
|
|
312
|
+
maxRequests: number;
|
|
313
|
+
strategy: RateLimitStrategy;
|
|
314
|
+
cleanupEnabled: boolean;
|
|
315
|
+
cleanupIntervalMs: number;
|
|
316
|
+
store: string;
|
|
317
|
+
cache: string;
|
|
318
|
+
cacheAvailable: boolean;
|
|
319
|
+
}
|
|
320
|
+
export interface RateLimitConfigUpdateRequest {
|
|
321
|
+
windowMs?: number;
|
|
322
|
+
maxRequests?: number;
|
|
323
|
+
strategy?: RateLimitStrategy;
|
|
324
|
+
cleanupEnabled?: boolean;
|
|
325
|
+
cleanupIntervalMs?: number;
|
|
326
|
+
}
|
|
327
|
+
export interface RateLimitConfigUpdateResponse {
|
|
328
|
+
success: boolean;
|
|
329
|
+
config: RateLimitConfig;
|
|
330
|
+
}
|
|
174
331
|
declare class ControlPanelApi {
|
|
175
332
|
private baseUrl;
|
|
176
333
|
constructor(baseUrl?: string);
|
|
@@ -179,6 +336,15 @@ declare class ControlPanelApi {
|
|
|
179
336
|
* Call this when the control panel is mounted at a custom path.
|
|
180
337
|
*/
|
|
181
338
|
setBaseUrl(baseUrl: string): void;
|
|
339
|
+
/**
|
|
340
|
+
* Get the base URL for API requests.
|
|
341
|
+
*/
|
|
342
|
+
getBaseUrl(): string;
|
|
343
|
+
/**
|
|
344
|
+
* Generic fetch method for API requests.
|
|
345
|
+
* Automatically prepends the base URL and /api prefix.
|
|
346
|
+
*/
|
|
347
|
+
fetch<T = unknown>(path: string, options?: RequestInit): Promise<T>;
|
|
182
348
|
/**
|
|
183
349
|
* Detect which user management plugins are available by probing their endpoints
|
|
184
350
|
*/
|
|
@@ -219,14 +385,35 @@ declare class ControlPanelApi {
|
|
|
219
385
|
page?: number;
|
|
220
386
|
}): Promise<LogsResponse>;
|
|
221
387
|
getLogSources(): Promise<LogSource[]>;
|
|
222
|
-
getPlugins(): Promise<
|
|
223
|
-
|
|
224
|
-
id: string;
|
|
225
|
-
name: string;
|
|
226
|
-
version?: string;
|
|
227
|
-
}>;
|
|
228
|
-
}>;
|
|
388
|
+
getPlugins(): Promise<PluginsResponse>;
|
|
389
|
+
getPluginDetail(id: string): Promise<PluginDetailResponse>;
|
|
229
390
|
getUiContributions(): Promise<UiContributionsResponse>;
|
|
391
|
+
getAuthConfigStatus(): Promise<AuthConfigStatus>;
|
|
392
|
+
getAuthConfig(): Promise<AuthConfigStatus>;
|
|
393
|
+
/**
|
|
394
|
+
* Update auth configuration (save to database for hot-reload)
|
|
395
|
+
*/
|
|
396
|
+
updateAuthConfig(request: UpdateAuthConfigRequest): Promise<{
|
|
397
|
+
success: boolean;
|
|
398
|
+
message: string;
|
|
399
|
+
}>;
|
|
400
|
+
/**
|
|
401
|
+
* Delete auth configuration (revert to environment variables)
|
|
402
|
+
*/
|
|
403
|
+
deleteAuthConfig(): Promise<{
|
|
404
|
+
success: boolean;
|
|
405
|
+
message: string;
|
|
406
|
+
}>;
|
|
407
|
+
/**
|
|
408
|
+
* Test auth provider connection without saving
|
|
409
|
+
*/
|
|
410
|
+
testAuthProvider(request: TestProviderRequest): Promise<TestProviderResponse>;
|
|
411
|
+
/**
|
|
412
|
+
* Test current auth provider connection (uses existing env/runtime config)
|
|
413
|
+
*/
|
|
414
|
+
testCurrentAuthProvider(): Promise<TestProviderResponse>;
|
|
415
|
+
getRateLimitConfig(): Promise<RateLimitConfig>;
|
|
416
|
+
updateRateLimitConfig(updates: RateLimitConfigUpdateRequest): Promise<RateLimitConfigUpdateResponse>;
|
|
230
417
|
}
|
|
231
418
|
export declare const api: ControlPanelApi;
|
|
232
419
|
export {};
|
|
@@ -6,23 +6,27 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
8
|
*/
|
|
9
|
-
import { ReactNode } from 'react';
|
|
9
|
+
import React, { type ReactNode } from 'react';
|
|
10
10
|
/**
|
|
11
11
|
* Widget component definition
|
|
12
|
+
*
|
|
13
|
+
* IMPORTANT: We store component functions (ComponentType), not JSX instances (ReactNode).
|
|
14
|
+
* This ensures cross-React-version compatibility when the library is used in apps
|
|
15
|
+
* with different React versions.
|
|
12
16
|
*/
|
|
13
17
|
export interface WidgetComponent {
|
|
14
18
|
/** Component name (must match server-side WidgetContribution.component) */
|
|
15
19
|
name: string;
|
|
16
|
-
/** The React component to render */
|
|
17
|
-
component:
|
|
20
|
+
/** The React component function to render */
|
|
21
|
+
component: React.ComponentType;
|
|
18
22
|
}
|
|
19
23
|
interface WidgetComponentRegistryContextValue {
|
|
20
24
|
/** Register a widget component */
|
|
21
|
-
registerComponent: (name: string, component:
|
|
25
|
+
registerComponent: (name: string, component: React.ComponentType) => void;
|
|
22
26
|
/** Register multiple widget components */
|
|
23
27
|
registerComponents: (components: WidgetComponent[]) => void;
|
|
24
28
|
/** Get a component by name */
|
|
25
|
-
getComponent: (name: string) =>
|
|
29
|
+
getComponent: (name: string) => React.ComponentType | null;
|
|
26
30
|
/** Check if a component is registered */
|
|
27
31
|
hasComponent: (name: string) => boolean;
|
|
28
32
|
/** Get all registered component names */
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* Maps built-in widget component names to their React components.
|
|
5
5
|
* These are the widgets that qwickapps-server provides out of the box.
|
|
6
6
|
*
|
|
7
|
+
* IMPORTANT: We export component functions, not JSX instances.
|
|
8
|
+
* This ensures cross-React-version compatibility.
|
|
9
|
+
*
|
|
7
10
|
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
11
|
*/
|
|
9
12
|
import type { WidgetComponent } from './WidgetComponentRegistry';
|
|
@@ -13,7 +16,10 @@ import type { WidgetComponent } from './WidgetComponentRegistry';
|
|
|
13
16
|
*/
|
|
14
17
|
export declare const builtInWidgetComponents: Record<string, React.ComponentType>;
|
|
15
18
|
/**
|
|
16
|
-
* Get built-in widget components as WidgetComponent array
|
|
19
|
+
* Get built-in widget components as WidgetComponent array.
|
|
17
20
|
* Use this when registering with WidgetComponentRegistryProvider.
|
|
21
|
+
*
|
|
22
|
+
* Returns component functions (not JSX instances) to ensure compatibility
|
|
23
|
+
* across different React versions.
|
|
18
24
|
*/
|
|
19
25
|
export declare function getBuiltInWidgetComponents(): WidgetComponent[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Status Widget
|
|
3
|
+
*
|
|
4
|
+
* Displays the authentication plugin status on the dashboard.
|
|
5
|
+
* Shows whether auth is enabled, the adapter type, and configuration status.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
export declare function AuthStatusWidget(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration Status Widget
|
|
3
|
+
*
|
|
4
|
+
* Displays the status of configured integrations with their connection status.
|
|
5
|
+
* Used in the dashboard to show a quick overview of integration health.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
export declare function IntegrationStatusWidget(): import("react/jsx-runtime").JSX.Element | null;
|