maleo-foundation 0.2.48__py3-none-any.whl → 0.2.49__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.
@@ -54,12 +54,12 @@ class BaseControllerUtils:
54
54
  return result
55
55
 
56
56
  #* Recursive function to apply expansion processors
57
- def recursive_expand(data:Union[Dict, List], expand:List[str]):
57
+ def recursive_expand(data:Union[Dict, List], expand:BaseTypes.OptionalListOfStrings):
58
58
  if isinstance(data, list):
59
59
  for idx, item in enumerate(data):
60
60
  data[idx] = recursive_expand(item, expand)
61
61
  return data
62
- elif isinstance(data, dict):
62
+ elif isinstance(data, Dict):
63
63
  #* Apply each processor to current dict
64
64
  for processor in field_expansion_processors or []:
65
65
  raw_parameters = {"data": data, "expand": expand}
@@ -69,13 +69,9 @@ class BaseControllerUtils:
69
69
  .model_validate(raw_parameters)
70
70
  )
71
71
  data = processor(parameters)
72
-
73
- #* Now recursively apply to nested fields if they are in expand
74
- for key in expand:
75
- if key in data and isinstance(data[key], (dict, list)):
76
- #* Recursively expand nested field with same expand
72
+ for key in data.keys():
73
+ if isinstance(data[key], (Dict, List)):
77
74
  data[key] = recursive_expand(data[key], expand)
78
-
79
75
  return data
80
76
  else:
81
77
  return data
@@ -85,39 +81,10 @@ class BaseControllerUtils:
85
81
  result.success
86
82
  and result.content.get("data", None) is not None
87
83
  and field_expansion_processors is not None
88
- and expand is not None
89
84
  ):
90
85
  data = result.content["data"]
91
86
  result.content["data"] = recursive_expand(data, expand)
92
-
93
- # #* Process the fields if needed
94
- # if (result.success
95
- # and result.content.get("data", None) is not None
96
- # and field_expansion_processors is not None
97
- # ):
98
- # data = result.content["data"]
99
- # if isinstance(data, List):
100
- # for idx, dt in enumerate(data):
101
- # for processor in field_expansion_processors:
102
- # raw_parameters = {"data": dt, "expand": expand}
103
- # parameters = (
104
- # BaseGeneralParametersTransfers
105
- # .FieldExpansionProcessor
106
- # .model_validate(raw_parameters)
107
- # )
108
- # dt = processor(parameters)
109
- # data[idx] = dt
110
- # elif isinstance(data, Dict):
111
- # raw_parameters = {"data": data, "expand": expand}
112
- # parameters = (
113
- # BaseGeneralParametersTransfers
114
- # .FieldExpansionProcessor
115
- # .model_validate(raw_parameters)
116
- # )
117
- # for processor in field_expansion_processors:
118
- # data = processor(parameters)
119
- # result.content["data"] = data
120
- # result.process_response()
87
+ result.process_response()
121
88
 
122
89
  return result
123
90
  return wrapper
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.2.48
3
+ Version: 0.2.49
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -99,7 +99,7 @@ maleo_foundation/models/transfers/results/service/controllers/__init__.py,sha256
99
99
  maleo_foundation/models/transfers/results/service/controllers/rest.py,sha256=wCuFyOTQkuBs2cqjPsWnPy0XIsCfMqGByhrSy57qp7Y,1107
100
100
  maleo_foundation/utils/__init__.py,sha256=SRPEVoqjZoO6W8rtF_Ti8VIangg6Auwm6eHbZMdOthY,520
101
101
  maleo_foundation/utils/client.py,sha256=F5X9TUxWQgeOHjwsMpPoSRhZANQYZ_iFv0RJDTUVhrw,2820
102
- maleo_foundation/utils/controller.py,sha256=n8_-BG3EJuQCKI5aHf-WMhpxNsnM2veeuvEZLtSVcv8,6242
102
+ maleo_foundation/utils/controller.py,sha256=XhCcRy-OxJzv0xkZmVEBOkYqbaAckHaMaW6ND6Be-_c,4520
103
103
  maleo_foundation/utils/exceptions.py,sha256=kDLTWiUauvc-fSKrEyxlGvIi2NtZIAhJ9bV3OXnpTyo,6253
104
104
  maleo_foundation/utils/extractor.py,sha256=SZXVYDHWGaA-Dd1BUydwF2HHdZqexEielS4CjL0Ceng,814
105
105
  maleo_foundation/utils/logging.py,sha256=W5Fhk_xAXVqSujaY8mv3hRH4wlQSpUn4ReuMoiKcQa4,7759
@@ -117,7 +117,7 @@ maleo_foundation/utils/loaders/credential/__init__.py,sha256=qopTKvcMVoTFwyRijeg
117
117
  maleo_foundation/utils/loaders/credential/google.py,sha256=SKsqPuFnAiCcYLf24CxKnMybhVHpgqnq1gGSlThqjts,994
118
118
  maleo_foundation/utils/loaders/key/__init__.py,sha256=hVygcC2ImHc_aVrSrOmyedR8tMUZokWUKCKOSh5ctbo,106
119
119
  maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
120
- maleo_foundation-0.2.48.dist-info/METADATA,sha256=PwEMHPB56vLw8qCtJeywYE7td7_7d0gpnQbrMhEF5aI,3598
121
- maleo_foundation-0.2.48.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
122
- maleo_foundation-0.2.48.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
123
- maleo_foundation-0.2.48.dist-info/RECORD,,
120
+ maleo_foundation-0.2.49.dist-info/METADATA,sha256=8U6ht0Me4xfpRVvEEqRlbdAyee_2wiIEXtPifCoQSBY,3598
121
+ maleo_foundation-0.2.49.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
122
+ maleo_foundation-0.2.49.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
123
+ maleo_foundation-0.2.49.dist-info/RECORD,,