@qwickapps/server 1.3.0 → 1.3.1
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 +154 -0
- package/dist/core/control-panel.d.ts.map +1 -1
- package/dist/core/control-panel.js +30 -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/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- 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/env-config.d.ts +88 -0
- package/dist/plugins/auth/env-config.d.ts.map +1 -0
- package/dist/plugins/auth/env-config.js +489 -0
- package/dist/plugins/auth/env-config.js.map +1 -0
- package/dist/plugins/auth/index.d.ts +3 -1
- package/dist/plugins/auth/index.d.ts.map +1 -1
- package/dist/plugins/auth/index.js +3 -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 +70 -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 +4 -2
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +3 -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/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-Bsp2ntcw.js → index-BY8OxNgO.js} +112 -112
- package/dist-ui/assets/index-BY8OxNgO.js.map +1 -0
- package/dist-ui/index.html +1 -1
- package/dist-ui-lib/api/controlPanelApi.d.ts +53 -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/index.js +2382 -3651
- package/dist-ui-lib/index.js.map +1 -1
- package/dist-ui-lib/pages/AuthPage.d.ts +1 -0
- package/dist-ui-lib/pages/PluginsPage.d.ts +1 -0
- package/package.json +7 -2
- package/src/core/control-panel.ts +33 -2
- package/src/core/plugin-registry.ts +63 -0
- package/src/index.ts +7 -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/env-config.ts +572 -0
- package/src/plugins/auth/index.ts +9 -0
- package/src/plugins/auth/supertokens-adapter.test.ts +621 -0
- package/src/plugins/auth/types.ts +80 -0
- package/src/plugins/cache-plugin.test.ts +3 -0
- package/src/plugins/index.ts +26 -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/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 +4 -1
- package/ui/src/api/controlPanelApi.ts +100 -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 +8 -2
- package/ui/src/pages/AuthPage.tsx +259 -0
- package/ui/src/pages/PluginsPage.tsx +394 -0
- package/ui/vite.lib.config.ts +5 -0
- 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-BY8OxNgO.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-CiizQQnb.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
@@ -171,6 +171,55 @@ 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 interface AuthConfigStatus {
|
|
217
|
+
state: AuthPluginState;
|
|
218
|
+
adapter: string | null;
|
|
219
|
+
error?: string;
|
|
220
|
+
missingVars?: string[];
|
|
221
|
+
config?: Record<string, string>;
|
|
222
|
+
}
|
|
174
223
|
declare class ControlPanelApi {
|
|
175
224
|
private baseUrl;
|
|
176
225
|
constructor(baseUrl?: string);
|
|
@@ -219,14 +268,11 @@ declare class ControlPanelApi {
|
|
|
219
268
|
page?: number;
|
|
220
269
|
}): Promise<LogsResponse>;
|
|
221
270
|
getLogSources(): Promise<LogSource[]>;
|
|
222
|
-
getPlugins(): Promise<
|
|
223
|
-
|
|
224
|
-
id: string;
|
|
225
|
-
name: string;
|
|
226
|
-
version?: string;
|
|
227
|
-
}>;
|
|
228
|
-
}>;
|
|
271
|
+
getPlugins(): Promise<PluginsResponse>;
|
|
272
|
+
getPluginDetail(id: string): Promise<PluginDetailResponse>;
|
|
229
273
|
getUiContributions(): Promise<UiContributionsResponse>;
|
|
274
|
+
getAuthConfigStatus(): Promise<AuthConfigStatus>;
|
|
275
|
+
getAuthConfig(): Promise<AuthConfigStatus>;
|
|
230
276
|
}
|
|
231
277
|
export declare const api: ControlPanelApi;
|
|
232
278
|
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[];
|