maleo-foundation 0.2.58__py3-none-any.whl → 0.2.60__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.
maleo_foundation/enums.py CHANGED
@@ -8,6 +8,28 @@ class BaseEnums:
8
8
  STAGING = "staging"
9
9
  PRODUCTION = "production"
10
10
 
11
+ class ServiceType(StrEnum):
12
+ BACKEND = "backend"
13
+ FRONTEND = "frontend"
14
+
15
+ class ServiceCategory(StrEnum):
16
+ CORE = "core"
17
+ AI = "ai"
18
+
19
+ class Service(StrEnum):
20
+ MALEO_STUDIO = "maleo-studio"
21
+ MALEO_NEXUS = "maleo-nexus"
22
+ MALEO_METADATA = "maleo-metadata"
23
+ MALEO_IDENTITY = "maleo-identity"
24
+ MALEO_ACCESS = "maleo-access"
25
+ MALEO_MEDIX = "maleo-medix"
26
+ MALEO_FHIR = "maleo-fhir"
27
+ MALEO_DICOM = "maleo-dicom"
28
+ MALEO_SCRIBE = "maleo-scribe"
29
+ MALEO_CDS = "maleo-cds"
30
+ MALEO_IMAGING = "maleo-imaging"
31
+ MALEO_MCU = "maleo-mcu"
32
+
11
33
  class StatusType(StrEnum):
12
34
  DELETED = "deleted"
13
35
  INACTIVE = "inactive"
@@ -16,6 +38,7 @@ class BaseEnums:
16
38
  class UserType(StrEnum):
17
39
  REGULAR = "regular"
18
40
  PROXY = "proxy"
41
+ SERVICE = "service"
19
42
 
20
43
  class SortOrder(StrEnum):
21
44
  ASC = "asc"
@@ -0,0 +1,21 @@
1
+ from collections.abc import Mapping
2
+ from typing import Dict
3
+
4
+ def deep_merge(*obj:Dict) -> Dict:
5
+ def merge_dicts(a:Dict, b:Dict) -> Dict:
6
+ result = dict(a)
7
+ for key, value in b.items():
8
+ if (
9
+ key in result
10
+ and isinstance(result[key], Mapping)
11
+ and isinstance(value, Mapping)
12
+ ):
13
+ result[key] = merge_dicts(result[key], value)
14
+ else:
15
+ result[key] = value
16
+ return result
17
+
18
+ merged = {}
19
+ for ob in obj:
20
+ merged = merge_dicts(merged, ob)
21
+ return merged
@@ -0,0 +1,15 @@
1
+ from typing import Dict, List
2
+
3
+ def deep_search(d:Dict, key:str) -> List:
4
+ """Recursively search for all values of a key in a nested Dict/List."""
5
+ results = []
6
+ if isinstance(d, Dict):
7
+ for k, v in d.items():
8
+ if k == key:
9
+ results.append(v)
10
+ elif isinstance(v, (Dict, List)):
11
+ results.extend(deep_search(v, key))
12
+ elif isinstance(d, List):
13
+ for item in d:
14
+ results.extend(deep_search(item, key))
15
+ return results
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.2.58
3
+ Version: 0.2.60
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -2,7 +2,7 @@ maleo_foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
2
2
  maleo_foundation/authentication.py,sha256=kmM2QKh0st2p2pac9MKP7yYNpJzI0cFwTOrMtoQ0gMI,1575
3
3
  maleo_foundation/authorization.py,sha256=euq24UEhTaimmM24Ies-kZF1zqVwM_x0Zox_6k7zyqI,281
4
4
  maleo_foundation/constants.py,sha256=aBmEfWlBqZxi0k-n6h2NM1YRLOjMnheEiLyQcjP-zCQ,1164
5
- maleo_foundation/enums.py,sha256=OLVgb0rKk2gfG19FEyq9YGrQcmovr_FgtGFUcIu23Lo,3596
5
+ maleo_foundation/enums.py,sha256=p8O-I3sotn5CiJmeDlnEHbTkPAUd9M9N9qk8aosTT6A,4265
6
6
  maleo_foundation/extended_types.py,sha256=pIKt-_9tby4rmune3fmWcCW_mohaNRh_1lywBmdc-L4,301
