soroushthon 0.2.21__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- soroushthon-0.2.21/.github/workflows/check.yml +27 -0
- soroushthon-0.2.21/.gitignore +81 -0
- soroushthon-0.2.21/AUDIT.md +92 -0
- soroushthon-0.2.21/CAPABILITIES.json +2657 -0
- soroushthon-0.2.21/CAPABILITIES.md +148 -0
- soroushthon-0.2.21/INTERACTIONS.md +64 -0
- soroushthon-0.2.21/LICENSE +674 -0
- soroushthon-0.2.21/MANIFEST.in +14 -0
- soroushthon-0.2.21/MEDIA.md +76 -0
- soroushthon-0.2.21/NOTICE.md +7 -0
- soroushthon-0.2.21/PARITY.md +44 -0
- soroushthon-0.2.21/PKG-INFO +65 -0
- soroushthon-0.2.21/PROTOCOL.md +52 -0
- soroushthon-0.2.21/PUBLISHING.md +112 -0
- soroushthon-0.2.21/PYPI_README.md +41 -0
- soroushthon-0.2.21/README.md +188 -0
- soroushthon-0.2.21/RUBIKA_REVIEW.md +52 -0
- soroushthon-0.2.21/SPLUSTHON_COMPAT.md +47 -0
- soroushthon-0.2.21/TELETHON_LICENSE +21 -0
- soroushthon-0.2.21/examples/coverage.py +223 -0
- soroushthon-0.2.21/examples/event_coverage.py +113 -0
- soroushthon-0.2.21/examples/interactive_coverage.py +136 -0
- soroushthon-0.2.21/examples/media_coverage.py +124 -0
- soroushthon-0.2.21/examples/media_fixtures/audio.mp3 +0 -0
- soroushthon-0.2.21/examples/media_fixtures/document.txt +1 -0
- soroushthon-0.2.21/examples/media_fixtures/photo.png +0 -0
- soroushthon-0.2.21/examples/media_fixtures/video.mp4 +0 -0
- soroushthon-0.2.21/examples/media_fixtures/voice.ogg +0 -0
- soroushthon-0.2.21/examples/multipart_coverage.py +352 -0
- soroushthon-0.2.21/examples/other_bio.py +31 -0
- soroushthon-0.2.21/examples/profile.py +28 -0
- soroushthon-0.2.21/examples/whoami.py +21 -0
- soroushthon-0.2.21/pyproject.toml +32 -0
- soroushthon-0.2.21/setup.cfg +4 -0
- soroushthon-0.2.21/setup.py +3 -0
- soroushthon-0.2.21/soroushthon/__init__.py +13 -0
- soroushthon-0.2.21/soroushthon/_updates/__init__.py +3 -0
- soroushthon-0.2.21/soroushthon/_updates/entitycache.py +59 -0
- soroushthon-0.2.21/soroushthon/_updates/messagebox.py +830 -0
- soroushthon-0.2.21/soroushthon/_updates/session.py +195 -0
- soroushthon-0.2.21/soroushthon/client/__init__.py +26 -0
- soroushthon-0.2.21/soroushthon/client/account.py +278 -0
- soroushthon-0.2.21/soroushthon/client/auth.py +744 -0
- soroushthon-0.2.21/soroushthon/client/bots.py +72 -0
- soroushthon-0.2.21/soroushthon/client/buttons.py +101 -0
- soroushthon-0.2.21/soroushthon/client/chats.py +1346 -0
- soroushthon-0.2.21/soroushthon/client/dialogs.py +628 -0
- soroushthon-0.2.21/soroushthon/client/downloads.py +1120 -0
- soroushthon-0.2.21/soroushthon/client/interactions.py +252 -0
- soroushthon-0.2.21/soroushthon/client/messageparse.py +238 -0
- soroushthon-0.2.21/soroushthon/client/messages.py +1531 -0
- soroushthon-0.2.21/soroushthon/client/soroushclient.py +57 -0
- soroushthon-0.2.21/soroushthon/client/telegrambaseclient.py +1110 -0
- soroushthon-0.2.21/soroushthon/client/updates.py +793 -0
- soroushthon-0.2.21/soroushthon/client/uploads.py +877 -0
- soroushthon-0.2.21/soroushthon/client/users.py +703 -0
- soroushthon-0.2.21/soroushthon/crypto/__init__.py +10 -0
- soroushthon-0.2.21/soroushthon/crypto/aes.py +111 -0
- soroushthon-0.2.21/soroushthon/crypto/aesctr.py +42 -0
- soroushthon-0.2.21/soroushthon/crypto/authkey.py +63 -0
- soroushthon-0.2.21/soroushthon/crypto/cdndecrypter.py +109 -0
- soroushthon-0.2.21/soroushthon/crypto/factorization.py +67 -0
- soroushthon-0.2.21/soroushthon/crypto/libssl.py +138 -0
- soroushthon-0.2.21/soroushthon/crypto/rsa.py +268 -0
- soroushthon-0.2.21/soroushthon/custom.py +1 -0
- soroushthon-0.2.21/soroushthon/errors/__init__.py +46 -0
- soroushthon-0.2.21/soroushthon/errors/common.py +180 -0
- soroushthon-0.2.21/soroushthon/errors/rpcbaseerrors.py +135 -0
- soroushthon-0.2.21/soroushthon/errors/rpcerrorlist.py +5356 -0
- soroushthon-0.2.21/soroushthon/events/__init__.py +139 -0
- soroushthon-0.2.21/soroushthon/events/album.py +345 -0
- soroushthon-0.2.21/soroushthon/events/callbackquery.py +345 -0
- soroushthon-0.2.21/soroushthon/events/chataction.py +458 -0
- soroushthon-0.2.21/soroushthon/events/common.py +186 -0
- soroushthon-0.2.21/soroushthon/events/inlinequery.py +247 -0
- soroushthon-0.2.21/soroushthon/events/messagedeleted.py +57 -0
- soroushthon-0.2.21/soroushthon/events/messageedited.py +52 -0
- soroushthon-0.2.21/soroushthon/events/messageread.py +143 -0
- soroushthon-0.2.21/soroushthon/events/newmessage.py +223 -0
- soroushthon-0.2.21/soroushthon/events/raw.py +53 -0
- soroushthon-0.2.21/soroushthon/events/userupdate.py +310 -0
- soroushthon-0.2.21/soroushthon/extensions/__init__.py +6 -0
- soroushthon-0.2.21/soroushthon/extensions/binaryreader.py +210 -0
- soroushthon-0.2.21/soroushthon/extensions/html.py +208 -0
- soroushthon-0.2.21/soroushthon/extensions/markdown.py +193 -0
- soroushthon-0.2.21/soroushthon/extensions/messagepacker.py +122 -0
- soroushthon-0.2.21/soroushthon/functions.py +1 -0
- soroushthon-0.2.21/soroushthon/helpers.py +434 -0
- soroushthon-0.2.21/soroushthon/hints.py +72 -0
- soroushthon-0.2.21/soroushthon/network/__init__.py +14 -0
- soroushthon-0.2.21/soroushthon/network/authenticator.py +212 -0
- soroushthon-0.2.21/soroushthon/network/connection/__init__.py +13 -0
- soroushthon-0.2.21/soroushthon/network/connection/connection.py +455 -0
- soroushthon-0.2.21/soroushthon/network/connection/http.py +39 -0
- soroushthon-0.2.21/soroushthon/network/connection/tcpabridged.py +33 -0
- soroushthon-0.2.21/soroushthon/network/connection/tcpfull.py +58 -0
- soroushthon-0.2.21/soroushthon/network/connection/tcpintermediate.py +46 -0
- soroushthon-0.2.21/soroushthon/network/connection/tcpmtproxy.py +165 -0
- soroushthon-0.2.21/soroushthon/network/connection/tcpobfuscated.py +62 -0
- soroushthon-0.2.21/soroushthon/network/connection/websocket.py +433 -0
- soroushthon-0.2.21/soroushthon/network/mtprotoplainsender.py +56 -0
- soroushthon-0.2.21/soroushthon/network/mtprotosender.py +983 -0
- soroushthon-0.2.21/soroushthon/network/mtprotostate.py +285 -0
- soroushthon-0.2.21/soroushthon/network/requeststate.py +19 -0
- soroushthon-0.2.21/soroushthon/password.py +194 -0
- soroushthon-0.2.21/soroushthon/requestiter.py +134 -0
- soroushthon-0.2.21/soroushthon/sessions/__init__.py +4 -0
- soroushthon-0.2.21/soroushthon/sessions/abstract.py +172 -0
- soroushthon-0.2.21/soroushthon/sessions/memory.py +260 -0
- soroushthon-0.2.21/soroushthon/sessions/sqlite.py +393 -0
- soroushthon-0.2.21/soroushthon/sessions/string.py +72 -0
- soroushthon-0.2.21/soroushthon/sync.py +74 -0
- soroushthon-0.2.21/soroushthon/tl/__init__.py +1 -0
- soroushthon-0.2.21/soroushthon/tl/alltlobjects.py +1696 -0
- soroushthon-0.2.21/soroushthon/tl/core/__init__.py +26 -0
- soroushthon-0.2.21/soroushthon/tl/core/gzippacked.py +48 -0
- soroushthon-0.2.21/soroushthon/tl/core/messagecontainer.py +47 -0
- soroushthon-0.2.21/soroushthon/tl/core/rpcresult.py +35 -0
- soroushthon-0.2.21/soroushthon/tl/core/tlmessage.py +34 -0
- soroushthon-0.2.21/soroushthon/tl/custom/__init__.py +14 -0
- soroushthon-0.2.21/soroushthon/tl/custom/adminlogevent.py +475 -0
- soroushthon-0.2.21/soroushthon/tl/custom/button.py +346 -0
- soroushthon-0.2.21/soroushthon/tl/custom/chatgetter.py +154 -0
- soroushthon-0.2.21/soroushthon/tl/custom/conversation.py +529 -0
- soroushthon-0.2.21/soroushthon/tl/custom/dialog.py +161 -0
- soroushthon-0.2.21/soroushthon/tl/custom/draft.py +194 -0
- soroushthon-0.2.21/soroushthon/tl/custom/file.py +146 -0
- soroushthon-0.2.21/soroushthon/tl/custom/forward.py +51 -0
- soroushthon-0.2.21/soroushthon/tl/custom/inlinebuilder.py +450 -0
- soroushthon-0.2.21/soroushthon/tl/custom/inlineresult.py +176 -0
- soroushthon-0.2.21/soroushthon/tl/custom/inlineresults.py +83 -0
- soroushthon-0.2.21/soroushthon/tl/custom/inputsizedfile.py +9 -0
- soroushthon-0.2.21/soroushthon/tl/custom/message.py +1250 -0
- soroushthon-0.2.21/soroushthon/tl/custom/messagebutton.py +160 -0
- soroushthon-0.2.21/soroushthon/tl/custom/participantpermissions.py +138 -0
- soroushthon-0.2.21/soroushthon/tl/custom/qrlogin.py +119 -0
- soroushthon-0.2.21/soroushthon/tl/custom/sendergetter.py +106 -0
- soroushthon-0.2.21/soroushthon/tl/custom/types.py +38 -0
- soroushthon-0.2.21/soroushthon/tl/functions/__init__.py +452 -0
- soroushthon-0.2.21/soroushthon/tl/functions/account.py +1581 -0
- soroushthon-0.2.21/soroushthon/tl/functions/auth.py +593 -0
- soroushthon-0.2.21/soroushthon/tl/functions/bots.py +112 -0
- soroushthon-0.2.21/soroushthon/tl/functions/channels.py +1672 -0
- soroushthon-0.2.21/soroushthon/tl/functions/chatlists.py +325 -0
- soroushthon-0.2.21/soroushthon/tl/functions/conference.py +437 -0
- soroushthon-0.2.21/soroushthon/tl/functions/contacts.py +476 -0
- soroushthon-0.2.21/soroushthon/tl/functions/folders.py +44 -0
- soroushthon-0.2.21/soroushthon/tl/functions/help.py +259 -0
- soroushthon-0.2.21/soroushthon/tl/functions/langpack.py +146 -0
- soroushthon-0.2.21/soroushthon/tl/functions/messages.py +5469 -0
- soroushthon-0.2.21/soroushthon/tl/functions/payments.py +292 -0
- soroushthon-0.2.21/soroushthon/tl/functions/phone.py +809 -0
- soroushthon-0.2.21/soroushthon/tl/functions/photos.py +282 -0
- soroushthon-0.2.21/soroushthon/tl/functions/premium.py +152 -0
- soroushthon-0.2.21/soroushthon/tl/functions/stats.py +300 -0
- soroushthon-0.2.21/soroushthon/tl/functions/stories.py +765 -0
- soroushthon-0.2.21/soroushthon/tl/functions/thirdParty.py +67 -0
- soroushthon-0.2.21/soroushthon/tl/functions/updates.py +139 -0
- soroushthon-0.2.21/soroushthon/tl/functions/upload.py +168 -0
- soroushthon-0.2.21/soroushthon/tl/functions/users.py +170 -0
- soroushthon-0.2.21/soroushthon/tl/patched/__init__.py +20 -0
- soroushthon-0.2.21/soroushthon/tl/tlobject.py +222 -0
- soroushthon-0.2.21/soroushthon/tl/types/__init__.py +40015 -0
- soroushthon-0.2.21/soroushthon/tl/types/account.py +1096 -0
- soroushthon-0.2.21/soroushthon/tl/types/auth.py +809 -0
- soroushthon-0.2.21/soroushthon/tl/types/bots.py +43 -0
- soroushthon-0.2.21/soroushthon/tl/types/channels.py +232 -0
- soroushthon-0.2.21/soroushthon/tl/types/chatlists.py +273 -0
- soroushthon-0.2.21/soroushthon/tl/types/conference.py +69 -0
- soroushthon-0.2.21/soroushthon/tl/types/contacts.py +478 -0
- soroushthon-0.2.21/soroushthon/tl/types/help.py +1206 -0
- soroushthon-0.2.21/soroushthon/tl/types/messages.py +3000 -0
- soroushthon-0.2.21/soroushthon/tl/types/payments.py +633 -0
- soroushthon-0.2.21/soroushthon/tl/types/phone.py +313 -0
- soroushthon-0.2.21/soroushthon/tl/types/photos.py +135 -0
- soroushthon-0.2.21/soroushthon/tl/types/premium.py +209 -0
- soroushthon-0.2.21/soroushthon/tl/types/stats.py +368 -0
- soroushthon-0.2.21/soroushthon/tl/types/stickers.py +35 -0
- soroushthon-0.2.21/soroushthon/tl/types/storage.py +197 -0
- soroushthon-0.2.21/soroushthon/tl/types/stories.py +317 -0
- soroushthon-0.2.21/soroushthon/tl/types/thirdParty.py +94 -0
- soroushthon-0.2.21/soroushthon/tl/types/update.py +39 -0
- soroushthon-0.2.21/soroushthon/tl/types/updates.py +447 -0
- soroushthon-0.2.21/soroushthon/tl/types/upload.py +196 -0
- soroushthon-0.2.21/soroushthon/tl/types/users.py +131 -0
- soroushthon-0.2.21/soroushthon/types.py +1 -0
- soroushthon-0.2.21/soroushthon/utils.py +1577 -0
- soroushthon-0.2.21/soroushthon/version.py +1 -0
- soroushthon-0.2.21/soroushthon.egg-info/PKG-INFO +65 -0
- soroushthon-0.2.21/soroushthon.egg-info/SOURCES.txt +259 -0
- soroushthon-0.2.21/soroushthon.egg-info/dependency_links.txt +1 -0
- soroushthon-0.2.21/soroushthon.egg-info/requires.txt +10 -0
- soroushthon-0.2.21/soroushthon.egg-info/top_level.txt +2 -0
- soroushthon-0.2.21/soroushthon_generator/__init__.py +1 -0
- soroushthon-0.2.21/soroushthon_generator/data/api.tl +1638 -0
- soroushthon-0.2.21/soroushthon_generator/data/errors.csv +534 -0
- soroushthon-0.2.21/soroushthon_generator/data/friendly.csv +26 -0
- soroushthon-0.2.21/soroushthon_generator/data/html/404.html +44 -0
- soroushthon-0.2.21/soroushthon_generator/data/html/core.html +179 -0
- soroushthon-0.2.21/soroushthon_generator/data/html/css/docs.dark.css +185 -0
- soroushthon-0.2.21/soroushthon_generator/data/html/css/docs.h4x0r.css +229 -0
- soroushthon-0.2.21/soroushthon_generator/data/html/css/docs.light.css +182 -0
- soroushthon-0.2.21/soroushthon_generator/data/html/img/arrow.svg +35 -0
- soroushthon-0.2.21/soroushthon_generator/data/html/js/search.js +244 -0
- soroushthon-0.2.21/soroushthon_generator/data/methods.csv +365 -0
- soroushthon-0.2.21/soroushthon_generator/data/mtproto.tl +116 -0
- soroushthon-0.2.21/soroushthon_generator/docswriter.py +295 -0
- soroushthon-0.2.21/soroushthon_generator/generators/__init__.py +3 -0
- soroushthon-0.2.21/soroushthon_generator/generators/docs.py +649 -0
- soroushthon-0.2.21/soroushthon_generator/generators/errors.py +60 -0
- soroushthon-0.2.21/soroushthon_generator/generators/tlobject.py +720 -0
- soroushthon-0.2.21/soroushthon_generator/parsers/__init__.py +3 -0
- soroushthon-0.2.21/soroushthon_generator/parsers/errors.py +85 -0
- soroushthon-0.2.21/soroushthon_generator/parsers/methods.py +67 -0
- soroushthon-0.2.21/soroushthon_generator/parsers/tlobject/__init__.py +3 -0
- soroushthon-0.2.21/soroushthon_generator/parsers/tlobject/parser.py +148 -0
- soroushthon-0.2.21/soroushthon_generator/parsers/tlobject/tlarg.py +256 -0
- soroushthon-0.2.21/soroushthon_generator/parsers/tlobject/tlobject.py +177 -0
- soroushthon-0.2.21/soroushthon_generator/sourcebuilder.py +65 -0
- soroushthon-0.2.21/soroushthon_generator/syncerrors.py +55 -0
- soroushthon-0.2.21/soroushthon_generator/utils.py +8 -0
- soroushthon-0.2.21/tests/__init__.py +0 -0
- soroushthon-0.2.21/tests/soroushthon/__init__.py +0 -0
- soroushthon-0.2.21/tests/soroushthon/client/__init__.py +0 -0
- soroushthon-0.2.21/tests/soroushthon/client/test_account_sessions.py +21 -0
- soroushthon-0.2.21/tests/soroushthon/client/test_delete_messages.py +35 -0
- soroushthon-0.2.21/tests/soroushthon/client/test_drafts.py +24 -0
- soroushthon-0.2.21/tests/soroushthon/client/test_entity_cache.py +58 -0
- soroushthon-0.2.21/tests/soroushthon/client/test_interactions.py +138 -0
- soroushthon-0.2.21/tests/soroushthon/client/test_media_connection.py +266 -0
- soroushthon-0.2.21/tests/soroushthon/client/test_messages.py +84 -0
- soroushthon-0.2.21/tests/soroushthon/client/test_profiles.py +193 -0
- soroushthon-0.2.21/tests/soroushthon/client/test_read_acknowledge.py +40 -0
- soroushthon-0.2.21/tests/soroushthon/client/test_shortcuts.py +31 -0
- soroushthon-0.2.21/tests/soroushthon/client/test_unsupported_features.py +56 -0
- soroushthon-0.2.21/tests/soroushthon/crypto/__init__.py +0 -0
- soroushthon-0.2.21/tests/soroushthon/crypto/test_rsa.py +45 -0
- soroushthon-0.2.21/tests/soroushthon/events/__init__.py +0 -0
- soroushthon-0.2.21/tests/soroushthon/events/test_chataction.py +68 -0
- soroushthon-0.2.21/tests/soroushthon/events/test_dispatch.py +71 -0
- soroushthon-0.2.21/tests/soroushthon/events/test_registration.py +47 -0
- soroushthon-0.2.21/tests/soroushthon/extensions/__init__.py +0 -0
- soroushthon-0.2.21/tests/soroushthon/extensions/test_html.py +81 -0
- soroushthon-0.2.21/tests/soroushthon/extensions/test_markdown.py +80 -0
- soroushthon-0.2.21/tests/soroushthon/test_coverage_runner.py +138 -0
- soroushthon-0.2.21/tests/soroushthon/test_event_coverage_diagnostics.py +59 -0
- soroushthon-0.2.21/tests/soroushthon/test_helpers.py +83 -0
- soroushthon-0.2.21/tests/soroushthon/test_interactive_coverage.py +67 -0
- soroushthon-0.2.21/tests/soroushthon/test_media_attributes.py +48 -0
- soroushthon-0.2.21/tests/soroushthon/test_media_coverage.py +53 -0
- soroushthon-0.2.21/tests/soroushthon/test_multipart_coverage.py +149 -0
- soroushthon-0.2.21/tests/soroushthon/test_pickle.py +35 -0
- soroushthon-0.2.21/tests/soroushthon/test_sessions.py +51 -0
- soroushthon-0.2.21/tests/soroushthon/test_utils.py +82 -0
- soroushthon-0.2.21/tests/soroushthon/test_websocket.py +220 -0
- soroushthon-0.2.21/tests/soroushthon/tl/__init__.py +0 -0
- soroushthon-0.2.21/tests/soroushthon/tl/test_serialization.py +13 -0
- soroushthon-0.2.21/tools/audit_upstreams.py +133 -0
- soroushthon-0.2.21/tools/build_capability_inventory.py +120 -0
- soroushthon-0.2.21/tools/check_release.py +84 -0
- soroushthon-0.2.21/tools/generate.py +157 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Check Python package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test-and-build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: '3.12'
|
|
19
|
+
- name: Install test and build tools
|
|
20
|
+
run: python -m pip install -e '.[test]' build twine
|
|
21
|
+
- name: Test
|
|
22
|
+
run: python -m pytest -q
|
|
23
|
+
- name: Build and check metadata
|
|
24
|
+
run: |
|
|
25
|
+
python -m build
|
|
26
|
+
python -m twine check dist/*
|
|
27
|
+
python tools/check_release.py dist
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
dist-*/
|
|
11
|
+
downloads/
|
|
12
|
+
eggs/
|
|
13
|
+
.eggs/
|
|
14
|
+
lib/
|
|
15
|
+
lib64/
|
|
16
|
+
parts/
|
|
17
|
+
sdist/
|
|
18
|
+
var/
|
|
19
|
+
wheels/
|
|
20
|
+
*.egg-info/
|
|
21
|
+
.installed.cfg
|
|
22
|
+
*.egg
|
|
23
|
+
*.pyi
|
|
24
|
+
|
|
25
|
+
# Virtual Environment
|
|
26
|
+
venv/
|
|
27
|
+
.venv/
|
|
28
|
+
env/
|
|
29
|
+
ENV/
|
|
30
|
+
|
|
31
|
+
# Package managers
|
|
32
|
+
poetry.lock
|
|
33
|
+
pip-log.txt
|
|
34
|
+
pip-delete-this-directory.txt
|
|
35
|
+
|
|
36
|
+
# Linting / Type checking
|
|
37
|
+
.mypy_cache/
|
|
38
|
+
.ruff_cache/
|
|
39
|
+
|
|
40
|
+
# Environment variables
|
|
41
|
+
.env
|
|
42
|
+
.env.*
|
|
43
|
+
.pypirc
|
|
44
|
+
|
|
45
|
+
# Testing
|
|
46
|
+
.pytest_cache/
|
|
47
|
+
.coverage
|
|
48
|
+
htmlcov/
|
|
49
|
+
coverage.xml
|
|
50
|
+
*.cover
|
|
51
|
+
*.py,cover
|
|
52
|
+
.hypothesis/
|
|
53
|
+
|
|
54
|
+
# IDE
|
|
55
|
+
.vscode/
|
|
56
|
+
.idea/
|
|
57
|
+
*.swp
|
|
58
|
+
*.swo
|
|
59
|
+
*~
|
|
60
|
+
|
|
61
|
+
# OS
|
|
62
|
+
.DS_Store
|
|
63
|
+
Thumbs.db
|
|
64
|
+
|
|
65
|
+
# Documentation
|
|
66
|
+
docs/site/
|
|
67
|
+
|
|
68
|
+
# Testing scripts
|
|
69
|
+
speedtest.py
|
|
70
|
+
test.py
|
|
71
|
+
|
|
72
|
+
*.session
|
|
73
|
+
*.session-journal
|
|
74
|
+
*.session-*
|
|
75
|
+
pytest-of-root/
|
|
76
|
+
pip-ephem-wheel-cache-*/
|
|
77
|
+
pip-unpack-*/
|
|
78
|
+
readthedocs/
|
|
79
|
+
.readthedocs.yaml
|
|
80
|
+
tests/readthedocs/
|
|
81
|
+
.mimocode/
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# گزارش بررسی معماری Soroushthon، SPlusthon و Telethon
|
|
2
|
+
|
|
3
|
+
این گزارش برای ساخت یک **کتابخانهٔ عمومی حساب کاربری** است. هیچ بخش آن به ربات مدیریت گروه وابسته نیست. نسخهٔ مبنا: SPlusthon در commit `cad975488c66f91e4548c7fd4c255b4f787f9b0e`؛ مرجع مقایسه: شاخهٔ v1 کتابخانهٔ Telethon در commit `dab6bc4d4fc0c7815f6f19c6f643d9f75d2d930c`. مقایسه و آزمونهای این گزارش در ۲۷ سپتامبر ۲۰۲۶ انجام شدهاند. این بررسی جایگزین آزمایش همهٔ قابلیتها روی سرور زندهٔ سروش نیست.
|
|
4
|
+
|
|
5
|
+
## Telethon چه چیزی را فراهم میکند؟
|
|
6
|
+
|
|
7
|
+
Telethon چند لایه دارد: تعریفهای [زبان TL](https://docs.telethon.dev/en/stable/developing/understanding-the-type-language.html) برای ساخت کلاسهای درخواست و پاسخ؛ موتور شبکه، رمزنگاری و نشست؛ و متدهای سادهتر کلاینت. مولد، تعریفهای TL را به کلاسهای پایتون تبدیل میکند و کلاسهای `*Methods` رابط کاربردی هستند. [ساختار پروژهٔ Telethon](https://docs.telethon.dev/en/stable/developing/project-structure.html) و [راهنمای Raw API](https://docs.telethon.dev/en/stable/concepts/full-api.html) این تفکیک را توضیح میدهند. SPlusthon این لایهها را از Telethon گرفته و طرح TL، WebSocket، کلیدها و پیشفرضهای اتصال را برای سروش تغییر داده است. از روی کد هیچ شاهدی برای «نفوذ به سرور» به دست نمیآید؛ منشأ دقیق همهٔ تعریفهای TL را نیز نمیتوان با مشاهدهٔ مخزن تعیین کرد.
|
|
8
|
+
|
|
9
|
+
کپی کردن متدهای Telethon بهتنهایی کافی نیست: درخواست خام باید در طرح **خود سروش** وجود داشته باشد، شناسه و امضایش مطابق سرور باشد و پاسخ و خطا واقعاً آزموده شوند. تفاوت لایهٔ طرح تلگرام و سروش دلیل کافی برای نتیجهگیری دربارهٔ پشتیبانی سرور از هر درخواست منفرد نیست.
|
|
10
|
+
|
|
11
|
+
## دامنهٔ قابلیتهای خود سروش
|
|
12
|
+
|
|
13
|
+
[وبسایت رسمی سروشپلاس](https://sapp.ir/) گفتگوی شخصی و گروهی، کانال، فایل، فضای ذخیرهسازی و تماس صوتی/تصویری را معرفی میکند. در طرح TL فعلی بسته نامهای مربوط به پیام، حساب، کانال، تماس، کنفرانس، داستان، پرداخت و سایر حوزهها دیده میشود (شمارش هر حوزه در `CAPABILITIES.md`). این دو مشاهده **بهتنهایی** اثبات نمیکنند که تمام امکانات برنامه با همین WebSocket و یک حساب، یا با یک فراخوانی TL، قابل پیادهسازی هستند. برای تماس زنده، پرداخت و امکانات تازه ممکن است جریانها و سرویسهای دیگری نیز لازم باشد. در منابع عمومی بررسیشده، مرجع معتبر و کاملِ شناسه و امضای همهٔ درخواستهای حساب کاربریِ سروش به دست نیامد؛ بنابراین درخواستهای غایب را با شناسهٔ تلگرام پر نکردهایم.
|
|
14
|
+
|
|
15
|
+
## نتیجهٔ قابل تکرارِ مقایسهٔ کل طرح
|
|
16
|
+
|
|
17
|
+
در ریشهٔ پروژه، کنار یک checkout از Telethon v1، اجرا کن:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
python tools/audit_upstreams.py --telethon ../telethon_reference
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
| گروه | SPlusthon/Soroushthon | Telethon v1 | نام مشترک | شناسهٔ یکسان | تعریف کاملاً یکسان | فقط سروش | فقط Telethon |
|
|
24
|
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
|
25
|
+
| نوعهای TL | ۱۲۷۰ | ۱۵۴۱ | ۱۲۲۵ | ۱۱۲۱ | ۱۱۱۱ | ۴۵ | ۳۱۶ |
|
|
26
|
+
| تابعهای TL | ۳۶۶ | ۷۵۴ | ۳۳۶ | ۳۰۲ | ۲۹۶ | ۳۰ | ۴۱۸ |
|
|
27
|
+
|
|
28
|
+
طرح بستهٔ سروش `LAYER 182` و طرح checkout تلگرام `LAYER 222` است. این شمارش فقط تعریفهای یکخطی معتبر در دو فایل `api.tl` را مقایسه میکند. برای مثال بعضی سازندهها با نام مشترک، شناسه یا امضای متفاوت دارند؛ `messages.deleteMessages` از این دسته است. انتقال خودکار درخواستهای غایب Telethon به سروش اشتباه است.
|
|
29
|
+
|
|
30
|
+
در کلاسهای `*Methods`، ۵۹ نام عمومی Telethon در فورک هم یافت شد و پنج نام دیگر برای پروفایل در Soroushthon وجود دارد؛ **اشتراک نام به معنی کارکرد ۵۹ قابلیت نیست**. بررسی اولیه ۱۲ نام کلاس خامِ غایب یافت؛ پس از حذف استفادهٔ نامعتبر `InvokeWithoutUpdatesRequest` در 0.2.13، ۱۱ نام در ارجاعهای کد باقیاند و شاخههای عمومی وابسته به آنها خطای مشخص میدهند. مسیر پیشنویسهای همهٔ گفتگوها از ارجاع به درخواست غایب به بازیابی از فهرست گفتگوها تغییر کرده است؛ این تغییر هنوز روی سرور زنده آزموده نشده است.
|
|
31
|
+
|
|
32
|
+
## درخواستهای غایب و اثرشان
|
|
33
|
+
|
|
34
|
+
| حوزه | نامهای غایب در طرحِ بسته | مسیر استفادهٔ احتمالی |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| ورود ربات | `auth.ImportBotAuthorizationRequest` | شاخهٔ `sign_in(bot_token=...)`؛ اکنون پیام واضح `NotImplementedError` میدهد |
|
|
37
|
+
| نشست takeout | `account.InitTakeoutSessionRequest`, `account.FinishTakeoutSessionRequest`, `InvokeWithTakeoutRequest` | آغاز، درخواست درون نشست، پایان |
|
|
38
|
+
| بدون رویداد | `InvokeWithoutUpdatesRequest` | گزینهٔ `receive_updates=False` و مسیر ارسال درخواست |
|
|
39
|
+
| گفتگو و رسانه | `messages.EditInlineBotMessageRequest`, `upload.GetCdnFileRequest`, `upload.ReuploadCdnFileRequest` | ویرایش inline، مسیر CDN؛ پیشنویسها اکنون مسیر جایگزین دارند |
|
|
40
|
+
| مدیریت و پوشهها | `channels.GetAdminLogRequest`, `messages.EditChatAdminRequest`, `folders.DeleteFolderRequest` | مسیرهای متناظر متدهای سطحبالا |
|
|
41
|
+
| پیکربندی CDN | `help.GetCdnConfigRequest` | مسیر دریافت کلید/پیکربندی CDN |
|
|
42
|
+
|
|
43
|
+
اینها ارجاعهای **ایستا** هستند. بعضی فقط در یک شاخهٔ شرطی یا برای نوع خاصی از ورودی اجرا میشوند. وجودشان به معنای خراب بودن تمام تابع `send_file` یا `sign_in` نیست؛ برای نمونه ورود با شمارهٔ تلفن قبلاً روی گوشی اجرا شده، ولی ورود با توکن ربات در طرح فعلی تعریف نشده است. بدون تعریف تأییدشدهٔ سروش، ساختن کلاس TL با شناسهٔ تلگرام راهحل معتبر نیست.
|
|
44
|
+
|
|
45
|
+
## مرور لایهها
|
|
46
|
+
|
|
47
|
+
| لایه | شواهد در کد | وضعیت/کار بعدی |
|
|
48
|
+
| --- | --- | --- |
|
|
49
|
+
| اتصال و رمزنگاری | `network/connection/websocket.py`، `network/mtprotosender.py`، `crypto/`، `client/telegrambaseclient.py` | WebSocket پیشفرض سروش به مسیر `/apiws` میرود. گزینههای proxy و local_addr در این مسیر اعمال نمیشدند؛ اکنون بهجای اتصال مستقیم ناخواسته، خطای صریح میدهند. پایداری اتصال طولانی و مسیرهای جایگزین نیازمند آزمون زندهاند. |
|
|
50
|
+
| نشست و بازیابی | `sessions/memory.py`، `sessions/sqlite.py`، `sessions/string.py` | خطای setter کلید موقت و ترتیب بازیابی ستونهای SQLite اصلاح شد؛ حفظ مقدارها بعد از بستن و بازکردن با آزمون محلی بررسی شد. بازیابی نشست واقعی پس از قطعی طولانی نیازمند آزمون گوشی است. |
|
|
51
|
+
| احراز هویت | `client/auth.py` و `tl/functions/auth.py` | ورود با شماره/کد در نسخههای قبلی توسط کاربر اجرا شده است. مسیر bot-token کلاس خام ندارد؛ بعضی متنهای مستنداتِ منتقلشده از تلگرام هنوز باید بازبینی شوند. |
|
|
52
|
+
| موجودیتها و آدرسدهی | `client/users.py`، `sessions/`، `utils.py` | پردازش موجودیتها اکنون قبل از برگشت RPC منتظر میماند؛ تبدیل لینک عمومی و دریافت بیوی خود/کاربر دیگر روی گوشی گزارش شدهاند. |
|
|
53
|
+
| پیام، گفتگو و رویداد | `client/messages.py`، `client/dialogs.py`، `client/updates.py`، `events/` | کاربر خواندن سه گفتگو و سه پیام از تاریخچه را روی گوشی تأیید کرد. مسیر همهٔ پیشنویسها از گفتگوها بازسازی شده و آزمون محلی دارد. برای حذف پیام، اگر مقصد داده شده باشد، اکنون فیلد `peer` طرح سروش فرستاده میشود. دریافت رویداد، پیشنویس، ویرایش، حذف و شاخههای پیشرفته هنوز نیازمند آزمون زندهاند. |
|
|
54
|
+
| فایل و رسانه | `client/uploads.py`، `client/downloads.py`، `tl/custom/` | کد سطحبالا موجود است؛ شاخههای CDN به کلاسهای غایب اشاره میکنند. آپلود/دانلود عادی، انواع فایل و انقضا نیازمند آزمون واقعی و گزارش خطا هستند. |
|
|
55
|
+
| تولید کد TL | `soroushthon_generator/data/api.tl`، `tools/generate.py` | مولد و ۳۶۶ تعریف درخواست بسته شدهاند. برای هر قابلیت تازه باید ابتدا تعریف معتبر همان سرویس به دست آید، بعد کلاس تولید و درخواست/پاسخ آزموده شود. |
|
|
56
|
+
| ابزار و آزمون | `tests/`، `tools/audit_upstreams.py` | آزمونهای محلی مسیرهای مشخص هسته را میسنجند؛ آزمون خودکار محلی نمیتواند پشتیبانی سرور را ثابت کند. |
|
|
57
|
+
|
|
58
|
+
نسخهٔ 0.2.4 متد `SoroushClient.for_account('test')` را برای نشست مستقلِ حساب آزمایشی اضافه کرده است. نام `main` به فایل نشست قدیمی اشاره میکند؛ نامهای دیگر فایل جدا در پوشهٔ خانگی میسازند. آزمون رسانه در `examples/media_coverage.py` برای پنج قالب کوچک، مراحل ارسال، بازیابی، دانلود و حذف پیام تازهٔ همان حساب را ثبت میکند. مسیر ساخت محلیِ عکس، ویدئو، صوت و سند آزمایش شده است. شرح نتیجهٔ سرور در `MEDIA.md` آمده است.
|
|
59
|
+
|
|
60
|
+
آزمون زندهٔ حساب دوم در نسخهٔ 0.2.4 نشان داد ارسال متن، ویرایش و حذف پیام تازه موفقاند، ولی پنج بار `upload.SaveFilePartRequest` و یک بار `upload.GetFileRequest` با `FILE_REQUEST_RECEIVED_ON_CONNECTION_SERVER` رد شدند. نسخهٔ 0.2.5 اتصال مستقل و `InitConnection(params.connection=upload)` را روی همان میزبان عمومی امتحان کرد؛ نتیجهٔ زندهٔ هر پنج آپلود همچنان خطای ۴۲۲ بود. این روش رد شده است. بررسی [بستهٔ وب رسمی](https://web.splus.ir/main.69cb2ff17c22724308b0.js) نشان داد sender فایل به میزبان جایگزین DC متصل میشود و RPC فایل را مستقیم میفرستد. نسخهٔ 0.2.6 مسیر آپلود و دانلود را بر این اساس عوض کرده است. آزمونهای محلی مسیریابی، درخواست خام، کلید DC دیگر و بستن اتصال را بررسی کردهاند. جدول دقیق میزبانها در [PROTOCOL.md](PROTOCOL.md) آمده است.
|
|
61
|
+
|
|
62
|
+
پس از انتشار 0.2.6، کاربر روی حساب آزمایشی `70012182` برای هر پنج قالب کوچک، ارسال، بازیابی، دانلود و حذف را موفق گزارش کرد. مجموعاً ۲۰ مرحلهٔ `PASS` ثبت شد. این نتیجه، مسیر رسانه را برای همین حساب و همین اندازهها تأیید میکند؛ اندازهٔ نمونهها کمتر از ۱۰ کیلوبایت است و شاخهٔ چندبخشی و `SaveBigFilePart` را پوشش نمیدهد. نسخهٔ 0.2.7 آزمون جداگانهٔ سند حدود ۲ مگابایتی و مسیر اختیاری بالای ۱۰ مگابایت با بررسی تطابق بایتها اضافه میکند. دانلود عکس پروفایل و انتقال فایل از DC متفاوت همچنان نیازمند آزمون زندهاند.
|
|
63
|
+
|
|
64
|
+
اجرای زندهٔ نخست آزمون ۲ مگابایتی در نسخهٔ 0.2.7 با `TimeoutError` در ارسال شکست خورد؛ اتصال WebSocket چند بار timeout شد و یک `aiohttp.ClientSession` باز ماند. تعداد بخشهای پذیرفتهشده در خروجی معلوم نبود، بنابراین این مشاهده بهتنهایی مشکل سرور یا محدودیت اندازهٔ فایل را ثابت نمیکند. نسخهٔ 0.2.8 نشست را هنگام لغو/شکست handshake و راهاندازی WebSocket میبندد و آزمون تشخیصی دو بخشی با شمارش زندهٔ بخشها اضافه میکند. علت اصلی timeout همچنان نیازمند گزارش شمارش بخشها و آزمون شبکهٔ حساب آزمایشی است.
|
|
65
|
+
|
|
66
|
+
گزارش 0.2.7 بعداً نشان داد ۵ بخش از ۱۷ بخش پذیرفته شدند؛ اجرای زندهٔ `--probe` در 0.2.8 با دو بخش، بازیابی و تطابق کامل بایتها موفق بود. در آزمون 0.2.7 `asyncio.wait_for(send_file, timeout=180)` سقف را روی کل ارسال گذاشته بود. نسخهٔ 0.2.9 آن را به وقفهٔ بدون پیشرفت تغییر میدهد و زمان تأیید هر بخش را گزارش میکند تا کندی CPU/شبکه از خطای سرور جدا شود. هنوز آزمون زندهٔ دوبارهٔ فایل ۲ مگابایتی انجام نشده است.
|
|
67
|
+
|
|
68
|
+
آزمون زندهٔ 0.2.9 روی حساب دوم هر ۱۷ بخش فایل `2097169` بایتی را در حدود ۹۱ ثانیه آپلود کرد و پیام را بازیافت و حذف کرد. دانلود در **اولین** `GetFileRequest` با `ServerError` ۵۰۰ شکست خورد؛ شمار بخشهای دریافتی صفر و زمان خطا ۰٫۴ ثانیه بود. کلاینت وب رسمی برای این اندازه درخواست ۱۲۸ کیلوبایتی دارد و خطای داخلی فایل را چند بار تکرار میکند. مسیر نخستین فایل در 0.2.9 مستقیم با `sender.send` میرفت و برخلاف درخواستهای بعدی، حلقهٔ retry نداشت. نسخهٔ 0.2.10 حداکثر سه تکرار محدود برای `ServerError` در درخواست نخست اضافه کرد. آزمون زندهٔ 0.2.10 روی همان حساب، ارسال، بازیابی، دریافت ۱۷ بخش، تطابق کامل محتوا و حذف سند را تأیید کرد. از گزارش نمیتوان فهمید در آن اجرای موفق، retry لازم شده بود یا نه.
|
|
69
|
+
|
|
70
|
+
کد وب رسمی برای آپلود بر حسب اندازهٔ فایل، بخش ۳۲/۲۵۶/۵۱۲ کیلوبایتی به کار میبرد؛ کد قبلی کتابخانه تا ۱۰۰ مگابایت همیشه ۱۲۸ کیلوبایت انتخاب میکرد. در 0.2.11 اندازهٔ پیشفرض آپلود با این رفتار هماهنگ شد و آزمون محلی ۲ مگابایت + ۱۷ بایت (۹ بخش کوچک) و ۱۰ مگابایت + ۱ کیلوبایت (۲۱ بخش بزرگ) افزوده شد. نتیجهٔ آزمون زندهٔ بعدی در بند زیر ثبت شده است.
|
|
71
|
+
|
|
72
|
+
آزمون زندهٔ 0.2.11 آپلود ۹ بخشی و دانلود ۱۷ بخشی سند ۲ مگابایتی را با تطابق محتوا تأیید کرد. سند بالای ۱۰ مگابایت نیز در ۲۱ بخش ارسال و پیام آن بازیافت شد. دانلود پس از دریافت ۱۶ بخش به سقف ۹۰ ثانیهٔ کل دانلود برخورد؛ آن سقف در ابزار آزمون بود. نسخهٔ 0.2.12 سقف را برای هر وقفهٔ بدون دریافت بخش جداگانه میسنجد و امکان نگهداری پیام پس از شکست و تلاش دوبارهٔ دانلود با هش ثبتشده را به ابزار آزمون افزود. دریافت و تطابق کامل سند بزرگ هنوز روی سرور تأیید نشده است.
|
|
73
|
+
|
|
74
|
+
در 0.2.13 تمام ۵۹ نام متد Telethon v1 با رابط بسته و تعریفهای خامِ SPlusthon مقایسه شدند؛ جدول تفکیک آزمون زنده، مسیر غیرمستقیم، آزمون محلی و شاخهٔ مسدود در `PARITY.md` است. بررسی دوبارهٔ ارجاعهای خام، ۱۱ نام کلاس غایب را در کد بهجا نشان میدهد. مسیرهای takeout، گزارش مدیران، unpack پوشه، ویرایش مدیر گروه کوچک، ویرایش پیام inline، CDN redirect و خاموشکردن رویداد، در نبود طرح سروش خطای روشن میدهند؛ اصلاح درصد پیشرفت `action` برای فایل نیز آزمون محلی دارد. این تغییرها به معنی اجرای موفق شاخههای مسدود روی سرور نیستند.
|
|
75
|
+
|
|
76
|
+
## تغییرهای عملی این مرحله
|
|
77
|
+
|
|
78
|
+
1. پردازش موجودیتهای RPC تکدرخواستی و دستهای قبل از بازگشت پاسخ انجام میشود؛ مصرفکننده فوراً به موجودیتهای ذخیرهشده دسترسی دارد.
|
|
79
|
+
2. کلید موقت نشست از کلید اصلی جدا میماند و SQLite ترتیب ستونهای ذخیرهشده را درست بازمیخواند؛ نشستهای قدیمی با کلید موقت خالی هم پوشش داده میشوند.
|
|
80
|
+
3. WebSocket گزینهٔ proxy/local_addr را دیگر بیصدا نادیده نمیگیرد؛ پشتیبانی واقعی این گزینهها هنوز باید پیادهسازی شود.
|
|
81
|
+
4. مسیر ورود با توکن ربات به جای خطای مبهم AttributeError دلیل روشن میدهد.
|
|
82
|
+
5. اسکریپت بررسی مستقل برای مقایسهٔ تمام تعریفهای TL و کشف ارجاعهای خام غایب اضافه شد.
|
|
83
|
+
6. فهرست ماشینی ۶۴ متد عمومی و ۳۶۶ درخواست خام در `CAPABILITIES.json` و مرور آن در `CAPABILITIES.md` تولید شد؛ `examples/coverage.py` در یک اجرا برای همهٔ متدهای عمومی نتیجهٔ `PASS`، `FAIL` یا `SKIP` ثبت میکند. `SKIP` با `PASS` یکسان نیست و نبود دادهٔ آزمایشی را پنهان نمیکند.
|
|
84
|
+
|
|
85
|
+
## ترتیب کار برای رسیدن به کتابخانهٔ قوی
|
|
86
|
+
|
|
87
|
+
1. برای هر قابلیت، نمونهٔ ورودی/پاسخ **بدون شماره، کد ورود یا فایل نشست** تهیه و نسخهٔ کلاینت رسمی/طرح متناظر را مشخص کن. از حساب آزمایشی خودت استفاده کن.
|
|
88
|
+
2. ابتدا مسیرهای پرکاربرد کتابخانه را روی گوشی در سناریوهای کوچک بیازما: ورود دوباره، فهرست گفتگو، دریافت رویداد، ارسال/ویرایش/حذف پیام خود، آپلود/دانلود فایل. نتیجهٔ هر مسیر را با خطا و نوع پاسخ ثبت کن.
|
|
89
|
+
3. اگر کلاس خام موجود است، ناسازگاری تبدیل ورودی/پاسخ را در متد سطحبالا اصلاح کن. اگر نیست، فقط با شناسه و امضای معتبر سروش آن را به `api.tl` اضافه و مولد را اجرا کن.
|
|
90
|
+
4. برای هر اصلاح مسیر موفق، خطا، نشست و اتصال مجدد را جداگانه آزمایش کن. یک جدول پوشش بر اساس **رفتار واقعی** نگهدار؛ تعداد نام متدها معیار پوشش نیست.
|
|
91
|
+
|
|
92
|
+
هیچ کلید نشست، شماره یا کد تأییدی را برای بررسی این پروژه منتشر نکن. گزارش خطا با نوع درخواست و متن پاکسازیشده کافی است.
|