satori-python-server 0.17.1__tar.gz → 0.17.3__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.
- {satori_python_server-0.17.1 → satori_python_server-0.17.3}/PKG-INFO +2 -1
- {satori_python_server-0.17.1 → satori_python_server-0.17.3}/README.md +1 -0
- {satori_python_server-0.17.1 → satori_python_server-0.17.3}/pyproject.toml +6 -4
- {satori_python_server-0.17.1 → satori_python_server-0.17.3}/src/satori/server/__init__.py +13 -3
- {satori_python_server-0.17.1 → satori_python_server-0.17.3}/.mina/server.toml +0 -0
- {satori_python_server-0.17.1 → satori_python_server-0.17.3}/LICENSE +0 -0
- {satori_python_server-0.17.1 → satori_python_server-0.17.3}/src/satori/server/adapter.py +0 -0
- {satori_python_server-0.17.1 → satori_python_server-0.17.3}/src/satori/server/connection.py +0 -0
- {satori_python_server-0.17.1 → satori_python_server-0.17.3}/src/satori/server/formdata.py +0 -0
- {satori_python_server-0.17.1 → satori_python_server-0.17.3}/src/satori/server/model.py +0 -0
- {satori_python_server-0.17.1 → satori_python_server-0.17.3}/src/satori/server/route.py +0 -0
- {satori_python_server-0.17.1 → satori_python_server-0.17.3}/src/satori/server/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: satori-python-server
|
|
3
|
-
Version: 0.17.
|
|
3
|
+
Version: 0.17.3
|
|
4
4
|
Summary: Satori Protocol SDK for python, specify server part
|
|
5
5
|
Home-page: https://github.com/RF-Tar-Railt/satori-python
|
|
6
6
|
Author-Email: RF-Tar-Railt <rf_tar_railt@qq.com>
|
|
@@ -80,6 +80,7 @@ pip install satori-python-server
|
|
|
80
80
|
| Satori | `pip install satori-python-adapter-satori` | satori.adapters.satori |
|
|
81
81
|
| OneBot V11 | `pip install satori-python-adapter-onebot11` | satori.adapters.onebot11.forward, satori.adapters.onebot11.reverse |
|
|
82
82
|
| Console | `pip install satori-python-adapter-console` | satori.adapters.console |
|
|
83
|
+
| Milky | `pip install satori-python-adapter-milky` | satori.adapters.milky.main, satori.adapters.milky.webhook |
|
|
83
84
|
|
|
84
85
|
### 社区适配器
|
|
85
86
|
|
|
@@ -52,6 +52,7 @@ pip install satori-python-server
|
|
|
52
52
|
| Satori | `pip install satori-python-adapter-satori` | satori.adapters.satori |
|
|
53
53
|
| OneBot V11 | `pip install satori-python-adapter-onebot11` | satori.adapters.onebot11.forward, satori.adapters.onebot11.reverse |
|
|
54
54
|
| Console | `pip install satori-python-adapter-console` | satori.adapters.console |
|
|
55
|
+
| Milky | `pip install satori-python-adapter-milky` | satori.adapters.milky.main, satori.adapters.milky.webhook |
|
|
55
56
|
|
|
56
57
|
### 社区适配器
|
|
57
58
|
|
|
@@ -27,7 +27,7 @@ classifiers = [
|
|
|
27
27
|
"Programming Language :: Python :: 3.12",
|
|
28
28
|
"Operating System :: OS Independent",
|
|
29
29
|
]
|
|
30
|
-
version = "0.17.
|
|
30
|
+
version = "0.17.3"
|
|
31
31
|
|
|
32
32
|
[project.license]
|
|
33
33
|
text = "MIT"
|
|
@@ -69,7 +69,7 @@ excludes = [
|
|
|
69
69
|
composite = [
|
|
70
70
|
"isort ./src/ ./example/",
|
|
71
71
|
"black ./src/ ./example/",
|
|
72
|
-
"ruff check
|
|
72
|
+
"ruff check",
|
|
73
73
|
]
|
|
74
74
|
|
|
75
75
|
[tool.pdm.version]
|
|
@@ -93,7 +93,9 @@ extra_standard_library = [
|
|
|
93
93
|
line-length = 120
|
|
94
94
|
target-version = "py310"
|
|
95
95
|
exclude = [
|
|
96
|
-
"
|
|
96
|
+
"exam_qps.py",
|
|
97
|
+
"exam1.py",
|
|
98
|
+
"exam2.py",
|
|
97
99
|
]
|
|
98
100
|
|
|
99
101
|
[tool.ruff.lint]
|
|
@@ -111,7 +113,7 @@ ignore = [
|
|
|
111
113
|
"F403",
|
|
112
114
|
"F405",
|
|
113
115
|
"C901",
|
|
114
|
-
"
|
|
116
|
+
"T201",
|
|
115
117
|
]
|
|
116
118
|
|
|
117
119
|
[tool.pyright]
|
|
@@ -60,6 +60,16 @@ _T_ws_endpoint = TypeVar("_T_ws_endpoint", bound=Callable[[WebSocket], Awaitable
|
|
|
60
60
|
StarletteResponse = Response
|
|
61
61
|
|
|
62
62
|
|
|
63
|
+
async def _json(self: StarletteRequest) -> Any:
|
|
64
|
+
if not hasattr(self, "_json"):
|
|
65
|
+
body = await self.body()
|
|
66
|
+
self._json = decode(body)
|
|
67
|
+
return self._json
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
StarletteRequest.json = _json
|
|
71
|
+
|
|
72
|
+
|
|
63
73
|
async def _request_handler(action: str, request: StarletteRequest, func: RouteCall, platform: str, self_id: str):
|
|
64
74
|
if action == Api.UPLOAD_CREATE.value:
|
|
65
75
|
async with request.form() as form:
|
|
@@ -78,7 +88,7 @@ async def _request_handler(action: str, request: StarletteRequest, func: RouteCa
|
|
|
78
88
|
Request(
|
|
79
89
|
request,
|
|
80
90
|
action,
|
|
81
|
-
|
|
91
|
+
await request.json(),
|
|
82
92
|
platform=platform,
|
|
83
93
|
self_id=self_id,
|
|
84
94
|
)
|
|
@@ -407,7 +417,7 @@ class Server(Service, RouterMixin):
|
|
|
407
417
|
return JSONResponse(content=Meta(logins, proxy_urls).dump())
|
|
408
418
|
|
|
409
419
|
async def webhook_create_handler(self, request: StarletteRequest):
|
|
410
|
-
body =
|
|
420
|
+
body = await request.json()
|
|
411
421
|
url = body["url"]
|
|
412
422
|
token = body.get("token")
|
|
413
423
|
self.webhooks.append(WebhookEndpoint(url, token))
|
|
@@ -427,7 +437,7 @@ class Server(Service, RouterMixin):
|
|
|
427
437
|
return Response()
|
|
428
438
|
|
|
429
439
|
async def webhook_delete_handler(self, request: StarletteRequest):
|
|
430
|
-
body =
|
|
440
|
+
body = await request.json()
|
|
431
441
|
url = body["url"]
|
|
432
442
|
for endpoint in self.webhooks:
|
|
433
443
|
if endpoint.url == url:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|