7
7
  maleo_foundation/rest_controller_result.py,sha256=4KbCmk70IEHj1L1bNJfFg1Y3ifnRSnmvK6dYyVJddok,2014
8
8
  maleo_foundation/types.py,sha256=bUcCR-qRlxxttMxJQnVmtBic3EXEd_urcC2P55evWPc,2451
@@ -103,9 +103,10 @@ maleo_foundation/utils/controller.py,sha256=XhCcRy-OxJzv0xkZmVEBOkYqbaAckHaMaW6N
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
106
- maleo_foundation/utils/mergers.py,sha256=DniUu3Ot4qkYH_YSw4uD1cn9cfirum4S_Opp8fMkQwA,702
106
+ maleo_foundation/utils/merger.py,sha256=z9GROLVtGpwx84bOiakBFphKazsI-9l3F3WauTDwQLs,597
107
107
  maleo_foundation/utils/query.py,sha256=nDj-9Q-5eAOvqXqKgKjtHaFAxVAY87E0BMaVXmTN7jA,7957
108
108
  maleo_foundation/utils/repository.py,sha256=knBi3xOLlhBIEtChvqbZh4wXmgrFCB3rDwQXy41d7_c,2852
109
+ maleo_foundation/utils/searcher.py,sha256=gsseMkr0swKj3l-xil5qqncTbYNkS96eieFE_ehaF8I,504
109
110
  maleo_foundation/utils/dependencies/__init__.py,sha256=0KKGrdfj8Cc5A4SRk_ZBAxzOP795Mizdb4zIBh07KC4,122
110
111
  maleo_foundation/utils/dependencies/auth.py,sha256=wS9qnmd1n2WsFhiSfyq_3Io3wwZKTENVPv4rMwxJslE,727
111
112
  maleo_foundation/utils/formatter/__init__.py,sha256=iKf5YCbEdg1qKnFHyKqqcQbqAqEeRUf8mhI3v3dQoj8,78
@@ -117,7 +118,7 @@ maleo_foundation/utils/loaders/credential/__init__.py,sha256=qopTKvcMVoTFwyRijeg
117
118
  maleo_foundation/utils/loaders/credential/google.py,sha256=SKsqPuFnAiCcYLf24CxKnMybhVHpgqnq1gGSlThqjts,994
118
119
  maleo_foundation/utils/loaders/key/__init__.py,sha256=hVygcC2ImHc_aVrSrOmyedR8tMUZokWUKCKOSh5ctbo,106
119
120
  maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
120
- maleo_foundation-0.2.58.dist-info/METADATA,sha256=_V6ypomt5loZpFHzokl0RgznOfOc-qKc2oXGElSJIH8,3598
121
- maleo_foundation-0.2.58.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
122
- maleo_foundation-0.2.58.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
123
- maleo_foundation-0.2.58.dist-info/RECORD,,
121
+ maleo_foundation-0.2.60.dist-info/METADATA,sha256=34TzP4mFm7zRntFP5nz8l4xNZCyouof_RaxwnyTAfI8,3598
122
+ maleo_foundation-0.2.60.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
123
+ maleo_foundation-0.2.60.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
124
+ maleo_foundation-0.2.60.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,23 +0,0 @@
1
- from collections.abc import Mapping
2
- from typing import Dict
3
-
4
- class BaseMergers:
5
- @staticmethod
6
- def deep_merge(*obj:Dict) -> Dict:
7
- def merge_dicts(a:Dict, b:Dict) -> Dict:
8
- result = dict(a)
9
- for key, value in b.items():
10
- if (
11
- key in result
12
- and isinstance(result[key], Mapping)
13
- and isinstance(value, Mapping)
14
- ):
15
- result[key] = merge_dicts(result[key], value)
16
- else:
17
- result[key] = value
18
- return result
19
-
20
- merged = {}
21
- for ob in obj:
22
- merged = merge_dicts(merged, ob)
23
- return merged