Skip to content

Commit 68a7803

Browse files
committedFeb 4, 2025
Fix api schema after merging latest changes
1 parent 2657af9 commit 68a7803

File tree

6 files changed

+40
-71
lines changed

6 files changed

+40
-71
lines changed
 

‎backend/internal/stream.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const internalStream = {
2020
* @returns {Promise}
2121
*/
2222
create: (access, data) => {
23-
let create_certificate = data.certificate_id === 'new';
23+
const create_certificate = data.certificate_id === 'new';
2424

2525
if (create_certificate) {
2626
delete data.certificate_id;
@@ -96,7 +96,7 @@ const internalStream = {
9696
* @return {Promise}
9797
*/
9898
update: (access, data) => {
99-
let create_certificate = data.certificate_id === 'new';
99+
const create_certificate = data.certificate_id === 'new';
100100

101101
if (create_certificate) {
102102
delete data.certificate_id;

‎backend/schema/components/stream-object.json

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
"enabled": {
5656
"$ref": "../common.json#/properties/enabled"
5757
},
58+
"certificate_id": {
59+
"$ref": "../common.json#/properties/certificate_id"
60+
},
5861
"meta": {
5962
"type": "object"
6063
}

‎backend/schema/paths/nginx/streams/get.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"description": "Expansions",
1515
"schema": {
1616
"type": "string",
17-
"enum": ["access_list", "owner", "certificate"]
17+
"enum": ["owner", "certificate"]
1818
}
1919
}
2020
],
@@ -40,7 +40,8 @@
4040
"nginx_online": true,
4141
"nginx_err": null
4242
},
43-
"enabled": true
43+
"enabled": true,
44+
"certificate_id": 0
4445
}
4546
]
4647
}

‎backend/schema/paths/nginx/streams/post.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
"udp_forwarding": {
3333
"$ref": "../../../components/stream-object.json#/properties/udp_forwarding"
3434
},
35+
"certificate_id": {
36+
"$ref": "../../../components/stream-object.json#/properties/certificate_id"
37+
},
3538
"meta": {
3639
"$ref": "../../../components/stream-object.json#/properties/meta"
3740
}
@@ -73,7 +76,8 @@
7376
"nickname": "Admin",
7477
"avatar": "",
7578
"roles": ["admin"]
76-
}
79+
},
80+
"certificate_id": 0
7781
}
7882
}
7983
},

‎backend/schema/paths/nginx/streams/streamID/get.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"nginx_online": true,
4141
"nginx_err": null
4242
},
43-
"enabled": true
43+
"enabled": true,
44+
"certificate_id": 0
4445
}
4546
}
4647
},

‎backend/schema/paths/nginx/streams/streamID/put.json

