internal 1.0.60__py3-none-any.whl → 1.0.62__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 internal might be problematic. Click here for more details.

internal/base_config.py CHANGED
@@ -14,10 +14,10 @@ class BaseConfig(BaseSettings):
14
14
  REQUEST_VERIFY_SSL: bool = True
15
15
  REQUEST_PROXY: str = ''
16
16
  REQUEST_RETRY: int = 5
17
+ REQUEST_CONN_POOL_TIMEOUT: float = 5
17
18
  REQUEST_CONN_TIMEOUT: float = 5
18
- REQUEST_READ_TIMEOUT: float = 5
19
19
  REQUEST_WRITE_TIMEOUT: float = 5
20
- REQUEST_POOL_TIMEOUT: float = 5
20
+ RESPONSE_READ_TIMEOUT: float = 5
21
21
 
22
22
  # AWS
23
23
  AWS_ACCESS_KEY_ID: str = ""
@@ -0,0 +1,6 @@
1
+ from enum import Enum
2
+
3
+
4
+ class FeatureEnum(str, Enum):
5
+ IMPORT = 'import'
6
+ QUERY = 'query'
@@ -0,0 +1,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class NotifyTypeEnum(str, Enum):
5
+ APP = "app"
6
+ LINE = "line"
7
+ SMS = "sms"
8
+ NOTIFICATION = "notification"
9
+ WEBSOCKET = "websocket"
internal/http/requests.py CHANGED
@@ -6,9 +6,21 @@ from fastapi.encoders import jsonable_encoder
6
6
  from ..exception.internal_exception import GatewayTimeoutException, BadGatewayException
7
7
 
8
8
 
9
- async def async_request(app: FastAPI, method, url, current_user: dict = None, **kwargs):
10
- timeout = httpx.Timeout(connect=app.state.config.REQUEST_CONN_TIMEOUT, read=app.state.config.REQUEST_READ_TIMEOUT,
11
- write=app.state.config.REQUEST_WRITE_TIMEOUT, pool=app.state.config.REQUEST_POOL_TIMEOUT)
9
+ async def async_request(app: FastAPI, method, url, current_user: dict = None,
10
+ request_conn_pool_timeout: float = 0, request_conn_timeout: float = 0,
11
+ request_write_timeout: float = 0, response_read_timeout: float = 0,
12
+ **kwargs):
13
+ if request_conn_pool_timeout <= 0:
14
+ request_conn_pool_timeout = app.state.config.REQUEST_CONN_POOL_TIMEOUT
15
+ if request_conn_timeout <= 0:
16
+ request_conn_timeout = app.state.config.REQUEST_CONN_TIMEOUT
17
+ if request_write_timeout <= 0:
18
+ request_write_timeout = app.state.config.REQUEST_WRITE_TIMEOUT
19
+ if response_read_timeout <= 0:
20
+ response_read_timeout = app.state.config.RESPONSE_READ_TIMEOUT
21
+
22
+ timeout = httpx.Timeout(connect=request_conn_timeout, read=response_read_timeout,
23
+ write=request_write_timeout, pool=request_conn_pool_timeout)
12
24
 
13
25
  if current_user and "access_token" in current_user:
14
26
  if "headers" in kwargs.keys():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: internal
3
- Version: 1.0.60
3
+ Version: 1.0.62
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -1,11 +1,13 @@
1
1
  internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- internal/base_config.py,sha256=knLHMFmBAaQ8LoLdttMXETbWLdh8BkTBm01J6GK5w8I,1948
2
+ internal/base_config.py,sha256=tuEu2m98igYt4ZxMKtWjaQrFokpc85cRQcAjGtf_cI0,1954
3
3
  internal/base_factory.py,sha256=7UUiolLWYSodc9PxqLHaZ6KqDYUU3kC4g07iVggSymU,10125
4
4
  internal/common_enum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  internal/common_enum/contact_type.py,sha256=7QkTQ71UxpaT1YHI40FpjmLz3r-UbRU-sd0m5ajH1as,142
6
6
  internal/common_enum/description_type.py,sha256=kGwkFQh6dMnjDl6ipWYpA-qbNRrhEpnPq3NleTsNwwk,118
7
7
  internal/common_enum/event_trigger_type.py,sha256=vgsWReheEuLevYqCYMwCFH6HBwIFZtOOeRfHa76o9FE,1599
8
+ internal/common_enum/feature.py,sha256=x7cm0JMSS0DzbBw6Q9yBFxHY8d2XrCGuEzSoAj8Gd4k,96
8
9
  internal/common_enum/lpnr_direction.py,sha256=Rkzyu3qz4_jwkA8tFsrRUc4L8HLOz9SALfN4K_9Xd1w,90
10
+ internal/common_enum/notify_type.py,sha256=0xYVmUPU1hp6NiKK2fqL8e-Ip1dSBxBR9MbJve5UZRk,169
9
11
  internal/common_enum/operator_type.py,sha256=JU4EqloxtrIXzaUbEWuQLDMmAZy6AT8EAX8KIrJH4xs,125
10
12
  internal/common_enum/order_type.py,sha256=XwAl5JaZgFLahBQhBKG4VuMJ39Si9KZEhcSS0-DKKzQ,90
11
13
  internal/const.py,sha256=U1S9r7bjtHgad2oYQoHO19s8D4V0WDUG-L-haV4UaIw,1025
@@ -19,7 +21,7 @@ internal/ext/amazon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
19
21
  internal/ext/amazon/aws/__init__.py,sha256=2YFjb-rHG1JaZGZiZffYDesgTAJjDshOqQbswOYzhP8,834
20
22
  internal/ext/amazon/aws/const.py,sha256=l4WMg5bKWujwOKABBkCO2zclNg3abnYOfbhD7DG8GsA,109
21
23
  internal/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- internal/http/requests.py,sha256=PA3Z9Yqb-TWO-bP1xVvRAw8LptZTJPPt1MrfukpVJqk,2167
24
+ internal/http/requests.py,sha256=W6MFRs3pBTzHRWzTnkqXT52k6qiTPbmwxXgrJqcMvo4,2750
23
25
  internal/http/responses.py,sha256=_xhp52Y4T8tGQ4g6U8gh71WADLECibOAV42jKSvtvtw,2923
24
26
  internal/interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
27
  internal/interface/base_interface.py,sha256=3YaVjIgLi_pZpLk5SEIk8WVkuICM8qPavT8rB0MdB5U,1536
@@ -29,6 +31,6 @@ internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
31
  internal/model/base_model.py,sha256=NS_GZvw_IqU1aZPHPpyQs6A741O34ybmzVzBPm9nGWU,3014
30
32
  internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
31
33
  internal/utils.py,sha256=CXYZs4rDDe33Zac27YeknBE4uQN437ys1YAbW3Xeyow,1517
32
- internal-1.0.60.dist-info/METADATA,sha256=gLFWBMn49dOJsEagg7SHsU25s185xgjEVa8MLCj_sCA,625
33
- internal-1.0.60.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
34
- internal-1.0.60.dist-info/RECORD,,
34
+ internal-1.0.62.dist-info/METADATA,sha256=JAfvLqKVh1yWlKLKgC1sjvmhqskBCLgkVWIlTWeCtjg,625
35
+ internal-1.0.62.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
36
+ internal-1.0.62.dist-info/RECORD,,