|
|
@@ -38,6 +38,8 @@ export interface Endpoint {
|
|
|
response?: string;
|
|
|
errorResponse?: string;
|
|
|
errorStatus?: number;
|
|
|
+ responseSchema?: string;
|
|
|
+ responseSchemaArray?: boolean;
|
|
|
}
|
|
|
|
|
|
export interface SubscriptionHeader {
|
|
|
@@ -107,22 +109,22 @@ export const sections: readonly Section[] = [
|
|
|
method: 'GET',
|
|
|
path: '/panel/api/inbounds/list',
|
|
|
summary: 'List every inbound owned by the authenticated user, including each inbound’s clientStats traffic counters. settings, streamSettings, and sniffing are returned as nested JSON objects (no escaped strings); legacy callers that send them back as JSON-encoded strings are still accepted on write.',
|
|
|
- response:
|
|
|
- '{\n "success": true,\n "obj": [\n {\n "id": 1,\n "userId": 1,\n "up": 0,\n "down": 0,\n "total": 0,\n "remark": "VLESS-443",\n "enable": true,\n "expiryTime": 0,\n "listen": "",\n "port": 443,\n "protocol": "vless",\n "settings": {\n "clients": [],\n "decryption": "none"\n },\n "streamSettings": {\n "network": "tcp",\n "security": "reality",\n "realitySettings": { "show": false, "dest": "..." }\n },\n "tag": "inbound-443",\n "sniffing": {\n "enabled": true,\n "destOverride": ["http", "tls"]\n },\n "clientStats": []\n }\n ]\n}',
|
|
|
+ responseSchema: 'Inbound',
|
|
|
+ responseSchemaArray: true,
|
|
|
},
|
|
|
{
|
|
|
method: 'GET',
|
|
|
path: '/panel/api/inbounds/list/slim',
|
|
|
summary: 'Same shape as /list but with settings.clients[] stripped down to {email, enable, comment} and ClientStats not enriched with UUID/SubId. Use this for list pages; fetch /get/:id when you need the full per-client payload (uuid, password, flow, ...).',
|
|
|
response:
|
|
|
- '{\n "success": true,\n "obj": [\n {\n "id": 1,\n "userId": 1,\n "remark": "VLESS-443",\n "settings": {\n "clients": [\n { "email": "alice", "enable": true }\n ],\n "decryption": "none"\n },\n "clientStats": []\n }\n ]\n}',
|
|
|
+ '{\n "success": true,\n "obj": [\n {\n "id": 1,\n "remark": "VLESS-443",\n "settings": {\n "clients": [\n { "email": "alice", "enable": true }\n ],\n "decryption": "none"\n },\n "clientStats": []\n }\n ]\n}',
|
|
|
},
|
|
|
{
|
|
|
method: 'GET',
|
|
|
path: '/panel/api/inbounds/options',
|
|
|
- summary: 'Lightweight picker projection of the authenticated user’s inbounds. Returns only id, remark, protocol, port, and a server-computed tlsFlowCapable flag (true for VLESS / port-fallback on TCP with tls or reality). Use this for dropdowns and attach pickers — it skips settings, streamSettings, and clientStats so the payload stays small even on panels with thousands of clients.',
|
|
|
- response:
|
|
|
- '{\n "success": true,\n "obj": [\n {\n "id": 1,\n "remark": "VLESS-443",\n "protocol": "vless",\n "port": 443,\n "tlsFlowCapable": true\n }\n ]\n}',
|
|
|
+ summary: 'Lightweight picker projection of the authenticated user’s inbounds. Returns id, remark, tag, protocol, port, a server-computed tlsFlowCapable flag (true for VLESS / port-fallback on TCP with tls or reality), and ssMethod (the Shadowsocks cipher, empty for non-Shadowsocks inbounds — used by the client UI to generate a valid Shadowsocks 2022 PSK). Use this for dropdowns and attach pickers — it skips settings, streamSettings, and clientStats so the payload stays small even on panels with thousands of clients.',
|
|
|
+ responseSchema: 'InboundOption',
|
|
|
+ responseSchemaArray: true,
|
|
|
},
|
|
|
{
|
|
|
method: 'GET',
|
|
|
@@ -696,7 +698,7 @@ export const sections: readonly Section[] = [
|
|
|
method: 'POST',
|
|
|
path: '/panel/api/clients/activeInbounds',
|
|
|
summary: 'Inbound tags that carried traffic within the heartbeat window, grouped by the hosting node\'s panelGuid. Pairs with onlinesByGuid so the inbounds page only marks a multi-inbound client online on the inbounds it actually used. Nodes that do not report per-inbound activity are absent.',
|
|
|
- response: '{\n "success": true,\n "obj": {\n "a1b2-...": ["inbound-443", "inbound-8443"]\n }\n}',
|
|
|
+ response: '{\n "success": true,\n "obj": {\n "a1b2-...": ["in-443-tcp", "in-8443-tcp"]\n }\n}',
|
|
|
},
|
|
|
{
|
|
|
method: 'POST',
|
|
|
@@ -711,7 +713,7 @@ export const sections: readonly Section[] = [
|
|
|
params: [
|
|
|
{ name: 'email', in: 'path', type: 'string', desc: 'Client email (unique across the panel).' },
|
|
|
],
|
|
|
- response: '{\n "success": true,\n "obj": {\n "email": "user1",\n "up": 1048576,\n "down": 2097152,\n "total": 10737418240,\n "expiryTime": 1735689600000\n }\n}',
|
|
|
+ responseSchema: 'ClientTraffic',
|
|
|
},
|
|
|
{
|
|
|
method: 'GET',
|
|
|
@@ -748,7 +750,8 @@ export const sections: readonly Section[] = [
|
|
|
method: 'GET',
|
|
|
path: '/panel/api/nodes/list',
|
|
|
summary: 'List every configured node with its connection details, health, and last heartbeat patch.',
|
|
|
- response: '{\n "success": true,\n "obj": [\n {\n "id": 1,\n "name": "de-fra-1",\n "remark": "",\n "scheme": "https",\n "address": "node1.example.com",\n "port": 2053,\n "basePath": "/",\n "apiToken": "abcdef...",\n "enable": true,\n "allowPrivateAddress": false,\n "status": "online",\n "lastHeartbeat": 1700000000,\n "latencyMs": 42,\n "xrayVersion": "25.x.x",\n "panelVersion": "v3.x.x",\n "cpuPct": 23.5,\n "memPct": 45.1,\n "uptimeSecs": 86400,\n "lastError": "",\n "inboundCount": 5,\n "clientCount": 27,\n "onlineCount": 3,\n "depletedCount": 1,\n "createdAt": 1700000000,\n "updatedAt": 1700000000\n }\n ]\n}',
|
|
|
+ responseSchema: 'Node',
|
|
|
+ responseSchemaArray: true,
|
|
|
},
|
|
|
{
|
|
|
method: 'GET',
|
|
|
@@ -805,7 +808,7 @@ export const sections: readonly Section[] = [
|
|
|
path: '/panel/api/nodes/test',
|
|
|
summary: 'Probe a node without saving it. Uses the body as connection details and returns the same heartbeat snapshot a registered node would have.',
|
|
|
body: '{\n "scheme": "https",\n "address": "node1.example.com",\n "port": 2053,\n "basePath": "/",\n "apiToken": "abcdef..."\n}',
|
|
|
- response: '{\n "success": true,\n "obj": {\n "status": "online",\n "latencyMs": 42,\n "xrayVersion": "25.x.x",\n "panelVersion": "v3.x.x",\n "cpuPct": 12.5,\n "memPct": 45.2,\n "uptimeSecs": 86400,\n "error": ""\n }\n}',
|
|
|
+ responseSchema: 'ProbeResultUI',
|
|
|
},
|
|
|
{
|
|
|
method: 'POST',
|
|
|
@@ -978,7 +981,7 @@ export const sections: readonly Section[] = [
|
|
|
{ name: 'name', in: 'body', type: 'string', desc: 'Human-readable label, e.g. "central-panel-a".' },
|
|
|
],
|
|
|
body: '{\n "name": "central-panel-a"\n}',
|
|
|
- response: '{\n "success": true,\n "obj": {\n "id": 2,\n "name": "central-panel-a",\n "token": "new-token-string",\n "enabled": true,\n "createdAt": 1736000000\n }\n}',
|
|
|
+ responseSchema: 'ApiTokenView',
|
|
|
errorResponse: '{\n "success": false,\n "msg": "a token with that name already exists"\n}',
|
|
|
},
|
|
|
{
|
|
|
@@ -1014,7 +1017,7 @@ export const sections: readonly Section[] = [
|
|
|
method: 'POST',
|
|
|
path: '/panel/xray/',
|
|
|
summary: 'Return the Xray config template (JSON string), available inbound tags, client reverse tags, and the configured outbound test URL in one response.',
|
|
|
- response: '{\n "success": true,\n "obj": {\n "xraySetting": "{...raw xray config...}",\n "inboundTags": "[\\"inbound-443\\"]",\n "clientReverseTags": "[]",\n "outboundTestUrl": "https://www.google.com/generate_204"\n }\n}',
|
|
|
+ response: '{\n "success": true,\n "obj": {\n "xraySetting": "{...raw xray config...}",\n "inboundTags": "[\\"in-443-tcp\\"]",\n "clientReverseTags": "[]",\n "outboundTestUrl": "https://www.google.com/generate_204"\n }\n}',
|
|
|
},
|
|
|
{
|
|
|
method: 'GET',
|