maleo-foundation 0.0.76__py3-none-any.whl → 0.0.78__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.
@@ -4,6 +4,7 @@ from typing import AsyncGenerator, Optional
4
4
 
5
5
  class HTTPClientManager:
6
6
  client:Optional[httpx.AsyncClient] = None
7
+ base_url:Optional[str] = None
7
8
 
8
9
  @classmethod
9
10
  def initialize(cls) -> None:
@@ -20,12 +21,12 @@ class HTTPClientManager:
20
21
  yield cls.client
21
22
 
22
23
  @classmethod
23
- async def inject(cls) -> AsyncGenerator[httpx.AsyncClient, None]:
24
+ async def inject_client(cls) -> AsyncGenerator[httpx.AsyncClient, None]:
24
25
  return cls._client_handler()
25
26
 
26
27
  @classmethod
27
28
  @asynccontextmanager
28
- async def get(cls) -> AsyncGenerator[httpx.AsyncClient, None]:
29
+ async def get_client(cls) -> AsyncGenerator[httpx.AsyncClient, None]:
29
30
  """
30
31
  Async context manager for manual HTTP client handling.
31
32
  Supports `async with HTTPClientManager.get() as client:`
@@ -33,9 +34,17 @@ class HTTPClientManager:
33
34
  async for client in cls._client_handler():
34
35
  yield client
35
36
 
37
+ @classmethod
38
+ def get_url(cls) -> str:
39
+ if cls.base_url is None:
40
+ raise RuntimeError("Base URL has not been initialized. Call initialize first.")
41
+ return cls.base_url
42
+
36
43
  @classmethod
37
44
  async def dispose(cls) -> None:
38
45
  """Dispose of the HTTP client and release any resources."""
39
46
  if cls.client is not None:
40
47
  await cls.client.aclose()
41
- cls.client = None
48
+ cls.client = None
49
+ if cls.base_url is not None:
50
+ cls.base_url = None
maleo_foundation/types.py CHANGED
@@ -11,6 +11,7 @@ class BaseTypes:
11
11
  #* Boolean-related types
12
12
  LiteralFalse = Literal[False]
13
13
  LiteralTrue = Literal[True]
14
+ ListOfBools = List[bool]
14
15
 
15
16
  #* Float-related types
16
17
  ListOfFloats = List[float]
@@ -62,8 +62,8 @@ class BaseControllerUtils:
62
62
  Decorator to handle expandable fields validation and processing.
63
63
 
64
64
  Args:
65
- validation_rules: Dictionary where keys are required fields and values are lists of dependent fields
66
- field_expansion_processors: Dictionary of field names to processor functions that handle that field's data
65
+ expandable_fields_dependencies_map: Dictionary where keys are dependency fields and values are lists of dependent fields
66
+ field_expansion_processors: List of processor functions that handle that field's data
67
67
  """
68
68
  def decorator(func:Callable[..., Awaitable[BaseServiceRESTControllerResults]]):
69
69
  @wraps(func)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.0.76
3
+ Version: 0.0.78
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -2,10 +2,10 @@ maleo_foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
2
2
  maleo_foundation/constants.py,sha256=aBmEfWlBqZxi0k-n6h2NM1YRLOjMnheEiLyQcjP-zCQ,1164
3
3
  maleo_foundation/enums.py,sha256=uXA5fLFeDXwlspUjU4DXSB68dfanxEwIJhsAMZXhsYo,2359
4
4
  maleo_foundation/extended_types.py,sha256=pIKt-_9tby4rmune3fmWcCW_mohaNRh_1lywBmdc-L4,301
5
- maleo_foundation/types.py,sha256=-LcVUXKTGeazRJC2kHW-Oc_gk899JG1wMUCBpoP9v-M,2385
5
+ maleo_foundation/types.py,sha256=aKXnIgEhYGSfFqNMGLc4qIKGkINBRpkOo9R9cb2CbwI,2414
6
6
  maleo_foundation/clients/__init__.py,sha256=W8vydJYeDEi6gdmOZSBFSSDsfZJtb8C05CHErZgsZ30,188
