@qwickapps/server 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +1 -1
- 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
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notifications Page
|
|
3
|
+
*
|
|
4
|
+
* Full management page for the Notifications Plugin.
|
|
5
|
+
* Shows connection stats, connected clients table, and management actions.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
export declare function NotificationsPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatting Utilities
|
|
3
|
+
*
|
|
4
|
+
* Common formatting functions for numbers, durations, and strings.
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Format a number with K/M suffix for large values
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatNumber(num: number): string;
|
|
12
|
+
/**
|
|
13
|
+
* Format milliseconds to human-readable duration
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatDuration(ms: number): string;
|
|
16
|
+
/**
|
|
17
|
+
* Truncate a string ID for display
|
|
18
|
+
*/
|
|
19
|
+
export declare function truncateId(id: string, maxLength?: number): string;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -109,6 +109,8 @@ export {
|
|
|
109
109
|
getUserStore,
|
|
110
110
|
getUserById,
|
|
111
111
|
getUserByEmail,
|
|
112
|
+
getUserByIdentifier,
|
|
113
|
+
linkUserIdentifiers,
|
|
112
114
|
findOrCreateUser,
|
|
113
115
|
postgresUserStore,
|
|
114
116
|
// Bans plugin (separate from Users, depends on Users)
|
|
@@ -164,6 +166,102 @@ export {
|
|
|
164
166
|
getLimitStatus,
|
|
165
167
|
clearLimit,
|
|
166
168
|
createCleanupJob,
|
|
169
|
+
// Devices plugin
|
|
170
|
+
createDevicesPlugin,
|
|
171
|
+
getDeviceStore,
|
|
172
|
+
getDeviceAdapter,
|
|
173
|
+
registerDevice,
|
|
174
|
+
verifyDeviceToken,
|
|
175
|
+
getDeviceById,
|
|
176
|
+
updateDevice,
|
|
177
|
+
deleteDevice,
|
|
178
|
+
regenerateToken,
|
|
179
|
+
listUserDevices,
|
|
180
|
+
listOrgDevices,
|
|
181
|
+
deactivateDevice,
|
|
182
|
+
activateDevice,
|
|
183
|
+
cleanupExpiredTokens,
|
|
184
|
+
postgresDeviceStore,
|
|
185
|
+
computeDeviceAdapter,
|
|
186
|
+
mobileDeviceAdapter,
|
|
187
|
+
generateDeviceToken,
|
|
188
|
+
generatePairingCode,
|
|
189
|
+
hashToken,
|
|
190
|
+
verifyToken,
|
|
191
|
+
isValidTokenFormat,
|
|
192
|
+
isTokenExpired,
|
|
193
|
+
getTokenExpiration,
|
|
194
|
+
DeviceTokens,
|
|
195
|
+
// Profiles plugin
|
|
196
|
+
createProfilesPlugin,
|
|
197
|
+
getProfileStore,
|
|
198
|
+
createProfile,
|
|
199
|
+
getProfileById,
|
|
200
|
+
updateProfile,
|
|
201
|
+
deleteProfile,
|
|
202
|
+
listUserProfiles,
|
|
203
|
+
getDefaultProfile,
|
|
204
|
+
setDefaultProfile,
|
|
205
|
+
getProfilesByAgeGroup,
|
|
206
|
+
getChildProfiles,
|
|
207
|
+
getProfileAge,
|
|
208
|
+
checkTimeRestrictions,
|
|
209
|
+
getContentFilterLevel,
|
|
210
|
+
canAccessContent,
|
|
211
|
+
postgresProfileStore,
|
|
212
|
+
// Subscriptions plugin
|
|
213
|
+
createSubscriptionsPlugin,
|
|
214
|
+
getSubscriptionsStore,
|
|
215
|
+
createTier,
|
|
216
|
+
getTierBySlug,
|
|
217
|
+
getTierById,
|
|
218
|
+
listTiers,
|
|
219
|
+
getTierEntitlements,
|
|
220
|
+
setTierEntitlements,
|
|
221
|
+
getUserSubscription,
|
|
222
|
+
createUserSubscription,
|
|
223
|
+
updateUserSubscription,
|
|
224
|
+
cancelSubscription,
|
|
225
|
+
getUserTierSlug,
|
|
226
|
+
getFeatureLimit,
|
|
227
|
+
hasFeature,
|
|
228
|
+
checkFeatureLimit,
|
|
229
|
+
ensureUserSubscription,
|
|
230
|
+
postgresSubscriptionsStore,
|
|
231
|
+
// Usage plugin
|
|
232
|
+
createUsagePlugin,
|
|
233
|
+
getUsageStore,
|
|
234
|
+
getDailyUsage,
|
|
235
|
+
incrementUsage,
|
|
236
|
+
checkUsageLimit,
|
|
237
|
+
getFeatureUsageStatus,
|
|
238
|
+
getDailyUsageSummary,
|
|
239
|
+
resetUsage,
|
|
240
|
+
getRemainingQuota,
|
|
241
|
+
canUseFeature,
|
|
242
|
+
postgresUsageStore,
|
|
243
|
+
// Parental plugin
|
|
244
|
+
createParentalPlugin,
|
|
245
|
+
getParentalStore,
|
|
246
|
+
getParentalAdapter,
|
|
247
|
+
getGuardianSettings,
|
|
248
|
+
createGuardianSettings,
|
|
249
|
+
updateGuardianSettings,
|
|
250
|
+
setPin,
|
|
251
|
+
verifyPin,
|
|
252
|
+
incrementFailedPinAttempts,
|
|
253
|
+
resetFailedPinAttempts,
|
|
254
|
+
getRestrictions,
|
|
255
|
+
createRestriction,
|
|
256
|
+
updateRestriction,
|
|
257
|
+
deleteRestriction,
|
|
258
|
+
pauseProfile,
|
|
259
|
+
resumeProfile,
|
|
260
|
+
checkProfileAccess,
|
|
261
|
+
logActivity,
|
|
262
|
+
getActivityLog,
|
|
263
|
+
postgresParentalStore,
|
|
264
|
+
kidsAdapter,
|
|
167
265
|
} from './plugins/index.js';
|
|
168
266
|
export type {
|
|
169
267
|
HealthPluginConfig,
|
|
@@ -204,6 +302,8 @@ export type {
|
|
|
204
302
|
UserSyncConfig,
|
|
205
303
|
UsersApiConfig,
|
|
206
304
|
UsersUiConfig,
|
|
305
|
+
UserIdentifiers,
|
|
306
|
+
StoredIdentifiers,
|
|
207
307
|
// Bans plugin types
|
|
208
308
|
BansPluginConfig,
|
|
209
309
|
BanStore,
|
|
@@ -236,4 +336,82 @@ export type {
|
|
|
236
336
|
RateLimitCache,
|
|
237
337
|
RateLimitCacheConfig,
|
|
238
338
|
RateLimitMiddlewareOptions,
|
|
339
|
+
// Devices plugin types
|
|
340
|
+
Device,
|
|
341
|
+
DeviceWithToken,
|
|
342
|
+
CreateDeviceInput,
|
|
343
|
+
UpdateDeviceInput,
|
|
344
|
+
DeviceSearchParams,
|
|
345
|
+
DeviceListResponse,
|
|
346
|
+
TokenVerificationResult,
|
|
347
|
+
DeviceAdapter,
|
|
348
|
+
DeviceValidationResult,
|
|
349
|
+
DeviceStore,
|
|
350
|
+
DevicesPluginConfig,
|
|
351
|
+
DevicesApiConfig,
|
|
352
|
+
PostgresDeviceStoreConfig,
|
|
353
|
+
ComputeDeviceMetadata,
|
|
354
|
+
MobileDeviceMetadata,
|
|
355
|
+
IoTDeviceMetadata,
|
|
356
|
+
ComputeAdapterConfig,
|
|
357
|
+
MobileAdapterConfig,
|
|
358
|
+
DeviceTokenPair,
|
|
359
|
+
// Profiles plugin types
|
|
360
|
+
Profile,
|
|
361
|
+
CreateProfileInput,
|
|
362
|
+
UpdateProfileInput,
|
|
363
|
+
ProfileSearchParams,
|
|
364
|
+
ProfileListResponse,
|
|
365
|
+
TimeRestrictionResult,
|
|
366
|
+
ContentFilterLevel,
|
|
367
|
+
AgeGroup,
|
|
368
|
+
ProfileStore,
|
|
369
|
+
ProfilesPluginConfig,
|
|
370
|
+
ProfilesApiConfig,
|
|
371
|
+
PostgresProfileStoreConfig,
|
|
372
|
+
AgeThresholds,
|
|
373
|
+
QwickBotProfileMetadata,
|
|
374
|
+
GamingProfileMetadata,
|
|
375
|
+
// Subscriptions plugin types
|
|
376
|
+
SubscriptionTier,
|
|
377
|
+
SubscriptionEntitlement,
|
|
378
|
+
UserSubscription,
|
|
379
|
+
UserSubscriptionWithTier,
|
|
380
|
+
SubscriptionStatus,
|
|
381
|
+
FeatureLimitResult,
|
|
382
|
+
CreateTierInput,
|
|
383
|
+
UpdateTierInput,
|
|
384
|
+
CreateEntitlementInput,
|
|
385
|
+
CreateUserSubscriptionInput,
|
|
386
|
+
UpdateUserSubscriptionInput,
|
|
387
|
+
SubscriptionsStore,
|
|
388
|
+
SubscriptionsPluginConfig,
|
|
389
|
+
SubscriptionsApiConfig,
|
|
390
|
+
PostgresSubscriptionsStoreConfig,
|
|
391
|
+
// Usage plugin types
|
|
392
|
+
DailyUsage,
|
|
393
|
+
MonthlyUsage,
|
|
394
|
+
UsageIncrementResult,
|
|
395
|
+
UsageStatus,
|
|
396
|
+
UsageSummary,
|
|
397
|
+
UsageStore,
|
|
398
|
+
UsagePluginConfig,
|
|
399
|
+
UsageApiConfig,
|
|
400
|
+
UsageCleanupConfig,
|
|
401
|
+
PostgresUsageStoreConfig,
|
|
402
|
+
// Parental plugin types
|
|
403
|
+
GuardianSettings,
|
|
404
|
+
ProfileRestriction,
|
|
405
|
+
ActivityLog,
|
|
406
|
+
AccessCheckResult,
|
|
407
|
+
CreateGuardianSettingsInput,
|
|
408
|
+
UpdateGuardianSettingsInput,
|
|
409
|
+
CreateRestrictionInput,
|
|
410
|
+
LogActivityInput,
|
|
411
|
+
ParentalAdapter,
|
|
412
|
+
ParentalStore,
|
|
413
|
+
ParentalPluginConfig,
|
|
414
|
+
ParentalApiConfig,
|
|
415
|
+
PostgresParentalStoreConfig,
|
|
416
|
+
KidsAdapterConfig,
|
|
239
417
|
} from './plugins/index.js';
|
|
@@ -21,7 +21,7 @@ import type {
|
|
|
21
21
|
RemoveBanInput,
|
|
22
22
|
} from './types.js';
|
|
23
23
|
import type { AuthenticatedRequest } from '../auth/types.js';
|
|
24
|
-
import { getUserByEmail, getUserById } from '../users/users-plugin.js';
|
|
24
|
+
import { getUserByEmail, getUserById, getUsersByIds } from '../users/users-plugin.js';
|
|
25
25
|
|
|
26
26
|
// Store instance for helper access
|
|
27
27
|
let currentStore: BanStore | null = null;
|
|
@@ -95,7 +95,7 @@ export function createBansPlugin(config: BansPluginConfig): Plugin {
|
|
|
95
95
|
|
|
96
96
|
// Add API routes if enabled
|
|
97
97
|
if (apiEnabled) {
|
|
98
|
-
// List active bans
|
|
98
|
+
// List active bans (enriched with user email)
|
|
99
99
|
registry.addRoute({
|
|
100
100
|
method: 'get',
|
|
101
101
|
path: apiPrefix,
|
|
@@ -106,7 +106,19 @@ export function createBansPlugin(config: BansPluginConfig): Plugin {
|
|
|
106
106
|
const offset = parseInt(req.query.offset as string) || 0;
|
|
107
107
|
|
|
108
108
|
const result = await config.store.listActiveBans({ limit, offset });
|
|
109
|
-
|
|
109
|
+
|
|
110
|
+
// Batch fetch users for all bans (single query instead of N queries)
|
|
111
|
+
const userIds = [...new Set(result.bans.map((ban) => ban.user_id))];
|
|
112
|
+
const users = await getUsersByIds(userIds);
|
|
113
|
+
const userMap = new Map(users.map((u) => [u.id, u]));
|
|
114
|
+
|
|
115
|
+
// Enrich bans with user email
|
|
116
|
+
const enrichedBans = result.bans.map((ban) => ({
|
|
117
|
+
...ban,
|
|
118
|
+
email: userMap.get(ban.user_id)?.email || 'Unknown',
|
|
119
|
+
}));
|
|
120
|
+
|
|
121
|
+
res.json({ bans: enrichedBans, total: result.total });
|
|
110
122
|
} catch (error) {
|
|
111
123
|
console.error('[BansPlugin] List bans error:', error);
|
|
112
124
|
res.status(500).json({ error: 'Failed to list bans' });
|