v15
This commit is contained in:
+69
-14
@@ -20,6 +20,7 @@ This file lists the current HTTP routes exposed by Core, grouped by access level
|
||||
| `POST` | `/auth/refresh` | `RefreshTokenDto` | Returns new JWT tokens |
|
||||
| `POST` | `/auth/telegram` | `TelegramAuthDto` | Telegram OAuth login |
|
||||
| `GET` | `/auth/telegram/bot-id` | none | `{ botId }` |
|
||||
| `GET` | `/public/settings/access` | none | Public panel and subscription host/path settings |
|
||||
| `GET` | `/sub/:uuid/info` | query string and request IP | Returns `SubscriptionInfo` JSON |
|
||||
| `GET` | `/sub/:uuid` | `format=v2ray|clash|singbox` | Returns encoded subscription content |
|
||||
|
||||
@@ -37,22 +38,26 @@ This file lists the current HTTP routes exposed by Core, grouped by access level
|
||||
| `GET` | `/auth/me` | none | Current user without `passwordHash` |
|
||||
| `POST` | `/auth/telegram/link` | `TelegramAuthDto` | Links Telegram to the current account |
|
||||
| `DELETE` | `/auth/telegram/unlink` | none | Unlinks Telegram from the current account |
|
||||
| `POST` | `/auth/referral-code/apply` | `{ code: string }` | Pending user self-approves via a referral code |
|
||||
| `GET` | `/me` | none | Current user without `passwordHash` |
|
||||
| `PATCH` | `/me/profile` | `UpdateProfileDto` | Updates name, email, or password |
|
||||
| `GET` | `/me/stats` | none | `UserStats` |
|
||||
| `GET` | `/me/traffic/daily` | none | Daily traffic series |
|
||||
| `GET` | `/me/traffic/hourly-dist` | none | Hour-of-day distribution |
|
||||
| `GET` | `/me/traffic` | `period=30d|7d|1d|1h` | Period traffic series |
|
||||
| `GET` | `/me/traffic/raw` | none | Raw per-minute traffic records |
|
||||
| `GET` | `/me/referral/referees` | none | Users invited by the current user |
|
||||
| `GET` | `/me/subscriptions/:id/usage` | `from?`, `to?` | Per-subscription usage for the current user |
|
||||
| `GET` | `/me/node-protocols` | none | Available node protocols for the current user |
|
||||
| `GET` | `/me/balance` | none | `{ balance }` |
|
||||
| `GET` | `/me/balance/transactions` | none | User balance transaction history |
|
||||
| `GET` | `/me/subscriptions` | none | User subscriptions |
|
||||
| `GET` | `/me/links` | none | All user subscription links |
|
||||
| `GET` | `/me/configs` | none | Available node/protocol configs for the current user |
|
||||
| `POST` | `/me/links` | `CreateUserLinkDto` | Creates a combined link or a per-subscription link |
|
||||
| `POST` | `/me/subscriptions` | `CreateSubscriptionLinkDto` | Legacy per-subscription link creation |
|
||||
| `POST` | `/me/subscriptions/:id/reset` | none | Resets the selected link UUID |
|
||||
| `PATCH` | `/me/subscriptions/links/:id` | `UpdateSubscriptionLinkDto` | Renames or reconfigures a link |
|
||||
| `DELETE` | `/me/subscriptions/links/:id` | none | Deletes a link |
|
||||
| `POST` | `/me/links/:id/reset` | none | Resets the link UUID |
|
||||
| `PATCH` | `/me/links/:id` | `UpdateUserLinkDto` | Renames, enables/disables, or reconfigures a link |
|
||||
| `DELETE` | `/me/links/:id` | none | Deletes a link |
|
||||
| `PATCH` | `/me/subscriptions/:id/auto-renew` | `UpdateAutoRenewDto` | Toggles auto-renew for own subscription |
|
||||
|
||||
## Admin routes - users
|
||||
@@ -60,10 +65,14 @@ This file lists the current HTTP routes exposed by Core, grouped by access level
|
||||
| Method | Route | Input | Output / Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| `GET` | `/admin/users` | `page`, `limit`, `search`, `status`, `isBlocked` | Paginated users |
|
||||
| `GET` | `/admin/users/all` | none | All users without pagination |
|
||||
| `GET` | `/admin/users/short` | none | Minimal user list (id, name, email) |
|
||||
| `POST` | `/admin/users` | `CreateAdminUserDto` | Creates a user account |
|
||||
| `GET` | `/admin/users/:id` | none | User detail |
|
||||
| `GET` | `/admin/users/:id/stats` | none | User stats |
|
||||
| `PATCH` | `/admin/users/:id` | `UpdateUserDto` | Updates email, password, role, block flag, name, comment |
|
||||
| `PATCH` | `/admin/users/:id/status` | `UpdateUserStatusDto` | Approves, rejects, or restores a user |
|
||||
| `GET` | `/admin/users/:id/referees` | none | Users invited by this user |
|
||||
| `DELETE` | `/admin/users/:id` | none | Deletes a user |
|
||||
|
||||
## Admin routes - balance
|
||||
@@ -92,20 +101,22 @@ This file lists the current HTTP routes exposed by Core, grouped by access level
|
||||
| `GET` | `/admin/subscriptions` | `page`, `limit`, `status`, `userId`, `tariffId` | Paginated subscriptions |
|
||||
| `GET` | `/admin/users/:id/subscriptions` | none | Subscriptions for a user |
|
||||
| `GET` | `/admin/users/:id/links` | none | All links for a user |
|
||||
| `GET` | `/admin/users/:id/node-protocols` | none | Available node protocols for a user |
|
||||
| `GET` | `/admin/subscriptions/:id/usage` | `from?`, `to?` | Per-subscription usage (admin) |
|
||||
| `POST` | `/admin/subscriptions` | `CreateSubscriptionDto` | Creates a subscription |
|
||||
| `DELETE` | `/admin/subscriptions/:id` | none | Cancels a subscription |
|
||||
| `PATCH` | `/admin/subscriptions/:id/auto-renew` | `UpdateAutoRenewDto` | Toggles auto-renew |
|
||||
| `POST` | `/admin/users/:id/links` | `CreateUserLinkDto` | Creates a link for any user |
|
||||
| `POST` | `/admin/subscriptions/:id/links` | `CreateSubscriptionLinkDto` | Creates a link for a specific subscription |
|
||||
| `POST` | `/admin/subscriptions/links/:id/reset` | none | Resets a link UUID |
|
||||
| `PATCH` | `/admin/subscriptions/links/:id` | `UpdateSubscriptionLinkDto` | Updates a link |
|
||||
| `DELETE` | `/admin/subscriptions/links/:id` | none | Deletes a link |
|
||||
| `POST` | `/admin/links/:id/reset` | none | Resets a link UUID |
|
||||
| `PATCH` | `/admin/links/:id` | `UpdateUserLinkDto` | Updates a link |
|
||||
| `DELETE` | `/admin/links/:id` | none | Deletes a link |
|
||||
|
||||
## Admin routes - nodes
|
||||
|
||||
| Method | Route | Input | Output / Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| `GET` | `/admin/nodes` | `page`, `limit` | Paginated nodes |
|
||||
| `GET` | `/admin/nodes/all` | none | All nodes without pagination |
|
||||
| `GET` | `/admin/nodes/status` | none | Computed node status list |
|
||||
| `GET` | `/admin/nodes/outbound-options` | none | Node/protocol outbound options |
|
||||
| `GET` | `/admin/nodes/:id` | none | Node detail |
|
||||
@@ -127,21 +138,31 @@ This file lists the current HTTP routes exposed by Core, grouped by access level
|
||||
| `POST` | `/admin/nodes/:id/update-geoip` | `UpdateGeoipDto` | Updates stored geoip/geosite URLs and node files |
|
||||
| `POST` | `/admin/nodes/:id/crypto/x25519` | none | Generates x25519 keys |
|
||||
| `POST` | `/admin/nodes/:id/crypto/mldsa65` | none | Generates ML-DSA-65 keys |
|
||||
| `POST` | `/admin/nodes/:id/crypto/tls-ech` | `{ serverName? }` | Generates TLS-ECH keys |
|
||||
| `POST` | `/admin/nodes/:id/crypto/vlessenc` | `{ authentication? }` | Generates VLESS encryption material |
|
||||
| `GET` | `/admin/nodes/xray/versions` | none | Cached xray release tags |
|
||||
| `GET` | `/admin/nodes/mtproto/versions` | none | Cached telemt release tags |
|
||||
| `PATCH` | `/admin/nodes/:id/routing-config` | `UpdateNodeRoutingConfigDto` | Updates per-node routing config |
|
||||
| `POST` | `/admin/nodes/:id/routing-config/apply-template` | `ApplyRoutingTemplateDto` | Copies a routing template into the node config |
|
||||
| `DELETE` | `/admin/nodes/:id/routing-config` | none | Clears per-node routing config |
|
||||
| `PATCH` | `/admin/nodes/:id/observatory` | `UpdateNodeObservatoryDto` | Updates observatory (outbound health check) settings |
|
||||
| `GET` | `/admin/nodes/:id/routing-balancers` | none | Node routing balancers |
|
||||
| `POST` | `/admin/nodes/:id/routing-balancers` | `CreateNodeRoutingBalancerDto` | Creates a routing balancer |
|
||||
| `PATCH` | `/admin/nodes/:id/routing-balancers/:balancerId` | `UpdateNodeRoutingBalancerDto` | Updates a routing balancer |
|
||||
| `DELETE` | `/admin/nodes/:id/routing-balancers/:balancerId` | none | Deletes a routing balancer |
|
||||
| `PUT` | `/admin/nodes/:id/nginx/site` | multipart form-data | Uploads cert/key/html for a masking site |
|
||||
| `GET` | `/admin/nodes/:id/nginx/site` | none | Returns nginx masking site status |
|
||||
| `GET` | `/admin/nodes/:id/nginx/sites/:domain/certificate` | none | Returns certificate and domain validity info |
|
||||
| `DELETE` | `/admin/nodes/:id/nginx/sites/:domain` | none | Deletes a masking site |
|
||||
| `POST` | `/admin/nodes/:id/install-mtproto` | body `{ version?: string }` | Installs telemt and stores the version |
|
||||
| `POST` | `/admin/nodes/:id/restart-mtproto` | none | Restarts telemt |
|
||||
| `GET` | `/admin/nodes/:id/runtime-status` | none | Live runtime status from the node |
|
||||
| `GET` | `/admin/nodes/:id/runtime-status` | `fromNode=true` forces a live fetch | Live runtime status from the node |
|
||||
| `GET` | `/admin/nodes/:id/stats-history` | `since` (timestamp) | Node stats history since a given time |
|
||||
| `GET` | `/admin/nodes/:id/outbounds` | none | Node outbounds |
|
||||
| `POST` | `/admin/nodes/:id/outbounds` | `CreateNodeOutboundDto` | Creates a node outbound |
|
||||
| `PATCH` | `/admin/nodes/:id/outbounds/:outboundId` | partial `CreateNodeOutboundDto` | Updates a node outbound |
|
||||
| `DELETE` | `/admin/nodes/:id/outbounds/:outboundId` | none | Deletes a node outbound |
|
||||
| `POST` | `/admin/nodes/:id/outbounds/:outboundId/probe` | `{ probeUrl? }` | Probes a node outbound and returns latency |
|
||||
| `POST` | `/admin/nodes/:id/outbounds/probe-builtin` | `{ tag, probeUrl? }` | Probes a builtin outbound (direct/block/etc.) |
|
||||
| `POST` | `/admin/nodes/:id/warp/generate` | none | Registers an anonymous WARP account on the node and returns a WireGuard outbound settings object |
|
||||
|
||||
## Admin routes - routing rule sets
|
||||
@@ -177,6 +198,26 @@ This file lists the current HTTP routes exposed by Core, grouped by access level
|
||||
| --- | --- | --- | --- |
|
||||
| `POST` | `/admin/xray/parse-link` | `{ link }` | Parses a proxy link into outbound config |
|
||||
|
||||
## Admin routes - settings
|
||||
|
||||
| Method | Route | Input | Output / Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| `GET` | `/admin/settings/:category` | none | Returns settings for the given category (`panel`, `subscription`, `telegram`) |
|
||||
| `PATCH` | `/admin/settings/panel` | `PanelSettingsDto` | Updates panel settings |
|
||||
| `PATCH` | `/admin/settings/subscription` | `SubscriptionSettingsDto` | Updates subscription delivery settings |
|
||||
| `PATCH` | `/admin/settings/telegram` | `TelegramSettingsDto` | Updates Telegram bot settings |
|
||||
|
||||
## Admin routes - broadcasts
|
||||
|
||||
| Method | Route | Input | Output / Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| `POST` | `/admin/broadcasts` | `CreateBroadcastDto` | Creates a Telegram broadcast |
|
||||
| `GET` | `/admin/broadcasts` | none | Broadcast list with delivery counts |
|
||||
| `GET` | `/admin/broadcasts/:id` | none | Broadcast detail |
|
||||
| `PATCH` | `/admin/broadcasts/:id` | `UpdateBroadcastDto` | Updates a broadcast |
|
||||
| `DELETE` | `/admin/broadcasts/:id` | none | Deletes a broadcast |
|
||||
| `GET` | `/admin/broadcasts/:id/deliveries` | `status?`, `page?`, `limit?` | Delivery log for a broadcast |
|
||||
|
||||
## DTO summary
|
||||
|
||||
### Auth
|
||||
@@ -185,11 +226,13 @@ This file lists the current HTTP routes exposed by Core, grouped by access level
|
||||
- `RegisterDto` - `email`, `password`
|
||||
- `RefreshTokenDto` - `refreshToken`
|
||||
- `TelegramAuthDto` - `tgAuthResult`
|
||||
- `ApplyReferralCodeDto` - `code`
|
||||
|
||||
### Users
|
||||
|
||||
- `CreateAdminUserDto` - `email`, `password`, `role?`, `name?`
|
||||
- `UpdateProfileDto` - `name?`, `email?`, `password?`
|
||||
- `UpdateUserDto` - `email?`, `password?`, `role?`, `isBlocked?`, `name?`, `comment?`
|
||||
- `UpdateUserDto` - `email?`, `password?`, `role?`, `isBlocked?`, `name?`, `comment?`, `allowedToInvite?`
|
||||
- `UpdateUserStatusDto` - `status: 'active' | 'pending' | 'rejected'`
|
||||
|
||||
### Balance
|
||||
@@ -215,9 +258,8 @@ This file lists the current HTTP routes exposed by Core, grouped by access level
|
||||
### Subscriptions
|
||||
|
||||
- `CreateSubscriptionDto` - `userId`, `tariffId`, `startAt?`
|
||||
- `CreateSubscriptionLinkDto` - `subscriptionId`, `name?`
|
||||
- `CreateUserLinkDto` - `subscriptionId?`, `name?`, `selectedNodeIds?`
|
||||
- `UpdateSubscriptionLinkDto` - `name?`, `isEnabled?`, `selectedNodeIds?`
|
||||
- `UpdateUserLinkDto` - `name?`, `isEnabled?`, `selectedNodeIds?`
|
||||
- `UpdateAutoRenewDto` - `autoRenew`
|
||||
|
||||
### Nodes
|
||||
@@ -244,6 +286,9 @@ This file lists the current HTTP routes exposed by Core, grouped by access level
|
||||
- `config?`
|
||||
- `targetNodeId?`
|
||||
- `targetProtocolId?`
|
||||
- `UpdateNodeObservatoryDto` - observatory settings for outbound health probing
|
||||
- `CreateNodeRoutingBalancerDto` - `tag`, `selector`, `strategy?`, `fallbackTag?`
|
||||
- `UpdateNodeRoutingBalancerDto` - partial `CreateNodeRoutingBalancerDto`
|
||||
- `CreateRoutingRuleSetDto`
|
||||
- `name`
|
||||
- `description?`
|
||||
@@ -257,7 +302,6 @@ This file lists the current HTTP routes exposed by Core, grouped by access level
|
||||
- `blockCryptominers?`
|
||||
- `blockAdult?`
|
||||
- `UpdateNodeRoutingConfigDto` - same routing fields as above, without `name` and `description`
|
||||
- `ApplyRoutingTemplateDto` - `templateId`
|
||||
- `InstallXrayDto` - `version`
|
||||
- `UpdateGeoipDto` - `geoipUrl?`, `geositeUrl?`
|
||||
|
||||
@@ -313,3 +357,14 @@ This file lists the current HTTP routes exposed by Core, grouped by access level
|
||||
- `leastPing`
|
||||
- `leastLoad`
|
||||
|
||||
### Settings
|
||||
|
||||
- `PanelSettingsDto` - `allowedHosts?`, `rootPath?`
|
||||
- `SubscriptionSettingsDto` - `allowedHosts?`, `rootPath?`, `updateInterval?`, `name?`, `supportUrl?`, `websiteUrl?`
|
||||
- `TelegramSettingsDto` - `botToken?`
|
||||
|
||||
### Broadcasts
|
||||
|
||||
- `CreateBroadcastDto` - `text`, `filters?` (`{ nodeIds?: number[] }`), `scheduledAt?`
|
||||
- `UpdateBroadcastDto` - partial `CreateBroadcastDto`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user