@qwickapps/server 1.5.2 → 1.6.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 +86 -0
- package/README.md +177 -0
- package/dist/core/control-panel.d.ts.map +1 -1
- package/dist/core/control-panel.js +118 -261
- package/dist/core/control-panel.js.map +1 -1
- package/dist/core/plugin-registry.d.ts +20 -0
- package/dist/core/plugin-registry.d.ts.map +1 -1
- package/dist/core/plugin-registry.js +27 -2
- package/dist/core/plugin-registry.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/plugins/api-keys/ApiKeysManagementPage.d.ts +9 -0
- package/dist/plugins/api-keys/ApiKeysManagementPage.d.ts.map +1 -0
- package/dist/plugins/api-keys/ApiKeysManagementPage.js +66 -0
- package/dist/plugins/api-keys/ApiKeysManagementPage.js.map +1 -0
- package/dist/plugins/api-keys/ApiKeysStatusWidget.d.ts +9 -0
- package/dist/plugins/api-keys/ApiKeysStatusWidget.d.ts.map +1 -0
- package/dist/plugins/api-keys/ApiKeysStatusWidget.js +30 -0
- package/dist/plugins/api-keys/ApiKeysStatusWidget.js.map +1 -0
- package/dist/plugins/api-keys/api-keys-plugin.d.ts +46 -0
- package/dist/plugins/api-keys/api-keys-plugin.d.ts.map +1 -0
- package/dist/plugins/api-keys/api-keys-plugin.js +452 -0
- package/dist/plugins/api-keys/api-keys-plugin.js.map +1 -0
- package/dist/plugins/api-keys/index.d.ts +18 -0
- package/dist/plugins/api-keys/index.d.ts.map +1 -0
- package/dist/plugins/api-keys/index.js +20 -0
- package/dist/plugins/api-keys/index.js.map +1 -0
- package/dist/plugins/api-keys/middleware/bearer-token-auth.d.ts +74 -0
- package/dist/plugins/api-keys/middleware/bearer-token-auth.d.ts.map +1 -0
- package/dist/plugins/api-keys/middleware/bearer-token-auth.js +201 -0
- package/dist/plugins/api-keys/middleware/bearer-token-auth.js.map +1 -0
- package/dist/plugins/api-keys/middleware/index.d.ts +8 -0
- package/dist/plugins/api-keys/middleware/index.d.ts.map +1 -0
- package/dist/plugins/api-keys/middleware/index.js +8 -0
- package/dist/plugins/api-keys/middleware/index.js.map +1 -0
- package/dist/plugins/api-keys/middleware/usage-logging.d.ts +21 -0
- package/dist/plugins/api-keys/middleware/usage-logging.d.ts.map +1 -0
- package/dist/plugins/api-keys/middleware/usage-logging.js +57 -0
- package/dist/plugins/api-keys/middleware/usage-logging.js.map +1 -0
- package/dist/plugins/api-keys/stores/index.d.ts +9 -0
- package/dist/plugins/api-keys/stores/index.d.ts.map +1 -0
- package/dist/plugins/api-keys/stores/index.js +9 -0
- package/dist/plugins/api-keys/stores/index.js.map +1 -0
- package/dist/plugins/api-keys/stores/plugin-scope-store.d.ts +81 -0
- package/dist/plugins/api-keys/stores/plugin-scope-store.d.ts.map +1 -0
- package/dist/plugins/api-keys/stores/plugin-scope-store.js +155 -0
- package/dist/plugins/api-keys/stores/plugin-scope-store.js.map +1 -0
- package/dist/plugins/api-keys/stores/postgres-store.d.ts +34 -0
- package/dist/plugins/api-keys/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/api-keys/stores/postgres-store.js +360 -0
- package/dist/plugins/api-keys/stores/postgres-store.js.map +1 -0
- package/dist/plugins/api-keys/stores/usage-log-store.d.ts +119 -0
- package/dist/plugins/api-keys/stores/usage-log-store.d.ts.map +1 -0
- package/dist/plugins/api-keys/stores/usage-log-store.js +246 -0
- package/dist/plugins/api-keys/stores/usage-log-store.js.map +1 -0
- package/dist/plugins/api-keys/types.d.ts +309 -0
- package/dist/plugins/api-keys/types.d.ts.map +1 -0
- package/dist/plugins/api-keys/types.js +105 -0
- package/dist/plugins/api-keys/types.js.map +1 -0
- package/dist/plugins/auth/AuthManagementPage.d.ts +9 -0
- package/dist/plugins/auth/AuthManagementPage.d.ts.map +1 -0
- package/dist/plugins/auth/AuthManagementPage.js +73 -0
- package/dist/plugins/auth/AuthManagementPage.js.map +1 -0
- package/dist/plugins/auth/AuthStatusWidget.d.ts +9 -0
- package/dist/plugins/auth/AuthStatusWidget.d.ts.map +1 -0
- package/dist/plugins/auth/AuthStatusWidget.js +30 -0
- package/dist/plugins/auth/AuthStatusWidget.js.map +1 -0
- package/dist/plugins/auth/adapters/basic-adapter.d.ts +1 -0
- package/dist/plugins/auth/adapters/basic-adapter.d.ts.map +1 -1
- package/dist/plugins/auth/adapters/basic-adapter.js +54 -0
- package/dist/plugins/auth/adapters/basic-adapter.js.map +1 -1
- package/dist/plugins/auth/auth-plugin.js +1 -1
- package/dist/plugins/auth/auth-plugin.js.map +1 -1
- package/dist/plugins/auth/env-config.d.ts +15 -1
- package/dist/plugins/auth/env-config.d.ts.map +1 -1
- package/dist/plugins/auth/env-config.js +16 -6
- package/dist/plugins/auth/env-config.js.map +1 -1
- package/dist/plugins/auth/index.d.ts +5 -1
- package/dist/plugins/auth/index.d.ts.map +1 -1
- package/dist/plugins/auth/index.js +7 -1
- package/dist/plugins/auth/index.js.map +1 -1
- package/dist/plugins/bans/BansManagementPage.d.ts +9 -0
- package/dist/plugins/bans/BansManagementPage.d.ts.map +1 -0
- package/dist/plugins/bans/BansManagementPage.js +65 -0
- package/dist/plugins/bans/BansManagementPage.js.map +1 -0
- package/dist/plugins/bans/BansStatusWidget.d.ts +9 -0
- package/dist/plugins/bans/BansStatusWidget.d.ts.map +1 -0
- package/dist/plugins/bans/BansStatusWidget.js +30 -0
- package/dist/plugins/bans/BansStatusWidget.js.map +1 -0
- package/dist/plugins/bans/bans-plugin.js +1 -1
- package/dist/plugins/bans/bans-plugin.js.map +1 -1
- package/dist/plugins/bans/index.d.ts +4 -0
- package/dist/plugins/bans/index.d.ts.map +1 -1
- package/dist/plugins/bans/index.js +3 -0
- package/dist/plugins/bans/index.js.map +1 -1
- package/dist/plugins/cache/CacheManagementPage.d.ts +13 -0
- package/dist/plugins/cache/CacheManagementPage.d.ts.map +1 -0
- package/dist/plugins/cache/CacheManagementPage.js +175 -0
- package/dist/plugins/cache/CacheManagementPage.js.map +1 -0
- package/dist/plugins/cache/CacheStatusWidget.d.ts +13 -0
- package/dist/plugins/cache/CacheStatusWidget.d.ts.map +1 -0
- package/dist/plugins/cache/CacheStatusWidget.js +80 -0
- package/dist/plugins/cache/CacheStatusWidget.js.map +1 -0
- package/dist/plugins/cache/index.d.ts +10 -0
- package/dist/plugins/cache/index.d.ts.map +1 -0
- package/dist/plugins/cache/index.js +8 -0
- package/dist/plugins/cache/index.js.map +1 -0
- package/dist/plugins/cms/cms-plugin.d.ts +24 -0
- package/dist/plugins/cms/cms-plugin.d.ts.map +1 -0
- package/dist/plugins/cms/cms-plugin.js +220 -0
- package/dist/plugins/cms/cms-plugin.js.map +1 -0
- package/dist/plugins/cms/index.d.ts +8 -0
- package/dist/plugins/cms/index.d.ts.map +1 -0
- package/dist/plugins/cms/index.js +7 -0
- package/dist/plugins/cms/index.js.map +1 -0
- package/dist/plugins/config-plugin.js +4 -4
- package/dist/plugins/config-plugin.js.map +1 -1
- package/dist/plugins/core/index.d.ts +32 -0
- package/dist/plugins/core/index.d.ts.map +1 -0
- package/dist/plugins/core/index.js +129 -0
- package/dist/plugins/core/index.js.map +1 -0
- package/dist/plugins/devices/DevicesManagementPage.d.ts +9 -0
- package/dist/plugins/devices/DevicesManagementPage.d.ts.map +1 -0
- package/dist/plugins/devices/DevicesManagementPage.js +65 -0
- package/dist/plugins/devices/DevicesManagementPage.js.map +1 -0
- package/dist/plugins/devices/DevicesStatusWidget.d.ts +9 -0
- package/dist/plugins/devices/DevicesStatusWidget.d.ts.map +1 -0
- package/dist/plugins/devices/DevicesStatusWidget.js +30 -0
- package/dist/plugins/devices/DevicesStatusWidget.js.map +1 -0
- package/dist/plugins/devices/devices-plugin.js +1 -1
- package/dist/plugins/devices/devices-plugin.js.map +1 -1
- package/dist/plugins/devices/index.d.ts +4 -0
- package/dist/plugins/devices/index.d.ts.map +1 -1
- package/dist/plugins/devices/index.js +3 -0
- package/dist/plugins/devices/index.js.map +1 -1
- package/dist/plugins/diagnostics/DiagnosticsManagementPage.d.ts +13 -0
- package/dist/plugins/diagnostics/DiagnosticsManagementPage.d.ts.map +1 -0
- package/dist/plugins/diagnostics/DiagnosticsManagementPage.js +78 -0
- package/dist/plugins/diagnostics/DiagnosticsManagementPage.js.map +1 -0
- package/dist/plugins/diagnostics/DiagnosticsStatusWidget.d.ts +13 -0
- package/dist/plugins/diagnostics/DiagnosticsStatusWidget.d.ts.map +1 -0
- package/dist/plugins/diagnostics/DiagnosticsStatusWidget.js +87 -0
- package/dist/plugins/diagnostics/DiagnosticsStatusWidget.js.map +1 -0
- package/dist/plugins/diagnostics/index.d.ts +10 -0
- package/dist/plugins/diagnostics/index.d.ts.map +1 -0
- package/dist/plugins/diagnostics/index.js +8 -0
- package/dist/plugins/diagnostics/index.js.map +1 -0
- package/dist/plugins/diagnostics-plugin.js +4 -3
- package/dist/plugins/diagnostics-plugin.js.map +1 -1
- package/dist/plugins/entitlements/EntitlementsManagementPage.d.ts +9 -0
- package/dist/plugins/entitlements/EntitlementsManagementPage.d.ts.map +1 -0
- package/dist/plugins/entitlements/EntitlementsManagementPage.js +59 -0
- package/dist/plugins/entitlements/EntitlementsManagementPage.js.map +1 -0
- package/dist/plugins/entitlements/EntitlementsStatusWidget.d.ts +9 -0
- package/dist/plugins/entitlements/EntitlementsStatusWidget.d.ts.map +1 -0
- package/dist/plugins/entitlements/EntitlementsStatusWidget.js +30 -0
- package/dist/plugins/entitlements/EntitlementsStatusWidget.js.map +1 -0
- package/dist/plugins/entitlements/entitlements-plugin.js +1 -1
- package/dist/plugins/entitlements/entitlements-plugin.js.map +1 -1
- package/dist/plugins/entitlements/index.d.ts +4 -0
- package/dist/plugins/entitlements/index.d.ts.map +1 -1
- package/dist/plugins/entitlements/index.js +3 -0
- package/dist/plugins/entitlements/index.js.map +1 -1
- package/dist/plugins/frontend-app-plugin.d.ts.map +1 -1
- package/dist/plugins/frontend-app-plugin.js +5 -2
- package/dist/plugins/frontend-app-plugin.js.map +1 -1
- package/dist/plugins/health/HealthManagementPage.d.ts +13 -0
- package/dist/plugins/health/HealthManagementPage.d.ts.map +1 -0
- package/dist/plugins/health/HealthManagementPage.js +120 -0
- package/dist/plugins/health/HealthManagementPage.js.map +1 -0
- package/dist/plugins/health/HealthStatusWidget.d.ts +13 -0
- package/dist/plugins/health/HealthStatusWidget.d.ts.map +1 -0
- package/dist/plugins/health/HealthStatusWidget.js +80 -0
- package/dist/plugins/health/HealthStatusWidget.js.map +1 -0
- package/dist/plugins/health/index.d.ts +10 -0
- package/dist/plugins/health/index.d.ts.map +1 -0
- package/dist/plugins/health/index.js +8 -0
- package/dist/plugins/health/index.js.map +1 -0
- package/dist/plugins/index.d.ts +9 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +6 -1
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/logs/LogsManagementPage.d.ts +13 -0
- package/dist/plugins/logs/LogsManagementPage.d.ts.map +1 -0
- package/dist/plugins/logs/LogsManagementPage.js +151 -0
- package/dist/plugins/logs/LogsManagementPage.js.map +1 -0
- package/dist/plugins/logs/LogsStatusWidget.d.ts +13 -0
- package/dist/plugins/logs/LogsStatusWidget.d.ts.map +1 -0
- package/dist/plugins/logs/LogsStatusWidget.js +76 -0
- package/dist/plugins/logs/LogsStatusWidget.js.map +1 -0
- package/dist/plugins/logs/index.d.ts +10 -0
- package/dist/plugins/logs/index.d.ts.map +1 -0
- package/dist/plugins/logs/index.js +8 -0
- package/dist/plugins/logs/index.js.map +1 -0
- package/dist/plugins/logs-plugin.js +6 -6
- package/dist/plugins/logs-plugin.js.map +1 -1
- package/dist/plugins/maintenance/MaintenanceManagementPage.d.ts +13 -0
- package/dist/plugins/maintenance/MaintenanceManagementPage.d.ts.map +1 -0
- package/dist/plugins/maintenance/MaintenanceManagementPage.js +40 -0
- package/dist/plugins/maintenance/MaintenanceManagementPage.js.map +1 -0
- package/dist/plugins/maintenance/MaintenanceStatusWidget.d.ts +13 -0
- package/dist/plugins/maintenance/MaintenanceStatusWidget.d.ts.map +1 -0
- package/dist/plugins/maintenance/MaintenanceStatusWidget.js +76 -0
- package/dist/plugins/maintenance/MaintenanceStatusWidget.js.map +1 -0
- package/dist/plugins/maintenance/SeedExecutor.d.ts +17 -0
- package/dist/plugins/maintenance/SeedExecutor.d.ts.map +1 -0
- package/dist/plugins/maintenance/SeedExecutor.js +154 -0
- package/dist/plugins/maintenance/SeedExecutor.js.map +1 -0
- package/dist/plugins/maintenance/SeedHistory.d.ts +14 -0
- package/dist/plugins/maintenance/SeedHistory.d.ts.map +1 -0
- package/dist/plugins/maintenance/SeedHistory.js +183 -0
- package/dist/plugins/maintenance/SeedHistory.js.map +1 -0
- package/dist/plugins/maintenance/SeedList.d.ts +15 -0
- package/dist/plugins/maintenance/SeedList.d.ts.map +1 -0
- package/dist/plugins/maintenance/SeedList.js +68 -0
- package/dist/plugins/maintenance/SeedList.js.map +1 -0
- package/dist/plugins/maintenance/SeedManagementPage.d.ts +14 -0
- package/dist/plugins/maintenance/SeedManagementPage.d.ts.map +1 -0
- package/dist/plugins/maintenance/SeedManagementPage.js +42 -0
- package/dist/plugins/maintenance/SeedManagementPage.js.map +1 -0
- package/dist/plugins/maintenance/index.d.ts +20 -0
- package/dist/plugins/maintenance/index.d.ts.map +1 -0
- package/dist/plugins/maintenance/index.js +15 -0
- package/dist/plugins/maintenance/index.js.map +1 -0
- package/dist/plugins/maintenance/seed-executor.d.ts +55 -0
- package/dist/plugins/maintenance/seed-executor.d.ts.map +1 -0
- package/dist/plugins/maintenance/seed-executor.js +178 -0
- package/dist/plugins/maintenance/seed-executor.js.map +1 -0
- package/dist/plugins/maintenance-plugin.d.ts +35 -0
- package/dist/plugins/maintenance-plugin.d.ts.map +1 -0
- package/dist/plugins/maintenance-plugin.js +321 -0
- package/dist/plugins/maintenance-plugin.js.map +1 -0
- package/dist/plugins/notifications/NotificationsManagementPage.d.ts +13 -0
- package/dist/plugins/notifications/NotificationsManagementPage.d.ts.map +1 -0
- package/dist/plugins/notifications/NotificationsManagementPage.js +59 -0
- package/dist/plugins/notifications/NotificationsManagementPage.js.map +1 -0
- package/dist/plugins/notifications/NotificationsStatusWidget.d.ts +9 -0
- package/dist/plugins/notifications/NotificationsStatusWidget.d.ts.map +1 -0
- package/dist/plugins/notifications/NotificationsStatusWidget.js +30 -0
- package/dist/plugins/notifications/NotificationsStatusWidget.js.map +1 -0
- package/dist/plugins/notifications/index.d.ts +4 -0
- package/dist/plugins/notifications/index.d.ts.map +1 -1
- package/dist/plugins/notifications/index.js +3 -0
- package/dist/plugins/notifications/index.js.map +1 -1
- package/dist/plugins/notifications/notifications-plugin.js +1 -1
- package/dist/plugins/notifications/notifications-plugin.js.map +1 -1
- package/dist/plugins/parental/ParentalManagementPage.d.ts +9 -0
- package/dist/plugins/parental/ParentalManagementPage.d.ts.map +1 -0
- package/dist/plugins/parental/ParentalManagementPage.js +56 -0
- package/dist/plugins/parental/ParentalManagementPage.js.map +1 -0
- package/dist/plugins/parental/ParentalStatusWidget.d.ts +9 -0
- package/dist/plugins/parental/ParentalStatusWidget.d.ts.map +1 -0
- package/dist/plugins/parental/ParentalStatusWidget.js +30 -0
- package/dist/plugins/parental/ParentalStatusWidget.js.map +1 -0
- package/dist/plugins/parental/index.d.ts +4 -0
- package/dist/plugins/parental/index.d.ts.map +1 -1
- package/dist/plugins/parental/index.js +3 -0
- package/dist/plugins/parental/index.js.map +1 -1
- package/dist/plugins/parental/parental-plugin.js +1 -1
- package/dist/plugins/parental/parental-plugin.js.map +1 -1
- package/dist/plugins/postgres/PostgresManagementPage.d.ts +13 -0
- package/dist/plugins/postgres/PostgresManagementPage.d.ts.map +1 -0
- package/dist/plugins/postgres/PostgresManagementPage.js +139 -0
- package/dist/plugins/postgres/PostgresManagementPage.js.map +1 -0
- package/dist/plugins/postgres/PostgresStatusWidget.d.ts +13 -0
- package/dist/plugins/postgres/PostgresStatusWidget.d.ts.map +1 -0
- package/dist/plugins/postgres/PostgresStatusWidget.js +87 -0
- package/dist/plugins/postgres/PostgresStatusWidget.js.map +1 -0
- package/dist/plugins/postgres/index.d.ts +10 -0
- package/dist/plugins/postgres/index.d.ts.map +1 -0
- package/dist/plugins/postgres/index.js +8 -0
- package/dist/plugins/postgres/index.js.map +1 -0
- package/dist/plugins/preferences/PreferencesManagementPage.d.ts +9 -0
- package/dist/plugins/preferences/PreferencesManagementPage.d.ts.map +1 -0
- package/dist/plugins/preferences/PreferencesManagementPage.js +67 -0
- package/dist/plugins/preferences/PreferencesManagementPage.js.map +1 -0
- package/dist/plugins/preferences/PreferencesStatusWidget.d.ts +9 -0
- package/dist/plugins/preferences/PreferencesStatusWidget.d.ts.map +1 -0
- package/dist/plugins/preferences/PreferencesStatusWidget.js +30 -0
- package/dist/plugins/preferences/PreferencesStatusWidget.js.map +1 -0
- package/dist/plugins/preferences/index.d.ts +4 -0
- package/dist/plugins/preferences/index.d.ts.map +1 -1
- package/dist/plugins/preferences/index.js +3 -0
- package/dist/plugins/preferences/index.js.map +1 -1
- package/dist/plugins/preferences/preferences-plugin.d.ts.map +1 -1
- package/dist/plugins/preferences/preferences-plugin.js +9 -4
- package/dist/plugins/preferences/preferences-plugin.js.map +1 -1
- package/dist/plugins/preferences/types.d.ts +5 -0
- package/dist/plugins/preferences/types.d.ts.map +1 -1
- package/dist/plugins/preferences/types.js +5 -1
- package/dist/plugins/preferences/types.js.map +1 -1
- package/dist/plugins/profiles/ProfilesManagementPage.d.ts +9 -0
- package/dist/plugins/profiles/ProfilesManagementPage.d.ts.map +1 -0
- package/dist/plugins/profiles/ProfilesManagementPage.js +51 -0
- package/dist/plugins/profiles/ProfilesManagementPage.js.map +1 -0
- package/dist/plugins/profiles/ProfilesStatusWidget.d.ts +9 -0
- package/dist/plugins/profiles/ProfilesStatusWidget.d.ts.map +1 -0
- package/dist/plugins/profiles/ProfilesStatusWidget.js +30 -0
- package/dist/plugins/profiles/ProfilesStatusWidget.js.map +1 -0
- package/dist/plugins/profiles/index.d.ts +4 -0
- package/dist/plugins/profiles/index.d.ts.map +1 -1
- package/dist/plugins/profiles/index.js +3 -0
- package/dist/plugins/profiles/index.js.map +1 -1
- package/dist/plugins/profiles/profiles-plugin.js +1 -1
- package/dist/plugins/profiles/profiles-plugin.js.map +1 -1
- package/dist/plugins/qwickbrain/QwickbrainManagementPage.d.ts +13 -0
- package/dist/plugins/qwickbrain/QwickbrainManagementPage.d.ts.map +1 -0
- package/dist/plugins/qwickbrain/QwickbrainManagementPage.js +59 -0
- package/dist/plugins/qwickbrain/QwickbrainManagementPage.js.map +1 -0
- package/dist/plugins/qwickbrain/QwickbrainStatusWidget.d.ts +9 -0
- package/dist/plugins/qwickbrain/QwickbrainStatusWidget.d.ts.map +1 -0
- package/dist/plugins/qwickbrain/QwickbrainStatusWidget.js +30 -0
- package/dist/plugins/qwickbrain/QwickbrainStatusWidget.js.map +1 -0
- package/dist/plugins/qwickbrain/index.d.ts +4 -0
- package/dist/plugins/qwickbrain/index.d.ts.map +1 -1
- package/dist/plugins/qwickbrain/index.js +3 -0
- package/dist/plugins/qwickbrain/index.js.map +1 -1
- package/dist/plugins/qwickbrain/qwickbrain-plugin.d.ts.map +1 -1
- package/dist/plugins/qwickbrain/qwickbrain-plugin.js +12 -34
- package/dist/plugins/qwickbrain/qwickbrain-plugin.js.map +1 -1
- package/dist/plugins/qwickbrain/types.d.ts +0 -1
- package/dist/plugins/qwickbrain/types.d.ts.map +1 -1
- package/dist/plugins/rate-limit/RateLimitManagementPage.d.ts +13 -0
- package/dist/plugins/rate-limit/RateLimitManagementPage.d.ts.map +1 -0
- package/dist/plugins/rate-limit/RateLimitManagementPage.js +60 -0
- package/dist/plugins/rate-limit/RateLimitManagementPage.js.map +1 -0
- package/dist/plugins/rate-limit/RateLimitStatusWidget.d.ts +9 -0
- package/dist/plugins/rate-limit/RateLimitStatusWidget.d.ts.map +1 -0
- package/dist/plugins/rate-limit/RateLimitStatusWidget.js +30 -0
- package/dist/plugins/rate-limit/RateLimitStatusWidget.js.map +1 -0
- package/dist/plugins/rate-limit/index.d.ts +4 -0
- package/dist/plugins/rate-limit/index.d.ts.map +1 -1
- package/dist/plugins/rate-limit/index.js +3 -0
- package/dist/plugins/rate-limit/index.js.map +1 -1
- package/dist/plugins/rate-limit/rate-limit-plugin.js +5 -5
- package/dist/plugins/rate-limit/rate-limit-plugin.js.map +1 -1
- package/dist/plugins/subscriptions/SubscriptionsManagementPage.d.ts +9 -0
- package/dist/plugins/subscriptions/SubscriptionsManagementPage.d.ts.map +1 -0
- package/dist/plugins/subscriptions/SubscriptionsManagementPage.js +66 -0
- package/dist/plugins/subscriptions/SubscriptionsManagementPage.js.map +1 -0
- package/dist/plugins/subscriptions/SubscriptionsStatusWidget.d.ts +9 -0
- package/dist/plugins/subscriptions/SubscriptionsStatusWidget.d.ts.map +1 -0
- package/dist/plugins/subscriptions/SubscriptionsStatusWidget.js +30 -0
- package/dist/plugins/subscriptions/SubscriptionsStatusWidget.js.map +1 -0
- package/dist/plugins/subscriptions/index.d.ts +4 -0
- package/dist/plugins/subscriptions/index.d.ts.map +1 -1
- package/dist/plugins/subscriptions/index.js +3 -0
- package/dist/plugins/subscriptions/index.js.map +1 -1
- package/dist/plugins/subscriptions/subscriptions-plugin.js +1 -1
- package/dist/plugins/subscriptions/subscriptions-plugin.js.map +1 -1
- package/dist/plugins/usage/UsageManagementPage.d.ts +9 -0
- package/dist/plugins/usage/UsageManagementPage.d.ts.map +1 -0
- package/dist/plugins/usage/UsageManagementPage.js +42 -0
- package/dist/plugins/usage/UsageManagementPage.js.map +1 -0
- package/dist/plugins/usage/UsageStatusWidget.d.ts +9 -0
- package/dist/plugins/usage/UsageStatusWidget.d.ts.map +1 -0
- package/dist/plugins/usage/UsageStatusWidget.js +30 -0
- package/dist/plugins/usage/UsageStatusWidget.js.map +1 -0
- package/dist/plugins/usage/index.d.ts +4 -0
- package/dist/plugins/usage/index.d.ts.map +1 -1
- package/dist/plugins/usage/index.js +3 -0
- package/dist/plugins/usage/index.js.map +1 -1
- package/dist/plugins/usage/usage-plugin.js +1 -1
- package/dist/plugins/usage/usage-plugin.js.map +1 -1
- package/dist/plugins/users/UsersManagementPage.d.ts +13 -0
- package/dist/plugins/users/UsersManagementPage.d.ts.map +1 -0
- package/dist/plugins/users/UsersManagementPage.js +199 -0
- package/dist/plugins/users/UsersManagementPage.js.map +1 -0
- package/dist/plugins/users/UsersStatusWidget.d.ts +13 -0
- package/dist/plugins/users/UsersStatusWidget.d.ts.map +1 -0
- package/dist/plugins/users/UsersStatusWidget.js +79 -0
- package/dist/plugins/users/UsersStatusWidget.js.map +1 -0
- package/dist/plugins/users/stores/postgres-store.d.ts.map +1 -1
- package/dist/plugins/users/stores/postgres-store.js +74 -19
- package/dist/plugins/users/stores/postgres-store.js.map +1 -1
- package/dist/plugins/users/types.d.ts +30 -1
- package/dist/plugins/users/types.d.ts.map +1 -1
- package/dist/plugins/users/users-plugin.d.ts.map +1 -1
- package/dist/plugins/users/users-plugin.js +118 -3
- package/dist/plugins/users/users-plugin.js.map +1 -1
- package/dist-ui/assets/index-BiEHWqD3.js +528 -0
- package/dist-ui/assets/index-BiEHWqD3.js.map +1 -0
- package/dist-ui/index.html +1 -1
- package/dist-ui-lib/index.js +3682 -2765
- package/dist-ui-lib/index.js.map +1 -1
- package/dist-ui-lib/src/api/clientBuilder.d.ts +33 -0
- package/dist-ui-lib/{api → src/api}/controlPanelApi.d.ts +124 -0
- package/dist-ui-lib/src/api/index.d.ts +11 -0
- package/dist-ui-lib/src/api/types.d.ts +313 -0
- package/dist-ui-lib/{components → src/components}/ControlPanelApp.d.ts +2 -1
- package/dist-ui-lib/src/components/auth/AcceptInvitationPage.d.ts +21 -0
- package/dist-ui-lib/src/components/auth/LoginPage.d.ts +27 -0
- package/dist-ui-lib/src/components/auth/PasswordResetConfirmPage.d.ts +17 -0
- package/dist-ui-lib/src/components/auth/PasswordResetPage.d.ts +12 -0
- package/dist-ui-lib/src/components/auth/SignupPage.d.ts +27 -0
- package/dist-ui-lib/src/components/auth/VerifyEmailPage.d.ts +12 -0
- package/dist-ui-lib/src/components/auth/index.d.ts +19 -0
- package/dist-ui-lib/src/components/auth/shared/AuthError.d.ts +9 -0
- package/dist-ui-lib/src/components/auth/shared/AuthLayout.d.ts +11 -0
- package/dist-ui-lib/src/components/auth/shared/index.d.ts +7 -0
- package/dist-ui-lib/{components → src/components}/index.d.ts +5 -2
- package/dist-ui-lib/src/components/plugins/PluginConfigPanel.d.ts +65 -0
- package/dist-ui-lib/src/components/plugins/PluginManagementPage.d.ts +62 -0
- package/dist-ui-lib/src/components/plugins/PluginStatusWidget.d.ts +51 -0
- package/dist-ui-lib/src/components/plugins/index.d.ts +13 -0
- package/dist-ui-lib/src/config/preferences.d.ts +16 -0
- package/dist-ui-lib/src/dashboard/widgets/CMSMaintenanceWidget.d.ts +8 -0
- package/dist-ui-lib/src/dashboard/widgets/CMSStatusWidget.d.ts +8 -0
- package/dist-ui-lib/{dashboard → src/dashboard}/widgets/index.d.ts +2 -0
- package/dist-ui-lib/src/hooks/useJobStream.d.ts +38 -0
- package/dist-ui-lib/src/pages/AcceptInvitationPage.d.ts +28 -0
- package/dist-ui-lib/src/pages/PreferencesPage.d.ts +9 -0
- package/package.json +12 -5
- package/src/core/control-panel.ts +141 -286
- package/src/core/plugin-registry.ts +52 -3
- package/src/index.ts +27 -0
- package/src/plugins/api-keys/API_ROUTES.md +165 -0
- package/src/plugins/api-keys/ApiKeysManagementPage.test.tsx +58 -0
- package/src/plugins/api-keys/ApiKeysManagementPage.tsx +131 -0
- package/src/plugins/api-keys/ApiKeysStatusWidget.test.tsx +112 -0
- package/src/plugins/api-keys/ApiKeysStatusWidget.tsx +53 -0
- package/src/plugins/api-keys/api-keys-plugin.ts +533 -0
- package/src/plugins/api-keys/index.ts +55 -0
- package/src/plugins/api-keys/middleware/bearer-token-auth.ts +250 -0
- package/src/plugins/api-keys/middleware/index.ts +15 -0
- package/src/plugins/api-keys/middleware/usage-logging.ts +78 -0
- package/src/plugins/api-keys/stores/index.ts +21 -0
- package/src/plugins/api-keys/stores/plugin-scope-store.ts +280 -0
- package/src/plugins/api-keys/stores/postgres-store.ts +487 -0
- package/src/plugins/api-keys/stores/usage-log-store.ts +423 -0
- package/src/plugins/api-keys/types.ts +307 -0
- package/src/plugins/auth/API_ROUTES.md +110 -0
- package/src/plugins/auth/AuthManagementPage.test.tsx +58 -0
- package/src/plugins/auth/AuthManagementPage.tsx +170 -0
- package/src/plugins/auth/AuthStatusWidget.test.tsx +112 -0
- package/src/plugins/auth/AuthStatusWidget.tsx +53 -0
- package/src/plugins/auth/adapters/basic-adapter.ts +62 -0
- package/src/plugins/auth/auth-plugin.ts +1 -1
- package/src/plugins/auth/env-config.ts +16 -6
- package/src/plugins/auth/index.ts +9 -0
- package/src/plugins/bans/API_ROUTES.md +183 -0
- package/src/plugins/bans/BansManagementPage.test.tsx +58 -0
- package/src/plugins/bans/BansManagementPage.tsx +129 -0
- package/src/plugins/bans/BansStatusWidget.test.tsx +112 -0
- package/src/plugins/bans/BansStatusWidget.tsx +53 -0
- package/src/plugins/bans/bans-plugin.ts +1 -1
- package/src/plugins/bans/index.ts +6 -0
- package/src/plugins/cache/API_ROUTES.md +312 -0
- package/src/plugins/cache/CacheManagementPage.test.tsx +57 -0
- package/src/plugins/cache/CacheManagementPage.tsx +360 -0
- package/src/plugins/cache/CacheStatusWidget.test.tsx +113 -0
- package/src/plugins/cache/CacheStatusWidget.tsx +122 -0
- package/src/plugins/cache/index.ts +10 -0
- package/src/plugins/cms/cms-plugin.ts +259 -0
- package/src/plugins/cms/index.ts +8 -0
- package/src/plugins/config-plugin.ts +4 -4
- package/src/plugins/core/index.ts +164 -0
- package/src/plugins/devices/API_ROUTES.md +27 -0
- package/src/plugins/devices/DevicesManagementPage.test.tsx +58 -0
- package/src/plugins/devices/DevicesManagementPage.tsx +124 -0
- package/src/plugins/devices/DevicesStatusWidget.test.tsx +109 -0
- package/src/plugins/devices/DevicesStatusWidget.tsx +52 -0
- package/src/plugins/devices/devices-plugin.ts +1 -1
- package/src/plugins/devices/index.ts +6 -0
- package/src/plugins/diagnostics/API_ROUTES.md +316 -0
- package/src/plugins/diagnostics/DiagnosticsManagementPage.test.tsx +58 -0
- package/src/plugins/diagnostics/DiagnosticsManagementPage.tsx +306 -0
- package/src/plugins/diagnostics/DiagnosticsStatusWidget.test.tsx +112 -0
- package/src/plugins/diagnostics/DiagnosticsStatusWidget.tsx +129 -0
- package/src/plugins/diagnostics/index.ts +10 -0
- package/src/plugins/diagnostics-plugin.ts +3 -3
- package/src/plugins/entitlements/API_ROUTES.md +27 -0
- package/src/plugins/entitlements/EntitlementsManagementPage.test.tsx +58 -0
- package/src/plugins/entitlements/EntitlementsManagementPage.tsx +113 -0
- package/src/plugins/entitlements/EntitlementsStatusWidget.test.tsx +109 -0
- package/src/plugins/entitlements/EntitlementsStatusWidget.tsx +52 -0
- package/src/plugins/entitlements/entitlements-plugin.ts +1 -1
- package/src/plugins/entitlements/index.ts +6 -0
- package/src/plugins/frontend-app-plugin.ts +7 -2
- package/src/plugins/health/API_ROUTES.md +283 -0
- package/src/plugins/health/HealthManagementPage.test.tsx +57 -0
- package/src/plugins/health/HealthManagementPage.tsx +320 -0
- package/src/plugins/health/HealthStatusWidget.test.tsx +107 -0
- package/src/plugins/health/HealthStatusWidget.tsx +134 -0
- package/src/plugins/health/index.ts +10 -0
- package/src/plugins/index.ts +49 -0
- package/src/plugins/logs/API_ROUTES.md +297 -0
- package/src/plugins/logs/LogsManagementPage.test.tsx +58 -0
- package/src/plugins/logs/LogsManagementPage.tsx +283 -0
- package/src/plugins/logs/LogsStatusWidget.test.tsx +119 -0
- package/src/plugins/logs/LogsStatusWidget.tsx +123 -0
- package/src/plugins/logs/index.ts +10 -0
- package/src/plugins/logs-plugin.ts +6 -6
- package/src/plugins/maintenance/MaintenanceManagementPage.tsx +193 -0
- package/src/plugins/maintenance/MaintenanceStatusWidget.tsx +120 -0
- package/src/plugins/maintenance/SeedExecutor.tsx +236 -0
- package/src/plugins/maintenance/SeedHistory.tsx +360 -0
- package/src/plugins/maintenance/SeedList.tsx +130 -0
- package/src/plugins/maintenance/SeedManagementPage.tsx +91 -0
- package/src/plugins/maintenance/index.ts +24 -0
- package/src/plugins/maintenance/seed-executor.ts +224 -0
- package/src/plugins/maintenance-plugin.ts +409 -0
- package/src/plugins/notifications/NotificationsManagementPage.test.tsx +58 -0
- package/src/plugins/notifications/NotificationsManagementPage.tsx +128 -0
- package/src/plugins/notifications/NotificationsStatusWidget.test.tsx +109 -0
- package/src/plugins/notifications/NotificationsStatusWidget.tsx +52 -0
- package/src/plugins/notifications/index.ts +6 -0
- package/src/plugins/notifications/notifications-plugin.ts +1 -1
- package/src/plugins/parental/API_ROUTES.md +30 -0
- package/src/plugins/parental/ParentalManagementPage.test.tsx +58 -0
- package/src/plugins/parental/ParentalManagementPage.tsx +119 -0
- package/src/plugins/parental/ParentalStatusWidget.test.tsx +109 -0
- package/src/plugins/parental/ParentalStatusWidget.tsx +52 -0
- package/src/plugins/parental/index.ts +6 -0
- package/src/plugins/parental/parental-plugin.ts +1 -1
- package/src/plugins/postgres/API_ROUTES.md +243 -0
- package/src/plugins/postgres/PostgresManagementPage.test.tsx +62 -0
- package/src/plugins/postgres/PostgresManagementPage.tsx +362 -0
- package/src/plugins/postgres/PostgresStatusWidget.test.tsx +117 -0
- package/src/plugins/postgres/PostgresStatusWidget.tsx +131 -0
- package/src/plugins/postgres/index.ts +10 -0
- package/src/plugins/preferences/API_ROUTES.md +162 -0
- package/src/plugins/preferences/PreferencesManagementPage.test.tsx +58 -0
- package/src/plugins/preferences/PreferencesManagementPage.tsx +139 -0
- package/src/plugins/preferences/PreferencesStatusWidget.test.tsx +109 -0
- package/src/plugins/preferences/PreferencesStatusWidget.tsx +52 -0
- package/src/plugins/preferences/index.ts +6 -0
- package/src/plugins/preferences/preferences-plugin.ts +10 -5
- package/src/plugins/preferences/types.d.ts +95 -0
- package/src/plugins/preferences/types.ts +6 -0
- package/src/plugins/profiles/API_ROUTES.md +27 -0
- package/src/plugins/profiles/ProfilesManagementPage.test.tsx +58 -0
- package/src/plugins/profiles/ProfilesManagementPage.tsx +113 -0
- package/src/plugins/profiles/ProfilesStatusWidget.test.tsx +109 -0
- package/src/plugins/profiles/ProfilesStatusWidget.tsx +52 -0
- package/src/plugins/profiles/index.ts +6 -0
- package/src/plugins/profiles/profiles-plugin.ts +1 -1
- package/src/plugins/qwickbrain/QwickbrainManagementPage.test.tsx +58 -0
- package/src/plugins/qwickbrain/QwickbrainManagementPage.tsx +126 -0
- package/src/plugins/qwickbrain/QwickbrainStatusWidget.test.tsx +109 -0
- package/src/plugins/qwickbrain/QwickbrainStatusWidget.tsx +52 -0
- package/src/plugins/qwickbrain/index.ts +6 -0
- package/src/plugins/qwickbrain/qwickbrain-plugin.ts +12 -36
- package/src/plugins/qwickbrain/types.ts +0 -1
- package/src/plugins/rate-limit/RateLimitManagementPage.test.tsx +58 -0
- package/src/plugins/rate-limit/RateLimitManagementPage.tsx +127 -0
- package/src/plugins/rate-limit/RateLimitStatusWidget.test.tsx +109 -0
- package/src/plugins/rate-limit/RateLimitStatusWidget.tsx +52 -0
- package/src/plugins/rate-limit/index.ts +6 -0
- package/src/plugins/rate-limit/rate-limit-plugin.ts +5 -5
- package/src/plugins/subscriptions/API_ROUTES.md +27 -0
- package/src/plugins/subscriptions/SubscriptionsManagementPage.test.tsx +58 -0
- package/src/plugins/subscriptions/SubscriptionsManagementPage.tsx +125 -0
- package/src/plugins/subscriptions/SubscriptionsStatusWidget.test.tsx +109 -0
- package/src/plugins/subscriptions/SubscriptionsStatusWidget.tsx +52 -0
- package/src/plugins/subscriptions/index.ts +6 -0
- package/src/plugins/subscriptions/subscriptions-plugin.ts +1 -1
- package/src/plugins/usage/API_ROUTES.md +24 -0
- package/src/plugins/usage/UsageManagementPage.test.tsx +58 -0
- package/src/plugins/usage/UsageManagementPage.tsx +93 -0
- package/src/plugins/usage/UsageStatusWidget.test.tsx +109 -0
- package/src/plugins/usage/UsageStatusWidget.tsx +52 -0
- package/src/plugins/usage/index.ts +6 -0
- package/src/plugins/usage/usage-plugin.ts +1 -1
- package/src/plugins/users/API_ROUTES.md +311 -0
- package/src/plugins/users/UsersManagementPage.test.tsx +58 -0
- package/src/plugins/users/UsersManagementPage.tsx +384 -0
- package/src/plugins/users/UsersStatusWidget.test.tsx +114 -0
- package/src/plugins/users/UsersStatusWidget.tsx +120 -0
- package/src/plugins/users/__tests__/postgres-store.test.ts +1 -0
- package/src/plugins/users/__tests__/users-plugin.test.ts +22 -18
- package/src/plugins/users/stores/postgres-store.ts +95 -17
- package/src/plugins/users/types.ts +33 -1
- package/src/plugins/users/users-plugin.ts +137 -3
- package/ui/src/App.tsx +18 -4
- package/ui/src/api/clientBuilder.ts +206 -0
- package/ui/src/api/controlPanelApi.ts +309 -122
- package/ui/src/api/index.ts +12 -0
- package/ui/src/api/types.ts +276 -0
- package/ui/src/components/ControlPanelApp.tsx +4 -5
- package/ui/src/components/auth/AcceptInvitationPage.tsx +151 -0
- package/ui/src/components/auth/LoginPage.tsx +122 -0
- package/ui/src/components/auth/PasswordResetConfirmPage.tsx +109 -0
- package/ui/src/components/auth/PasswordResetPage.tsx +95 -0
- package/ui/src/components/auth/SignupPage.tsx +140 -0
- package/ui/src/components/auth/VerifyEmailPage.tsx +38 -0
- package/ui/src/components/auth/__tests__/AcceptInvitationPage.test.tsx +201 -0
- package/ui/src/components/auth/__tests__/LoginPage.test.tsx +207 -0
- package/ui/src/components/auth/__tests__/PasswordResetConfirmPage.test.tsx +183 -0
- package/ui/src/components/auth/__tests__/PasswordResetPage.test.tsx +174 -0
- package/ui/src/components/auth/__tests__/SignupPage.test.tsx +210 -0
- package/ui/src/components/auth/__tests__/VerifyEmailPage.test.tsx +53 -0
- package/ui/src/components/auth/index.ts +26 -0
- package/ui/src/components/auth/shared/AuthError.tsx +28 -0
- package/ui/src/components/auth/shared/AuthLayout.tsx +42 -0
- package/ui/src/components/auth/shared/index.ts +9 -0
- package/ui/src/components/index.ts +21 -2
- package/ui/src/components/plugins/PluginConfigPanel.tsx +315 -0
- package/ui/src/components/plugins/PluginManagementPage.tsx +218 -0
- package/ui/src/components/plugins/PluginStatusWidget.tsx +158 -0
- package/ui/src/components/plugins/index.ts +20 -0
- package/ui/src/config/preferences.ts +18 -0
- package/ui/src/dashboard/builtInWidgets.tsx +15 -1
- package/ui/src/dashboard/widgets/CMSMaintenanceWidget.tsx +229 -0
- package/ui/src/dashboard/widgets/CMSStatusWidget.tsx +115 -0
- package/ui/src/dashboard/widgets/NotificationsStatsWidget.tsx +1 -1
- package/ui/src/dashboard/widgets/index.ts +2 -0
- package/ui/src/hooks/useJobStream.ts +194 -0
- package/ui/src/pages/APIKeysPage.tsx +849 -0
- package/ui/src/pages/AcceptInvitationPage.tsx +169 -0
- package/ui/src/pages/ContentOpsJobsPage.tsx +422 -0
- package/ui/src/pages/MaintenancePage.tsx +27 -0
- package/ui/src/pages/NotificationsPage.tsx +1 -1
- package/ui/src/pages/PluginPage.tsx +3 -1
- package/ui/src/pages/PreferencesPage.tsx +240 -0
- package/ui/src/pages/UsersPage.tsx +225 -2
- package/ui/src/pages/__tests__/PreferencesPage.test.tsx +273 -0
- package/ui/src/pages/index.ts +15 -0
- package/ui/tsconfig.lib.json +4 -2
- package/dist/plugins/auth/adapter-wrapper.test.d.ts +0 -7
- package/dist/plugins/auth/adapter-wrapper.test.d.ts.map +0 -1
- package/dist/plugins/auth/adapter-wrapper.test.js +0 -303
- package/dist/plugins/auth/adapter-wrapper.test.js.map +0 -1
- package/dist/plugins/auth/auth-plugin.test.d.ts +0 -9
- package/dist/plugins/auth/auth-plugin.test.d.ts.map +0 -1
- package/dist/plugins/auth/auth-plugin.test.js +0 -280
- package/dist/plugins/auth/auth-plugin.test.js.map +0 -1
- package/dist/plugins/auth/config-store.test.d.ts +0 -7
- package/dist/plugins/auth/config-store.test.d.ts.map +0 -1
- package/dist/plugins/auth/config-store.test.js +0 -299
- package/dist/plugins/auth/config-store.test.js.map +0 -1
- package/dist/plugins/auth/supertokens-adapter.test.d.ts +0 -10
- package/dist/plugins/auth/supertokens-adapter.test.d.ts.map +0 -1
- package/dist/plugins/auth/supertokens-adapter.test.js +0 -486
- package/dist/plugins/auth/supertokens-adapter.test.js.map +0 -1
- package/dist/plugins/cache-plugin.test.d.ts +0 -8
- package/dist/plugins/cache-plugin.test.d.ts.map +0 -1
- package/dist/plugins/cache-plugin.test.js +0 -255
- package/dist/plugins/cache-plugin.test.js.map +0 -1
- package/dist/plugins/devices/__tests__/devices-plugin.test.d.ts +0 -11
- package/dist/plugins/devices/__tests__/devices-plugin.test.d.ts.map +0 -1
- package/dist/plugins/devices/__tests__/devices-plugin.test.js +0 -410
- package/dist/plugins/devices/__tests__/devices-plugin.test.js.map +0 -1
- package/dist/plugins/devices/__tests__/token-utils.test.d.ts +0 -7
- package/dist/plugins/devices/__tests__/token-utils.test.d.ts.map +0 -1
- package/dist/plugins/devices/__tests__/token-utils.test.js +0 -199
- package/dist/plugins/devices/__tests__/token-utils.test.js.map +0 -1
- package/dist/plugins/notifications/__tests__/notifications-manager.test.d.ts +0 -5
- package/dist/plugins/notifications/__tests__/notifications-manager.test.d.ts.map +0 -1
- package/dist/plugins/notifications/__tests__/notifications-manager.test.js +0 -470
- package/dist/plugins/notifications/__tests__/notifications-manager.test.js.map +0 -1
- package/dist/plugins/parental/__tests__/parental-plugin.test.d.ts +0 -12
- package/dist/plugins/parental/__tests__/parental-plugin.test.d.ts.map +0 -1
- package/dist/plugins/parental/__tests__/parental-plugin.test.js +0 -349
- package/dist/plugins/parental/__tests__/parental-plugin.test.js.map +0 -1
- package/dist/plugins/postgres-plugin.test.d.ts +0 -8
- package/dist/plugins/postgres-plugin.test.d.ts.map +0 -1
- package/dist/plugins/postgres-plugin.test.js +0 -186
- package/dist/plugins/postgres-plugin.test.js.map +0 -1
- package/dist/plugins/preferences/__tests__/deep-merge.test.d.ts +0 -7
- package/dist/plugins/preferences/__tests__/deep-merge.test.d.ts.map +0 -1
- package/dist/plugins/preferences/__tests__/deep-merge.test.js +0 -215
- package/dist/plugins/preferences/__tests__/deep-merge.test.js.map +0 -1
- package/dist/plugins/preferences/__tests__/preferences-plugin.test.d.ts +0 -7
- package/dist/plugins/preferences/__tests__/preferences-plugin.test.d.ts.map +0 -1
- package/dist/plugins/preferences/__tests__/preferences-plugin.test.js +0 -265
- package/dist/plugins/preferences/__tests__/preferences-plugin.test.js.map +0 -1
- package/dist/plugins/profiles/__tests__/profiles-plugin.test.d.ts +0 -11
- package/dist/plugins/profiles/__tests__/profiles-plugin.test.d.ts.map +0 -1
- package/dist/plugins/profiles/__tests__/profiles-plugin.test.js +0 -243
- package/dist/plugins/profiles/__tests__/profiles-plugin.test.js.map +0 -1
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.d.ts +0 -7
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.d.ts.map +0 -1
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.js +0 -220
- package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.js.map +0 -1
- package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.d.ts +0 -11
- package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.d.ts.map +0 -1
- package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.js +0 -305
- package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.js.map +0 -1
- package/dist/plugins/usage/__tests__/usage-plugin.test.d.ts +0 -11
- package/dist/plugins/usage/__tests__/usage-plugin.test.d.ts.map +0 -1
- package/dist/plugins/usage/__tests__/usage-plugin.test.js +0 -218
- package/dist/plugins/usage/__tests__/usage-plugin.test.js.map +0 -1
- package/dist/plugins/users/__tests__/postgres-store.test.d.ts +0 -10
- package/dist/plugins/users/__tests__/postgres-store.test.d.ts.map +0 -1
- package/dist/plugins/users/__tests__/postgres-store.test.js +0 -229
- package/dist/plugins/users/__tests__/postgres-store.test.js.map +0 -1
- package/dist/plugins/users/__tests__/users-plugin.test.d.ts +0 -9
- package/dist/plugins/users/__tests__/users-plugin.test.d.ts.map +0 -1
- package/dist/plugins/users/__tests__/users-plugin.test.js +0 -549
- package/dist/plugins/users/__tests__/users-plugin.test.js.map +0 -1
- package/dist-ui/assets/index-BfC7mG5L.js +0 -469
- package/dist-ui/assets/index-BfC7mG5L.js.map +0 -1
- package/dist-ui-lib/components/StatCard.d.ts +0 -16
- package/dist-ui-lib/pages/ConfigPage.d.ts +0 -1
- package/dist-ui-lib/pages/DiagnosticsPage.d.ts +0 -1
- package/dist-ui-lib/pages/IntegrationsPage.d.ts +0 -1
- package/dist-ui-lib/pages/NotificationsPage.d.ts +0 -9
- package/dist-ui-lib/pages/PluginPage.d.ts +0 -15
- package/dist-ui-lib/pages/PluginsPage.d.ts +0 -1
- package/dist-ui-lib/pages/RateLimitPage.d.ts +0 -1
- package/ui/src/components/StatCard.tsx +0 -58
- /package/dist-ui-lib/{config → src/config}/AppConfig.d.ts +0 -0
- /package/dist-ui-lib/{dashboard → src/dashboard}/DashboardWidgetRegistry.d.ts +0 -0
- /package/dist-ui-lib/{dashboard → src/dashboard}/DashboardWidgetRenderer.d.ts +0 -0
- /package/dist-ui-lib/{dashboard → src/dashboard}/PluginWidgetRenderer.d.ts +0 -0
- /package/dist-ui-lib/{dashboard → src/dashboard}/WidgetComponentRegistry.d.ts +0 -0
- /package/dist-ui-lib/{dashboard → src/dashboard}/builtInWidgets.d.ts +0 -0
- /package/dist-ui-lib/{dashboard → src/dashboard}/index.d.ts +0 -0
- /package/dist-ui-lib/{dashboard → src/dashboard}/widgets/AuthStatusWidget.d.ts +0 -0
- /package/dist-ui-lib/{dashboard → src/dashboard}/widgets/IntegrationStatusWidget.d.ts +0 -0
- /package/dist-ui-lib/{dashboard → src/dashboard}/widgets/NotificationsStatsWidget.d.ts +0 -0
- /package/dist-ui-lib/{dashboard → src/dashboard}/widgets/ServiceHealthWidget.d.ts +0 -0
- /package/dist-ui-lib/{pages → src/pages}/AuthPage.d.ts +0 -0
- /package/dist-ui-lib/{pages → src/pages}/DashboardPage.d.ts +0 -0
- /package/dist-ui-lib/{pages → src/pages}/EntitlementsPage.d.ts +0 -0
- /package/dist-ui-lib/{pages → src/pages}/LogsPage.d.ts +0 -0
- /package/dist-ui-lib/{pages → src/pages}/NotFoundPage.d.ts +0 -0
- /package/dist-ui-lib/{pages → src/pages}/SystemPage.d.ts +0 -0
- /package/dist-ui-lib/{pages → src/pages}/UsersPage.d.ts +0 -0
- /package/dist-ui-lib/{utils → src/utils}/formatters.d.ts +0 -0
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Keys Plugin
|
|
3
|
+
*
|
|
4
|
+
* API key authentication and management plugin for @qwickapps/server.
|
|
5
|
+
* Provides API key generation, storage, and verification with PostgreSQL RLS.
|
|
6
|
+
*
|
|
7
|
+
* This plugin depends on the Users Plugin for user identity.
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type { Request, Response } from 'express';
|
|
13
|
+
import type { Plugin, PluginConfig, PluginRegistry } from '../../core/plugin-registry.js';
|
|
14
|
+
import type {
|
|
15
|
+
ApiKeysPluginConfig,
|
|
16
|
+
ApiKeyStore,
|
|
17
|
+
CreateApiKeyParams,
|
|
18
|
+
UpdateApiKeyParams,
|
|
19
|
+
ApiKey,
|
|
20
|
+
} from './types.js';
|
|
21
|
+
import type { AuthenticatedRequest } from '../auth/types.js';
|
|
22
|
+
import {
|
|
23
|
+
CreateApiKeySchema,
|
|
24
|
+
UpdateApiKeySchema,
|
|
25
|
+
} from './types.js';
|
|
26
|
+
|
|
27
|
+
// Store instance for helper access
|
|
28
|
+
let currentStore: ApiKeyStore | null = null;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Create the API Keys plugin
|
|
32
|
+
*/
|
|
33
|
+
export function createApiKeysPlugin(config: ApiKeysPluginConfig): Plugin {
|
|
34
|
+
const debug = config.debug || false;
|
|
35
|
+
// Framework automatically prefixes routes with plugin slug, so use root path
|
|
36
|
+
const apiPrefix = config.api?.prefix || '/';
|
|
37
|
+
const apiEnabled = config.api?.enabled !== false;
|
|
38
|
+
|
|
39
|
+
function log(message: string, data?: Record<string, unknown>) {
|
|
40
|
+
if (debug) {
|
|
41
|
+
console.log(`[ApiKeysPlugin] ${message}`, data || '');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
id: 'api-keys',
|
|
47
|
+
name: 'API Keys',
|
|
48
|
+
version: '1.0.0',
|
|
49
|
+
|
|
50
|
+
async onStart(_pluginConfig: PluginConfig, registry: PluginRegistry): Promise<void> {
|
|
51
|
+
log('Starting API keys plugin');
|
|
52
|
+
|
|
53
|
+
// Check for users plugin dependency
|
|
54
|
+
if (!registry.hasPlugin('users')) {
|
|
55
|
+
throw new Error('API Keys plugin requires Users plugin to be loaded first');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Initialize the store (creates tables and RLS policies if needed)
|
|
59
|
+
await config.store.initialize();
|
|
60
|
+
log('API keys store initialized');
|
|
61
|
+
|
|
62
|
+
// Initialize optional Phase 2 stores
|
|
63
|
+
if (config.scopeStore) {
|
|
64
|
+
await config.scopeStore.initialize();
|
|
65
|
+
log('Plugin scope store initialized');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (config.usageStore) {
|
|
69
|
+
await config.usageStore.initialize();
|
|
70
|
+
log('Usage log store initialized');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Store reference for helper access
|
|
74
|
+
currentStore = config.store;
|
|
75
|
+
|
|
76
|
+
// Register health check
|
|
77
|
+
registry.registerHealthCheck({
|
|
78
|
+
name: 'api-keys-store',
|
|
79
|
+
type: 'custom',
|
|
80
|
+
check: async () => {
|
|
81
|
+
try {
|
|
82
|
+
// Simple health check - store is accessible
|
|
83
|
+
return { healthy: currentStore !== null };
|
|
84
|
+
} catch {
|
|
85
|
+
return { healthy: false };
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Add API routes if enabled
|
|
91
|
+
if (apiEnabled) {
|
|
92
|
+
// POST /api-keys - Create a new API key
|
|
93
|
+
registry.addRoute({
|
|
94
|
+
method: 'post',
|
|
95
|
+
path: apiPrefix,
|
|
96
|
+
pluginId: 'api-keys',
|
|
97
|
+
handler: async (req: Request, res: Response) => {
|
|
98
|
+
try {
|
|
99
|
+
const authReq = req as AuthenticatedRequest;
|
|
100
|
+
const userId = authReq.auth?.user?.id;
|
|
101
|
+
|
|
102
|
+
if (!userId) {
|
|
103
|
+
return res.status(401).json({ error: 'Authentication required' });
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Validate request body
|
|
107
|
+
const validation = CreateApiKeySchema.safeParse(req.body);
|
|
108
|
+
if (!validation.success) {
|
|
109
|
+
return res.status(400).json({
|
|
110
|
+
error: 'Invalid request',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const params: CreateApiKeyParams = {
|
|
115
|
+
user_id: userId,
|
|
116
|
+
...validation.data,
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// Create the API key
|
|
120
|
+
const apiKey = await config.store.create(params);
|
|
121
|
+
|
|
122
|
+
// Return the key with plaintext (ONLY time plaintext is accessible)
|
|
123
|
+
res.status(201).json({
|
|
124
|
+
id: apiKey.id,
|
|
125
|
+
name: apiKey.name,
|
|
126
|
+
key: apiKey.plaintext_key, // Client must save this - won't be shown again
|
|
127
|
+
key_prefix: apiKey.key_prefix,
|
|
128
|
+
key_type: apiKey.key_type,
|
|
129
|
+
scopes: apiKey.scopes,
|
|
130
|
+
expires_at: apiKey.expires_at,
|
|
131
|
+
is_active: apiKey.is_active,
|
|
132
|
+
created_at: apiKey.created_at,
|
|
133
|
+
});
|
|
134
|
+
} catch (error) {
|
|
135
|
+
console.error('[ApiKeysPlugin] Create API key error:', error);
|
|
136
|
+
res.status(500).json({ error: 'Failed to create API key' });
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// GET /api-keys - List current user's API keys
|
|
142
|
+
registry.addRoute({
|
|
143
|
+
method: 'get',
|
|
144
|
+
path: apiPrefix,
|
|
145
|
+
pluginId: 'api-keys',
|
|
146
|
+
handler: async (req: Request, res: Response) => {
|
|
147
|
+
try {
|
|
148
|
+
const authReq = req as AuthenticatedRequest;
|
|
149
|
+
const userId = authReq.auth?.user?.id;
|
|
150
|
+
|
|
151
|
+
if (!userId) {
|
|
152
|
+
return res.status(401).json({ error: 'Authentication required' });
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const keys = await config.store.list(userId);
|
|
156
|
+
|
|
157
|
+
// Remove sensitive fields from response
|
|
158
|
+
const sanitized = keys.map(key => ({
|
|
159
|
+
id: key.id,
|
|
160
|
+
name: key.name,
|
|
161
|
+
key_prefix: key.key_prefix,
|
|
162
|
+
key_type: key.key_type,
|
|
163
|
+
scopes: key.scopes,
|
|
164
|
+
last_used_at: key.last_used_at,
|
|
165
|
+
expires_at: key.expires_at,
|
|
166
|
+
is_active: key.is_active,
|
|
167
|
+
created_at: key.created_at,
|
|
168
|
+
updated_at: key.updated_at,
|
|
169
|
+
}));
|
|
170
|
+
|
|
171
|
+
res.json({ keys: sanitized });
|
|
172
|
+
} catch (error) {
|
|
173
|
+
console.error('[ApiKeysPlugin] List API keys error:', error);
|
|
174
|
+
res.status(500).json({ error: 'Failed to list API keys' });
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// GET /api-keys/:id - Get a specific API key
|
|
180
|
+
registry.addRoute({
|
|
181
|
+
method: 'get',
|
|
182
|
+
path: `${apiPrefix}/:id`,
|
|
183
|
+
pluginId: 'api-keys',
|
|
184
|
+
handler: async (req: Request, res: Response) => {
|
|
185
|
+
try {
|
|
186
|
+
const authReq = req as AuthenticatedRequest;
|
|
187
|
+
const userId = authReq.auth?.user?.id;
|
|
188
|
+
|
|
189
|
+
if (!userId) {
|
|
190
|
+
return res.status(401).json({ error: 'Authentication required' });
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const { id } = req.params;
|
|
194
|
+
const key = await config.store.get(userId, id);
|
|
195
|
+
|
|
196
|
+
if (!key) {
|
|
197
|
+
return res.status(404).json({ error: 'API key not found' });
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Remove sensitive fields from response
|
|
201
|
+
const sanitized = {
|
|
202
|
+
id: key.id,
|
|
203
|
+
name: key.name,
|
|
204
|
+
key_prefix: key.key_prefix,
|
|
205
|
+
key_type: key.key_type,
|
|
206
|
+
scopes: key.scopes,
|
|
207
|
+
last_used_at: key.last_used_at,
|
|
208
|
+
expires_at: key.expires_at,
|
|
209
|
+
is_active: key.is_active,
|
|
210
|
+
created_at: key.created_at,
|
|
211
|
+
updated_at: key.updated_at,
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
res.json(sanitized);
|
|
215
|
+
} catch (error) {
|
|
216
|
+
console.error('[ApiKeysPlugin] Get API key error:', error);
|
|
217
|
+
res.status(500).json({ error: 'Failed to get API key' });
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// PUT /api-keys/:id - Update an API key
|
|
223
|
+
registry.addRoute({
|
|
224
|
+
method: 'put',
|
|
225
|
+
path: `${apiPrefix}/:id`,
|
|
226
|
+
pluginId: 'api-keys',
|
|
227
|
+
handler: async (req: Request, res: Response) => {
|
|
228
|
+
try {
|
|
229
|
+
const authReq = req as AuthenticatedRequest;
|
|
230
|
+
const userId = authReq.auth?.user?.id;
|
|
231
|
+
|
|
232
|
+
if (!userId) {
|
|
233
|
+
return res.status(401).json({ error: 'Authentication required' });
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// Validate request body
|
|
237
|
+
const validation = UpdateApiKeySchema.safeParse(req.body);
|
|
238
|
+
if (!validation.success) {
|
|
239
|
+
return res.status(400).json({
|
|
240
|
+
error: 'Invalid request',
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const { id } = req.params;
|
|
245
|
+
const params: UpdateApiKeyParams = validation.data;
|
|
246
|
+
|
|
247
|
+
const updated = await config.store.update(userId, id, params);
|
|
248
|
+
|
|
249
|
+
if (!updated) {
|
|
250
|
+
return res.status(404).json({ error: 'API key not found' });
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Remove sensitive fields from response
|
|
254
|
+
const sanitized = {
|
|
255
|
+
id: updated.id,
|
|
256
|
+
name: updated.name,
|
|
257
|
+
key_prefix: updated.key_prefix,
|
|
258
|
+
key_type: updated.key_type,
|
|
259
|
+
scopes: updated.scopes,
|
|
260
|
+
last_used_at: updated.last_used_at,
|
|
261
|
+
expires_at: updated.expires_at,
|
|
262
|
+
is_active: updated.is_active,
|
|
263
|
+
created_at: updated.created_at,
|
|
264
|
+
updated_at: updated.updated_at,
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
res.json(sanitized);
|
|
268
|
+
} catch (error) {
|
|
269
|
+
console.error('[ApiKeysPlugin] Update API key error:', error);
|
|
270
|
+
res.status(500).json({ error: 'Failed to update API key' });
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
// DELETE /api-keys/:id - Delete an API key
|
|
276
|
+
registry.addRoute({
|
|
277
|
+
method: 'delete',
|
|
278
|
+
path: `${apiPrefix}/:id`,
|
|
279
|
+
pluginId: 'api-keys',
|
|
280
|
+
handler: async (req: Request, res: Response) => {
|
|
281
|
+
try {
|
|
282
|
+
const authReq = req as AuthenticatedRequest;
|
|
283
|
+
const userId = authReq.auth?.user?.id;
|
|
284
|
+
|
|
285
|
+
if (!userId) {
|
|
286
|
+
return res.status(401).json({ error: 'Authentication required' });
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const { id } = req.params;
|
|
290
|
+
const deleted = await config.store.delete(userId, id);
|
|
291
|
+
|
|
292
|
+
if (!deleted) {
|
|
293
|
+
return res.status(404).json({ error: 'API key not found' });
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
res.status(204).send();
|
|
297
|
+
} catch (error) {
|
|
298
|
+
console.error('[ApiKeysPlugin] Delete API key error:', error);
|
|
299
|
+
res.status(500).json({ error: 'Failed to delete API key' });
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
// Phase 2: GET /scopes - List all available scopes
|
|
305
|
+
if (config.scopeStore) {
|
|
306
|
+
registry.addRoute({
|
|
307
|
+
method: 'get',
|
|
308
|
+
path: '/scopes',
|
|
309
|
+
pluginId: 'api-keys',
|
|
310
|
+
handler: async (_req: Request, res: Response) => {
|
|
311
|
+
try {
|
|
312
|
+
const scopes = await config.scopeStore!.getAllScopes();
|
|
313
|
+
|
|
314
|
+
// Group by plugin
|
|
315
|
+
const grouped = scopes.reduce((acc, scope) => {
|
|
316
|
+
if (!acc[scope.plugin_id]) {
|
|
317
|
+
acc[scope.plugin_id] = [];
|
|
318
|
+
}
|
|
319
|
+
acc[scope.plugin_id].push({
|
|
320
|
+
name: scope.name,
|
|
321
|
+
description: scope.description,
|
|
322
|
+
category: scope.category,
|
|
323
|
+
});
|
|
324
|
+
return acc;
|
|
325
|
+
}, {} as Record<string, Array<{ name: string; description: string; category?: string }>>);
|
|
326
|
+
|
|
327
|
+
// Convert to array format
|
|
328
|
+
const result = Object.entries(grouped).map(([pluginId, pluginScopes]) => ({
|
|
329
|
+
pluginId,
|
|
330
|
+
scopes: pluginScopes,
|
|
331
|
+
}));
|
|
332
|
+
|
|
333
|
+
res.json({ scopes: result });
|
|
334
|
+
} catch (error) {
|
|
335
|
+
console.error('[ApiKeysPlugin] Get scopes error:', error);
|
|
336
|
+
res.status(500).json({ error: 'Failed to retrieve scopes' });
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// Phase 2: GET /api-keys/:id/usage - Get usage logs for a specific key
|
|
343
|
+
if (config.usageStore) {
|
|
344
|
+
registry.addRoute({
|
|
345
|
+
method: 'get',
|
|
346
|
+
path: `${apiPrefix}/:id/usage`,
|
|
347
|
+
pluginId: 'api-keys',
|
|
348
|
+
handler: async (req: Request, res: Response) => {
|
|
349
|
+
try {
|
|
350
|
+
const authReq = req as AuthenticatedRequest;
|
|
351
|
+
const userId = authReq.auth?.user?.id;
|
|
352
|
+
|
|
353
|
+
if (!userId) {
|
|
354
|
+
return res.status(401).json({ error: 'Authentication required' });
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
const { id: keyId } = req.params;
|
|
358
|
+
|
|
359
|
+
// Verify key belongs to user
|
|
360
|
+
const key = await config.store.get(userId, keyId);
|
|
361
|
+
if (!key) {
|
|
362
|
+
return res.status(404).json({ error: 'API key not found' });
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Parse query parameters
|
|
366
|
+
const limit = parseInt(req.query.limit as string) || 100;
|
|
367
|
+
const offset = parseInt(req.query.offset as string) || 0;
|
|
368
|
+
const since = req.query.since ? new Date(req.query.since as string) : undefined;
|
|
369
|
+
const until = req.query.until ? new Date(req.query.until as string) : undefined;
|
|
370
|
+
const endpoint = req.query.endpoint as string | undefined;
|
|
371
|
+
const method = req.query.method as string | undefined;
|
|
372
|
+
const statusCode = req.query.statusCode ? parseInt(req.query.statusCode as string) : undefined;
|
|
373
|
+
|
|
374
|
+
// Get usage logs
|
|
375
|
+
const logs = await config.usageStore!.getKeyUsage(keyId, {
|
|
376
|
+
limit,
|
|
377
|
+
offset,
|
|
378
|
+
since,
|
|
379
|
+
until,
|
|
380
|
+
endpoint,
|
|
381
|
+
method,
|
|
382
|
+
statusCode,
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
// Get stats
|
|
386
|
+
const stats = await config.usageStore!.getKeyStats(keyId, { since, until });
|
|
387
|
+
|
|
388
|
+
res.json({
|
|
389
|
+
keyId,
|
|
390
|
+
keyName: key.name,
|
|
391
|
+
totalCalls: stats.totalCalls,
|
|
392
|
+
lastUsed: stats.lastUsed,
|
|
393
|
+
callsByStatus: stats.callsByStatus,
|
|
394
|
+
callsByEndpoint: stats.callsByEndpoint,
|
|
395
|
+
logs,
|
|
396
|
+
});
|
|
397
|
+
} catch (error) {
|
|
398
|
+
console.error('[ApiKeysPlugin] Get usage error:', error);
|
|
399
|
+
res.status(500).json({ error: 'Failed to retrieve usage logs' });
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
log('API keys plugin started');
|
|
407
|
+
},
|
|
408
|
+
|
|
409
|
+
async onStop(): Promise<void> {
|
|
410
|
+
log('Stopping API keys plugin');
|
|
411
|
+
if (currentStore) {
|
|
412
|
+
await currentStore.shutdown();
|
|
413
|
+
}
|
|
414
|
+
if (config.scopeStore) {
|
|
415
|
+
await config.scopeStore.shutdown();
|
|
416
|
+
}
|
|
417
|
+
if (config.usageStore) {
|
|
418
|
+
await config.usageStore.shutdown();
|
|
419
|
+
}
|
|
420
|
+
currentStore = null;
|
|
421
|
+
log('API keys plugin stopped');
|
|
422
|
+
},
|
|
423
|
+
|
|
424
|
+
async onPluginEvent(event): Promise<void> {
|
|
425
|
+
// Automatically register plugin scopes when plugins start
|
|
426
|
+
if (event.type === 'plugin:started' && config.scopeStore) {
|
|
427
|
+
const { plugin } = event;
|
|
428
|
+
|
|
429
|
+
if (plugin.scopes && plugin.scopes.length > 0) {
|
|
430
|
+
try {
|
|
431
|
+
await config.scopeStore.registerScopes(plugin.id, plugin.scopes);
|
|
432
|
+
log(`Registered ${plugin.scopes.length} scopes for plugin: ${plugin.id}`, {
|
|
433
|
+
scopes: plugin.scopes.map(s => s.name),
|
|
434
|
+
});
|
|
435
|
+
} catch (error) {
|
|
436
|
+
console.error(`[ApiKeysPlugin] Failed to register scopes for ${plugin.id}:`, error);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// ========================================
|
|
445
|
+
// Helper Functions
|
|
446
|
+
// ========================================
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Get the current API keys store instance
|
|
450
|
+
*/
|
|
451
|
+
export function getApiKeysStore(): ApiKeyStore | null {
|
|
452
|
+
return currentStore;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Verify an API key and return the associated key record
|
|
457
|
+
* Returns null if key is invalid, expired, or inactive
|
|
458
|
+
*/
|
|
459
|
+
export async function verifyApiKey(plaintextKey: string): Promise<ApiKey | null> {
|
|
460
|
+
if (!currentStore) {
|
|
461
|
+
throw new Error('API Keys plugin not initialized');
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
const key = await currentStore.verify(plaintextKey);
|
|
465
|
+
|
|
466
|
+
// Update last_used_at timestamp if key is valid
|
|
467
|
+
if (key) {
|
|
468
|
+
await currentStore.recordUsage(key.id).catch(err => {
|
|
469
|
+
console.error('[ApiKeysPlugin] Failed to record key usage:', err);
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
return key;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Create an API key for a user
|
|
478
|
+
*/
|
|
479
|
+
export async function createApiKey(params: CreateApiKeyParams): Promise<ApiKey> {
|
|
480
|
+
if (!currentStore) {
|
|
481
|
+
throw new Error('API Keys plugin not initialized');
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return currentStore.create(params);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* List all API keys for a user
|
|
489
|
+
*/
|
|
490
|
+
export async function listApiKeys(userId: string): Promise<ApiKey[]> {
|
|
491
|
+
if (!currentStore) {
|
|
492
|
+
throw new Error('API Keys plugin not initialized');
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
return currentStore.list(userId);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Get a specific API key
|
|
500
|
+
*/
|
|
501
|
+
export async function getApiKey(userId: string, keyId: string): Promise<ApiKey | null> {
|
|
502
|
+
if (!currentStore) {
|
|
503
|
+
throw new Error('API Keys plugin not initialized');
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return currentStore.get(userId, keyId);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Update an API key
|
|
511
|
+
*/
|
|
512
|
+
export async function updateApiKey(
|
|
513
|
+
userId: string,
|
|
514
|
+
keyId: string,
|
|
515
|
+
params: UpdateApiKeyParams
|
|
516
|
+
): Promise<ApiKey | null> {
|
|
517
|
+
if (!currentStore) {
|
|
518
|
+
throw new Error('API Keys plugin not initialized');
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
return currentStore.update(userId, keyId, params);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Delete an API key
|
|
526
|
+
*/
|
|
527
|
+
export async function deleteApiKey(userId: string, keyId: string): Promise<boolean> {
|
|
528
|
+
if (!currentStore) {
|
|
529
|
+
throw new Error('API Keys plugin not initialized');
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
return currentStore.delete(userId, keyId);
|
|
533
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Keys Plugin Index
|
|
3
|
+
*
|
|
4
|
+
* API key authentication and management plugin with PostgreSQL RLS.
|
|
5
|
+
* Depends on the Users Plugin for user identity.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// Main plugin
|
|
11
|
+
export {
|
|
12
|
+
createApiKeysPlugin,
|
|
13
|
+
getApiKeysStore,
|
|
14
|
+
verifyApiKey,
|
|
15
|
+
createApiKey,
|
|
16
|
+
listApiKeys,
|
|
17
|
+
getApiKey,
|
|
18
|
+
updateApiKey,
|
|
19
|
+
deleteApiKey,
|
|
20
|
+
} from './api-keys-plugin.js';
|
|
21
|
+
|
|
22
|
+
// Types
|
|
23
|
+
export type {
|
|
24
|
+
ApiKeysPluginConfig,
|
|
25
|
+
ApiKeyStore,
|
|
26
|
+
ApiKey,
|
|
27
|
+
ApiKeyWithPlaintext,
|
|
28
|
+
ApiKeyScope,
|
|
29
|
+
ApiKeyType,
|
|
30
|
+
CreateApiKeyParams,
|
|
31
|
+
UpdateApiKeyParams,
|
|
32
|
+
PostgresApiKeyStoreConfig,
|
|
33
|
+
ApiKeysApiConfig,
|
|
34
|
+
} from './types.js';
|
|
35
|
+
|
|
36
|
+
// Zod schemas
|
|
37
|
+
export {
|
|
38
|
+
ApiKeyScopeSchema,
|
|
39
|
+
ApiKeyTypeSchema,
|
|
40
|
+
CreateApiKeySchema,
|
|
41
|
+
UpdateApiKeySchema,
|
|
42
|
+
ApiKeySchema,
|
|
43
|
+
} from './types.js';
|
|
44
|
+
|
|
45
|
+
// Stores
|
|
46
|
+
export { postgresApiKeyStore } from './stores/index.js';
|
|
47
|
+
|
|
48
|
+
// Middleware
|
|
49
|
+
export { bearerTokenAuth } from './middleware/index.js';
|
|
50
|
+
|
|
51
|
+
// UI Components
|
|
52
|
+
export { ApiKeysStatusWidget } from './ApiKeysStatusWidget.js';
|
|
53
|
+
export type { ApiKeysStatusWidgetProps } from './ApiKeysStatusWidget.js';
|
|
54
|
+
export { ApiKeysManagementPage } from './ApiKeysManagementPage.js';
|
|
55
|
+
export type { ApiKeysManagementPageProps } from './ApiKeysManagementPage.js';
|