@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.
Files changed (132) hide show
  1. package/README.md +154 -0
  2. package/dist/core/control-panel.d.ts.map +1 -1
  3. package/dist/core/control-panel.js +30 -2
  4. package/dist/core/control-panel.js.map +1 -1
  5. package/dist/core/plugin-registry.d.ts +36 -0
  6. package/dist/core/plugin-registry.d.ts.map +1 -1
  7. package/dist/core/plugin-registry.js +26 -0
  8. package/dist/core/plugin-registry.js.map +1 -1
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +1 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/plugins/auth/adapters/index.d.ts +1 -0
  14. package/dist/plugins/auth/adapters/index.d.ts.map +1 -1
  15. package/dist/plugins/auth/adapters/index.js +1 -0
  16. package/dist/plugins/auth/adapters/index.js.map +1 -1
  17. package/dist/plugins/auth/adapters/supabase-adapter.d.ts.map +1 -1
  18. package/dist/plugins/auth/adapters/supabase-adapter.js.map +1 -1
  19. package/dist/plugins/auth/adapters/supertokens-adapter.d.ts +18 -0
  20. package/dist/plugins/auth/adapters/supertokens-adapter.d.ts.map +1 -0
  21. package/dist/plugins/auth/adapters/supertokens-adapter.js +267 -0
  22. package/dist/plugins/auth/adapters/supertokens-adapter.js.map +1 -0
  23. package/dist/plugins/auth/env-config.d.ts +88 -0
  24. package/dist/plugins/auth/env-config.d.ts.map +1 -0
  25. package/dist/plugins/auth/env-config.js +489 -0
  26. package/dist/plugins/auth/env-config.js.map +1 -0
  27. package/dist/plugins/auth/index.d.ts +3 -1
  28. package/dist/plugins/auth/index.d.ts.map +1 -1
  29. package/dist/plugins/auth/index.js +3 -0
  30. package/dist/plugins/auth/index.js.map +1 -1
  31. package/dist/plugins/auth/supertokens-adapter.test.d.ts +10 -0
  32. package/dist/plugins/auth/supertokens-adapter.test.d.ts.map +1 -0
  33. package/dist/plugins/auth/supertokens-adapter.test.js +486 -0
  34. package/dist/plugins/auth/supertokens-adapter.test.js.map +1 -0
  35. package/dist/plugins/auth/types.d.ts +70 -0
  36. package/dist/plugins/auth/types.d.ts.map +1 -1
  37. package/dist/plugins/auth/types.js.map +1 -1
  38. package/dist/plugins/cache-plugin.test.js +3 -0
  39. package/dist/plugins/cache-plugin.test.js.map +1 -1
  40. package/dist/plugins/index.d.ts +4 -2
  41. package/dist/plugins/index.d.ts.map +1 -1
  42. package/dist/plugins/index.js +3 -1
  43. package/dist/plugins/index.js.map +1 -1
  44. package/dist/plugins/postgres-plugin.test.js +3 -0
  45. package/dist/plugins/postgres-plugin.test.js.map +1 -1
  46. package/dist/plugins/preferences/__tests__/deep-merge.test.d.ts +7 -0
  47. package/dist/plugins/preferences/__tests__/deep-merge.test.d.ts.map +1 -0
  48. package/dist/plugins/preferences/__tests__/deep-merge.test.js +215 -0
  49. package/dist/plugins/preferences/__tests__/deep-merge.test.js.map +1 -0
  50. package/dist/plugins/preferences/__tests__/preferences-plugin.test.d.ts +7 -0
  51. package/dist/plugins/preferences/__tests__/preferences-plugin.test.d.ts.map +1 -0
  52. package/dist/plugins/preferences/__tests__/preferences-plugin.test.js +265 -0
  53. package/dist/plugins/preferences/__tests__/preferences-plugin.test.js.map +1 -0
  54. package/dist/plugins/preferences/index.d.ts +12 -0
  55. package/dist/plugins/preferences/index.d.ts.map +1 -0
  56. package/dist/plugins/preferences/index.js +13 -0
  57. package/dist/plugins/preferences/index.js.map +1 -0
  58. package/dist/plugins/preferences/preferences-plugin.d.ts +39 -0
  59. package/dist/plugins/preferences/preferences-plugin.d.ts.map +1 -0
  60. package/dist/plugins/preferences/preferences-plugin.js +226 -0
  61. package/dist/plugins/preferences/preferences-plugin.js.map +1 -0
  62. package/dist/plugins/preferences/stores/index.d.ts +9 -0
  63. package/dist/plugins/preferences/stores/index.d.ts.map +1 -0
  64. package/dist/plugins/preferences/stores/index.js +9 -0
  65. package/dist/plugins/preferences/stores/index.js.map +1 -0
  66. package/dist/plugins/preferences/stores/postgres-store.d.ts +41 -0
  67. package/dist/plugins/preferences/stores/postgres-store.d.ts.map +1 -0
  68. package/dist/plugins/preferences/stores/postgres-store.js +181 -0
  69. package/dist/plugins/preferences/stores/postgres-store.js.map +1 -0
  70. package/dist/plugins/preferences/types.d.ts +91 -0
  71. package/dist/plugins/preferences/types.d.ts.map +1 -0
  72. package/dist/plugins/preferences/types.js +10 -0
  73. package/dist/plugins/preferences/types.js.map +1 -0
  74. package/dist/plugins/users/__tests__/users-plugin.test.d.ts +9 -0
  75. package/dist/plugins/users/__tests__/users-plugin.test.d.ts.map +1 -0
  76. package/dist/plugins/users/__tests__/users-plugin.test.js +546 -0
  77. package/dist/plugins/users/__tests__/users-plugin.test.js.map +1 -0
  78. package/dist/plugins/users/index.d.ts +2 -2
  79. package/dist/plugins/users/index.d.ts.map +1 -1
  80. package/dist/plugins/users/index.js +1 -1
  81. package/dist/plugins/users/index.js.map +1 -1
  82. package/dist/plugins/users/types.d.ts +36 -0
  83. package/dist/plugins/users/types.d.ts.map +1 -1
  84. package/dist/plugins/users/users-plugin.d.ts +8 -2
  85. package/dist/plugins/users/users-plugin.d.ts.map +1 -1
  86. package/dist/plugins/users/users-plugin.js +122 -5
  87. package/dist/plugins/users/users-plugin.js.map +1 -1
  88. package/dist-ui/assets/{index-Bsp2ntcw.js → index-BY8OxNgO.js} +112 -112
  89. package/dist-ui/assets/index-BY8OxNgO.js.map +1 -0
  90. package/dist-ui/index.html +1 -1
  91. package/dist-ui-lib/api/controlPanelApi.d.ts +53 -7
  92. package/dist-ui-lib/dashboard/WidgetComponentRegistry.d.ts +9 -5
  93. package/dist-ui-lib/dashboard/builtInWidgets.d.ts +7 -1
  94. package/dist-ui-lib/index.js +2382 -3651
  95. package/dist-ui-lib/index.js.map +1 -1
  96. package/dist-ui-lib/pages/AuthPage.d.ts +1 -0
  97. package/dist-ui-lib/pages/PluginsPage.d.ts +1 -0
  98. package/package.json +7 -2
  99. package/src/core/control-panel.ts +33 -2
  100. package/src/core/plugin-registry.ts +63 -0
  101. package/src/index.ts +7 -0
  102. package/src/plugins/auth/adapters/index.ts +1 -0
  103. package/src/plugins/auth/adapters/supabase-adapter.ts +22 -14
  104. package/src/plugins/auth/adapters/supertokens-adapter.ts +326 -0
  105. package/src/plugins/auth/env-config.ts +572 -0
  106. package/src/plugins/auth/index.ts +9 -0
  107. package/src/plugins/auth/supertokens-adapter.test.ts +621 -0
  108. package/src/plugins/auth/types.ts +80 -0
  109. package/src/plugins/cache-plugin.test.ts +3 -0
  110. package/src/plugins/index.ts +26 -0
  111. package/src/plugins/postgres-plugin.test.ts +3 -0
  112. package/src/plugins/preferences/__tests__/deep-merge.test.ts +242 -0
  113. package/src/plugins/preferences/__tests__/preferences-plugin.test.ts +350 -0
  114. package/src/plugins/preferences/index.ts +30 -0
  115. package/src/plugins/preferences/preferences-plugin.ts +270 -0
  116. package/src/plugins/preferences/stores/index.ts +9 -0
  117. package/src/plugins/preferences/stores/postgres-store.ts +252 -0
  118. package/src/plugins/preferences/types.ts +100 -0
  119. package/src/plugins/users/__tests__/users-plugin.test.ts +690 -0
  120. package/src/plugins/users/index.ts +3 -0
  121. package/src/plugins/users/types.ts +38 -0
  122. package/src/plugins/users/users-plugin.ts +142 -5
  123. package/ui/src/App.tsx +4 -1
  124. package/ui/src/api/controlPanelApi.ts +100 -1
  125. package/ui/src/components/ControlPanelApp.tsx +3 -0
  126. package/ui/src/dashboard/PluginWidgetRenderer.tsx +13 -10
  127. package/ui/src/dashboard/WidgetComponentRegistry.tsx +13 -9
  128. package/ui/src/dashboard/builtInWidgets.tsx +8 -2
  129. package/ui/src/pages/AuthPage.tsx +259 -0
  130. package/ui/src/pages/PluginsPage.tsx +394 -0
  131. package/ui/vite.lib.config.ts +5 -0
  132. package/dist-ui/assets/index-Bsp2ntcw.js.map +0 -1
@@ -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-Bsp2ntcw.js"></script>
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
- plugins: Array<{
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: ReactNode;
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: ReactNode) => void;
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) => ReactNode | null;
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 with JSX elements.
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[];