ul-api-utils 7.11.2__py3-none-any.whl → 7.11.4__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 ul-api-utils might be problematic. Click here for more details.
- ul_api_utils/modules/api_sdk.py +2 -2
- ul_api_utils/utils/json_encoder.py +13 -0
- {ul_api_utils-7.11.2.dist-info → ul_api_utils-7.11.4.dist-info}/METADATA +2 -1
- {ul_api_utils-7.11.2.dist-info → ul_api_utils-7.11.4.dist-info}/RECORD +8 -8
- {ul_api_utils-7.11.2.dist-info → ul_api_utils-7.11.4.dist-info}/LICENSE +0 -0
- {ul_api_utils-7.11.2.dist-info → ul_api_utils-7.11.4.dist-info}/WHEEL +0 -0
- {ul_api_utils-7.11.2.dist-info → ul_api_utils-7.11.4.dist-info}/entry_points.txt +0 -0
- {ul_api_utils-7.11.2.dist-info → ul_api_utils-7.11.4.dist-info}/top_level.txt +0 -0
ul_api_utils/modules/api_sdk.py
CHANGED
|
@@ -45,7 +45,7 @@ from ul_api_utils.utils.cached_per_request import cached_per_request
|
|
|
45
45
|
from ul_api_utils.utils.constants import TKwargs
|
|
46
46
|
from ul_api_utils.utils.jinja.t_url_for import t_url_for
|
|
47
47
|
from ul_api_utils.utils.jinja.to_pretty_json import to_pretty_json
|
|
48
|
-
from ul_api_utils.utils.json_encoder import CustomJSONEncoder
|
|
48
|
+
from ul_api_utils.utils.json_encoder import CustomJSONEncoder, SocketIOJsonWrapper
|
|
49
49
|
from ul_api_utils.utils.load_modules import load_modules_by_template
|
|
50
50
|
from ul_api_utils.utils.uuid_converter import UUID4Converter
|
|
51
51
|
|
|
@@ -258,7 +258,7 @@ class ApiSdk:
|
|
|
258
258
|
assert self._sio # mypy
|
|
259
259
|
self._sio.init_app(
|
|
260
260
|
flask_app,
|
|
261
|
-
json=
|
|
261
|
+
json=SocketIOJsonWrapper,
|
|
262
262
|
message_queue=self._config.socket_config.message_queue,
|
|
263
263
|
async_mode=SocketAsyncModesEnum.GEVENT.value,
|
|
264
264
|
channel=self._config.socket_config.channel,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import dataclasses
|
|
2
2
|
import decimal
|
|
3
|
+
import json
|
|
3
4
|
from base64 import b64encode
|
|
4
5
|
from datetime import date, datetime
|
|
5
6
|
from enum import Enum
|
|
@@ -98,3 +99,15 @@ class CustomJSONEncoder(JSONEncoder):
|
|
|
98
99
|
fields[field] = val
|
|
99
100
|
return fields
|
|
100
101
|
return super().default(obj)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class SocketIOJsonWrapper:
|
|
105
|
+
@staticmethod
|
|
106
|
+
def dumps(*args: Any, **kwargs: Any) -> str:
|
|
107
|
+
if 'cls' not in kwargs:
|
|
108
|
+
kwargs['cls'] = CustomJSONEncoder
|
|
109
|
+
return json.dumps(*args, **kwargs)
|
|
110
|
+
|
|
111
|
+
@staticmethod
|
|
112
|
+
def loads(*args: Any, **kwargs: Any) -> Any:
|
|
113
|
+
return json.loads(*args, **kwargs)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ul-api-utils
|
|
3
|
-
Version: 7.11.
|
|
3
|
+
Version: 7.11.4
|
|
4
4
|
Summary: Python api utils
|
|
5
5
|
Author: Unic-lab
|
|
6
6
|
Author-email:
|
|
@@ -45,6 +45,7 @@ Requires-Dist: sentry-sdk[flask] (==1.9.2)
|
|
|
45
45
|
Requires-Dist: faker (==24.8.0)
|
|
46
46
|
Requires-Dist: types-requests (==2.28.8)
|
|
47
47
|
Requires-Dist: types-jinja2 (==2.11.9)
|
|
48
|
+
Requires-Dist: XlsxWriter (==3.2.0)
|
|
48
49
|
Requires-Dist: werkzeug (==2.3.7)
|
|
49
50
|
Requires-Dist: wtforms (==3.0.1)
|
|
50
51
|
Requires-Dist: wtforms-alchemy (==0.18.0)
|
|
@@ -64,7 +64,7 @@ ul_api_utils/internal_api/__tests__/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQ
|
|
|
64
64
|
ul_api_utils/internal_api/__tests__/internal_api.py,sha256=X2iopeso6vryszeeA__lcqXQVtz3Nwt3ngH7M4OuN1U,1116
|
|
65
65
|
ul_api_utils/internal_api/__tests__/internal_api_content_type.py,sha256=mfiYPkzKtfZKFpi4RSnWAoCd6mRijr6sFsa2TF-s5t8,749
|
|
66
66
|
ul_api_utils/modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
67
|
-
ul_api_utils/modules/api_sdk.py,sha256=
|
|
67
|
+
ul_api_utils/modules/api_sdk.py,sha256=6RFwqj1OQBdPOT6XYZ2zetAvFvEmWbwMPMMjY567HRg,26502
|
|
68
68
|
ul_api_utils/modules/api_sdk_config.py,sha256=3r46W5jNKlx7K2MWP94QuM216fmQkhP6LtCRZ9KmNEs,2151
|
|
69
69
|
ul_api_utils/modules/api_sdk_jwt.py,sha256=2XRfb0LxHUnldSL67S60v1uyoDpVPNaq4zofUtkeg88,15112
|
|
70
70
|
ul_api_utils/modules/intermediate_state.py,sha256=7ZZ3Sypbb8LaSfrVhaXaWRDnj8oyy26NUbmFK7vr-y4,1270
|
|
@@ -110,7 +110,7 @@ ul_api_utils/utils/deprecated.py,sha256=xR3ELgoDj7vJEY4CAYeEhdbtSJTfkukbjxcULtpM
|
|
|
110
110
|
ul_api_utils/utils/flags.py,sha256=AYN5nKWp4-uu6PSlPptL7ZiLqr3Pu-x5dffF6SBsqfg,957
|
|
111
111
|
ul_api_utils/utils/imports.py,sha256=i8PhoD0c_jnWTeXt_VxW_FihynwXSL_dHRT7jQiFyXE,376
|
|
112
112
|
ul_api_utils/utils/instance_checks.py,sha256=9punTfY5uabuJhmSGLfTgBqRderoFysCXBSI8rvbPco,467
|
|
113
|
-
ul_api_utils/utils/json_encoder.py,sha256=
|
|
113
|
+
ul_api_utils/utils/json_encoder.py,sha256=BU52LnLODDuDpnirTPl-UYXqVGh3O0Jbm9Fi0yL9MC0,4480
|
|
114
114
|
ul_api_utils/utils/load_modules.py,sha256=_CPmQuB6o_33FE6zFl_GyO5xS5gmjfNffB6k-cglKAA,685
|
|
115
115
|
ul_api_utils/utils/token_check.py,sha256=-Quuh8gOs9fNE1shYhdiMpQedafsLN7MB2ilSxG_F8E,489
|
|
116
116
|
ul_api_utils/utils/token_check_through_request.py,sha256=OyyObu6Btk9br7auIYvWcMULhNznNSD5T0mWOwZX7Uk,663
|
|
@@ -147,9 +147,9 @@ ul_api_utils/validators/validate_empty_object.py,sha256=3Ck_iwyJE_M5e7l6s1i88aqb
|
|
|
147
147
|
ul_api_utils/validators/validate_uuid.py,sha256=EfvlRirv2EW0Z6w3s8E8rUa9GaI8qXZkBWhnPs8NFrA,257
|
|
148
148
|
ul_api_utils/validators/__tests__/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
149
149
|
ul_api_utils/validators/__tests__/test_custom_fields.py,sha256=QLZ7DFta01Z7DOK9Z5Iq4uf_CmvDkVReis-GAl_QN48,1447
|
|
150
|
-
ul_api_utils-7.11.
|
|
151
|
-
ul_api_utils-7.11.
|
|
152
|
-
ul_api_utils-7.11.
|
|
153
|
-
ul_api_utils-7.11.
|
|
154
|
-
ul_api_utils-7.11.
|
|
155
|
-
ul_api_utils-7.11.
|
|
150
|
+
ul_api_utils-7.11.4.dist-info/LICENSE,sha256=6Qo8OdcqI8aGrswJKJYhST-bYqxVQBQ3ujKdTSdq-80,1062
|
|
151
|
+
ul_api_utils-7.11.4.dist-info/METADATA,sha256=76QTGrSznkk1f_E8LnGXQCj0Q8bgd8nBDGXY0NCEYwc,14751
|
|
152
|
+
ul_api_utils-7.11.4.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
153
|
+
ul_api_utils-7.11.4.dist-info/entry_points.txt,sha256=8tL3ySHWTyJMuV1hx1fHfN8zumDVOCOm63w3StphkXg,53
|
|
154
|
+
ul_api_utils-7.11.4.dist-info/top_level.txt,sha256=1XsW8iOSFaH4LOzDcnNyxHpHrbKU3fSn-aIAxe04jmw,21
|
|
155
|
+
ul_api_utils-7.11.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|