This commit is contained in:
Cavallium 2021-07-10 07:18:36 +00:00
parent 228c40bec8
commit 42678f732f
16 changed files with 392 additions and 26 deletions

View File

@ -121,7 +121,7 @@ function onLoad(initial) {
function onOsChanged(initial) { function onOsChanged(initial) {
var os = document.getElementById('osSelect').value; var os = document.getElementById('osSelect').value;
if (os.includes('Choose ')) { if (os.includes('Choose ')) {
if (history.state != '') { if (history.state !== '' && history.state !== null) {
history.pushState('', '', 'build.html'); history.pushState('', '', 'build.html');
} }

View File

@ -4,8 +4,6 @@
<title>Swagger UI: OAuth2 Redirect</title> <title>Swagger UI: OAuth2 Redirect</title>
</head> </head>
<body> <body>
</body>
</html>
<script> <script>
'use strict'; 'use strict';
function run () { function run () {
@ -20,15 +18,15 @@
qp = location.search.substring(1); qp = location.search.substring(1);
} }
arr = qp.split("&") arr = qp.split("&");
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';}) arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
qp = qp ? JSON.parse('{' + arr.join() + '}', qp = qp ? JSON.parse('{' + arr.join() + '}',
function (key, value) { function (key, value) {
return key === "" ? value : decodeURIComponent(value) return key === "" ? value : decodeURIComponent(value);
} }
) : {} ) : {};
isValid = qp.state === sentState isValid = qp.state === sentState;
if (( if ((
oauth2.auth.schema.get("flow") === "accessCode" || oauth2.auth.schema.get("flow") === "accessCode" ||
@ -49,7 +47,7 @@
oauth2.auth.code = qp.code; oauth2.auth.code = qp.code;
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl}); oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
} else { } else {
let oauthErrorMsg let oauthErrorMsg;
if (qp.error) { if (qp.error) {
oauthErrorMsg = "["+qp.error+"]: " + oauthErrorMsg = "["+qp.error+"]: " +
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") + (qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
@ -73,3 +71,5 @@
run(); run();
}); });
</script> </script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/swagger-ui.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/swagger-ui.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>tdlight Telegram bot API docs</title> <title>tdlight Telegram bot API docs</title>
<link rel="stylesheet" type="text/css" href="dist/swagger-ui.css" > <link rel="stylesheet" type="text/css" href="dist/swagger-ui.css" />
<link rel="icon" type="image/png" href="icons/favicon-32x32.png" sizes="32x32" /> <link rel="icon" type="image/png" href="icons/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="icons/favicon-16x16.png" sizes="16x16" /> <link rel="icon" type="image/png" href="icons/favicon-16x16.png" sizes="16x16" />
<style> <style>
@ -50,11 +50,11 @@
SwaggerUIBundle.plugins.DownloadUrl SwaggerUIBundle.plugins.DownloadUrl
], ],
layout: "StandaloneLayout" layout: "StandaloneLayout"
}) });
// End Swagger UI call region // End Swagger UI call region
window.ui = ui window.ui = ui;
} };
</script> </script>
</body> </body>
</html> </html>

View File

