nsj-rest-lib2 0.0.5__py3-none-any.whl → 0.0.7__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.
- nsj_rest_lib2/compiler/dto_compiler.py +12 -0
- nsj_rest_lib2/compiler/util/__init__.py +0 -0
- nsj_rest_lib2/compiler/util/str_util.py +22 -0
- nsj_rest_lib2/compiler/util/type_util.py +12 -0
- {nsj_rest_lib2-0.0.5.dist-info → nsj_rest_lib2-0.0.7.dist-info}/METADATA +1 -1
- {nsj_rest_lib2-0.0.5.dist-info → nsj_rest_lib2-0.0.7.dist-info}/RECORD +8 -5
- {nsj_rest_lib2-0.0.5.dist-info → nsj_rest_lib2-0.0.7.dist-info}/WHEEL +0 -0
- {nsj_rest_lib2-0.0.5.dist-info → nsj_rest_lib2-0.0.7.dist-info}/top_level.txt +0 -0
|
@@ -50,6 +50,18 @@ class DTOCompiler:
|
|
|
50
50
|
names=[ast.alias(name="DTOField", asname=None)],
|
|
51
51
|
level=0,
|
|
52
52
|
),
|
|
53
|
+
# from nsj_rest_lib.descriptor.dto_field_validators import DTOFieldValidators
|
|
54
|
+
ast.ImportFrom(
|
|
55
|
+
module="nsj_rest_lib.descriptor.dto_field_validators",
|
|
56
|
+
names=[ast.alias(name="DTOFieldValidators", asname=None)],
|
|
57
|
+
level=0,
|
|
58
|
+
),
|
|
59
|
+
# from nsj_rest_lib.dto.dto_base import DTOBase
|
|
60
|
+
ast.ImportFrom(
|
|
61
|
+
module="nsj_rest_lib.dto.dto_base",
|
|
62
|
+
names=[ast.alias(name="DTOBase", asname=None)],
|
|
63
|
+
level=0,
|
|
64
|
+
),
|
|
53
65
|
]
|
|
54
66
|
|
|
55
67
|
class_name = f"{CompilerStrUtil.to_pascal_case(entity_model.id)}DTO"
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
class CompilerStrUtil:
|
|
2
|
+
@staticmethod
|
|
3
|
+
def to_camel_case(snake_str: str) -> str:
|
|
4
|
+
"""Converte uma string de snake_case para camelCase."""
|
|
5
|
+
components = snake_str.split("_")
|
|
6
|
+
return components[0] + "".join(x.title() for x in components[1:])
|
|
7
|
+
|
|
8
|
+
@staticmethod
|
|
9
|
+
def to_pascal_case(snake_str: str) -> str:
|
|
10
|
+
"""Converte uma string de snake_case para PascalCase."""
|
|
11
|
+
components = snake_str.split("_")
|
|
12
|
+
return "".join(x.title() for x in components)
|
|
13
|
+
|
|
14
|
+
@staticmethod
|
|
15
|
+
def to_snake_case(camel_str: str) -> str:
|
|
16
|
+
"""Converte uma string de camelCase ou PascalCase para snake_case."""
|
|
17
|
+
snake_str = ""
|
|
18
|
+
for i, char in enumerate(camel_str):
|
|
19
|
+
if char.isupper() and i != 0:
|
|
20
|
+
snake_str += "_"
|
|
21
|
+
snake_str += char.lower()
|
|
22
|
+
return snake_str
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from nsj_rest_lib2.compiler.edl_model.primitives import (
|
|
2
|
+
MAPPING_PRIMITIVE_TYPES_TO_PYTHON,
|
|
3
|
+
PrimitiveTypes,
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class TypeUtil:
|
|
8
|
+
@staticmethod
|
|
9
|
+
def property_type_to_python_type(prop_type: PrimitiveTypes) -> str:
|
|
10
|
+
"""Mapeia tipos de propriedades do EDL para tipos Python."""
|
|
11
|
+
|
|
12
|
+
return MAPPING_PRIMITIVE_TYPES_TO_PYTHON[prop_type]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nsj_rest_lib2
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.7
|
|
4
4
|
Summary: Biblioteca para permitir a distribuição de rotas dinâmicas numa API, configuradas por meio de EDLs declarativos (em formato JSON).
|
|
5
5
|
Home-page: https://github.com/Nasajon/nsj_rest_lib2
|
|
6
6
|
Author: Nasajon Sistemas
|
|
@@ -6,7 +6,7 @@ nsj_rest_lib2/compiler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
6
6
|
nsj_rest_lib2/compiler/ai_compiler.py,sha256=shAtN4T0ai_52qh15L3mK1QbeC6glHOR6C3J3gj14II,9029
|
|
7
7
|
nsj_rest_lib2/compiler/compiler.py,sha256=EX_ACseDkYd7CoRkqT7F_NjAd8NBB1PS1Nu9k_AKHug,10639
|
|
8
8
|
nsj_rest_lib2/compiler/compiler_structures.py,sha256=2bM4_7lG1fytDGxJl6SU9pLsbspiNV36gVn9-O-23Q8,1009
|
|
9
|
-
nsj_rest_lib2/compiler/dto_compiler.py,sha256=
|
|
9
|
+
nsj_rest_lib2/compiler/dto_compiler.py,sha256=WyUM3V2_5r3Zn-teR1CNMgRKr9sH_yALzUe-VRDJOwY,3163
|
|
10
10
|
nsj_rest_lib2/compiler/entity_compiler.py,sha256=ytcS-RPQTJtf56z4HqT3xQLBYzbd6UUPGsaGB1pj_EA,4240
|
|
11
11
|
nsj_rest_lib2/compiler/property_compiler.py,sha256=NwQd3hVypT7CYgy8rK506XTRaz5oxiWUtkZEpGyolRs,13969
|
|
12
12
|
nsj_rest_lib2/compiler/edl_model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -19,11 +19,14 @@ nsj_rest_lib2/compiler/edl_model/primitives.py,sha256=VAzTbpkQAZWkeTdpoXL4FSaO1K
|
|
|
19
19
|
nsj_rest_lib2/compiler/edl_model/property_meta_model.py,sha256=i7lu-JFvPzUDBdsHB6kspGUyCkqf_GuTRmKfpIZj-K0,3444
|
|
20
20
|
nsj_rest_lib2/compiler/edl_model/repository_model.py,sha256=Vt1HxlaoifP4w5ij1laKDkD1-COBihE8EX1HkdEDUSo,977
|
|
21
21
|
nsj_rest_lib2/compiler/edl_model/trait_property_meta_model.py,sha256=NA8eRh5rA0boFmFd-0sHLrilOoOQSeN-amN_4TXcGiA,358
|
|
22
|
+
nsj_rest_lib2/compiler/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
+
nsj_rest_lib2/compiler/util/str_util.py,sha256=lVP1yHhj1pOd6ULtTnkcfX6Gqrpe4yCBratHUhBNGcI,843
|
|
24
|
+
nsj_rest_lib2/compiler/util/type_util.py,sha256=HTKOH4uRTOY0YgoM8oUv_6cEcReE_bgKYXFBsQCb-3A,357
|
|
22
25
|
nsj_rest_lib2/controller/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
26
|
nsj_rest_lib2/controller/dynamic_controller.py,sha256=4HS1__ton8cQ1LSvMoZUv93BQEnGV5f2gE-jW5lD510,13448
|
|
24
27
|
nsj_rest_lib2/service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
28
|
nsj_rest_lib2/service/entity_loader.py,sha256=E--DbswAMIn3Ic6LOMotRTcUN4PsArA9oSFAVzadnAQ,10713
|
|
26
|
-
nsj_rest_lib2-0.0.
|
|
27
|
-
nsj_rest_lib2-0.0.
|
|
28
|
-
nsj_rest_lib2-0.0.
|
|
29
|
-
nsj_rest_lib2-0.0.
|
|
29
|
+
nsj_rest_lib2-0.0.7.dist-info/METADATA,sha256=pDps3omxCAwtLnBr9O3b6tlcQKv1w1s6ge6d7BolKnw,1324
|
|
30
|
+
nsj_rest_lib2-0.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
31
|
+
nsj_rest_lib2-0.0.7.dist-info/top_level.txt,sha256=L6zh0EfH8_rur7OJ8_V-El-XEMf4qg3bkF8ADgqLVIA,14
|
|
32
|
+
nsj_rest_lib2-0.0.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|