soia-client 1.0.28__py3-none-any.whl → 1.0.30__py3-none-any.whl
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.
Potentially problematic release.
This version of soia-client might be problematic. Click here for more details.
- soia/_impl/primitives.py +7 -6
- soia/_impl/service.py +3 -6
- {soia_client-1.0.28.dist-info → soia_client-1.0.30.dist-info}/METADATA +1 -1
- {soia_client-1.0.28.dist-info → soia_client-1.0.30.dist-info}/RECORD +7 -7
- {soia_client-1.0.28.dist-info → soia_client-1.0.30.dist-info}/WHEEL +0 -0
- {soia_client-1.0.28.dist-info → soia_client-1.0.30.dist-info}/licenses/LICENSE +0 -0
- {soia_client-1.0.28.dist-info → soia_client-1.0.30.dist-info}/top_level.txt +0 -0
soia/_impl/primitives.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import base64
|
|
1
2
|
from collections.abc import Callable
|
|
2
3
|
from dataclasses import dataclass
|
|
3
4
|
from typing import Any, Final, final
|
|
4
5
|
|
|
6
|
+
from soia import _spec, reflection
|
|
5
7
|
from soia._impl.function_maker import Expr, ExprLike
|
|
6
8
|
from soia._impl.timestamp import Timestamp
|
|
7
9
|
from soia._impl.type_adapter import TypeAdapter
|
|
8
10
|
|
|
9
|
-
from soia import _spec, reflection
|
|
10
|
-
|
|
11
11
|
|
|
12
12
|
class AbstractPrimitiveAdapter(TypeAdapter):
|
|
13
13
|
@final
|
|
@@ -280,8 +280,6 @@ STRING_ADAPTER: Final[TypeAdapter] = _StringAdapter()
|
|
|
280
280
|
|
|
281
281
|
|
|
282
282
|
class _BytesAdapter(AbstractPrimitiveAdapter):
|
|
283
|
-
_fromhex_fn: Final = bytes.fromhex
|
|
284
|
-
|
|
285
283
|
def default_expr(self) -> ExprLike:
|
|
286
284
|
return 'b""'
|
|
287
285
|
|
|
@@ -296,11 +294,14 @@ class _BytesAdapter(AbstractPrimitiveAdapter):
|
|
|
296
294
|
in_expr: ExprLike,
|
|
297
295
|
readable: bool,
|
|
298
296
|
) -> Expr:
|
|
299
|
-
return Expr.join(
|
|
297
|
+
return Expr.join(
|
|
298
|
+
Expr.local("b64encode", base64.b64encode),
|
|
299
|
+
"(", in_expr, ").decode('utf-8')",
|
|
300
|
+
)
|
|
300
301
|
|
|
301
302
|
def from_json_expr(self, json_expr: ExprLike) -> Expr:
|
|
302
303
|
return Expr.join(
|
|
303
|
-
Expr.local("
|
|
304
|
+
Expr.local("b64decode", base64.b64decode), "(", json_expr, ' or "")'
|
|
304
305
|
)
|
|
305
306
|
|
|
306
307
|
def get_type(self) -> reflection.Type:
|
soia/_impl/service.py
CHANGED
|
@@ -177,14 +177,11 @@ class _HandleRequestFlow(Generic[Request, Response, RequestHeaders, ResponseHead
|
|
|
177
177
|
)
|
|
178
178
|
try:
|
|
179
179
|
req: Any
|
|
180
|
+
request_serializer = method_impl.method.request_serializer
|
|
180
181
|
if request_data[0] == "json-code":
|
|
181
|
-
req =
|
|
182
|
-
request_data
|
|
183
|
-
)
|
|
182
|
+
req = request_serializer.from_json_code(request_data[1])
|
|
184
183
|
elif request_data[0] == "json":
|
|
185
|
-
req =
|
|
186
|
-
request_data
|
|
187
|
-
)
|
|
184
|
+
req = request_serializer.from_json(request_data[1])
|
|
188
185
|
else:
|
|
189
186
|
_: Never = request_data[0]
|
|
190
187
|
del _
|
|
@@ -10,17 +10,17 @@ soia/_impl/keyed_items.py,sha256=EoPrdeLJ8i7zCH-oW-7qOcyadyrzykB6lkrf3xRVmyk,337
|
|
|
10
10
|
soia/_impl/method.py,sha256=C6ygh-Li4zADxFR_gfeBTuPUzLjZ1XHCp0ZI4-uiRYs,455
|
|
11
11
|
soia/_impl/never.py,sha256=T7PHtIipuXlici4wa0yuJKrn9JgcT-ODC3QVCwsPprY,46
|
|
12
12
|
soia/_impl/optionals.py,sha256=KTgmbfYLJLrju5v10jgnnnW98QG6NYw2We3gdgi9i2E,2414
|
|
13
|
-
soia/_impl/primitives.py,sha256=
|
|
13
|
+
soia/_impl/primitives.py,sha256=jH8MVhD2GSZx7TYXVBgzd0wzXEAEapyBFU8vozE_LbE,9000
|
|
14
14
|
soia/_impl/repr.py,sha256=7WX0bEAVENTjlyZIcbT8TcJylS7IRIyafGCmqaIMxFM,1413
|
|
15
15
|
soia/_impl/serializer.py,sha256=28IwkjtUnLpbnPQfVNfJXkApCK4JhXHwLkC5MVhF8xo,3529
|
|
16
16
|
soia/_impl/serializers.py,sha256=IL9jHHMo11pgrL1-crarOEElvTyV5YM6FTcgumjW6IU,2564
|
|
17
|
-
soia/_impl/service.py,sha256=
|
|
17
|
+
soia/_impl/service.py,sha256=3dpcH4XEBTEShyjzxMA_zDGg9_amTFF5A49U6hivAdQ,14792
|
|
18
18
|
soia/_impl/service_client.py,sha256=0WgiN6Stg548FAdZQMuezZoooe4MYw2frEQ5KUE7xag,5311
|
|
19
19
|
soia/_impl/structs.py,sha256=KrqucOqSxXda4-3gKyCmx_Oj4osTFBLk9ORyRkV_7dk,26785
|
|
20
20
|
soia/_impl/timestamp.py,sha256=lXBNH8mPmzflkNjSKZSBl2XS-ot9N8N92B_zGO2SMtU,4078
|
|
21
21
|
soia/_impl/type_adapter.py,sha256=RyIyh4Fnt9rMy0HRzC-a2v2JAdZsV9FBzoGEUVygVRE,2101
|
|
22
|
-
soia_client-1.0.
|
|
23
|
-
soia_client-1.0.
|
|
24
|
-
soia_client-1.0.
|
|
25
|
-
soia_client-1.0.
|
|
26
|
-
soia_client-1.0.
|
|
22
|
+
soia_client-1.0.30.dist-info/licenses/LICENSE,sha256=SaAftKkX6hfSOiPdENQPS70tifH3PDHgazq8eK2Pwfw,1064
|
|
23
|
+
soia_client-1.0.30.dist-info/METADATA,sha256=wDHdwHbIjPphBsvbyABOZrRKISu3cfzbQ9Rlwdol1LA,2122
|
|
24
|
+
soia_client-1.0.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
25
|
+
soia_client-1.0.30.dist-info/top_level.txt,sha256=lsYG9JrvauFe1oIV5zvnwsS9hsx3ztwfK_937op9mxc,5
|
|
26
|
+
soia_client-1.0.30.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|