@qwickapps/server 1.3.1 → 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/README.md +157 -0
- package/dist/core/control-panel.d.ts.map +1 -1
- package/dist/core/control-panel.js +114 -0
- package/dist/core/control-panel.js.map +1 -1
- package/dist/core/types.d.ts +19 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/plugins/auth/adapter-wrapper.d.ts +47 -0
- package/dist/plugins/auth/adapter-wrapper.d.ts.map +1 -0
- package/dist/plugins/auth/adapter-wrapper.js +166 -0
- package/dist/plugins/auth/adapter-wrapper.js.map +1 -0
- package/dist/plugins/auth/adapter-wrapper.test.d.ts +7 -0
- package/dist/plugins/auth/adapter-wrapper.test.d.ts.map +1 -0
- package/dist/plugins/auth/adapter-wrapper.test.js +303 -0
- package/dist/plugins/auth/adapter-wrapper.test.js.map +1 -0
- package/dist/plugins/auth/config-store.d.ts +11 -0
- package/dist/plugins/auth/config-store.d.ts.map +1 -0
- package/dist/plugins/auth/config-store.js +232 -0
- package/dist/plugins/auth/config-store.js.map +1 -0
- package/dist/plugins/auth/config-store.test.d.ts +7 -0
- package/dist/plugins/auth/config-store.test.d.ts.map +1 -0
- package/dist/plugins/auth/config-store.test.js +299 -0
- package/dist/plugins/auth/config-store.test.js.map +1 -0
- package/dist/plugins/auth/env-config.d.ts +51 -1
- package/dist/plugins/auth/env-config.d.ts.map +1 -1
- package/dist/plugins/auth/env-config.js +640 -7
- package/dist/plugins/auth/env-config.js.map +1 -1
- package/dist/plugins/auth/index.d.ts +6 -2
- package/dist/plugins/auth/index.d.ts.map +1 -1
- package/dist/plugins/auth/index.js +5 -1
- package/dist/plugins/auth/index.js.map +1 -1
- package/dist/plugins/auth/types.d.ts +106 -0
- package/dist/plugins/auth/types.d.ts.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 +18 -4
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +16 -2
- 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/rate-limit/__tests__/rate-limit-plugin.test.d.ts +7 -0
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.d.ts.map +1 -0
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.js +220 -0
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.js.map +1 -0
- package/dist/plugins/rate-limit/cleanup.d.ts +40 -0
- package/dist/plugins/rate-limit/cleanup.d.ts.map +1 -0
- package/dist/plugins/rate-limit/cleanup.js +72 -0
- package/dist/plugins/rate-limit/cleanup.js.map +1 -0
- package/dist/plugins/rate-limit/env-config.d.ts +91 -0
- package/dist/plugins/rate-limit/env-config.d.ts.map +1 -0
- package/dist/plugins/rate-limit/env-config.js +318 -0
- package/dist/plugins/rate-limit/env-config.js.map +1 -0
- package/dist/plugins/rate-limit/index.d.ts +76 -0
- package/dist/plugins/rate-limit/index.d.ts.map +1 -0
- package/dist/plugins/rate-limit/index.js +79 -0
- package/dist/plugins/rate-limit/index.js.map +1 -0
- package/dist/plugins/rate-limit/middleware.d.ts +40 -0
- package/dist/plugins/rate-limit/middleware.d.ts.map +1 -0
- package/dist/plugins/rate-limit/middleware.js +169 -0
- package/dist/plugins/rate-limit/middleware.js.map +1 -0
- package/dist/plugins/rate-limit/rate-limit-plugin.d.ts +44 -0
- package/dist/plugins/rate-limit/rate-limit-plugin.d.ts.map +1 -0
- package/dist/plugins/rate-limit/rate-limit-plugin.js +354 -0
- package/dist/plugins/rate-limit/rate-limit-plugin.js.map +1 -0
- package/dist/plugins/rate-limit/rate-limit-service.d.ts +110 -0
- package/dist/plugins/rate-limit/rate-limit-service.d.ts.map +1 -0
- package/dist/plugins/rate-limit/rate-limit-service.js +172 -0
- package/dist/plugins/rate-limit/rate-limit-service.js.map +1 -0
- package/dist/plugins/rate-limit/stores/cache-store.d.ts +33 -0
- package/dist/plugins/rate-limit/stores/cache-store.d.ts.map +1 -0
- package/dist/plugins/rate-limit/stores/cache-store.js +225 -0
- package/dist/plugins/rate-limit/stores/cache-store.js.map +1 -0
- package/dist/plugins/rate-limit/stores/index.d.ts +8 -0
- package/dist/plugins/rate-limit/stores/index.d.ts.map +1 -0
- package/dist/plugins/rate-limit/stores/index.js +8 -0
- package/dist/plugins/rate-limit/stores/index.js.map +1 -0
- package/dist/plugins/rate-limit/stores/postgres-store.d.ts +34 -0
- package/dist/plugins/rate-limit/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/rate-limit/stores/postgres-store.js +320 -0
- package/dist/plugins/rate-limit/stores/postgres-store.js.map +1 -0
- package/dist/plugins/rate-limit/strategies/fixed-window.d.ts +21 -0
- package/dist/plugins/rate-limit/strategies/fixed-window.d.ts.map +1 -0
- package/dist/plugins/rate-limit/strategies/fixed-window.js +97 -0
- package/dist/plugins/rate-limit/strategies/fixed-window.js.map +1 -0
- package/dist/plugins/rate-limit/strategies/index.d.ts +14 -0
- package/dist/plugins/rate-limit/strategies/index.d.ts.map +1 -0
- package/dist/plugins/rate-limit/strategies/index.js +27 -0
- package/dist/plugins/rate-limit/strategies/index.js.map +1 -0
- package/dist/plugins/rate-limit/strategies/sliding-window.d.ts +22 -0
- package/dist/plugins/rate-limit/strategies/sliding-window.d.ts.map +1 -0
- package/dist/plugins/rate-limit/strategies/sliding-window.js +122 -0
- package/dist/plugins/rate-limit/strategies/sliding-window.js.map +1 -0
- package/dist/plugins/rate-limit/strategies/token-bucket.d.ts +28 -0
- package/dist/plugins/rate-limit/strategies/token-bucket.d.ts.map +1 -0
- package/dist/plugins/rate-limit/strategies/token-bucket.js +121 -0
- package/dist/plugins/rate-limit/strategies/token-bucket.js.map +1 -0
- package/dist/plugins/rate-limit/types.d.ts +265 -0
- package/dist/plugins/rate-limit/types.d.ts.map +1 -0
- package/dist/plugins/rate-limit/types.js +9 -0
- package/dist/plugins/rate-limit/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-BY8OxNgO.js.map → index-CynOqPkb.js.map} +1 -1
- package/dist-ui/index.html +1 -1
- package/dist-ui-lib/api/controlPanelApi.d.ts +187 -0
- package/dist-ui-lib/components/StatCard.d.ts +16 -0
- package/dist-ui-lib/dashboard/widgets/AuthStatusWidget.d.ts +9 -0
- package/dist-ui-lib/dashboard/widgets/IntegrationStatusWidget.d.ts +9 -0
- package/dist-ui-lib/dashboard/widgets/NotificationsStatsWidget.d.ts +12 -0
- package/dist-ui-lib/dashboard/widgets/index.d.ts +3 -0
- package/dist-ui-lib/index.js +3579 -2379
- package/dist-ui-lib/index.js.map +1 -1
- package/dist-ui-lib/pages/IntegrationsPage.d.ts +1 -0
- package/dist-ui-lib/pages/NotificationsPage.d.ts +9 -0
- package/dist-ui-lib/pages/RateLimitPage.d.ts +1 -0
- package/dist-ui-lib/utils/formatters.d.ts +19 -0
- package/package.json +1 -1
- package/src/core/control-panel.ts +128 -0
- package/src/core/types.ts +17 -0
- package/src/index.ts +216 -0
- package/src/plugins/auth/adapter-wrapper.test.ts +395 -0
- package/src/plugins/auth/adapter-wrapper.ts +205 -0
- package/src/plugins/auth/config-store.test.ts +417 -0
- package/src/plugins/auth/config-store.ts +305 -0
- package/src/plugins/auth/env-config.ts +714 -7
- package/src/plugins/auth/index.ts +22 -1
- package/src/plugins/auth/types.ts +138 -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 +267 -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/rate-limit/__tests__/rate-limit-plugin.test.ts +259 -0
- package/src/plugins/rate-limit/cleanup.ts +117 -0
- package/src/plugins/rate-limit/env-config.ts +400 -0
- package/src/plugins/rate-limit/index.ts +128 -0
- package/src/plugins/rate-limit/middleware.ts +212 -0
- package/src/plugins/rate-limit/rate-limit-plugin.ts +400 -0
- package/src/plugins/rate-limit/rate-limit-service.ts +228 -0
- package/src/plugins/rate-limit/stores/cache-store.ts +261 -0
- package/src/plugins/rate-limit/stores/index.ts +8 -0
- package/src/plugins/rate-limit/stores/postgres-store.ts +402 -0
- package/src/plugins/rate-limit/strategies/fixed-window.ts +116 -0
- package/src/plugins/rate-limit/strategies/index.ts +30 -0
- package/src/plugins/rate-limit/strategies/sliding-window.ts +157 -0
- package/src/plugins/rate-limit/strategies/token-bucket.ts +154 -0
- package/src/plugins/rate-limit/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 +36 -14
- package/ui/src/api/controlPanelApi.ts +329 -6
- package/ui/src/components/StatCard.tsx +58 -0
- package/ui/src/dashboard/builtInWidgets.tsx +7 -1
- package/ui/src/dashboard/widgets/AuthStatusWidget.tsx +143 -0
- package/ui/src/dashboard/widgets/IntegrationStatusWidget.tsx +135 -0
- package/ui/src/dashboard/widgets/NotificationsStatsWidget.tsx +167 -0
- package/ui/src/dashboard/widgets/index.ts +3 -0
- package/ui/src/pages/AuthPage.tsx +986 -142
- package/ui/src/pages/IntegrationsPage.tsx +288 -0
- package/ui/src/pages/NotificationsPage.tsx +417 -0
- package/ui/src/pages/RateLimitPage.tsx +292 -0
- package/ui/src/utils/formatters.ts +33 -0
- package/dist-ui/assets/index-BY8OxNgO.js +0 -465
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Card,
|
|
5
|
+
CardContent,
|
|
6
|
+
Typography,
|
|
7
|
+
TextField,
|
|
8
|
+
Select,
|
|
9
|
+
MenuItem,
|
|
10
|
+
FormControl,
|
|
11
|
+
InputLabel,
|
|
12
|
+
Switch,
|
|
13
|
+
FormControlLabel,
|
|
14
|
+
Button,
|
|
15
|
+
CircularProgress,
|
|
16
|
+
Alert,
|
|
17
|
+
IconButton,
|
|
18
|
+
Tooltip,
|
|
19
|
+
Chip,
|
|
20
|
+
} from '@mui/material';
|
|
21
|
+
import RefreshIcon from '@mui/icons-material/Refresh';
|
|
22
|
+
import SaveIcon from '@mui/icons-material/Save';
|
|
23
|
+
import SpeedIcon from '@mui/icons-material/Speed';
|
|
24
|
+
import StorageIcon from '@mui/icons-material/Storage';
|
|
25
|
+
import CachedIcon from '@mui/icons-material/Cached';
|
|
26
|
+
import { api, RateLimitConfig, RateLimitStrategy } from '../api/controlPanelApi';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Format milliseconds to human-readable duration
|
|
30
|
+
*/
|
|
31
|
+
function formatDuration(ms: number): string {
|
|
32
|
+
if (ms < 1000) return `${ms}ms`;
|
|
33
|
+
if (ms < 60000) return `${ms / 1000}s`;
|
|
34
|
+
if (ms < 3600000) return `${ms / 60000}m`;
|
|
35
|
+
return `${ms / 3600000}h`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function RateLimitPage() {
|
|
39
|
+
const [config, setConfig] = useState<RateLimitConfig | null>(null);
|
|
40
|
+
const [loading, setLoading] = useState(true);
|
|
41
|
+
const [saving, setSaving] = useState(false);
|
|
42
|
+
const [error, setError] = useState<string | null>(null);
|
|
43
|
+
const [success, setSuccess] = useState<string | null>(null);
|
|
44
|
+
|
|
45
|
+
// Editable fields
|
|
46
|
+
const [windowMs, setWindowMs] = useState<number>(60000);
|
|
47
|
+
const [maxRequests, setMaxRequests] = useState<number>(100);
|
|
48
|
+
const [strategy, setStrategy] = useState<RateLimitStrategy>('sliding-window');
|
|
49
|
+
const [cleanupEnabled, setCleanupEnabled] = useState<boolean>(true);
|
|
50
|
+
const [cleanupIntervalMs, setCleanupIntervalMs] = useState<number>(300000);
|
|
51
|
+
|
|
52
|
+
const fetchConfig = async () => {
|
|
53
|
+
setLoading(true);
|
|
54
|
+
setError(null);
|
|
55
|
+
try {
|
|
56
|
+
const data = await api.getRateLimitConfig();
|
|
57
|
+
setConfig(data);
|
|
58
|
+
// Update editable fields
|
|
59
|
+
setWindowMs(data.windowMs);
|
|
60
|
+
setMaxRequests(data.maxRequests);
|
|
61
|
+
setStrategy(data.strategy);
|
|
62
|
+
setCleanupEnabled(data.cleanupEnabled);
|
|
63
|
+
setCleanupIntervalMs(data.cleanupIntervalMs);
|
|
64
|
+
} catch (err) {
|
|
65
|
+
setError(err instanceof Error ? err.message : 'Failed to fetch config');
|
|
66
|
+
} finally {
|
|
67
|
+
setLoading(false);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
fetchConfig();
|
|
73
|
+
}, []);
|
|
74
|
+
|
|
75
|
+
const handleSave = async () => {
|
|
76
|
+
setSaving(true);
|
|
77
|
+
setError(null);
|
|
78
|
+
setSuccess(null);
|
|
79
|
+
try {
|
|
80
|
+
const result = await api.updateRateLimitConfig({
|
|
81
|
+
windowMs,
|
|
82
|
+
maxRequests,
|
|
83
|
+
strategy,
|
|
84
|
+
cleanupEnabled,
|
|
85
|
+
cleanupIntervalMs,
|
|
86
|
+
});
|
|
87
|
+
setConfig(result.config);
|
|
88
|
+
setSuccess('Configuration saved successfully');
|
|
89
|
+
setTimeout(() => setSuccess(null), 3000);
|
|
90
|
+
} catch (err) {
|
|
91
|
+
setError(err instanceof Error ? err.message : 'Failed to save config');
|
|
92
|
+
} finally {
|
|
93
|
+
setSaving(false);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const hasChanges = config && (
|
|
98
|
+
windowMs !== config.windowMs ||
|
|
99
|
+
maxRequests !== config.maxRequests ||
|
|
100
|
+
strategy !== config.strategy ||
|
|
101
|
+
cleanupEnabled !== config.cleanupEnabled ||
|
|
102
|
+
cleanupIntervalMs !== config.cleanupIntervalMs
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
if (loading) {
|
|
106
|
+
return (
|
|
107
|
+
<Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', minHeight: '50vh' }}>
|
|
108
|
+
<CircularProgress />
|
|
109
|
+
</Box>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (error && !config) {
|
|
114
|
+
return (
|
|
115
|
+
<Card sx={{ bgcolor: 'var(--theme-surface)', border: '1px solid var(--theme-error)' }}>
|
|
116
|
+
<CardContent>
|
|
117
|
+
<Typography color="error">{error}</Typography>
|
|
118
|
+
</CardContent>
|
|
119
|
+
</Card>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<Box>
|
|
125
|
+
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 1 }}>
|
|
126
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
|
127
|
+
<SpeedIcon sx={{ color: 'var(--theme-primary)', fontSize: 32 }} />
|
|
128
|
+
<Typography variant="h4" sx={{ color: 'var(--theme-text-primary)' }}>
|
|
129
|
+
Rate Limits
|
|
130
|
+
</Typography>
|
|
131
|
+
</Box>
|
|
132
|
+
<Box sx={{ display: 'flex', gap: 1 }}>
|
|
133
|
+
<Tooltip title="Refresh">
|
|
134
|
+
<IconButton onClick={fetchConfig} sx={{ color: 'var(--theme-text-secondary)' }}>
|
|
135
|
+
<RefreshIcon />
|
|
136
|
+
</IconButton>
|
|
137
|
+
</Tooltip>
|
|
138
|
+
<Button
|
|
139
|
+
variant="contained"
|
|
140
|
+
startIcon={saving ? <CircularProgress size={16} color="inherit" /> : <SaveIcon />}
|
|
141
|
+
onClick={handleSave}
|
|
142
|
+
disabled={saving || !hasChanges}
|
|
143
|
+
sx={{ minWidth: 100 }}
|
|
144
|
+
>
|
|
145
|
+
{saving ? 'Saving...' : 'Save'}
|
|
146
|
+
</Button>
|
|
147
|
+
</Box>
|
|
148
|
+
</Box>
|
|
149
|
+
<Typography variant="body2" sx={{ mb: 4, color: 'var(--theme-text-secondary)' }}>
|
|
150
|
+
Configure rate limiting defaults for your API
|
|
151
|
+
</Typography>
|
|
152
|
+
|
|
153
|
+
{/* Success/Error messages */}
|
|
154
|
+
{success && <Alert severity="success" sx={{ mb: 3 }}>{success}</Alert>}
|
|
155
|
+
{error && config && <Alert severity="error" sx={{ mb: 3 }}>{error}</Alert>}
|
|
156
|
+
|
|
157
|
+
{/* Status Card */}
|
|
158
|
+
<Card sx={{ bgcolor: 'var(--theme-surface)', mb: 3 }}>
|
|
159
|
+
<CardContent>
|
|
160
|
+
<Typography variant="h6" sx={{ color: 'var(--theme-text-primary)', mb: 2 }}>
|
|
161
|
+
System Status
|
|
162
|
+
</Typography>
|
|
163
|
+
<Box sx={{ display: 'flex', gap: 3, flexWrap: 'wrap' }}>
|
|
164
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
|
165
|
+
<StorageIcon sx={{ color: 'var(--theme-text-secondary)' }} />
|
|
166
|
+
<Box>
|
|
167
|
+
<Typography variant="caption" sx={{ color: 'var(--theme-text-secondary)' }}>Store</Typography>
|
|
168
|
+
<Typography sx={{ color: 'var(--theme-text-primary)' }}>{config?.store}</Typography>
|
|
169
|
+
</Box>
|
|
170
|
+
</Box>
|
|
171
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
|
172
|
+
<CachedIcon sx={{ color: config?.cacheAvailable ? 'var(--theme-success)' : 'var(--theme-warning)' }} />
|
|
173
|
+
<Box>
|
|
174
|
+
<Typography variant="caption" sx={{ color: 'var(--theme-text-secondary)' }}>Cache</Typography>
|
|
175
|
+
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
|
176
|
+
<Typography sx={{ color: 'var(--theme-text-primary)' }}>{config?.cache}</Typography>
|
|
177
|
+
<Chip
|
|
178
|
+
label={config?.cacheAvailable ? 'Available' : 'Unavailable'}
|
|
179
|
+
size="small"
|
|
180
|
+
sx={{
|
|
181
|
+
bgcolor: config?.cacheAvailable ? 'var(--theme-success)20' : 'var(--theme-warning)20',
|
|
182
|
+
color: config?.cacheAvailable ? 'var(--theme-success)' : 'var(--theme-warning)',
|
|
183
|
+
}}
|
|
184
|
+
/>
|
|
185
|
+
</Box>
|
|
186
|
+
</Box>
|
|
187
|
+
</Box>
|
|
188
|
+
</Box>
|
|
189
|
+
</CardContent>
|
|
190
|
+
</Card>
|
|
191
|
+
|
|
192
|
+
{/* Rate Limit Settings */}
|
|
193
|
+
<Card sx={{ bgcolor: 'var(--theme-surface)', mb: 3 }}>
|
|
194
|
+
<CardContent>
|
|
195
|
+
<Typography variant="h6" sx={{ color: 'var(--theme-text-primary)', mb: 3 }}>
|
|
196
|
+
Default Rate Limit Settings
|
|
197
|
+
</Typography>
|
|
198
|
+
|
|
199
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
200
|
+
{/* Strategy */}
|
|
201
|
+
<FormControl fullWidth>
|
|
202
|
+
<InputLabel sx={{ color: 'var(--theme-text-secondary)' }}>Strategy</InputLabel>
|
|
203
|
+
<Select
|
|
204
|
+
value={strategy}
|
|
205
|
+
label="Strategy"
|
|
206
|
+
onChange={(e) => setStrategy(e.target.value as RateLimitStrategy)}
|
|
207
|
+
sx={{
|
|
208
|
+
color: 'var(--theme-text-primary)',
|
|
209
|
+
'& .MuiOutlinedInput-notchedOutline': { borderColor: 'var(--theme-border)' },
|
|
210
|
+
}}
|
|
211
|
+
>
|
|
212
|
+
<MenuItem value="sliding-window">
|
|
213
|
+
Sliding Window - Smooth rate limiting with weighted overlap
|
|
214
|
+
</MenuItem>
|
|
215
|
+
<MenuItem value="fixed-window">
|
|
216
|
+
Fixed Window - Simple discrete time windows
|
|
217
|
+
</MenuItem>
|
|
218
|
+
<MenuItem value="token-bucket">
|
|
219
|
+
Token Bucket - Allows bursts while maintaining average rate
|
|
220
|
+
</MenuItem>
|
|
221
|
+
</Select>
|
|
222
|
+
</FormControl>
|
|
223
|
+
|
|
224
|
+
{/* Window and Max Requests */}
|
|
225
|
+
<Box sx={{ display: 'flex', gap: 3, flexWrap: 'wrap' }}>
|
|
226
|
+
<TextField
|
|
227
|
+
label="Window (ms)"
|
|
228
|
+
type="number"
|
|
229
|
+
value={windowMs}
|
|
230
|
+
onChange={(e) => setWindowMs(Math.max(1000, parseInt(e.target.value) || 60000))}
|
|
231
|
+
helperText={`= ${formatDuration(windowMs)}`}
|
|
232
|
+
sx={{ flex: 1, minWidth: 200 }}
|
|
233
|
+
InputProps={{ inputProps: { min: 1000, step: 1000 } }}
|
|
234
|
+
/>
|
|
235
|
+
<TextField
|
|
236
|
+
label="Max Requests"
|
|
237
|
+
type="number"
|
|
238
|
+
value={maxRequests}
|
|
239
|
+
onChange={(e) => setMaxRequests(Math.max(1, parseInt(e.target.value) || 100))}
|
|
240
|
+
helperText="Per window per key"
|
|
241
|
+
sx={{ flex: 1, minWidth: 200 }}
|
|
242
|
+
InputProps={{ inputProps: { min: 1 } }}
|
|
243
|
+
/>
|
|
244
|
+
</Box>
|
|
245
|
+
|
|
246
|
+
{/* Summary */}
|
|
247
|
+
<Alert severity="info" sx={{ bgcolor: 'var(--theme-surface)' }}>
|
|
248
|
+
<Typography variant="body2">
|
|
249
|
+
<strong>Current limit:</strong> {maxRequests} requests per {formatDuration(windowMs)} using {strategy} strategy
|
|
250
|
+
</Typography>
|
|
251
|
+
</Alert>
|
|
252
|
+
</Box>
|
|
253
|
+
</CardContent>
|
|
254
|
+
</Card>
|
|
255
|
+
|
|
256
|
+
{/* Cleanup Settings */}
|
|
257
|
+
<Card sx={{ bgcolor: 'var(--theme-surface)' }}>
|
|
258
|
+
<CardContent>
|
|
259
|
+
<Typography variant="h6" sx={{ color: 'var(--theme-text-primary)', mb: 3 }}>
|
|
260
|
+
Cleanup Job
|
|
261
|
+
</Typography>
|
|
262
|
+
|
|
263
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
264
|
+
<FormControlLabel
|
|
265
|
+
control={
|
|
266
|
+
<Switch
|
|
267
|
+
checked={cleanupEnabled}
|
|
268
|
+
onChange={(e) => setCleanupEnabled(e.target.checked)}
|
|
269
|
+
color="primary"
|
|
270
|
+
/>
|
|
271
|
+
}
|
|
272
|
+
label="Enable automatic cleanup of expired rate limits"
|
|
273
|
+
sx={{ color: 'var(--theme-text-primary)' }}
|
|
274
|
+
/>
|
|
275
|
+
|
|
276
|
+
{cleanupEnabled && (
|
|
277
|
+
<TextField
|
|
278
|
+
label="Cleanup Interval (ms)"
|
|
279
|
+
type="number"
|
|
280
|
+
value={cleanupIntervalMs}
|
|
281
|
+
onChange={(e) => setCleanupIntervalMs(Math.max(60000, parseInt(e.target.value) || 300000))}
|
|
282
|
+
helperText={`= ${formatDuration(cleanupIntervalMs)}`}
|
|
283
|
+
sx={{ maxWidth: 300 }}
|
|
284
|
+
InputProps={{ inputProps: { min: 60000, step: 60000 } }}
|
|
285
|
+
/>
|
|
286
|
+
)}
|
|
287
|
+
</Box>
|
|
288
|
+
</CardContent>
|
|
289
|
+
</Card>
|
|
290
|
+
</Box>
|
|
291
|
+
);
|
|
292
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
/**
|
|
10
|
+
* Format a number with K/M suffix for large values
|
|
11
|
+
*/
|
|
12
|
+
export function formatNumber(num: number): string {
|
|
13
|
+
if (num >= 1000000) return `${(num / 1000000).toFixed(1)}M`;
|
|
14
|
+
if (num >= 1000) return `${(num / 1000).toFixed(1)}K`;
|
|
15
|
+
return num.toString();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Format milliseconds to human-readable duration
|
|
20
|
+
*/
|
|
21
|
+
export function formatDuration(ms: number): string {
|
|
22
|
+
if (ms < 1000) return `${ms}ms`;
|
|
23
|
+
if (ms < 60000) return `${(ms / 1000).toFixed(0)}s`;
|
|
24
|
+
if (ms < 3600000) return `${(ms / 60000).toFixed(0)}m`;
|
|
25
|
+
return `${(ms / 3600000).toFixed(1)}h`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Truncate a string ID for display
|
|
30
|
+
*/
|
|
31
|
+
export function truncateId(id: string, maxLength = 12): string {
|
|
32
|
+
return id.length > maxLength ? `${id.substring(0, maxLength)}...` : id;
|
|
33
|
+
}
|