+25-65
Original file line numberDiff line numberDiff line change
@@ -29,56 +29,26 @@
2929
"additionalProperties": false,
3030
"minProperties": 1,
3131
"properties": {
32-
"domain_names": {
33-
"$ref": "../../../../components/proxy-host-object.json#/properties/domain_names"
32+
"incoming_port": {
33+
"$ref": "../../../../components/stream-object.json#/properties/incoming_port"
3434
},
35-
"forward_scheme": {
36-
"$ref": "../../../../components/proxy-host-object.json#/properties/forward_scheme"
35+
"forwarding_host": {
36+
"$ref": "../../../../components/stream-object.json#/properties/forwarding_host"
3737
},
38-
"forward_host": {
39-
"$ref": "../../../../components/proxy-host-object.json#/properties/forward_host"
38+
"forwarding_port": {
39+
"$ref": "../../../../components/stream-object.json#/properties/forwarding_port"
4040
},
41-
"forward_port": {
42-
"$ref": "../../../../components/proxy-host-object.json#/properties/forward_port"
41+
"tcp_forwarding": {
42+
"$ref": "../../../../components/stream-object.json#/properties/tcp_forwarding"
4343
},
44-
"certificate_id": {
45-
"$ref": "../../../../components/proxy-host-object.json#/properties/certificate_id"
46-
},
47-
"ssl_forced": {
48-
"$ref": "../../../../components/proxy-host-object.json#/properties/ssl_forced"
49-
},
50-
"hsts_enabled": {
51-
"$ref": "../../../../components/proxy-host-object.json#/properties/hsts_enabled"
52-
},
53-
"hsts_subdomains": {
54-
"$ref": "../../../../components/proxy-host-object.json#/properties/hsts_subdomains"
55-
},
56-
"http2_support": {
57-
"$ref": "../../../../components/proxy-host-object.json#/properties/http2_support"
58-
},
59-
"block_exploits": {
60-
"$ref": "../../../../components/proxy-host-object.json#/properties/block_exploits"
44+
"udp_forwarding": {
45+
"$ref": "../../../../components/stream-object.json#/properties/udp_forwarding"
6146
},
62-
"caching_enabled": {
63-
"$ref": "../../../../components/proxy-host-object.json#/properties/caching_enabled"
64-
},
65-
"allow_websocket_upgrade": {
66-
"$ref": "../../../../components/proxy-host-object.json#/properties/allow_websocket_upgrade"
67-
},
68-
"access_list_id": {
69-
"$ref": "../../../../components/proxy-host-object.json#/properties/access_list_id"
70-
},
71-
"advanced_config": {
72-
"$ref": "../../../../components/proxy-host-object.json#/properties/advanced_config"
73-
},
74-
"enabled": {
75-
"$ref": "../../../../components/proxy-host-object.json#/properties/enabled"
47+
"certificate_id": {
48+
"$ref": "../../../../components/stream-object.json#/properties/certificate_id"
7649
},
7750
"meta": {
78-
"$ref": "../../../../components/proxy-host-object.json#/properties/meta"
79-
},
80-
"locations": {
81-
"$ref": "../../../../components/proxy-host-object.json#/properties/locations"
51+
"$ref": "../../../../components/stream-object.json#/properties/meta"
8252
}
8353
}
8454
}
@@ -94,42 +64,32 @@
9464
"default": {
9565
"value": {
9666
"id": 1,
97-
"created_on": "2024-10-08T23:23:03.000Z",
98-
"modified_on": "2024-10-08T23:26:37.000Z",
67+
"created_on": "2024-10-09T02:33:45.000Z",
68+
"modified_on": "2024-10-09T02:33:45.000Z",
9969
"owner_user_id": 1,
100-
"domain_names": ["test.example.com"],
101-
"forward_host": "192.168.0.10",
102-
"forward_port": 8989,
103-
"access_list_id": 0,
104-
"certificate_id": 0,
105-
"ssl_forced": false,
106-
"caching_enabled": false,
107-
"block_exploits": false,
108-
"advanced_config": "",
70+
"incoming_port": 9090,
71+
"forwarding_host": "router.internal",
72+
"forwarding_port": 80,
73+
"tcp_forwarding": true,
74+
"udp_forwarding": false,
10975
"meta": {
11076
"nginx_online": true,
11177
"nginx_err": null
11278
},
113-
"allow_websocket_upgrade": false,
114-
"http2_support": false,
115-
"forward_scheme": "http",
11679
"enabled": true,
117-
"hsts_enabled": false,
118-
"hsts_subdomains": false,
11980
"owner": {
12081
"id": 1,
121-
"created_on": "2024-10-07T22:43:55.000Z",
122-
"modified_on": "2024-10-08T12:52:54.000Z",
82+
"created_on": "2024-10-09T02:33:16.000Z",
83+
"modified_on": "2024-10-09T02:33:16.000Z",
12384
"is_deleted": false,
12485
"is_disabled": false,
12586
"email": "admin@example.com",
12687
"name": "Administrator",
127-
"nickname": "some guy",
128-
"avatar": "//www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?default=mm",
88+
"nickname": "Admin",
89+
"avatar": "",
12990
"roles": ["admin"]
13091
},
131-
"certificate": null,
132-
"access_list": null
92+
"certificate_id": 0
13393
}
13494
}
13595
},

0 commit comments

Comments
 (0)
Failed to load comments.