@qodalis/cli-server-plugin-admin 1.0.0-beta.5 → 1.0.0-beta.7

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.
Files changed (41) hide show
  1. package/README.md +9 -2
  2. package/dashboard/assets/index-BAmUWZCS.js +242 -0
  3. package/dashboard/assets/index-BF7ofZj2.css +32 -0
  4. package/dashboard/assets/wasm/qodalis_cli_wasm_bg.wasm +0 -0
  5. package/dashboard/index.html +3 -2
  6. package/dist/auth/auth-controller.d.ts +2 -1
  7. package/dist/auth/auth-controller.d.ts.map +1 -1
  8. package/dist/auth/auth-controller.js +35 -5
  9. package/dist/auth/auth-controller.js.map +1 -1
  10. package/dist/auth/auth-middleware.d.ts +2 -1
  11. package/dist/auth/auth-middleware.d.ts.map +1 -1
  12. package/dist/auth/auth-middleware.js +35 -1
  13. package/dist/auth/auth-middleware.js.map +1 -1
  14. package/dist/auth/auth-provider.d.ts +33 -0
  15. package/dist/auth/auth-provider.d.ts.map +1 -0
  16. package/dist/auth/auth-provider.js +16 -0
  17. package/dist/auth/auth-provider.js.map +1 -0
  18. package/dist/cli-admin-builder.d.ts +11 -7
  19. package/dist/cli-admin-builder.d.ts.map +1 -1
  20. package/dist/cli-admin-builder.js +37 -47
  21. package/dist/cli-admin-builder.js.map +1 -1
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +3 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/services/admin-config.d.ts +2 -0
  27. package/dist/services/admin-config.d.ts.map +1 -1
  28. package/dist/services/admin-config.js +4 -3
  29. package/dist/services/admin-config.js.map +1 -1
  30. package/dist/services/dashboard-dir.d.ts +10 -0
  31. package/dist/services/dashboard-dir.d.ts.map +1 -0
  32. package/dist/services/dashboard-dir.js +51 -0
  33. package/dist/services/dashboard-dir.js.map +1 -0
  34. package/dist/services/log-ring-buffer.d.ts +2 -0
  35. package/dist/services/log-ring-buffer.d.ts.map +1 -1
  36. package/dist/services/log-ring-buffer.js +12 -0
  37. package/dist/services/log-ring-buffer.js.map +1 -1
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +6 -3
  40. package/dashboard/assets/index-CKzcPzP-.js +0 -199
  41. package/dashboard/assets/index-LZx7c-rD.css +0 -32
package/README.md CHANGED
@@ -35,6 +35,8 @@ app.use(adminPlugin.dashboardPrefix, adminPlugin.dashboardRouter);
35
35
 
36
36
  ## Configuration
37
37
 
38
+ When the users plugin is installed, pass `setAuthProvider(usersPlugin.serverAuth)`: the dashboard then logs in with users credentials, its token is a users session token, and every admin route requires `admin:access`. The static credentials below are only used when the users plugin is absent.
39
+
38
40
  Credentials and JWT secret can be set via the builder or environment variables:
39
41
 
40
42
  | Environment Variable | Default | Description |
@@ -47,7 +49,8 @@ Credentials and JWT secret can be set via the builder or environment variables:
47
49
 
48
50
  | Method | Description |
49
51
  |---|---|
50
- | `setCredentials(username, password)` | Set admin login credentials |
52
+ | `setCredentials(username, password)` | Set admin login credentials (only used without the users plugin) |
53
+ | `setAuthProvider(usersPlugin.serverAuth)` | Log in through the users plugin; requires the `admin:access` permission (`admin` has it via `*`) |
51
54
  | `setJwtSecret(secret)` | Set JWT signing secret |
52
55
  | `setRegisteredJobs(count)` | Report job count in the status endpoint |
53
56
  | `setEnabledFeatures(features)` | Add custom feature flags to the status endpoint |
@@ -79,6 +82,8 @@ All endpoints are mounted at the plugin's built-in prefix (`/api/v1/qcli`). Rout
79
82
 
80
83
  ### Configuration
81
84
 
85
+ When the users plugin is installed, pass `setAuthProvider(usersPlugin.serverAuth)`: the dashboard then logs in with users credentials, its token is a users session token, and every admin route requires `admin:access`. The static credentials below are only used when the users plugin is absent.
86
+
82
87
  | Method | Endpoint | Description |
83
88
  |---|---|---|
84
89
  | GET | `/config` | Return structured config sections (server, auth, custom) |
@@ -90,6 +95,8 @@ All endpoints are mounted at the plugin's built-in prefix (`/api/v1/qcli`). Rout
90
95
  |---|---|---|
91
96
  | GET | `/logs` | Query log entries with optional `level`, `search`, `limit`, `offset` params |
92
97
 
98
+ The log buffer captures `console.log`/`warn`/`error` output. As a safety net, a value written after a `password`, `passwd`, `secret` or `token` label (`password: x`, `token=x`, `password for user "root": x`) is replaced with `[REDACTED]` before the entry is stored or broadcast.
99
+
93
100
  ### WebSocket Clients
94
101
 
95
102
  | Method | Endpoint | Description |
@@ -98,7 +105,7 @@ All endpoints are mounted at the plugin's built-in prefix (`/api/v1/qcli`). Rout
98
105
 
99
106
  ## Dashboard
100
107
 
101
- The plugin includes a bundled SPA dashboard served at the built-in prefix (`/qcli/admin`). The dashboard auto-resolves from the package's `dashboard/` directory, or from the `@qodalis/cli-server-dashboard` package if installed separately.
108
+ The plugin includes a bundled SPA dashboard served at the built-in prefix (`/qcli/admin`). The dashboard is found in this order: the directory given to `setDashboardDir()`, a sibling `cli-server-dashboard/dist` build (development), the package's bundled `dashboard/` directory, and the `@qodalis/cli-server-dashboard` package if installed separately. The same order applies whether the plugin runs compiled or from source (`tsx`).
102
109
 
103
110
  ## License
104
111