7
7
  maleo_foundation/clients/general/__init__.py,sha256=l9eQrBeLW4aXtGU5aK3i6fD-msVR4526W7D9V8WCXIg,91
8
- maleo_foundation/clients/general/http.py,sha256=Awvs470hgdhZSZW_uoIFJGcJ5hcfDEIX0A2yUaP9UCA,1353
8
+ maleo_foundation/clients/general/http.py,sha256=pObW6EaMeLDNsRZ9QJPzfhZDzcZ33kCsb-9Yfoh2MA4,1670
9
9
  maleo_foundation/clients/google/__init__.py,sha256=1uv6nF9QbATsSAcMimQOT7Y-eBljjDunBojNX6oAtS8,90
10
10
  maleo_foundation/clients/google/cloud/__init__.py,sha256=WGMPxEKKdkz3XGY5dZn9E-nYhD1kv1MgRHbmVnky4zk,245
11
11
  maleo_foundation/clients/google/cloud/logging.py,sha256=b-q6Mhlt2Vl5HBh-YXeEEfGu1TMFK_XIJa55haMvkpA,1552
@@ -48,13 +48,13 @@ maleo_foundation/models/transfers/results/service/query.py,sha256=G5A4FRkHyRRlpu
48
48
  maleo_foundation/models/transfers/results/service/controllers/__init__.py,sha256=HZJWMy2dskzOCzLmp_UaL9rjbQ-sDMI7sd2bXb-4QOU,175
49
49
  maleo_foundation/models/transfers/results/service/controllers/rest.py,sha256=wCuFyOTQkuBs2cqjPsWnPy0XIsCfMqGByhrSy57qp7Y,1107
50
50
  maleo_foundation/utils/__init__.py,sha256=FavmL5XYGCm955EAKiWWcXYeU15p5rSzfcglpV2yI6c,387
51
- maleo_foundation/utils/controller.py,sha256=vC2B2IfuwM4CqsFgpmawT1uniAJ_S9-rP7vXXAMlmrY,6397
51
+ maleo_foundation/utils/controller.py,sha256=ECzPzpw36zBAjKcWcDbUAhIJGbc6UpeypdUUX6ipXBg,6396
52
52
  maleo_foundation/utils/exceptions.py,sha256=nk3rD57fDR-D7BQkU1JEKV-Mu7FGMpLSEsqxdDZdKjU,4532
53
53
  maleo_foundation/utils/logger.py,sha256=978P57JOhGR-WIu7xdPXBIwd3JrfLLA8WerVzxhE_Fs,3408
54
54
  maleo_foundation/utils/query.py,sha256=ODQ3adOYQNj5E2cRW9ytbjBz56nEDcnfq8mQ6YZbCCM,4375
55
55
  maleo_foundation/utils/formatter/__init__.py,sha256=iKf5YCbEdg1qKnFHyKqqcQbqAqEeRUf8mhI3v3dQoj8,78
56
56
  maleo_foundation/utils/formatter/case.py,sha256=TmvvlfzGdC_omMTB5vAa40TZBxQ3hnr-SYeo0M52Rlg,1352
57
- maleo_foundation-0.0.76.dist-info/METADATA,sha256=R2JVBCmmGvCNmNzP9of4uM3tbCo4eCaN7slXucM1FMk,3160
58
- maleo_foundation-0.0.76.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
59
- maleo_foundation-0.0.76.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
60
- maleo_foundation-0.0.76.dist-info/RECORD,,
57
+ maleo_foundation-0.0.78.dist-info/METADATA,sha256=WseeG9gJK0d7mEiO38k8U3Pb79Gl2Gpfy3UVi5aXctc,3160
58
+ maleo_foundation-0.0.78.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
59
+ maleo_foundation-0.0.78.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
60
+ maleo_foundation-0.0.78.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.1)
2
+ Generator: setuptools (80.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5