@qwickapps/server 1.2.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 +392 -0
- package/dist/core/control-panel.d.ts +7 -2
- package/dist/core/control-panel.d.ts.map +1 -1
- package/dist/core/control-panel.js +120 -54
- package/dist/core/control-panel.js.map +1 -1
- package/dist/core/gateway.d.ts +159 -79
- package/dist/core/gateway.d.ts.map +1 -1
- package/dist/core/gateway.js +679 -319
- package/dist/core/gateway.js.map +1 -1
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/plugin-registry.d.ts +307 -0
- package/dist/core/plugin-registry.d.ts.map +1 -0
- package/dist/core/plugin-registry.js +352 -0
- package/dist/core/plugin-registry.js.map +1 -0
- package/dist/core/types.d.ts +16 -33
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -7
- package/dist/index.js.map +1 -1
- package/dist/plugins/auth/adapters/auth0-adapter.d.ts +14 -0
- package/dist/plugins/auth/adapters/auth0-adapter.d.ts.map +1 -0
- package/dist/plugins/auth/adapters/auth0-adapter.js +179 -0
- package/dist/plugins/auth/adapters/auth0-adapter.js.map +1 -0
- package/dist/plugins/auth/adapters/basic-adapter.d.ts +13 -0
- package/dist/plugins/auth/adapters/basic-adapter.d.ts.map +1 -0
- package/dist/plugins/auth/adapters/basic-adapter.js +51 -0
- package/dist/plugins/auth/adapters/basic-adapter.js.map +1 -0
- package/dist/plugins/auth/adapters/index.d.ts +10 -0
- package/dist/plugins/auth/adapters/index.d.ts.map +1 -0
- package/dist/plugins/auth/adapters/index.js +10 -0
- package/dist/plugins/auth/adapters/index.js.map +1 -0
- package/dist/plugins/auth/adapters/supabase-adapter.d.ts +13 -0
- package/dist/plugins/auth/adapters/supabase-adapter.d.ts.map +1 -0
- package/dist/plugins/auth/adapters/supabase-adapter.js +109 -0
- package/dist/plugins/auth/adapters/supabase-adapter.js.map +1 -0
- 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/auth-plugin.d.ts +40 -0
- package/dist/plugins/auth/auth-plugin.d.ts.map +1 -0
- package/dist/plugins/auth/auth-plugin.js +255 -0
- package/dist/plugins/auth/auth-plugin.js.map +1 -0
- package/dist/plugins/auth/auth-plugin.test.d.ts +9 -0
- package/dist/plugins/auth/auth-plugin.test.d.ts.map +1 -0
- package/dist/plugins/auth/auth-plugin.test.js +147 -0
- package/dist/plugins/auth/auth-plugin.test.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 +14 -0
- package/dist/plugins/auth/index.d.ts.map +1 -0
- package/dist/plugins/auth/index.js +16 -0
- package/dist/plugins/auth/index.js.map +1 -0
- 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 +218 -0
- package/dist/plugins/auth/types.d.ts.map +1 -0
- package/dist/plugins/auth/types.js +14 -0
- package/dist/plugins/auth/types.js.map +1 -0
- package/dist/plugins/bans/bans-plugin.d.ts +59 -0
- package/dist/plugins/bans/bans-plugin.d.ts.map +1 -0
- package/dist/plugins/bans/bans-plugin.js +428 -0
- package/dist/plugins/bans/bans-plugin.js.map +1 -0
- package/dist/plugins/bans/index.d.ts +9 -0
- package/dist/plugins/bans/index.d.ts.map +1 -0
- package/dist/plugins/bans/index.js +10 -0
- package/dist/plugins/bans/index.js.map +1 -0
- package/dist/plugins/bans/stores/index.d.ts +7 -0
- package/dist/plugins/bans/stores/index.d.ts.map +1 -0
- package/dist/plugins/bans/stores/index.js +7 -0
- package/dist/plugins/bans/stores/index.js.map +1 -0
- package/dist/plugins/bans/stores/postgres-store.d.ts +29 -0
- package/dist/plugins/bans/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/bans/stores/postgres-store.js +132 -0
- package/dist/plugins/bans/stores/postgres-store.js.map +1 -0
- package/dist/plugins/bans/types.d.ts +128 -0
- package/dist/plugins/bans/types.d.ts.map +1 -0
- package/dist/plugins/bans/types.js +11 -0
- package/dist/plugins/bans/types.js.map +1 -0
- package/dist/plugins/cache-plugin.d.ts +14 -3
- package/dist/plugins/cache-plugin.d.ts.map +1 -1
- package/dist/plugins/cache-plugin.js +27 -7
- package/dist/plugins/cache-plugin.js.map +1 -1
- package/dist/plugins/cache-plugin.test.js +99 -32
- package/dist/plugins/cache-plugin.test.js.map +1 -1
- package/dist/plugins/config-plugin.d.ts +3 -2
- package/dist/plugins/config-plugin.d.ts.map +1 -1
- package/dist/plugins/config-plugin.js +17 -10
- package/dist/plugins/config-plugin.js.map +1 -1
- package/dist/plugins/diagnostics-plugin.d.ts +2 -2
- package/dist/plugins/diagnostics-plugin.d.ts.map +1 -1
- package/dist/plugins/diagnostics-plugin.js +17 -10
- package/dist/plugins/diagnostics-plugin.js.map +1 -1
- package/dist/plugins/entitlements/entitlements-plugin.d.ts +95 -0
- package/dist/plugins/entitlements/entitlements-plugin.d.ts.map +1 -0
- package/dist/plugins/entitlements/entitlements-plugin.js +707 -0
- package/dist/plugins/entitlements/entitlements-plugin.js.map +1 -0
- package/dist/plugins/entitlements/index.d.ts +12 -0
- package/dist/plugins/entitlements/index.d.ts.map +1 -0
- package/dist/plugins/entitlements/index.js +16 -0
- package/dist/plugins/entitlements/index.js.map +1 -0
- package/dist/plugins/entitlements/sources/index.d.ts +9 -0
- package/dist/plugins/entitlements/sources/index.d.ts.map +1 -0
- package/dist/plugins/entitlements/sources/index.js +9 -0
- package/dist/plugins/entitlements/sources/index.js.map +1 -0
- package/dist/plugins/entitlements/sources/postgres-source.d.ts +29 -0
- package/dist/plugins/entitlements/sources/postgres-source.d.ts.map +1 -0
- package/dist/plugins/entitlements/sources/postgres-source.js +169 -0
- package/dist/plugins/entitlements/sources/postgres-source.js.map +1 -0
- package/dist/plugins/entitlements/types.d.ts +232 -0
- package/dist/plugins/entitlements/types.d.ts.map +1 -0
- package/dist/plugins/entitlements/types.js +11 -0
- package/dist/plugins/entitlements/types.js.map +1 -0
- package/dist/plugins/frontend-app-plugin.d.ts +9 -3
- package/dist/plugins/frontend-app-plugin.d.ts.map +1 -1
- package/dist/plugins/frontend-app-plugin.js +14 -9
- package/dist/plugins/frontend-app-plugin.js.map +1 -1
- package/dist/plugins/health-plugin.d.ts +5 -2
- package/dist/plugins/health-plugin.d.ts.map +1 -1
- package/dist/plugins/health-plugin.js +20 -5
- package/dist/plugins/health-plugin.js.map +1 -1
- package/dist/plugins/index.d.ts +10 -2
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +10 -2
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/logs-plugin.d.ts +3 -2
- package/dist/plugins/logs-plugin.d.ts.map +1 -1
- package/dist/plugins/logs-plugin.js +21 -12
- package/dist/plugins/logs-plugin.js.map +1 -1
- package/dist/plugins/postgres-plugin.d.ts +3 -3
- package/dist/plugins/postgres-plugin.d.ts.map +1 -1
- package/dist/plugins/postgres-plugin.js +9 -7
- package/dist/plugins/postgres-plugin.js.map +1 -1
- package/dist/plugins/postgres-plugin.test.js +50 -29
- 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 +12 -0
- package/dist/plugins/users/index.d.ts.map +1 -0
- package/dist/plugins/users/index.js +13 -0
- package/dist/plugins/users/index.js.map +1 -0
- package/dist/plugins/users/stores/index.d.ts +7 -0
- package/dist/plugins/users/stores/index.d.ts.map +1 -0
- package/dist/plugins/users/stores/index.js +7 -0
- package/dist/plugins/users/stores/index.js.map +1 -0
- package/dist/plugins/users/stores/postgres-store.d.ts +28 -0
- package/dist/plugins/users/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/users/stores/postgres-store.js +157 -0
- package/dist/plugins/users/stores/postgres-store.js.map +1 -0
- package/dist/plugins/users/types.d.ts +225 -0
- package/dist/plugins/users/types.d.ts.map +1 -0
- package/dist/plugins/users/types.js +12 -0
- package/dist/plugins/users/types.js.map +1 -0
- package/dist/plugins/users/users-plugin.d.ts +45 -0
- package/dist/plugins/users/users-plugin.d.ts.map +1 -0
- package/dist/plugins/users/users-plugin.js +359 -0
- package/dist/plugins/users/users-plugin.js.map +1 -0
- package/dist-ui/assets/index-BY8OxNgO.js +465 -0
- 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 +278 -0
- package/dist-ui-lib/components/ControlPanelApp.d.ts +61 -0
- package/dist-ui-lib/components/index.d.ts +18 -0
- package/dist-ui-lib/config/AppConfig.d.ts +7 -0
- package/dist-ui-lib/dashboard/DashboardWidgetRegistry.d.ts +62 -0
- package/dist-ui-lib/dashboard/DashboardWidgetRenderer.d.ts +8 -0
- package/dist-ui-lib/dashboard/PluginWidgetRenderer.d.ts +19 -0
- package/dist-ui-lib/dashboard/WidgetComponentRegistry.d.ts +48 -0
- package/dist-ui-lib/dashboard/builtInWidgets.d.ts +25 -0
- package/dist-ui-lib/dashboard/index.d.ts +13 -0
- package/dist-ui-lib/dashboard/widgets/ServiceHealthWidget.d.ts +12 -0
- package/dist-ui-lib/dashboard/widgets/index.d.ts +6 -0
- package/dist-ui-lib/index.js +5172 -0
- package/dist-ui-lib/index.js.map +1 -0
- package/dist-ui-lib/pages/AuthPage.d.ts +1 -0
- package/dist-ui-lib/pages/ConfigPage.d.ts +1 -0
- package/dist-ui-lib/pages/DashboardPage.d.ts +1 -0
- package/dist-ui-lib/pages/DiagnosticsPage.d.ts +1 -0
- package/dist-ui-lib/pages/EntitlementsPage.d.ts +17 -0
- package/dist-ui-lib/pages/LogsPage.d.ts +1 -0
- package/dist-ui-lib/pages/NotFoundPage.d.ts +1 -0
- package/dist-ui-lib/pages/PluginPage.d.ts +15 -0
- package/dist-ui-lib/pages/PluginsPage.d.ts +1 -0
- package/dist-ui-lib/pages/SystemPage.d.ts +1 -0
- package/dist-ui-lib/pages/UsersPage.d.ts +22 -0
- package/package.json +24 -7
- package/src/core/control-panel.ts +145 -61
- package/src/core/gateway.ts +863 -403
- package/src/core/index.ts +21 -2
- package/src/core/plugin-registry.ts +716 -0
- package/src/core/types.ts +31 -37
- package/src/index.ts +125 -19
- package/src/plugins/auth/adapters/auth0-adapter.ts +214 -0
- package/src/plugins/auth/adapters/basic-adapter.ts +61 -0
- package/src/plugins/auth/adapters/index.ts +10 -0
- package/src/plugins/auth/adapters/supabase-adapter.ts +149 -0
- package/src/plugins/auth/adapters/supertokens-adapter.ts +326 -0
- package/src/plugins/auth/auth-plugin.test.ts +176 -0
- package/src/plugins/auth/auth-plugin.ts +303 -0
- package/src/plugins/auth/env-config.ts +572 -0
- package/src/plugins/auth/index.ts +42 -0
- package/src/plugins/auth/supertokens-adapter.test.ts +621 -0
- package/src/plugins/auth/types.ts +245 -0
- package/src/plugins/bans/bans-plugin.ts +485 -0
- package/src/plugins/bans/index.ts +31 -0
- package/src/plugins/bans/stores/index.ts +7 -0
- package/src/plugins/bans/stores/postgres-store.ts +195 -0
- package/src/plugins/bans/types.ts +141 -0
- package/src/plugins/cache-plugin.test.ts +108 -32
- package/src/plugins/cache-plugin.ts +40 -9
- package/src/plugins/config-plugin.ts +23 -12
- package/src/plugins/diagnostics-plugin.ts +22 -12
- package/src/plugins/entitlements/entitlements-plugin.ts +820 -0
- package/src/plugins/entitlements/index.ts +51 -0
- package/src/plugins/entitlements/sources/index.ts +9 -0
- package/src/plugins/entitlements/sources/postgres-source.ts +253 -0
- package/src/plugins/entitlements/types.ts +256 -0
- package/src/plugins/frontend-app-plugin.ts +24 -12
- package/src/plugins/health-plugin.ts +27 -7
- package/src/plugins/index.ts +132 -4
- package/src/plugins/logs-plugin.ts +28 -14
- package/src/plugins/postgres-plugin.test.ts +52 -29
- package/src/plugins/postgres-plugin.ts +11 -9
- 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 +38 -0
- package/src/plugins/users/stores/index.ts +7 -0
- package/src/plugins/users/stores/postgres-store.ts +225 -0
- package/src/plugins/users/types.ts +247 -0
- package/src/plugins/users/users-plugin.ts +418 -0
- package/ui/src/App.tsx +188 -31
- package/ui/src/api/controlPanelApi.ts +453 -1
- package/ui/src/components/ControlPanelApp.tsx +212 -0
- package/ui/src/components/index.ts +62 -0
- package/ui/src/dashboard/DashboardWidgetRegistry.tsx +129 -0
- package/ui/src/dashboard/DashboardWidgetRenderer.tsx +34 -0
- package/ui/src/dashboard/PluginWidgetRenderer.tsx +118 -0
- package/ui/src/dashboard/WidgetComponentRegistry.tsx +120 -0
- package/ui/src/dashboard/builtInWidgets.tsx +35 -0
- package/ui/src/dashboard/index.ts +35 -0
- package/ui/src/dashboard/widgets/ServiceHealthWidget.tsx +140 -0
- package/ui/src/dashboard/widgets/index.ts +7 -0
- package/ui/src/pages/AuthPage.tsx +259 -0
- package/ui/src/pages/DashboardPage.tsx +28 -149
- package/ui/src/pages/EntitlementsPage.tsx +557 -0
- package/ui/src/pages/LogsPage.tsx +174 -8
- package/ui/src/pages/PluginPage.tsx +148 -0
- package/ui/src/pages/PluginsPage.tsx +394 -0
- package/ui/src/pages/SystemPage.tsx +445 -0
- package/ui/src/pages/UsersPage.tsx +837 -0
- package/ui/tsconfig.lib.json +11 -0
- package/ui/vite.lib.config.ts +56 -0
- package/dist-ui/assets/index-CW1BviRn.js +0 -465
- package/dist-ui/assets/index-CW1BviRn.js.map +0 -1
- package/ui/src/pages/HealthPage.tsx +0 -204
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostgreSQL Preferences Store
|
|
3
|
+
*
|
|
4
|
+
* Preferences storage implementation using PostgreSQL with Row-Level Security (RLS).
|
|
5
|
+
* Requires the 'pg' package and the Users plugin to be installed.
|
|
6
|
+
*
|
|
7
|
+
* RLS Context Pattern:
|
|
8
|
+
* Each operation uses an explicit transaction and sets `app.current_user_id`
|
|
9
|
+
* as a transaction-local configuration variable. The RLS policy checks this
|
|
10
|
+
* variable to enforce that users can only access their own preferences.
|
|
11
|
+
*
|
|
12
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
13
|
+
*/
|
|
14
|
+
import type { PreferencesStore, PostgresPreferencesStoreConfig } from '../types.js';
|
|
15
|
+
/**
|
|
16
|
+
* Deep merge two objects
|
|
17
|
+
* - Objects are recursively merged
|
|
18
|
+
* - Arrays are replaced (not merged)
|
|
19
|
+
* - Source values override target values
|
|
20
|
+
*/
|
|
21
|
+
export declare function deepMerge(target: Record<string, unknown>, source: Record<string, unknown>): Record<string, unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* Create a PostgreSQL preferences store with RLS
|
|
24
|
+
*
|
|
25
|
+
* @param config Configuration including a pg Pool instance
|
|
26
|
+
* @returns PreferencesStore implementation
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { Pool } from 'pg';
|
|
31
|
+
* import { postgresPreferencesStore } from '@qwickapps/server';
|
|
32
|
+
*
|
|
33
|
+
* const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
|
34
|
+
* const store = postgresPreferencesStore({ pool });
|
|
35
|
+
*
|
|
36
|
+
* // Or with lazy initialization:
|
|
37
|
+
* const store = postgresPreferencesStore({ pool: () => getPostgres().getPool() });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function postgresPreferencesStore(config: PostgresPreferencesStoreConfig): PreferencesStore;
|
|
41
|
+
//# sourceMappingURL=postgres-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-store.d.ts","sourceRoot":"","sources":["../../../../src/plugins/preferences/stores/postgres-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAarB;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgCzB;AAsCD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,8BAA8B,GAAG,gBAAgB,CA4HjG"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostgreSQL Preferences Store
|
|
3
|
+
*
|
|
4
|
+
* Preferences storage implementation using PostgreSQL with Row-Level Security (RLS).
|
|
5
|
+
* Requires the 'pg' package and the Users plugin to be installed.
|
|
6
|
+
*
|
|
7
|
+
* RLS Context Pattern:
|
|
8
|
+
* Each operation uses an explicit transaction and sets `app.current_user_id`
|
|
9
|
+
* as a transaction-local configuration variable. The RLS policy checks this
|
|
10
|
+
* variable to enforce that users can only access their own preferences.
|
|
11
|
+
*
|
|
12
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Deep merge two objects
|
|
16
|
+
* - Objects are recursively merged
|
|
17
|
+
* - Arrays are replaced (not merged)
|
|
18
|
+
* - Source values override target values
|
|
19
|
+
*/
|
|
20
|
+
export function deepMerge(target, source) {
|
|
21
|
+
const output = { ...target };
|
|
22
|
+
for (const key of Object.keys(source)) {
|
|
23
|
+
const sourceValue = source[key];
|
|
24
|
+
const targetValue = target[key];
|
|
25
|
+
// Skip undefined values in source
|
|
26
|
+
if (sourceValue === undefined) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
// If both are plain objects, merge recursively
|
|
30
|
+
if (sourceValue !== null &&
|
|
31
|
+
typeof sourceValue === 'object' &&
|
|
32
|
+
!Array.isArray(sourceValue) &&
|
|
33
|
+
targetValue !== null &&
|
|
34
|
+
typeof targetValue === 'object' &&
|
|
35
|
+
!Array.isArray(targetValue)) {
|
|
36
|
+
output[key] = deepMerge(targetValue, sourceValue);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// Otherwise, source overwrites target
|
|
40
|
+
output[key] = sourceValue;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return output;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Execute a function within an RLS-protected transaction
|
|
47
|
+
*
|
|
48
|
+
* This helper ensures that:
|
|
49
|
+
* 1. All queries run within the same transaction
|
|
50
|
+
* 2. The RLS context is set before any data access
|
|
51
|
+
* 3. The transaction is properly committed or rolled back
|
|
52
|
+
*
|
|
53
|
+
* @param pool PostgreSQL pool
|
|
54
|
+
* @param userId User ID to set as the RLS context
|
|
55
|
+
* @param callback Function to execute within the transaction
|
|
56
|
+
*/
|
|
57
|
+
async function withRLSContext(pool, userId, callback) {
|
|
58
|
+
const client = await pool.connect();
|
|
59
|
+
try {
|
|
60
|
+
await client.query('BEGIN');
|
|
61
|
+
// Set transaction-local user context for RLS
|
|
62
|
+
await client.query("SELECT set_config('app.current_user_id', $1, true)", [userId]);
|
|
63
|
+
const result = await callback(client);
|
|
64
|
+
await client.query('COMMIT');
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
await client.query('ROLLBACK');
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
finally {
|
|
72
|
+
client.release();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Create a PostgreSQL preferences store with RLS
|
|
77
|
+
*
|
|
78
|
+
* @param config Configuration including a pg Pool instance
|
|
79
|
+
* @returns PreferencesStore implementation
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* import { Pool } from 'pg';
|
|
84
|
+
* import { postgresPreferencesStore } from '@qwickapps/server';
|
|
85
|
+
*
|
|
86
|
+
* const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
|
87
|
+
* const store = postgresPreferencesStore({ pool });
|
|
88
|
+
*
|
|
89
|
+
* // Or with lazy initialization:
|
|
90
|
+
* const store = postgresPreferencesStore({ pool: () => getPostgres().getPool() });
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export function postgresPreferencesStore(config) {
|
|
94
|
+
const { pool: poolOrFn, tableName = 'user_preferences', schema = 'public', autoCreateTables = true, enableRLS = true, } = config;
|
|
95
|
+
// Helper to get pool (supports lazy initialization via function)
|
|
96
|
+
const getPool = () => {
|
|
97
|
+
const pool = typeof poolOrFn === 'function' ? poolOrFn() : poolOrFn;
|
|
98
|
+
if (!pool || typeof pool.query !== 'function') {
|
|
99
|
+
throw new Error('Invalid pool: must have query method');
|
|
100
|
+
}
|
|
101
|
+
return pool;
|
|
102
|
+
};
|
|
103
|
+
const tableFullName = `"${schema}"."${tableName}"`;
|
|
104
|
+
return {
|
|
105
|
+
name: 'postgres',
|
|
106
|
+
async initialize() {
|
|
107
|
+
if (!autoCreateTables)
|
|
108
|
+
return;
|
|
109
|
+
const pool = getPool();
|
|
110
|
+
// Create table with foreign key to users
|
|
111
|
+
await pool.query(`
|
|
112
|
+
CREATE TABLE IF NOT EXISTS ${tableFullName} (
|
|
113
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
114
|
+
user_id UUID NOT NULL REFERENCES "public"."users"(id) ON DELETE CASCADE,
|
|
115
|
+
preferences JSONB NOT NULL DEFAULT '{}',
|
|
116
|
+
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
117
|
+
updated_at TIMESTAMPTZ DEFAULT NOW(),
|
|
118
|
+
UNIQUE(user_id)
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
CREATE INDEX IF NOT EXISTS idx_${tableName}_user_id ON ${tableFullName}(user_id);
|
|
122
|
+
`);
|
|
123
|
+
// Enable RLS if configured
|
|
124
|
+
if (enableRLS) {
|
|
125
|
+
await pool.query(`
|
|
126
|
+
ALTER TABLE ${tableFullName} ENABLE ROW LEVEL SECURITY;
|
|
127
|
+
ALTER TABLE ${tableFullName} FORCE ROW LEVEL SECURITY;
|
|
128
|
+
`);
|
|
129
|
+
// Create or replace the RLS policy
|
|
130
|
+
// Drop existing policy first to avoid errors on re-initialization
|
|
131
|
+
await pool.query(`
|
|
132
|
+
DROP POLICY IF EXISTS "${tableName}_owner" ON ${tableFullName};
|
|
133
|
+
`);
|
|
134
|
+
// RLS policy with both USING (for SELECT/UPDATE/DELETE reads)
|
|
135
|
+
// and WITH CHECK (for INSERT/UPDATE writes) clauses
|
|
136
|
+
await pool.query(`
|
|
137
|
+
CREATE POLICY "${tableName}_owner" ON ${tableFullName}
|
|
138
|
+
FOR ALL
|
|
139
|
+
USING (user_id::text = current_setting('app.current_user_id', true))
|
|
140
|
+
WITH CHECK (user_id::text = current_setting('app.current_user_id', true));
|
|
141
|
+
`);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
async get(userId) {
|
|
145
|
+
return withRLSContext(getPool(), userId, async (client) => {
|
|
146
|
+
const result = await client.query(`SELECT preferences FROM ${tableFullName} WHERE user_id = $1`, [userId]);
|
|
147
|
+
if (result.rows.length === 0) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
return result.rows[0].preferences;
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
async update(userId, preferences) {
|
|
154
|
+
return withRLSContext(getPool(), userId, async (client) => {
|
|
155
|
+
// Get existing preferences within the same transaction
|
|
156
|
+
const existingResult = await client.query(`SELECT preferences FROM ${tableFullName} WHERE user_id = $1`, [userId]);
|
|
157
|
+
const existing = existingResult.rows.length > 0
|
|
158
|
+
? existingResult.rows[0].preferences
|
|
159
|
+
: null;
|
|
160
|
+
const merged = existing ? deepMerge(existing, preferences) : preferences;
|
|
161
|
+
// Upsert the merged preferences
|
|
162
|
+
await client.query(`INSERT INTO ${tableFullName} (user_id, preferences, updated_at)
|
|
163
|
+
VALUES ($1, $2, NOW())
|
|
164
|
+
ON CONFLICT (user_id) DO UPDATE SET
|
|
165
|
+
preferences = $2,
|
|
166
|
+
updated_at = NOW()`, [userId, JSON.stringify(merged)]);
|
|
167
|
+
return merged;
|
|
168
|
+
});
|
|
169
|
+
},
|
|
170
|
+
async delete(userId) {
|
|
171
|
+
return withRLSContext(getPool(), userId, async (client) => {
|
|
172
|
+
const result = await client.query(`DELETE FROM ${tableFullName} WHERE user_id = $1`, [userId]);
|
|
173
|
+
return (result.rowCount ?? 0) > 0;
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
async shutdown() {
|
|
177
|
+
// Pool is managed externally, nothing to do here
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=postgres-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-store.js","sourceRoot":"","sources":["../../../../src/plugins/preferences/stores/postgres-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAkBH;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CACvB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WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;gBAEzE,gCAAgC;gBAChC,MAAM,MAAM,CAAC,KAAK,CAChB,eAAe,aAAa;;;;gCAIN,EACtB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CACjC,CAAC;gBAEF,OAAO,MAAM,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,MAAc;YACzB,OAAO,cAAc,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;gBACxD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAC/B,eAAe,aAAa,qBAAqB,EACjD,CAAC,MAAM,CAAC,CACT,CAAC;gBAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,QAAQ;YACZ,iDAAiD;QACnD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preferences Plugin Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for user preferences management.
|
|
5
|
+
* Supports PostgreSQL with Row-Level Security (RLS) for data isolation.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* User preferences record in the database
|
|
11
|
+
*/
|
|
12
|
+
export interface UserPreferences {
|
|
13
|
+
/** Primary key - UUID */
|
|
14
|
+
id: string;
|
|
15
|
+
/** User ID (foreign key to users table) */
|
|
16
|
+
user_id: string;
|
|
17
|
+
/** Preferences as JSON object */
|
|
18
|
+
preferences: Record<string, unknown>;
|
|
19
|
+
/** When the preferences were created */
|
|
20
|
+
created_at: Date;
|
|
21
|
+
/** When the preferences were last updated */
|
|
22
|
+
updated_at: Date;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Preferences store interface - all storage backends must implement this
|
|
26
|
+
*/
|
|
27
|
+
export interface PreferencesStore {
|
|
28
|
+
/** Store name (e.g., 'postgres', 'memory') */
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* Initialize the store (create tables, RLS policies, etc.)
|
|
32
|
+
*/
|
|
33
|
+
initialize(): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Get preferences for a user
|
|
36
|
+
* Returns null if no preferences exist for the user
|
|
37
|
+
*/
|
|
38
|
+
get(userId: string): Promise<Record<string, unknown> | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Update preferences for a user (upsert with deep merge)
|
|
41
|
+
* Returns the merged preferences
|
|
42
|
+
*/
|
|
43
|
+
update(userId: string, preferences: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
44
|
+
/**
|
|
45
|
+
* Delete preferences for a user
|
|
46
|
+
* Returns true if preferences were deleted, false if none existed
|
|
47
|
+
*/
|
|
48
|
+
delete(userId: string): Promise<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* Shutdown the store
|
|
51
|
+
*/
|
|
52
|
+
shutdown(): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* PostgreSQL preferences store configuration
|
|
56
|
+
*/
|
|
57
|
+
export interface PostgresPreferencesStoreConfig {
|
|
58
|
+
/** PostgreSQL pool instance or a function that returns one (for lazy initialization) */
|
|
59
|
+
pool: unknown | (() => unknown);
|
|
60
|
+
/** Table name (default: 'user_preferences') */
|
|
61
|
+
tableName?: string;
|
|
62
|
+
/** Schema name (default: 'public') */
|
|
63
|
+
schema?: string;
|
|
64
|
+
/** Auto-create tables on init (default: true) */
|
|
65
|
+
autoCreateTables?: boolean;
|
|
66
|
+
/** Enable RLS (default: true) */
|
|
67
|
+
enableRLS?: boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Preferences API configuration
|
|
71
|
+
*/
|
|
72
|
+
export interface PreferencesApiConfig {
|
|
73
|
+
/** API route prefix (default: '/preferences') */
|
|
74
|
+
prefix?: string;
|
|
75
|
+
/** Enable API endpoints (default: true) */
|
|
76
|
+
enabled?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Preferences plugin configuration
|
|
80
|
+
*/
|
|
81
|
+
export interface PreferencesPluginConfig {
|
|
82
|
+
/** Preferences storage backend */
|
|
83
|
+
store: PreferencesStore;
|
|
84
|
+
/** Default preferences to merge with stored preferences on read */
|
|
85
|
+
defaults?: Record<string, unknown>;
|
|
86
|
+
/** API configuration */
|
|
87
|
+
api?: PreferencesApiConfig;
|
|
88
|
+
/** Enable debug logging */
|
|
89
|
+
debug?: boolean;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/preferences/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,wCAAwC;IACxC,UAAU,EAAE,IAAI,CAAC;IACjB,6CAA6C;IAC7C,UAAU,EAAE,IAAI,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5B;;;OAGG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IAE7D;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAE/F;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzC;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,wFAAwF;IACxF,IAAI,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC;IAChC,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iCAAiC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,kCAAkC;IAClC,KAAK,EAAE,gBAAgB,CAAC;IACxB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,wBAAwB;IACxB,GAAG,CAAC,EAAE,oBAAoB,CAAC;IAC3B,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preferences Plugin Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for user preferences management.
|
|
5
|
+
* Supports PostgreSQL with Row-Level Security (RLS) for data isolation.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plugins/preferences/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users-plugin.test.d.ts","sourceRoot":"","sources":["../../../../src/plugins/users/__tests__/users-plugin.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|