mirror of
https://github.com/lifegpc/pythonscript.git
synced 2026-06-05 11:08:49 +08:00
Add JSON schema files
This commit is contained in:
6
schema/base64.schema.json
Normal file
6
schema/base64.schema.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/schema",
|
||||
"$id": "https://github.com/lifegpc/pythonscript/raw/master/schema/base64.schema.json",
|
||||
"type": "string",
|
||||
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
|
||||
}
|
||||
95
schema/tdlib.schema.json
Normal file
95
schema/tdlib.schema.json
Normal file
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/schema",
|
||||
"$id": "https://github.com/lifegpc/pythonscript/raw/master/schema/tdlib.schema.json",
|
||||
"title": "Tdlib",
|
||||
"description": "Tdlib settings",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"bot_encryption_key": {
|
||||
"$ref": "base64.schema.json",
|
||||
"description": "Encryption key to check or set up for bot. Need base64 encoded.",
|
||||
"minLength": 4
|
||||
},
|
||||
"bot_token": {
|
||||
"description": "Bot Token, which can be obtained with @BotFather .",
|
||||
"type": "string"
|
||||
},
|
||||
"BotTdlibParameters": {
|
||||
"$ref": "tdlib_parameters.schema.json",
|
||||
"description": "Same as TdlibParameters, but when creating a bot session, these parameters will override parameters in TdlibParameters",
|
||||
"required": [
|
||||
"database_directory"
|
||||
]
|
||||
},
|
||||
"encryption_key": {
|
||||
"$ref": "base64.schema.json",
|
||||
"description": "Encryption key to check or set up. Need base64 encoded.",
|
||||
"minLength": 4
|
||||
},
|
||||
"phone_number": {
|
||||
"description": "User's phone number",
|
||||
"type": "string",
|
||||
"pattern": "^\\+?[0-9]+$"
|
||||
},
|
||||
"proxy": {
|
||||
"description": "Proxy settings.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"port": {
|
||||
"description": "The port of the proxy.",
|
||||
"type": "number"
|
||||
},
|
||||
"server": {
|
||||
"description": "The server address of the proxy.",
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"description": "The type of the proxy.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"@type": {
|
||||
"description": "The type of the proxy type. Support proxyTypeHttp, proxyTypeSocks5, proxyTypeMtproto.",
|
||||
"type": "string",
|
||||
"enum": ["proxyTypeHttp", "proxyTypeSocks5", "proxyTypeMtproto"]
|
||||
},
|
||||
"http_only": {
|
||||
"description": "Pass true if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method. Supported if @type is proxyTypeHttp.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"password": {
|
||||
"description": "The password to authenticate. Supported if @type is proxyTypeHttp or proxyTypeSocks5",
|
||||
"type": "string"
|
||||
},
|
||||
"secret": {
|
||||
"description": "The proxy's secret in hexadecimal encoding. Supported if @type is proxyTypeMtproto.",
|
||||
"type": "string",
|
||||
"pattern": "^[0-9a-fA-F]+$"
|
||||
},
|
||||
"username": {
|
||||
"description": "The username to authenticate. Supported if @type is proxyTypeHttp or proxyTypeSocks5",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"port",
|
||||
"server",
|
||||
"type"
|
||||
]
|
||||
},
|
||||
"TdlibParameters": {
|
||||
"$ref": "tdlib_parameters.schema.json",
|
||||
"required": [
|
||||
"api_hash",
|
||||
"api_id"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"encryption_key",
|
||||
"phone_number",
|
||||
"TdlibParameters"
|
||||
]
|
||||
}
|
||||
81
schema/tdlib_parameters.schema.json
Normal file
81
schema/tdlib_parameters.schema.json
Normal file
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/schema",
|
||||
"$id": "https://github.com/lifegpc/pythonscript/raw/master/schema/tdlib_parameters.schema.json",
|
||||
"title": "Tdlib Parameters",
|
||||
"description": "Parameters of tdlib. Detailed information is availabled on https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1tdlib_parameters.html",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"api_hash": {
|
||||
"description": "Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org.",
|
||||
"type": "string"
|
||||
},
|
||||
"api_id": {
|
||||
"description": "Application identifier for Telegram API access, which can be obtained at https://my.telegram.org .",
|
||||
"type": "number",
|
||||
"maximum": 2147483647,
|
||||
"minimum": -2147483648
|
||||
},
|
||||
"application_version": {
|
||||
"description": "Application version; must be non-empty.",
|
||||
"type": "string",
|
||||
"default": "1.0.0"
|
||||
},
|
||||
"database_directory": {
|
||||
"description": "The path to the directory for the persistent database; if empty, the current working directory will be used.",
|
||||
"type": "string"
|
||||
},
|
||||
"device_model": {
|
||||
"description": "Model of the device the application is being run on; must be non-empty.",
|
||||
"type": "string",
|
||||
"default": "Desktop"
|
||||
},
|
||||
"enable_storage_optimizer": {
|
||||
"description": "If set to true, old files will automatically be deleted.",
|
||||
"type": "string",
|
||||
"default": true
|
||||
},
|
||||
"files_directory": {
|
||||
"description": "The path to the directory for storing files; if empty, database_directory will be used.",
|
||||
"type": "string"
|
||||
},
|
||||
"ignore_file_names": {
|
||||
"description": "If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"system_language_code": {
|
||||
"description": "IETF language tag of the user's operating system language; must be non-empty.",
|
||||
"type": "string",
|
||||
"default": "en"
|
||||
},
|
||||
"system_version": {
|
||||
"description": "Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib.",
|
||||
"type": "string"
|
||||
},
|
||||
"use_chat_info_database": {
|
||||
"description": "If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"use_file_database": {
|
||||
"description": "If set to true, information about downloaded and uploaded files will be saved between application restarts.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"use_message_database": {
|
||||
"description": "If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"use_secret_chats": {
|
||||
"description": "If set to true, support for secret chats will be enabled.",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"use_test_dc": {
|
||||
"description": "If set to true, the Telegram test environment will be used instead of the production environment.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user