@qwickapps/server 1.4.0 → 1.5.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/CHANGELOG.md +507 -0
- package/README.md +9 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/plugins/bans/bans-plugin.d.ts.map +1 -1
- package/dist/plugins/bans/bans-plugin.js +12 -3
- package/dist/plugins/bans/bans-plugin.js.map +1 -1
- package/dist/plugins/devices/__tests__/devices-plugin.test.d.ts +11 -0
- package/dist/plugins/devices/__tests__/devices-plugin.test.d.ts.map +1 -0
- package/dist/plugins/devices/__tests__/devices-plugin.test.js +410 -0
- package/dist/plugins/devices/__tests__/devices-plugin.test.js.map +1 -0
- package/dist/plugins/devices/__tests__/token-utils.test.d.ts +7 -0
- package/dist/plugins/devices/__tests__/token-utils.test.d.ts.map +1 -0
- package/dist/plugins/devices/__tests__/token-utils.test.js +197 -0
- package/dist/plugins/devices/__tests__/token-utils.test.js.map +1 -0
- package/dist/plugins/devices/adapters/compute-adapter.d.ts +36 -0
- package/dist/plugins/devices/adapters/compute-adapter.d.ts.map +1 -0
- package/dist/plugins/devices/adapters/compute-adapter.js +100 -0
- package/dist/plugins/devices/adapters/compute-adapter.js.map +1 -0
- package/dist/plugins/devices/adapters/index.d.ts +12 -0
- package/dist/plugins/devices/adapters/index.d.ts.map +1 -0
- package/dist/plugins/devices/adapters/index.js +10 -0
- package/dist/plugins/devices/adapters/index.js.map +1 -0
- package/dist/plugins/devices/adapters/mobile-adapter.d.ts +41 -0
- package/dist/plugins/devices/adapters/mobile-adapter.d.ts.map +1 -0
- package/dist/plugins/devices/adapters/mobile-adapter.js +131 -0
- package/dist/plugins/devices/adapters/mobile-adapter.js.map +1 -0
- package/dist/plugins/devices/devices-plugin.d.ts +70 -0
- package/dist/plugins/devices/devices-plugin.d.ts.map +1 -0
- package/dist/plugins/devices/devices-plugin.js +453 -0
- package/dist/plugins/devices/devices-plugin.js.map +1 -0
- package/dist/plugins/devices/index.d.ts +18 -0
- package/dist/plugins/devices/index.d.ts.map +1 -0
- package/dist/plugins/devices/index.js +18 -0
- package/dist/plugins/devices/index.js.map +1 -0
- package/dist/plugins/devices/stores/index.d.ts +9 -0
- package/dist/plugins/devices/stores/index.d.ts.map +1 -0
- package/dist/plugins/devices/stores/index.js +9 -0
- package/dist/plugins/devices/stores/index.js.map +1 -0
- package/dist/plugins/devices/stores/postgres-store.d.ts +26 -0
- package/dist/plugins/devices/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/devices/stores/postgres-store.js +199 -0
- package/dist/plugins/devices/stores/postgres-store.js.map +1 -0
- package/dist/plugins/devices/token-utils.d.ts +100 -0
- package/dist/plugins/devices/token-utils.d.ts.map +1 -0
- package/dist/plugins/devices/token-utils.js +162 -0
- package/dist/plugins/devices/token-utils.js.map +1 -0
- package/dist/plugins/devices/types.d.ts +307 -0
- package/dist/plugins/devices/types.d.ts.map +1 -0
- package/dist/plugins/devices/types.js +10 -0
- package/dist/plugins/devices/types.js.map +1 -0
- package/dist/plugins/index.d.ts +14 -2
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +13 -1
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/notifications/__tests__/notifications-manager.test.d.ts +5 -0
- package/dist/plugins/notifications/__tests__/notifications-manager.test.d.ts.map +1 -0
- package/dist/plugins/notifications/__tests__/notifications-manager.test.js +470 -0
- package/dist/plugins/notifications/__tests__/notifications-manager.test.js.map +1 -0
- package/dist/plugins/notifications/index.d.ts +71 -0
- package/dist/plugins/notifications/index.d.ts.map +1 -0
- package/dist/plugins/notifications/index.js +72 -0
- package/dist/plugins/notifications/index.js.map +1 -0
- package/dist/plugins/notifications/notifications-manager.d.ts +182 -0
- package/dist/plugins/notifications/notifications-manager.d.ts.map +1 -0
- package/dist/plugins/notifications/notifications-manager.js +610 -0
- package/dist/plugins/notifications/notifications-manager.js.map +1 -0
- package/dist/plugins/notifications/notifications-plugin.d.ts +83 -0
- package/dist/plugins/notifications/notifications-plugin.d.ts.map +1 -0
- package/dist/plugins/notifications/notifications-plugin.js +337 -0
- package/dist/plugins/notifications/notifications-plugin.js.map +1 -0
- package/dist/plugins/notifications/types.d.ts +164 -0
- package/dist/plugins/notifications/types.d.ts.map +1 -0
- package/dist/plugins/notifications/types.js +9 -0
- package/dist/plugins/notifications/types.js.map +1 -0
- package/dist/plugins/parental/__tests__/parental-plugin.test.d.ts +12 -0
- package/dist/plugins/parental/__tests__/parental-plugin.test.d.ts.map +1 -0
- package/dist/plugins/parental/__tests__/parental-plugin.test.js +349 -0
- package/dist/plugins/parental/__tests__/parental-plugin.test.js.map +1 -0
- package/dist/plugins/parental/adapters/index.d.ts +8 -0
- package/dist/plugins/parental/adapters/index.d.ts.map +1 -0
- package/dist/plugins/parental/adapters/index.js +7 -0
- package/dist/plugins/parental/adapters/index.js.map +1 -0
- package/dist/plugins/parental/adapters/kids-adapter.d.ts +24 -0
- package/dist/plugins/parental/adapters/kids-adapter.d.ts.map +1 -0
- package/dist/plugins/parental/adapters/kids-adapter.js +174 -0
- package/dist/plugins/parental/adapters/kids-adapter.js.map +1 -0
- package/dist/plugins/parental/index.d.ts +14 -0
- package/dist/plugins/parental/index.d.ts.map +1 -0
- package/dist/plugins/parental/index.js +15 -0
- package/dist/plugins/parental/index.js.map +1 -0
- package/dist/plugins/parental/parental-plugin.d.ts +88 -0
- package/dist/plugins/parental/parental-plugin.d.ts.map +1 -0
- package/dist/plugins/parental/parental-plugin.js +666 -0
- package/dist/plugins/parental/parental-plugin.js.map +1 -0
- package/dist/plugins/parental/stores/index.d.ts +7 -0
- package/dist/plugins/parental/stores/index.d.ts.map +1 -0
- package/dist/plugins/parental/stores/index.js +7 -0
- package/dist/plugins/parental/stores/index.js.map +1 -0
- package/dist/plugins/parental/stores/postgres-store.d.ts +10 -0
- package/dist/plugins/parental/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/parental/stores/postgres-store.js +209 -0
- package/dist/plugins/parental/stores/postgres-store.js.map +1 -0
- package/dist/plugins/parental/types.d.ts +154 -0
- package/dist/plugins/parental/types.d.ts.map +1 -0
- package/dist/plugins/parental/types.js +10 -0
- package/dist/plugins/parental/types.js.map +1 -0
- package/dist/plugins/profiles/__tests__/profiles-plugin.test.d.ts +11 -0
- package/dist/plugins/profiles/__tests__/profiles-plugin.test.d.ts.map +1 -0
- package/dist/plugins/profiles/__tests__/profiles-plugin.test.js +243 -0
- package/dist/plugins/profiles/__tests__/profiles-plugin.test.js.map +1 -0
- package/dist/plugins/profiles/index.d.ts +12 -0
- package/dist/plugins/profiles/index.d.ts.map +1 -0
- package/dist/plugins/profiles/index.js +13 -0
- package/dist/plugins/profiles/index.js.map +1 -0
- package/dist/plugins/profiles/profiles-plugin.d.ts +71 -0
- package/dist/plugins/profiles/profiles-plugin.d.ts.map +1 -0
- package/dist/plugins/profiles/profiles-plugin.js +481 -0
- package/dist/plugins/profiles/profiles-plugin.js.map +1 -0
- package/dist/plugins/profiles/stores/index.d.ts +9 -0
- package/dist/plugins/profiles/stores/index.d.ts.map +1 -0
- package/dist/plugins/profiles/stores/index.js +9 -0
- package/dist/plugins/profiles/stores/index.js.map +1 -0
- package/dist/plugins/profiles/stores/postgres-store.d.ts +18 -0
- package/dist/plugins/profiles/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/profiles/stores/postgres-store.js +310 -0
- package/dist/plugins/profiles/stores/postgres-store.js.map +1 -0
- package/dist/plugins/profiles/types.d.ts +289 -0
- package/dist/plugins/profiles/types.d.ts.map +1 -0
- package/dist/plugins/profiles/types.js +10 -0
- package/dist/plugins/profiles/types.js.map +1 -0
- package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.d.ts +11 -0
- package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.d.ts.map +1 -0
- package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.js +305 -0
- package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.js.map +1 -0
- package/dist/plugins/subscriptions/index.d.ts +12 -0
- package/dist/plugins/subscriptions/index.d.ts.map +1 -0
- package/dist/plugins/subscriptions/index.js +13 -0
- package/dist/plugins/subscriptions/index.js.map +1 -0
- package/dist/plugins/subscriptions/stores/index.d.ts +9 -0
- package/dist/plugins/subscriptions/stores/index.d.ts.map +1 -0
- package/dist/plugins/subscriptions/stores/index.js +9 -0
- package/dist/plugins/subscriptions/stores/index.js.map +1 -0
- package/dist/plugins/subscriptions/stores/postgres-store.d.ts +14 -0
- package/dist/plugins/subscriptions/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/subscriptions/stores/postgres-store.js +359 -0
- package/dist/plugins/subscriptions/stores/postgres-store.js.map +1 -0
- package/dist/plugins/subscriptions/subscriptions-plugin.d.ts +82 -0
- package/dist/plugins/subscriptions/subscriptions-plugin.d.ts.map +1 -0
- package/dist/plugins/subscriptions/subscriptions-plugin.js +449 -0
- package/dist/plugins/subscriptions/subscriptions-plugin.js.map +1 -0
- package/dist/plugins/subscriptions/types.d.ts +308 -0
- package/dist/plugins/subscriptions/types.d.ts.map +1 -0
- package/dist/plugins/subscriptions/types.js +10 -0
- package/dist/plugins/subscriptions/types.js.map +1 -0
- package/dist/plugins/usage/__tests__/usage-plugin.test.d.ts +11 -0
- package/dist/plugins/usage/__tests__/usage-plugin.test.d.ts.map +1 -0
- package/dist/plugins/usage/__tests__/usage-plugin.test.js +218 -0
- package/dist/plugins/usage/__tests__/usage-plugin.test.js.map +1 -0
- package/dist/plugins/usage/index.d.ts +12 -0
- package/dist/plugins/usage/index.d.ts.map +1 -0
- package/dist/plugins/usage/index.js +13 -0
- package/dist/plugins/usage/index.js.map +1 -0
- package/dist/plugins/usage/stores/index.d.ts +9 -0
- package/dist/plugins/usage/stores/index.d.ts.map +1 -0
- package/dist/plugins/usage/stores/index.js +9 -0
- package/dist/plugins/usage/stores/index.js.map +1 -0
- package/dist/plugins/usage/stores/postgres-store.d.ts +14 -0
- package/dist/plugins/usage/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/usage/stores/postgres-store.js +146 -0
- package/dist/plugins/usage/stores/postgres-store.js.map +1 -0
- package/dist/plugins/usage/types.d.ts +195 -0
- package/dist/plugins/usage/types.d.ts.map +1 -0
- package/dist/plugins/usage/types.js +10 -0
- package/dist/plugins/usage/types.js.map +1 -0
- package/dist/plugins/usage/usage-plugin.d.ts +51 -0
- package/dist/plugins/usage/usage-plugin.d.ts.map +1 -0
- package/dist/plugins/usage/usage-plugin.js +412 -0
- package/dist/plugins/usage/usage-plugin.js.map +1 -0
- package/dist/plugins/users/__tests__/postgres-store.test.d.ts +10 -0
- package/dist/plugins/users/__tests__/postgres-store.test.d.ts.map +1 -0
- package/dist/plugins/users/__tests__/postgres-store.test.js +229 -0
- package/dist/plugins/users/__tests__/postgres-store.test.js.map +1 -0
- package/dist/plugins/users/__tests__/users-plugin.test.js +3 -0
- package/dist/plugins/users/__tests__/users-plugin.test.js.map +1 -1
- 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/stores/postgres-store.d.ts.map +1 -1
- package/dist/plugins/users/stores/postgres-store.js +76 -0
- package/dist/plugins/users/stores/postgres-store.js.map +1 -1
- package/dist/plugins/users/types.d.ts +74 -6
- package/dist/plugins/users/types.d.ts.map +1 -1
- package/dist/plugins/users/users-plugin.d.ts +15 -1
- package/dist/plugins/users/users-plugin.d.ts.map +1 -1
- package/dist/plugins/users/users-plugin.js +29 -0
- package/dist/plugins/users/users-plugin.js.map +1 -1
- package/dist-ui/assets/index-CynOqPkb.js +469 -0
- package/dist-ui/assets/index-CynOqPkb.js.map +1 -0
- package/dist-ui/index.html +1 -1
- package/dist-ui-lib/api/controlPanelApi.d.ts +46 -0
- package/dist-ui-lib/components/StatCard.d.ts +16 -0
- package/dist-ui-lib/dashboard/widgets/NotificationsStatsWidget.d.ts +12 -0
- package/dist-ui-lib/dashboard/widgets/index.d.ts +1 -0
- package/dist-ui-lib/index.js +1822 -1611
- package/dist-ui-lib/index.js.map +1 -1
- package/dist-ui-lib/pages/NotificationsPage.d.ts +9 -0
- package/dist-ui-lib/utils/formatters.d.ts +19 -0
- package/package.json +3 -2
- package/src/index.ts +178 -0
- package/src/plugins/bans/bans-plugin.ts +15 -3
- package/src/plugins/devices/__tests__/devices-plugin.test.ts +551 -0
- package/src/plugins/devices/__tests__/token-utils.test.ts +264 -0
- package/src/plugins/devices/adapters/compute-adapter.ts +139 -0
- package/src/plugins/devices/adapters/index.ts +13 -0
- package/src/plugins/devices/adapters/mobile-adapter.ts +179 -0
- package/src/plugins/devices/devices-plugin.ts +538 -0
- package/src/plugins/devices/index.ts +69 -0
- package/src/plugins/devices/stores/index.ts +9 -0
- package/src/plugins/devices/stores/postgres-store.ts +304 -0
- package/src/plugins/devices/token-utils.ts +213 -0
- package/src/plugins/devices/types.ts +351 -0
- package/src/plugins/index.ts +218 -0
- package/src/plugins/notifications/__tests__/notifications-manager.test.ts +637 -0
- package/src/plugins/notifications/index.ts +91 -0
- package/src/plugins/notifications/notifications-manager.ts +773 -0
- package/src/plugins/notifications/notifications-plugin.ts +398 -0
- package/src/plugins/notifications/types.ts +207 -0
- package/src/plugins/parental/__tests__/parental-plugin.test.ts +465 -0
- package/src/plugins/parental/adapters/index.ts +8 -0
- package/src/plugins/parental/adapters/kids-adapter.ts +206 -0
- package/src/plugins/parental/index.ts +55 -0
- package/src/plugins/parental/parental-plugin.ts +759 -0
- package/src/plugins/parental/stores/index.ts +7 -0
- package/src/plugins/parental/stores/postgres-store.ts +304 -0
- package/src/plugins/parental/types.ts +180 -0
- package/src/plugins/profiles/__tests__/profiles-plugin.test.ts +321 -0
- package/src/plugins/profiles/index.ts +49 -0
- package/src/plugins/profiles/profiles-plugin.ts +546 -0
- package/src/plugins/profiles/stores/index.ts +9 -0
- package/src/plugins/profiles/stores/postgres-store.ts +439 -0
- package/src/plugins/profiles/types.ts +338 -0
- package/src/plugins/subscriptions/__tests__/subscriptions-plugin.test.ts +404 -0
- package/src/plugins/subscriptions/index.ts +51 -0
- package/src/plugins/subscriptions/stores/index.ts +9 -0
- package/src/plugins/subscriptions/stores/postgres-store.ts +482 -0
- package/src/plugins/subscriptions/subscriptions-plugin.ts +530 -0
- package/src/plugins/subscriptions/types.ts +355 -0
- package/src/plugins/usage/__tests__/usage-plugin.test.ts +288 -0
- package/src/plugins/usage/index.ts +39 -0
- package/src/plugins/usage/stores/index.ts +9 -0
- package/src/plugins/usage/stores/postgres-store.ts +213 -0
- package/src/plugins/usage/types.ts +222 -0
- package/src/plugins/usage/usage-plugin.ts +484 -0
- package/src/plugins/users/__tests__/postgres-store.test.ts +326 -0
- package/src/plugins/users/__tests__/users-plugin.test.ts +3 -0
- package/src/plugins/users/index.ts +6 -0
- package/src/plugins/users/stores/postgres-store.ts +104 -0
- package/src/plugins/users/types.ts +82 -6
- package/src/plugins/users/users-plugin.ts +37 -0
- package/ui/src/App.tsx +5 -1
- package/ui/src/api/controlPanelApi.ts +103 -6
- package/ui/src/components/StatCard.tsx +58 -0
- package/ui/src/dashboard/builtInWidgets.tsx +3 -1
- package/ui/src/dashboard/widgets/NotificationsStatsWidget.tsx +167 -0
- package/ui/src/dashboard/widgets/index.ts +1 -0
- package/ui/src/pages/NotificationsPage.tsx +417 -0
- package/ui/src/utils/formatters.ts +33 -0
- package/dist-ui/assets/index-D7DoZ9rL.js +0 -478
- package/dist-ui/assets/index-D7DoZ9rL.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to @qwickapps/server will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.5.1] - 2025-12-18
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **npm Package** - Include CHANGELOG.md in published package
|
|
13
|
+
- **README** - Add "What's New" section highlighting v1.5.0 features
|
|
14
|
+
- **Input Validation** - `getByIdentifier()` now throws if no identifiers provided
|
|
15
|
+
- **Zero-value IDs** - Fixed `wp_user_id` and `keap_contact_id` to allow 0 as valid identifier
|
|
16
|
+
- **Memory Leak** - Fixed potential memory leak in NotificationsPage component
|
|
17
|
+
- **Audit Logging** - Disconnect actions now log admin user info (userId, email, IP)
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- **Unit Tests** - Comprehensive tests for postgres store methods (`getByIdentifier`, `linkIdentifiers`, `getByIds`)
|
|
22
|
+
|
|
23
|
+
## [1.5.0] - 2025-12-18
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- **Notifications Plugin UI** - Stats widget and management UI for notifications (#484)
|
|
28
|
+
- `NotificationsStatsWidget` - Dashboard widget showing notification statistics
|
|
29
|
+
- `NotificationsPage` - Full management UI for viewing and managing notifications
|
|
30
|
+
- `StatCard` component - Reusable statistics display component
|
|
31
|
+
- `formatters` utility - Number and date formatting helpers
|
|
32
|
+
|
|
33
|
+
- **Users Plugin Enhancements** - Improved user search and ban management (#491)
|
|
34
|
+
- Enhanced search functionality in Control Panel users page
|
|
35
|
+
- Search users by email, name, or external ID
|
|
36
|
+
- Ban management directly from user list with ban/unban actions
|
|
37
|
+
- Updated `controlPanelApi` with expanded user management endpoints
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- **Profile Sync** - Multi-identifier lookup for Auth0 profile sync (#492)
|
|
42
|
+
- Improved user matching with multiple identifier support
|
|
43
|
+
|
|
44
|
+
## [1.4.0] - 2025-12-16
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
|
|
48
|
+
- **Rate Limit Plugin** (`createRateLimitPlugin`) - API rate limiting with multiple strategies (#401)
|
|
49
|
+
- Three rate limiting strategies: sliding window (default), fixed window, token bucket
|
|
50
|
+
- PostgreSQL persistence with Row-Level Security (RLS) for multi-tenant isolation
|
|
51
|
+
- Redis caching with in-memory fallback (via cache plugin)
|
|
52
|
+
- Express middleware (`rateLimitMiddleware`) for automatic enforcement
|
|
53
|
+
- Programmatic API: `isLimited`, `checkLimit`, `incrementLimit`, `getRemainingRequests`, `clearLimit`
|
|
54
|
+
- Standard rate limit headers: `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset`, `Retry-After`
|
|
55
|
+
- Auto-cleanup of expired limits
|
|
56
|
+
- Configurable scopes: user, tenant, IP
|
|
57
|
+
- **Environment Config** (`createRateLimitPluginFromEnv`) for zero-config setup via env vars
|
|
58
|
+
- **Runtime Config UI** - Control Panel page for live configuration changes
|
|
59
|
+
- Edit window size, max requests, strategy at runtime
|
|
60
|
+
- Toggle cleanup job on/off
|
|
61
|
+
- View store and cache status
|
|
62
|
+
- **Config API** (`GET/PUT /api/rate-limit/config`) for programmatic runtime updates
|
|
63
|
+
- **PostgreSQL Store** (`postgresRateLimitStore`) with RLS policies
|
|
64
|
+
- **Cache Store** (`createRateLimitCache`) with Redis/memory support
|
|
65
|
+
- Status API endpoints: `GET /rate-limit/status`, `DELETE /rate-limit/clear/:key`
|
|
66
|
+
- New types: `RateLimitPluginConfig`, `LimitStatus`, `RateLimitMiddlewareOptions`, `RateLimitEnvPluginOptions`
|
|
67
|
+
|
|
68
|
+
### Fixed
|
|
69
|
+
|
|
70
|
+
- **Supabase Adapter TypeScript Error** - Fix build failure with `response.json()` returning `unknown`
|
|
71
|
+
- Added `SupabaseUserResponse` interface for type-safe Supabase API responses
|
|
72
|
+
- Node.js fetch types (`undici-types`) correctly return `Promise<unknown>` from `json()`
|
|
73
|
+
- This caused TS18046 errors when accessing properties on the response
|
|
74
|
+
- Fixes GitHub Actions publish workflow failure
|
|
75
|
+
|
|
76
|
+
### Added
|
|
77
|
+
|
|
78
|
+
- **Auth Plugin Runtime Configuration** - Control Panel UI for auth config with hot-reload (#394)
|
|
79
|
+
- Editable configuration forms for all auth providers (Auth0, Supabase, SuperTokens, Basic)
|
|
80
|
+
- PostgreSQL-backed config store with `pg_notify` for cross-instance sync
|
|
81
|
+
- Adapter wrapper pattern enables hot-reload without server restart
|
|
82
|
+
- Test connection feature validates provider before saving
|
|
83
|
+
- API endpoints: `PUT /api/auth/config`, `DELETE /api/auth/config`, `POST /api/auth/test-provider`
|
|
84
|
+
- New exports: `postgresAuthConfigStore()`, `setAuthConfigStore()`, `createAdapterWrapper()`, `getAdapterWrapper()`
|
|
85
|
+
- New types: `RuntimeAuthConfig`, `UpdateAuthConfigRequest`, `TestProviderRequest`, `TestProviderResponse`, `AuthConfigStore`, `PostgresAuthConfigStoreConfig`
|
|
86
|
+
- Social providers panel for SuperTokens (Google, GitHub, Apple)
|
|
87
|
+
- Reset to environment variables functionality
|
|
88
|
+
- SQL injection protection with identifier validation
|
|
89
|
+
- URL validation for SSRF protection in test connections
|
|
90
|
+
- Exponential backoff for pg_notify reconnection (1s → 60s max)
|
|
91
|
+
- **Note**: Hot-reload swaps `isAuthenticated/getUser` methods immediately; Express middleware routes (e.g., OAuth callbacks) require server restart to fully apply
|
|
92
|
+
|
|
93
|
+
- **Auth Plugin Environment Configuration** - Zero-code auth setup via environment variables (#393)
|
|
94
|
+
- New `createAuthPluginFromEnv()` factory function
|
|
95
|
+
- Supports ALL 4 adapters: Auth0, Supabase, Supertokens, Basic
|
|
96
|
+
- Plugin states: disabled (no config), enabled (valid config), error (invalid config)
|
|
97
|
+
- Clear error messages listing missing environment variables
|
|
98
|
+
- Control Panel Auth page showing configuration status
|
|
99
|
+
- `getAuthStatus()` function to check current auth state
|
|
100
|
+
- API endpoints: `GET /api/auth/config/status`, `GET /api/auth/config`
|
|
101
|
+
- New types: `AuthPluginState`, `AuthEnvPluginOptions`, `AuthConfigStatus`
|
|
102
|
+
- Comprehensive env var support (30+ variables across all adapters)
|
|
103
|
+
- Secrets automatically masked in status responses
|
|
104
|
+
|
|
105
|
+
- **Supertokens Auth Adapter** - Self-hosted authentication with Supertokens (#392)
|
|
106
|
+
- Supports email/password authentication via EmailPassword recipe
|
|
107
|
+
- Supports social logins (Google, Apple, GitHub) via ThirdParty recipe
|
|
108
|
+
- Uses Supertokens' native session management (HTTP-only cookies)
|
|
109
|
+
- Lazy initialization - doesn't require supertokens-node unless used
|
|
110
|
+
- Configurable options: enable/disable email/password, custom API paths
|
|
111
|
+
- Integrates with existing `requireAuth()` middleware
|
|
112
|
+
- New types: `SupertokensAdapterConfig`
|
|
113
|
+
- Requires `supertokens-node` v20+ as optional peer dependency
|
|
114
|
+
|
|
115
|
+
- **Users Plugin: User Info API** - Comprehensive user information aggregation (#352)
|
|
116
|
+
- `GET /api/users/:id/info` - Get comprehensive user info from all loaded plugins
|
|
117
|
+
- `POST /api/users/sync` - Find or create user and return full info (for Auth0/OAuth triggers)
|
|
118
|
+
- `buildUserInfo()` helper aggregates data in parallel from:
|
|
119
|
+
- Entitlements plugin (user's entitlements)
|
|
120
|
+
- Preferences plugin (user's preferences)
|
|
121
|
+
- Bans plugin (active ban status)
|
|
122
|
+
- Graceful degradation when plugins are not loaded
|
|
123
|
+
- Error resilience - partial failures don't break the entire request
|
|
124
|
+
- New types: `UserInfo`, `UserSyncInput`
|
|
125
|
+
|
|
126
|
+
- **Preferences Plugin** (`createPreferencesPlugin`) - User preferences management with PostgreSQL RLS (#349)
|
|
127
|
+
- Row-Level Security (RLS) for database-level data isolation
|
|
128
|
+
- Foreign key to users table with `ON DELETE CASCADE`
|
|
129
|
+
- Transaction-safe RLS context setting for connection pooling
|
|
130
|
+
- Deep merge updates (preserve nested objects on partial updates)
|
|
131
|
+
- Configurable default preferences
|
|
132
|
+
- Input validation (100KB size limit, 10-level nesting depth)
|
|
133
|
+
- **PostgreSQL Store** (`postgresPreferencesStore`)
|
|
134
|
+
- Creates `user_preferences` table with RLS policies
|
|
135
|
+
- `WITH CHECK` clause for complete RLS protection on writes
|
|
136
|
+
- **REST API endpoints**:
|
|
137
|
+
- `GET /api/preferences` - Get current user's preferences (merged with defaults)
|
|
138
|
+
- `PUT /api/preferences` - Update preferences (deep merge)
|
|
139
|
+
- `DELETE /api/preferences` - Reset to defaults
|
|
140
|
+
- **Helper functions**: `getPreferences()`, `updatePreferences()`, `deletePreferences()`, `getDefaultPreferences()`
|
|
141
|
+
- **Utility**: `deepMerge()` function exported for custom merge operations
|
|
142
|
+
|
|
143
|
+
### Changed
|
|
144
|
+
|
|
145
|
+
- **Logo Configuration**: Consolidated redundant logo properties into single `logoIconUrl` (fixes #336)
|
|
146
|
+
- Replaced `GatewayConfig.logoUrl` with `logoIconUrl`
|
|
147
|
+
- Removed `ControlPanelConfig.branding.logo` (was unused by React UI)
|
|
148
|
+
- Added `ControlPanelConfig.logoIconUrl` for custom logo icons
|
|
149
|
+
- React UI now renders custom logo when `logoIconUrl` is provided in `/api/info`
|
|
150
|
+
- **BREAKING**: Migrate from `logoUrl` to `logoIconUrl` in gateway configs
|
|
151
|
+
|
|
152
|
+
### Added
|
|
153
|
+
|
|
154
|
+
- **Plugins Overview Page** in Control Panel UI (closes #346)
|
|
155
|
+
- New core built-in page at `/plugins` showing all registered plugins
|
|
156
|
+
- Plugin list with status badges (active/stopped/error/starting)
|
|
157
|
+
- Expandable details showing plugin contributions (routes, menu items, pages, widgets)
|
|
158
|
+
- Error display for plugins in error state
|
|
159
|
+
- New `ConfigContribution` type for plugins to provide custom settings UI
|
|
160
|
+
- `GET /api/plugins/:id` endpoint for detailed plugin info
|
|
161
|
+
- Enhanced `GET /api/plugins` with contribution counts
|
|
162
|
+
- `addConfigComponent()` and `getPluginContributions()` methods on PluginRegistry
|
|
163
|
+
|
|
164
|
+
- **Cache Plugin**: `scanKeys()` method using Redis SCAN for non-blocking key iteration (closes #258)
|
|
165
|
+
- Cursor-based iteration prevents blocking Redis on large datasets
|
|
166
|
+
- Accepts optional `count` parameter for batch size hints
|
|
167
|
+
- Deprecated `keys()` method in favor of `scanKeys()` for production use
|
|
168
|
+
|
|
169
|
+
## [1.3.0] - 2025-12-10
|
|
170
|
+
|
|
171
|
+
### Added
|
|
172
|
+
|
|
173
|
+
- **Entitlements Plugin** (`createEntitlementsPlugin`)
|
|
174
|
+
- Pluggable entitlement source with adapter pattern
|
|
175
|
+
- **In-Memory Source** for demo/testing
|
|
176
|
+
- **PostgreSQL Source** (`postgresEntitlementSource`) for production
|
|
177
|
+
- REST API endpoints:
|
|
178
|
+
- `GET /api/entitlements/:email` - Get user entitlements
|
|
179
|
+
- `GET /api/entitlements/:email/check/:entitlement` - Check specific entitlement
|
|
180
|
+
- `POST /api/entitlements/:email/refresh` - Force cache refresh
|
|
181
|
+
- `GET /api/entitlements/available` - List all available entitlements
|
|
182
|
+
- `POST /api/entitlements/:email` - Grant entitlement (writable sources)
|
|
183
|
+
- `DELETE /api/entitlements/:email/:entitlement` - Revoke entitlement
|
|
184
|
+
- Helper functions: `getEntitlements()`, `hasEntitlement()`, `hasAnyEntitlement()`, `hasAllEntitlements()`
|
|
185
|
+
- Dashboard widget showing entitlement statistics
|
|
186
|
+
|
|
187
|
+
- **Entitlements Page** in Control Panel UI
|
|
188
|
+
- View all available entitlements with categories
|
|
189
|
+
- Search and filter entitlements
|
|
190
|
+
- Add/edit/delete entitlements (writable sources)
|
|
191
|
+
- View users with specific entitlements
|
|
192
|
+
|
|
193
|
+
- **Users Page** in Control Panel UI
|
|
194
|
+
- View all users with entitlement counts
|
|
195
|
+
- Lookup user entitlements dialog
|
|
196
|
+
- Grant/revoke entitlements from user view
|
|
197
|
+
- Ban/unban users integration
|
|
198
|
+
|
|
199
|
+
- **Bans Plugin** (`createBansPlugin`)
|
|
200
|
+
- Separated ban management from Users plugin
|
|
201
|
+
- Standalone ban store interface
|
|
202
|
+
- REST API endpoints for ban management
|
|
203
|
+
|
|
204
|
+
- **Gateway Maintenance Mode**
|
|
205
|
+
- Configurable maintenance pages for mounted apps
|
|
206
|
+
- `MaintenanceConfig`: enabled, title, message, expectedBackAt, contactUrl, bypassPaths
|
|
207
|
+
- Modern responsive design with dark mode support
|
|
208
|
+
- ETA countdown (ISO date, relative time like "2 hours", or "soon")
|
|
209
|
+
- Bypass paths for health checks during maintenance
|
|
210
|
+
|
|
211
|
+
- **Gateway Service Unavailable Pages**
|
|
212
|
+
- Automatic fallback page when proxied services are unreachable
|
|
213
|
+
- `FallbackConfig`: title, message, showRetry, autoRefresh
|
|
214
|
+
- Auto-refresh countdown (default 30 seconds)
|
|
215
|
+
- Smart content negotiation (JSON for API requests, HTML for browsers)
|
|
216
|
+
|
|
217
|
+
- **Auth Plugin** (`createAuthPlugin`)
|
|
218
|
+
- Pluggable authentication with adapter pattern
|
|
219
|
+
- **Auth0 Adapter** (`auth0Adapter`)
|
|
220
|
+
- OIDC authentication via express-openid-connect
|
|
221
|
+
- Role-based access control (RBAC) support
|
|
222
|
+
- Domain whitelist filtering
|
|
223
|
+
- Access token exposure for downstream API calls
|
|
224
|
+
- **Basic Adapter** (`basicAdapter`)
|
|
225
|
+
- HTTP Basic authentication
|
|
226
|
+
- Configurable realm
|
|
227
|
+
- **Supabase Adapter** (`supabaseAdapter`)
|
|
228
|
+
- JWT token validation
|
|
229
|
+
- User caching for performance
|
|
230
|
+
- Fallback adapter chain support
|
|
231
|
+
- Helper functions: `isAuthenticated()`, `getAuthenticatedUser()`, `getAccessToken()`
|
|
232
|
+
- Middleware helpers: `requireAuth()`, `requireRoles()`, `requireAnyRole()`
|
|
233
|
+
|
|
234
|
+
- **Users Plugin** (`createUsersPlugin`)
|
|
235
|
+
- Storage-agnostic user management with UserStore interface
|
|
236
|
+
- **PostgreSQL User Store** (`postgresUserStore`)
|
|
237
|
+
- User CRUD operations
|
|
238
|
+
- Search with pagination and filtering
|
|
239
|
+
- External ID mapping for provider sync
|
|
240
|
+
- **Ban Management** (user-id keyed)
|
|
241
|
+
- Permanent and temporary bans
|
|
242
|
+
- Ban history tracking
|
|
243
|
+
- Automatic cleanup of expired bans
|
|
244
|
+
- Callbacks: `onBan`, `onUnban`
|
|
245
|
+
- **Email Ban Management** (email-keyed, for auth-only scenarios)
|
|
246
|
+
- Ban users by email without storing users locally
|
|
247
|
+
- Helper functions: `isEmailBanned()`, `getEmailBan()`, `banEmail()`, `unbanEmail()`
|
|
248
|
+
- REST API endpoints for email bans
|
|
249
|
+
- REST API endpoints:
|
|
250
|
+
- `GET/POST /api/users` - List/create users
|
|
251
|
+
- `GET/PUT/DELETE /api/users/:id` - Get/update/delete user
|
|
252
|
+
- `GET /api/users/bans` - List active bans
|
|
253
|
+
- `GET/POST/DELETE /api/users/:id/ban` - Manage user bans
|
|
254
|
+
- `GET /api/users/email-bans` - List active email bans
|
|
255
|
+
- `GET/POST /api/users/email-bans/:email` - Get/create email ban
|
|
256
|
+
- `DELETE /api/users/email-bans/:email` - Remove email ban
|
|
257
|
+
|
|
258
|
+
- **Plugin Registry** (`PluginRegistry`)
|
|
259
|
+
- New centralized plugin registration system replacing PluginManager
|
|
260
|
+
- Cleaner API for plugin lifecycle management
|
|
261
|
+
- Better type safety for plugin metadata and dependencies
|
|
262
|
+
|
|
263
|
+
- **Dashboard Widget System** for Control Panel UI
|
|
264
|
+
- `DashboardWidgetProvider` context for managing widgets
|
|
265
|
+
- `DashboardWidget` interface for creating custom widgets
|
|
266
|
+
- Built-in widgets: Service Status, Quick Actions
|
|
267
|
+
- Consumer apps can register custom dashboard widgets
|
|
268
|
+
|
|
269
|
+
- **System Page** in Control Panel UI
|
|
270
|
+
- Displays server version and system information
|
|
271
|
+
- Shows plugin status and configuration
|
|
272
|
+
|
|
273
|
+
- **UI Library Export** (`@qwickapps/server/ui`)
|
|
274
|
+
- `ControlPanelApp` component for building admin UIs
|
|
275
|
+
- Shared dashboard components
|
|
276
|
+
- Vite library build configuration
|
|
277
|
+
|
|
278
|
+
### Changed
|
|
279
|
+
|
|
280
|
+
- **ControlPanelApp Navigation**: Routes now use relative paths (e.g., `/health` instead of `${basePath}/health`)
|
|
281
|
+
- Works correctly with React Router's `basename` prop
|
|
282
|
+
- Integrates with `@qwickapps/react-framework` NavigationContext
|
|
283
|
+
|
|
284
|
+
- **Control Panel Base Path Injection**
|
|
285
|
+
- Server now injects `window.__APP_BASE_PATH__` into HTML for reliable base path detection
|
|
286
|
+
- Simplified client-side detection from ~50 lines to single global read
|
|
287
|
+
- Works seamlessly behind proxies with X-Forwarded-Prefix support
|
|
288
|
+
|
|
289
|
+
- **Control Panel Asset Serving**
|
|
290
|
+
- Dynamic asset path rewriting for non-root mount paths
|
|
291
|
+
- Apps mounted at subpaths (e.g., `/cpanel`) now work without rebuilding UI
|
|
292
|
+
|
|
293
|
+
- **Demo Server**
|
|
294
|
+
- Added `demo-gateway.ts` example with frontend app at `/` and cpanel at `/cpanel`
|
|
295
|
+
- Uses in-memory stores for Users, Bans, and Entitlements
|
|
296
|
+
|
|
297
|
+
### Fixed
|
|
298
|
+
|
|
299
|
+
- Fixed `DashboardWidgetProvider` not wrapping app in built-in UI
|
|
300
|
+
|
|
301
|
+
### Removed
|
|
302
|
+
|
|
303
|
+
- **PluginManager** - Replaced by simpler PluginRegistry
|
|
304
|
+
|
|
305
|
+
## [1.2.0] - 2025-12-08
|
|
306
|
+
|
|
307
|
+
### Changed
|
|
308
|
+
|
|
309
|
+
- **Reduced Log Verbosity**
|
|
310
|
+
- Moved verbose startup messages to debug level
|
|
311
|
+
- Gateway now logs single concise INFO line: `{productName} started on port {port} (auth: {type})`
|
|
312
|
+
- Detailed route, port, and configuration info logged at debug level
|
|
313
|
+
- Control panel start/stop messages moved to debug level
|
|
314
|
+
|
|
315
|
+
### Notes
|
|
316
|
+
|
|
317
|
+
This release includes all features from 1.1.7-1.1.9 (PostgreSQL plugin, Cache plugin, Route Guards, Gateway enhancements) which were not published to npm. If upgrading from 1.1.6, see those version entries for full feature list.
|
|
318
|
+
|
|
319
|
+
## [1.1.9] - 2025-12-07
|
|
320
|
+
|
|
321
|
+
### Added
|
|
322
|
+
|
|
323
|
+
- **Configurable Logo for Landing Page**
|
|
324
|
+
- New `logoUrl` option in `GatewayConfig` to specify a custom product logo
|
|
325
|
+
- When set, the landing page displays the custom logo instead of the default icon
|
|
326
|
+
- Supports SVG, PNG, and other image formats
|
|
327
|
+
|
|
328
|
+
### Changed
|
|
329
|
+
|
|
330
|
+
- **Default Landing Page**
|
|
331
|
+
- Logo container now supports both custom images and the default SVG icon
|
|
332
|
+
- Added CSS classes `.logo.custom` and `.logo.default` for differentiated styling
|
|
333
|
+
|
|
334
|
+
## [1.1.8] - 2025-12-07
|
|
335
|
+
|
|
336
|
+
### Changed
|
|
337
|
+
|
|
338
|
+
- **Default Landing Page**
|
|
339
|
+
- Removed "Health Check" button (health can be checked via control panel)
|
|
340
|
+
- Updated footer to "Powered by QwickApps Server - Version x.y.z"
|
|
341
|
+
- "QwickApps Server" links to https://qwickapps.com
|
|
342
|
+
- Version links to https://github.com/qwickapps/server
|
|
343
|
+
|
|
344
|
+
## [1.1.7] - 2025-12-07
|
|
345
|
+
|
|
346
|
+
### Added
|
|
347
|
+
|
|
348
|
+
- **PostgreSQL Plugin** (`createPostgresPlugin`)
|
|
349
|
+
- Connection pooling with configurable max connections
|
|
350
|
+
- Transaction support with `withTransaction()` callback
|
|
351
|
+
- Built-in health checks with configurable intervals
|
|
352
|
+
- Named instances for multi-database support
|
|
353
|
+
- Exports: `getPostgres()`, `hasPostgres()`
|
|
354
|
+
|
|
355
|
+
- **Cache Plugin** (`createCachePlugin`)
|
|
356
|
+
- Redis-based caching using ioredis
|
|
357
|
+
- Key prefixing and configurable default TTL
|
|
358
|
+
- Full cache API: `get`, `set`, `delete`, `deletePattern`, `keys`, `flush`, `getStats`
|
|
359
|
+
- Built-in health checks
|
|
360
|
+
- Exports: `getCache()`, `hasCache()`
|
|
361
|
+
|
|
362
|
+
### Changed
|
|
363
|
+
|
|
364
|
+
- Renamed internal database plugin to postgres-plugin for clarity
|
|
365
|
+
- Added backward compatibility aliases (`createDatabasePlugin`, `getDatabase`)
|
|
366
|
+
|
|
367
|
+
## [1.1.6] - 2025-12-07
|
|
368
|
+
|
|
369
|
+
### Added
|
|
370
|
+
|
|
371
|
+
- **Configurable Mount Paths**
|
|
372
|
+
- Control panel now mounts at `/cpanel` by default (configurable via `mountPath`)
|
|
373
|
+
- Root path (`/`) reserved for frontend applications
|
|
374
|
+
- API routes available at `{mountPath}/api/` (e.g., `/cpanel/api/health`)
|
|
375
|
+
|
|
376
|
+
- **Route Guards System**
|
|
377
|
+
- New unified guard system replaces old auth configuration
|
|
378
|
+
- `BasicAuthGuardConfig` - HTTP Basic authentication
|
|
379
|
+
- `SupabaseAuthGuardConfig` - Supabase JWT token validation
|
|
380
|
+
- `Auth0GuardConfig` - Auth0 OpenID Connect integration
|
|
381
|
+
- `createRouteGuard()` factory function
|
|
382
|
+
- `isAuthenticated()` and `getAuthenticatedUser()` helper functions
|
|
383
|
+
|
|
384
|
+
- **Frontend App Plugin**
|
|
385
|
+
- New `createFrontendAppPlugin()` for handling root path
|
|
386
|
+
- Support for redirect to another URL
|
|
387
|
+
- Support for serving static files
|
|
388
|
+
- Support for custom landing page with links
|
|
389
|
+
|
|
390
|
+
- **Gateway Enhancements**
|
|
391
|
+
- `controlPanelPath` - Configurable mount path for control panel
|
|
392
|
+
- `controlPanelGuard` - Guard configuration for control panel
|
|
393
|
+
- `frontendApp` - Configuration for root path handling
|
|
394
|
+
|
|
395
|
+
### Changed
|
|
396
|
+
|
|
397
|
+
- Default control panel mount path changed from `/` to `/cpanel`
|
|
398
|
+
- Auth configuration replaced with guard-based system
|
|
399
|
+
|
|
400
|
+
### Removed
|
|
401
|
+
|
|
402
|
+
- Legacy `auth` configuration in `ControlPanelConfig` (use `guard` instead)
|
|
403
|
+
- Legacy `authMode`, `basicAuthUser`, `basicAuthPassword` in `GatewayConfig` (use `controlPanelGuard` instead)
|
|
404
|
+
|
|
405
|
+
### Breaking Changes
|
|
406
|
+
|
|
407
|
+
- Applications using the old `auth` configuration must migrate to `guard`
|
|
408
|
+
- Applications using gateway `authMode` must migrate to `controlPanelGuard`
|
|
409
|
+
|
|
410
|
+
## [1.1.5] - 2025-12-06
|
|
411
|
+
|
|
412
|
+
### Fixed
|
|
413
|
+
|
|
414
|
+
- Fixed `file:` reference for `@qwickapps/react-framework` devDependency that prevented builds in public repo
|
|
415
|
+
|
|
416
|
+
## [1.1.4] - 2025-12-06
|
|
417
|
+
|
|
418
|
+
### Changed
|
|
419
|
+
|
|
420
|
+
- Updated repository and homepage URLs to point to public GitHub org (https://github.com/qwickapps/control-panel)
|
|
421
|
+
|
|
422
|
+
## [1.1.3] - 2025-12-06
|
|
423
|
+
|
|
424
|
+
### Fixed
|
|
425
|
+
|
|
426
|
+
- Fixed `workspace:*` reference in devDependencies that prevented npm publish
|
|
427
|
+
|
|
428
|
+
## [1.1.2] - 2025-12-06
|
|
429
|
+
|
|
430
|
+
### Added
|
|
431
|
+
|
|
432
|
+
- **Gateway Pattern**
|
|
433
|
+
- New `createGateway()` function for production deployments
|
|
434
|
+
- Gateway runs control panel on public port (3101) and proxies to internal API (3100)
|
|
435
|
+
- Control panel remains responsive even when internal service crashes
|
|
436
|
+
- Built-in HTTP proxy middleware using `http-proxy-middleware`
|
|
437
|
+
- Auto-generated or configurable basic auth for control panel access
|
|
438
|
+
- Graceful error responses when internal service is unavailable
|
|
439
|
+
|
|
440
|
+
### Dependencies
|
|
441
|
+
|
|
442
|
+
- Added `http-proxy-middleware` ^3.0.3
|
|
443
|
+
|
|
444
|
+
## [1.1.1] - 2025-11-29
|
|
445
|
+
|
|
446
|
+
### Changed
|
|
447
|
+
|
|
448
|
+
- **Removed Supabase OAuth from core package**
|
|
449
|
+
- Server-side Supabase auth has been removed from @qwickapps/server
|
|
450
|
+
- Authentication should now be handled client-side using `@qwickapps/auth-client`
|
|
451
|
+
- This allows for better separation of concerns and reuse of existing auth infrastructure
|
|
452
|
+
|
|
453
|
+
### Removed
|
|
454
|
+
|
|
455
|
+
- `SupabaseAuthConfig` type export
|
|
456
|
+
- `supabase-auth.ts` module
|
|
457
|
+
- `@supabase/supabase-js` dependency
|
|
458
|
+
- `cookie-parser` dependency
|
|
459
|
+
- Supabase auth provider option
|
|
460
|
+
|
|
461
|
+
### Notes
|
|
462
|
+
|
|
463
|
+
- The `skipBodyParserPaths` feature is retained for proxy middleware support
|
|
464
|
+
- For authentication, use `@qwickapps/auth-client` with `SupabaseAuthProvider` in your React app
|
|
465
|
+
|
|
466
|
+
## [1.1.0] - 2025-11-29
|
|
467
|
+
|
|
468
|
+
### Added
|
|
469
|
+
|
|
470
|
+
- **Proxy Middleware Support**
|
|
471
|
+
- Added `skipBodyParserPaths` configuration option
|
|
472
|
+
- Allows control panel to act as a gateway with proxy middleware
|
|
473
|
+
- Prevents body parsing from consuming request body for proxied routes
|
|
474
|
+
|
|
475
|
+
### Changed
|
|
476
|
+
|
|
477
|
+
- Body parsing now conditionally skips configured paths
|
|
478
|
+
|
|
479
|
+
## [1.0.0] - 2025-11-28
|
|
480
|
+
|
|
481
|
+
### Added
|
|
482
|
+
|
|
483
|
+
- **Core Framework**
|
|
484
|
+
- Express-based control panel with security middleware (Helmet, CORS, compression)
|
|
485
|
+
- Plugin architecture for extensible functionality
|
|
486
|
+
- Health check management system
|
|
487
|
+
- Basic dashboard UI with product branding
|
|
488
|
+
|
|
489
|
+
- **Authentication**
|
|
490
|
+
- Basic auth provider with username/password
|
|
491
|
+
- JWT auth provider
|
|
492
|
+
- Custom middleware auth provider
|
|
493
|
+
|
|
494
|
+
- **Plugins**
|
|
495
|
+
- Health plugin for service monitoring
|
|
496
|
+
- Diagnostics endpoint for system information
|
|
497
|
+
|
|
498
|
+
- **Built-in Routes**
|
|
499
|
+
- `GET /` - Dashboard UI
|
|
500
|
+
- `GET /api/health` - Aggregated health status
|
|
501
|
+
- `GET /api/diagnostics` - System diagnostics
|
|
502
|
+
|
|
503
|
+
### Technical Details
|
|
504
|
+
|
|
505
|
+
- Written in TypeScript with full type exports
|
|
506
|
+
- ESM module format
|
|
507
|
+
- Express 4.x compatibility
|
package/README.md
CHANGED
|
@@ -12,6 +12,15 @@ A flexible, pluggable control panel framework for QwickApps services. Provides a
|
|
|
12
12
|
- **Frontend App Support**: Handle root path with redirect, static files, or landing page
|
|
13
13
|
- **Theming**: Customizable branding and styling
|
|
14
14
|
|
|
15
|
+
## What's New in v1.5.0
|
|
16
|
+
|
|
17
|
+
- **Notifications Plugin UI** - Full management page for SSE notifications with stats widget, connected clients table, and disconnect controls
|
|
18
|
+
- **Users Plugin Enhancements** - Multi-identifier user lookup (`getUserByIdentifier`), batch queries (`getUsersByIds`), and identifier linking
|
|
19
|
+
- **User Search & Ban Management** - Enhanced Control Panel with user search by email/name/ID and ban/unban actions
|
|
20
|
+
- **Audit Logging** - Admin actions now include user context (email, IP) for better traceability
|
|
21
|
+
|
|
22
|
+
See [CHANGELOG.md](./CHANGELOG.md) for full release history.
|
|
23
|
+
|
|
15
24
|
## Installation
|
|
16
25
|
|
|
17
26
|
```bash
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,6 @@ export { initializeLogging, getControlPanelLogger, getLoggingSubsystem, } from '
|
|
|
17
17
|
export type { LoggingConfig } from './core/logging.js';
|
|
18
18
|
export type { ControlPanelConfig, ControlPanelInstance, HealthCheck, HealthCheckType, HealthCheckResult, HealthStatus, LogSource, ConfigDisplayOptions, Logger, DiagnosticsReport, RouteGuardType, RouteGuardConfig, BasicAuthGuardConfig, SupabaseAuthGuardConfig, Auth0GuardConfig, NoAuthGuardConfig, MountConfig, FrontendAppConfig, } from './core/types.js';
|
|
19
19
|
export type { GatewayConfig, GatewayInstance, MountedAppConfig, } from './core/gateway.js';
|
|
20
|
-
export { createHealthPlugin, createLogsPlugin, createConfigPlugin, createDiagnosticsPlugin, createFrontendAppPlugin, createPostgresPlugin, getPostgres, hasPostgres, createCachePlugin, getCache, hasCache, createAuthPlugin, createAuthPluginFromEnv, getAuthStatus, setAuthConfigStore, postgresAuthConfigStore, isAuthenticated, getAuthenticatedUser, getAccessToken, requireAuth, requireRoles, requireAnyRole, auth0Adapter, basicAdapter, supabaseAdapter, supertokensAdapter, isAuthenticatedRequest, createUsersPlugin, getUserStore, getUserById, getUserByEmail, findOrCreateUser, postgresUserStore, createBansPlugin, getBanStore, isUserBanned, isEmailBanned, getActiveBan, banUser, unbanUser, listActiveBans, postgresBanStore, createEntitlementsPlugin, getEntitlementSource, isSourceReadonly, getEntitlements, refreshEntitlements, hasEntitlement, hasAnyEntitlement, hasAllEntitlements, grantEntitlement, revokeEntitlement, setEntitlements, getAvailableEntitlements, getEntitlementStats, invalidateEntitlementCache, storeExternalIdMapping, invalidateByExternalId, requireEntitlement, requireAnyEntitlement, requireAllEntitlements, postgresEntitlementSource, createRateLimitPlugin, createRateLimitPluginFromEnv, getRateLimitConfigStatus, postgresRateLimitStore, createRateLimitCache, createNoOpCache, createSlidingWindowStrategy, createFixedWindowStrategy, createTokenBucketStrategy, getStrategy, rateLimitMiddleware, rateLimitStatusMiddleware, RateLimitService, getRateLimitService, isLimited, checkLimit, incrementLimit, getRemainingRequests, getLimitStatus, clearLimit, createCleanupJob, } from './plugins/index.js';
|
|
21
|
-
export type { HealthPluginConfig, LogsPluginConfig, ConfigPluginConfig, DiagnosticsPluginConfig, FrontendAppPluginConfig, PostgresPluginConfig, PostgresInstance, TransactionCallback, CachePluginConfig, CacheInstance, AuthPluginConfig, AuthAdapter, AuthenticatedUser, AuthenticatedRequest, Auth0AdapterConfig, SupabaseAdapterConfig, BasicAdapterConfig, SupertokensAdapterConfig, AuthPluginState, AuthEnvPluginOptions, AuthConfigStatus, AuthConfigStore, PostgresAuthConfigStoreConfig, UsersPluginConfig, UserStore, User, CreateUserInput, UpdateUserInput, UserSearchParams, UserListResponse, PostgresUserStoreConfig, UserSyncConfig, UsersApiConfig, UsersUiConfig, BansPluginConfig, BanStore, Ban, CreateBanInput, RemoveBanInput, BanCallbacks, PostgresBanStoreConfig, EntitlementsPluginConfig, EntitlementSource, EntitlementResult, EntitlementDefinition, EntitlementCallbacks, EntitlementsCacheConfig, EntitlementsApiConfig, PostgresEntitlementSourceConfig, UserEntitlement, CachedEntitlements, EntitlementStats, RateLimitPluginConfig, RateLimitEnvPluginOptions, RateLimitStrategy, LimitStatus, StoredLimit, IncrementOptions, RateLimitStore, PostgresRateLimitStoreConfig, RateLimitCache, RateLimitCacheConfig, RateLimitMiddlewareOptions, } from './plugins/index.js';
|
|
20
|
+
export { createHealthPlugin, createLogsPlugin, createConfigPlugin, createDiagnosticsPlugin, createFrontendAppPlugin, createPostgresPlugin, getPostgres, hasPostgres, createCachePlugin, getCache, hasCache, createAuthPlugin, createAuthPluginFromEnv, getAuthStatus, setAuthConfigStore, postgresAuthConfigStore, isAuthenticated, getAuthenticatedUser, getAccessToken, requireAuth, requireRoles, requireAnyRole, auth0Adapter, basicAdapter, supabaseAdapter, supertokensAdapter, isAuthenticatedRequest, createUsersPlugin, getUserStore, getUserById, getUserByEmail, getUserByIdentifier, linkUserIdentifiers, findOrCreateUser, postgresUserStore, createBansPlugin, getBanStore, isUserBanned, isEmailBanned, getActiveBan, banUser, unbanUser, listActiveBans, postgresBanStore, createEntitlementsPlugin, getEntitlementSource, isSourceReadonly, getEntitlements, refreshEntitlements, hasEntitlement, hasAnyEntitlement, hasAllEntitlements, grantEntitlement, revokeEntitlement, setEntitlements, getAvailableEntitlements, getEntitlementStats, invalidateEntitlementCache, storeExternalIdMapping, invalidateByExternalId, requireEntitlement, requireAnyEntitlement, requireAllEntitlements, postgresEntitlementSource, createRateLimitPlugin, createRateLimitPluginFromEnv, getRateLimitConfigStatus, postgresRateLimitStore, createRateLimitCache, createNoOpCache, createSlidingWindowStrategy, createFixedWindowStrategy, createTokenBucketStrategy, getStrategy, rateLimitMiddleware, rateLimitStatusMiddleware, RateLimitService, getRateLimitService, isLimited, checkLimit, incrementLimit, getRemainingRequests, getLimitStatus, clearLimit, createCleanupJob, createDevicesPlugin, getDeviceStore, getDeviceAdapter, registerDevice, verifyDeviceToken, getDeviceById, updateDevice, deleteDevice, regenerateToken, listUserDevices, listOrgDevices, deactivateDevice, activateDevice, cleanupExpiredTokens, postgresDeviceStore, computeDeviceAdapter, mobileDeviceAdapter, generateDeviceToken, generatePairingCode, hashToken, verifyToken, isValidTokenFormat, isTokenExpired, getTokenExpiration, DeviceTokens, createProfilesPlugin, getProfileStore, createProfile, getProfileById, updateProfile, deleteProfile, listUserProfiles, getDefaultProfile, setDefaultProfile, getProfilesByAgeGroup, getChildProfiles, getProfileAge, checkTimeRestrictions, getContentFilterLevel, canAccessContent, postgresProfileStore, createSubscriptionsPlugin, getSubscriptionsStore, createTier, getTierBySlug, getTierById, listTiers, getTierEntitlements, setTierEntitlements, getUserSubscription, createUserSubscription, updateUserSubscription, cancelSubscription, getUserTierSlug, getFeatureLimit, hasFeature, checkFeatureLimit, ensureUserSubscription, postgresSubscriptionsStore, createUsagePlugin, getUsageStore, getDailyUsage, incrementUsage, checkUsageLimit, getFeatureUsageStatus, getDailyUsageSummary, resetUsage, getRemainingQuota, canUseFeature, postgresUsageStore, createParentalPlugin, getParentalStore, getParentalAdapter, getGuardianSettings, createGuardianSettings, updateGuardianSettings, setPin, verifyPin, incrementFailedPinAttempts, resetFailedPinAttempts, getRestrictions, createRestriction, updateRestriction, deleteRestriction, pauseProfile, resumeProfile, checkProfileAccess, logActivity, getActivityLog, postgresParentalStore, kidsAdapter, } from './plugins/index.js';
|
|
21
|
+
export type { HealthPluginConfig, LogsPluginConfig, ConfigPluginConfig, DiagnosticsPluginConfig, FrontendAppPluginConfig, PostgresPluginConfig, PostgresInstance, TransactionCallback, CachePluginConfig, CacheInstance, AuthPluginConfig, AuthAdapter, AuthenticatedUser, AuthenticatedRequest, Auth0AdapterConfig, SupabaseAdapterConfig, BasicAdapterConfig, SupertokensAdapterConfig, AuthPluginState, AuthEnvPluginOptions, AuthConfigStatus, AuthConfigStore, PostgresAuthConfigStoreConfig, UsersPluginConfig, UserStore, User, CreateUserInput, UpdateUserInput, UserSearchParams, UserListResponse, PostgresUserStoreConfig, UserSyncConfig, UsersApiConfig, UsersUiConfig, UserIdentifiers, StoredIdentifiers, BansPluginConfig, BanStore, Ban, CreateBanInput, RemoveBanInput, BanCallbacks, PostgresBanStoreConfig, EntitlementsPluginConfig, EntitlementSource, EntitlementResult, EntitlementDefinition, EntitlementCallbacks, EntitlementsCacheConfig, EntitlementsApiConfig, PostgresEntitlementSourceConfig, UserEntitlement, CachedEntitlements, EntitlementStats, RateLimitPluginConfig, RateLimitEnvPluginOptions, RateLimitStrategy, LimitStatus, StoredLimit, IncrementOptions, RateLimitStore, PostgresRateLimitStoreConfig, RateLimitCache, RateLimitCacheConfig, RateLimitMiddlewareOptions, Device, DeviceWithToken, CreateDeviceInput, UpdateDeviceInput, DeviceSearchParams, DeviceListResponse, TokenVerificationResult, DeviceAdapter, DeviceValidationResult, DeviceStore, DevicesPluginConfig, DevicesApiConfig, PostgresDeviceStoreConfig, ComputeDeviceMetadata, MobileDeviceMetadata, IoTDeviceMetadata, ComputeAdapterConfig, MobileAdapterConfig, DeviceTokenPair, Profile, CreateProfileInput, UpdateProfileInput, ProfileSearchParams, ProfileListResponse, TimeRestrictionResult, ContentFilterLevel, AgeGroup, ProfileStore, ProfilesPluginConfig, ProfilesApiConfig, PostgresProfileStoreConfig, AgeThresholds, QwickBotProfileMetadata, GamingProfileMetadata, SubscriptionTier, SubscriptionEntitlement, UserSubscription, UserSubscriptionWithTier, SubscriptionStatus, FeatureLimitResult, CreateTierInput, UpdateTierInput, CreateEntitlementInput, CreateUserSubscriptionInput, UpdateUserSubscriptionInput, SubscriptionsStore, SubscriptionsPluginConfig, SubscriptionsApiConfig, PostgresSubscriptionsStoreConfig, DailyUsage, MonthlyUsage, UsageIncrementResult, UsageStatus, UsageSummary, UsageStore, UsagePluginConfig, UsageApiConfig, UsageCleanupConfig, PostgresUsageStoreConfig, GuardianSettings, ProfileRestriction, ActivityLog, AccessCheckResult, CreateGuardianSettingsInput, UpdateGuardianSettingsInput, CreateRestrictionInput, LogActivityInput, ParentalAdapter, ParentalStore, ParentalPluginConfig, ParentalApiConfig, PostgresParentalStoreConfig, KidsAdapterConfig, } from './plugins/index.js';
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,MAAM,EACN,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,MAAM,EACN,iBAAiB,EAEjB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,E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AAU,EACV,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,MAAM,EACN,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,MAAM,EACN,iBAAiB,EAEjB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,aAAa,EACb,eAAe,EACf,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EAEvB,oBAAoB,EACp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f,eAAe,EACf,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,kBAAkB,EAClB,yBAAyB,EACzB,sBAAsB,EACtB,gCAAgC,EAEhC,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EAExB,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,2BAA2B,EAC3B,2BAA2B,EAC3B,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,2BAA2B,EAC3B,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -25,11 +25,21 @@ createCachePlugin, getCache, hasCache,
|
|
|
25
25
|
// Auth plugin
|
|
26
26
|
createAuthPlugin, createAuthPluginFromEnv, getAuthStatus, setAuthConfigStore, postgresAuthConfigStore, isAuthenticated, getAuthenticatedUser, getAccessToken, requireAuth, requireRoles, requireAnyRole, auth0Adapter, basicAdapter, supabaseAdapter, supertokensAdapter, isAuthenticatedRequest,
|
|
27
27
|
// Users plugin
|
|
28
|
-
createUsersPlugin, getUserStore, getUserById, getUserByEmail, findOrCreateUser, postgresUserStore,
|
|
28
|
+
createUsersPlugin, getUserStore, getUserById, getUserByEmail, getUserByIdentifier, linkUserIdentifiers, findOrCreateUser, postgresUserStore,
|
|
29
29
|
// Bans plugin (separate from Users, depends on Users)
|
|
30
30
|
createBansPlugin, getBanStore, isUserBanned, isEmailBanned, getActiveBan, banUser, unbanUser, listActiveBans, postgresBanStore,
|
|
31
31
|
// Entitlements plugin
|
|
32
32
|
createEntitlementsPlugin, getEntitlementSource, isSourceReadonly, getEntitlements, refreshEntitlements, hasEntitlement, hasAnyEntitlement, hasAllEntitlements, grantEntitlement, revokeEntitlement, setEntitlements, getAvailableEntitlements, getEntitlementStats, invalidateEntitlementCache, storeExternalIdMapping, invalidateByExternalId, requireEntitlement, requireAnyEntitlement, requireAllEntitlements, postgresEntitlementSource,
|
|
33
33
|
// Rate Limit plugin
|
|
34
|
-
createRateLimitPlugin, createRateLimitPluginFromEnv, getRateLimitConfigStatus, postgresRateLimitStore, createRateLimitCache, createNoOpCache, createSlidingWindowStrategy, createFixedWindowStrategy, createTokenBucketStrategy, getStrategy, rateLimitMiddleware, rateLimitStatusMiddleware, RateLimitService, getRateLimitService, isLimited, checkLimit, incrementLimit, getRemainingRequests, getLimitStatus, clearLimit, createCleanupJob,
|
|
34
|
+
createRateLimitPlugin, createRateLimitPluginFromEnv, getRateLimitConfigStatus, postgresRateLimitStore, createRateLimitCache, createNoOpCache, createSlidingWindowStrategy, createFixedWindowStrategy, createTokenBucketStrategy, getStrategy, rateLimitMiddleware, rateLimitStatusMiddleware, RateLimitService, getRateLimitService, isLimited, checkLimit, incrementLimit, getRemainingRequests, getLimitStatus, clearLimit, createCleanupJob,
|
|
35
|
+
// Devices plugin
|
|
36
|
+
createDevicesPlugin, getDeviceStore, getDeviceAdapter, registerDevice, verifyDeviceToken, getDeviceById, updateDevice, deleteDevice, regenerateToken, listUserDevices, listOrgDevices, deactivateDevice, activateDevice, cleanupExpiredTokens, postgresDeviceStore, computeDeviceAdapter, mobileDeviceAdapter, generateDeviceToken, generatePairingCode, hashToken, verifyToken, isValidTokenFormat, isTokenExpired, getTokenExpiration, DeviceTokens,
|
|
37
|
+
// Profiles plugin
|
|
38
|
+
createProfilesPlugin, getProfileStore, createProfile, getProfileById, updateProfile, deleteProfile, listUserProfiles, getDefaultProfile, setDefaultProfile, getProfilesByAgeGroup, getChildProfiles, getProfileAge, checkTimeRestrictions, getContentFilterLevel, canAccessContent, postgresProfileStore,
|
|
39
|
+
// Subscriptions plugin
|
|
40
|
+
createSubscriptionsPlugin, getSubscriptionsStore, createTier, getTierBySlug, getTierById, listTiers, getTierEntitlements, setTierEntitlements, getUserSubscription, createUserSubscription, updateUserSubscription, cancelSubscription, getUserTierSlug, getFeatureLimit, hasFeature, checkFeatureLimit, ensureUserSubscription, postgresSubscriptionsStore,
|
|
41
|
+
// Usage plugin
|
|
42
|
+
createUsagePlugin, getUsageStore, getDailyUsage, incrementUsage, checkUsageLimit, getFeatureUsageStatus, getDailyUsageSummary, resetUsage, getRemainingQuota, canUseFeature, postgresUsageStore,
|
|
43
|
+
// Parental plugin
|
|
44
|
+
createParentalPlugin, getParentalStore, getParentalAdapter, getGuardianSettings, createGuardianSettings, updateGuardianSettings, setPin, verifyPin, incrementFailedPinAttempts, resetFailedPinAttempts, getRestrictions, createRestriction, updateRestriction, deleteRestriction, pauseProfile, resumeProfile, checkProfileAccess, logActivity, getActivityLog, postgresParentalStore, kidsAdapter, } from './plugins/index.js';
|
|
35
45
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAe;AACf,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,2DAA2D;AAC3D,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AAcnC,8CAA8C;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,kBAAkB;AAClB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AA8B3B,mBAAmB;AACnB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB;AACvB,kBAAkB;AAClB,oBAAoB,EACpB,WAAW,EACX,WAAW;AACX,eAAe;AACf,iBAAiB,EACjB,QAAQ,EACR,QAAQ;AACR,cAAc;AACd,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,sBAAsB;AACtB,eAAe;AACf,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,iBAAiB;AACjB,sDAAsD;AACtD,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,SAAS,EACT,cAAc,EACd,gBAAgB;AAChB,sBAAsB;AACtB,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB;AACzB,oBAAoB;AACpB,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,WAAW,EACX,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACT,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAe;AACf,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7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B,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,kBAAkB;AAClB,kBAAkB;AAClB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,EACN,SAAS,EACT,0BAA0B,EAC1B,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,WAAW,GACZ,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bans-plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/bans/bans-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAgC,MAAM,+BAA+B,CAAC;AAC1F,OAAO,KAAK,EACV,gBAAgB,EAChB,QAAQ,EACR,GAAG,EACH,cAAc,EACd,cAAc,EACf,MAAM,YAAY,CAAC;AASpB;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"bans-plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/bans/bans-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAgC,MAAM,+BAA+B,CAAC;AAC1F,OAAO,KAAK,EACV,gBAAgB,EAChB,QAAQ,EACR,GAAG,EACH,cAAc,EACd,cAAc,EACf,MAAM,YAAY,CAAC;AASpB;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CA0VjE;AAMD;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,GAAG,IAAI,CAE7C;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKnE;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAYnE;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAKtE;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAoBjE;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAoBvE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAC3F,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAKD"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
12
12
|
*/
|
|
13
|
-
import { getUserByEmail, getUserById } from '../users/users-plugin.js';
|
|
13
|
+
import { getUserByEmail, getUserById, getUsersByIds } from '../users/users-plugin.js';
|
|
14
14
|
// Store instance for helper access
|
|
15
15
|
let currentStore = null;
|
|
16
16
|
let banCleanupInterval = null;
|
|
@@ -75,7 +75,7 @@ export function createBansPlugin(config) {
|
|
|
75
75
|
});
|
|
76
76
|
// Add API routes if enabled
|
|
77
77
|
if (apiEnabled) {
|
|
78
|
-
// List active bans
|
|
78
|
+
// List active bans (enriched with user email)
|
|
79
79
|
registry.addRoute({
|
|
80
80
|
method: 'get',
|
|
81
81
|
path: apiPrefix,
|
|
@@ -85,7 +85,16 @@ export function createBansPlugin(config) {
|
|
|
85
85
|
const limit = Math.min(parseInt(req.query.limit) || 50, 100);
|
|
86
86
|
const offset = parseInt(req.query.offset) || 0;
|
|
87
87
|
const result = await config.store.listActiveBans({ limit, offset });
|
|
88
|
-
|
|
88
|
+
// Batch fetch users for all bans (single query instead of N queries)
|
|
89
|
+
const userIds = [...new Set(result.bans.map((ban) => ban.user_id))];
|
|
90
|
+
const users = await getUsersByIds(userIds);
|
|
91
|
+
const userMap = new Map(users.map((u) => [u.id, u]));
|
|
92
|
+
// Enrich bans with user email
|
|
93
|
+
const enrichedBans = result.bans.map((ban) => ({
|
|
94
|
+
...ban,
|
|
95
|
+
email: userMap.get(ban.user_id)?.email || 'Unknown',
|
|
96
|
+
}));
|
|
97
|
+
res.json({ bans: enrichedBans, total: result.total });
|
|
89
98
|
}
|
|
90
99
|
catch (error) {
|
|
91
100
|
console.error('[BansPlugin] List bans error:', error);
|