@ -2080,6 +2080,331 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/Error' $ref: '#/components/schemas/Error'
/getProxies:
post:
tags:
- added
description: |-
Returns all configured proxies. Requires no parameters.
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
ok:
default: true
type: boolean
result:
type: array
items:
$ref: '#/components/schemas/Proxy'
required:
- ok
- result
default:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/addProxy:
post:
tags:
- added
description: |-
Adds a proxy.
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
server:
description: Server hostname or IP address to reach the proxy server.
type: string
port:
description: TCP port where the server is listening for incomming connections.
type: integer
type:
description: Type of proxy to be added. Must be either `mtproto`, `socks5` or `http`. MTProto proxies must provide a `secret` and Socks5/Http proxies can a `username` and `password`.
type: string
username:
description: Username used to authenticate against a Socks5/Http proxy.
type: string
password:
description: Password used to authenticate against a Socks5/Http proxy.
type: string
secret:
description: Secret used to authenticate against an MTProto proxy.
type: string
http_only:
description: Set to true if the proxy only supports HTTP requests (as opposed to transparent TCP connections via HTTP CONNECT).
type: boolean
required:
- server
- port
- type
multipart/form-data:
schema:
type: object
properties:
server:
description: Server hostname or IP address to reach the proxy server.
type: string
port:
description: TCP port where the server is listening for incomming connections.
type: integer
type:
description: Type of proxy to be added. Must be either `mtproto`, `socks5` or `http`. MTProto proxies must provide a `secret` and Socks5/Http proxies can a `username` and `password`.
type: string
username:
description: Username used to authenticate against a Socks5/Http proxy.
type: string
password:
description: Password used to authenticate against a Socks5/Http proxy.
type: string
secret:
description: Secret used to authenticate against an MTProto proxy.
type: string
http_only:
description: Set to true if the proxy only supports HTTP requests (as opposed to transparent TCP connections via HTTP CONNECT).
type: boolean
required:
- server
- port
- type
application/json:
schema:
type: object
properties:
server:
description: Server hostname or IP address to reach the proxy server.
type: string
port:
description: TCP port where the server is listening for incomming connections.
type: integer
type:
description: Type of proxy to be added. Must be either `mtproto`, `socks5` or `http`. MTProto proxies must provide a `secret` and Socks5/Http proxies can a `username` and `password`.
type: string
username:
description: Username used to authenticate against a Socks5/Http proxy.
type: string
password:
description: Password used to authenticate against a Socks5/Http proxy.
type: string
secret:
description: Secret used to authenticate against an MTProto proxy.
type: string
http_only:
description: Set to true if the proxy only supports HTTP requests (as opposed to transparent TCP connections via HTTP CONNECT).
type: boolean
required:
- server
- port
- type
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
ok:
default: true
type: boolean
result:
$ref: '#/components/schemas/Proxy'
required:
- ok
- result
default:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/deleteProxy:
post:
tags:
- added
description: |-
Deletes a proxy.
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
proxy_id:
description: The id that uniquely identifies that proxy server.
type: integer
required:
- proxy_id
multipart/form-data:
schema:
type: object
properties:
proxy_id:
description: The id that uniquely identifies that proxy server.
type: integer
required:
- proxy_id
application/json:
schema:
type: object
properties:
proxy_id:
description: The id that uniquely identifies that proxy server.
type: integer
required:
- proxy_id
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
ok:
default: true
type: boolean
result:
default: true
type: boolean
required:
- ok
- result
default:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/enableProxy:
post:
tags:
- added
description: |-
Enables the specified proxy. Takes immediate effect.
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
proxy_id:
description: The id that uniquely identifies that proxy server.
type: integer
required:
- proxy_id
multipart/form-data:
schema:
type: object
properties:
proxy_id:
description: The id that uniquely identifies that proxy server.
type: integer
required:
- proxy_id
application/json:
schema:
type: object
properties:
proxy_id:
description: The id that uniquely identifies that proxy server.
type: integer
required:
- proxy_id
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
ok:
default: true
type: boolean
result:
default: true
type: boolean
required:
- ok
- result
default:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/disableProxy:
post:
tags:
- added
description: |-
Disables the specified proxy. Takes immediate effect.
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
proxy_id:
description: The id that uniquely identifies that proxy server.
type: integer
required:
- proxy_id
multipart/form-data:
schema:
type: object
properties:
proxy_id:
description: The id that uniquely identifies that proxy server.
type: integer
required:
- proxy_id
application/json:
schema:
type: object
properties:
proxy_id:
description: The id that uniquely identifies that proxy server.
type: integer
required:
- proxy_id
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
ok:
default: true
type: boolean
result:
default: true
type: boolean
required:
- ok
- result
default:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/getUpdates: /getUpdates:
post: post:
@ -12102,6 +12427,47 @@ components:
type: string type: string
required: required:
- text - text
Proxy:
description: Contains a proxy definition.
type: object
properties:
id:
description: 'Unique ID of the proxy'
type: integer
last_used_date:
description: 'Unix timestamp indicating when the proxy was used for the last time.'
type: integer
is_enabled:
description: 'Whether the bot is being used at the moment.'
type: boolean
server:
description: 'Hostname or IP of the proxy server.'
type: string
port:
description: 'TCP port where the proxy server listens.'
type: integer
type:
description: 'Type of proxy server, either socks5, mtproto or http.'
type: string
username:
description: 'Username to authenticate to the proxy server.'
type: string
password:
description: 'Password to authenticate to the proxy server.'
type: string
secret:
description: 'Secret to authenticate to the proxy server.'
type: string
http_only:
description: 'Whether an Http proxy can only use Http requests (and does not support HTTP CONNECT method).'
type: boolean
required:
- id
- last_used_date
- is_enabled
- server
- port
- type
externalDocs: externalDocs:
description: The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram. description: The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
url: 'https://core.telegram.org/bots/api' url: 'https://core.telegram.org/bots/api'