nsj-rest-lib2 0.0.11__tar.gz → 0.0.12__tar.gz
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-0.0.11 → nsj_rest_lib2-0.0.12}/PKG-INFO +1 -1
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/compiler.py +6 -1
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/dto_compiler.py +28 -1
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/edl_model/column_meta_model.py +1 -1
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/edl_model/trait_property_meta_model.py +6 -0
- nsj_rest_lib2-0.0.12/nsj_rest_lib2/compiler/property_compiler.py +862 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/service/entity_loader.py +14 -7
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2.egg-info/PKG-INFO +1 -1
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/setup.cfg +1 -1
- nsj_rest_lib2-0.0.11/nsj_rest_lib2/compiler/property_compiler.py +0 -534
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/README.md +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/__init__.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/__init__.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/ai_compiler.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/compiler_structures.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/edl_model/__init__.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/edl_model/ai_entity_edl.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/edl_model/api_model.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/edl_model/entity_model.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/edl_model/index_model.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/edl_model/primitives.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/edl_model/property_meta_model.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/edl_model/repository_model.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/entity_compiler.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/model.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/util/__init__.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/util/str_util.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/util/type_naming_util.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/compiler/util/type_util.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/controller/__init__.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/controller/dynamic_controller.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/exception.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/redis_config.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/service/__init__.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2/settings.py +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2.egg-info/SOURCES.txt +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2.egg-info/dependency_links.txt +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2.egg-info/requires.txt +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/nsj_rest_lib2.egg-info/top_level.txt +0 -0
- {nsj_rest_lib2-0.0.11 → nsj_rest_lib2-0.0.12}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nsj_rest_lib2
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.12
|
|
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
|
|
@@ -105,6 +105,7 @@ class EDLCompiler:
|
|
|
105
105
|
enum_classes,
|
|
106
106
|
related_imports,
|
|
107
107
|
relations_dependencies,
|
|
108
|
+
fixed_filters,
|
|
108
109
|
) = self._properties_compiler.compile(
|
|
109
110
|
properties_structure,
|
|
110
111
|
map_unique_by_property,
|
|
@@ -114,7 +115,11 @@ class EDLCompiler:
|
|
|
114
115
|
|
|
115
116
|
# Gerando o código do DTO
|
|
116
117
|
dto_class_name, code_dto = self._dto_compiler.compile(
|
|
117
|
-
entity_model,
|
|
118
|
+
entity_model,
|
|
119
|
+
ast_dto_attributes,
|
|
120
|
+
enum_classes,
|
|
121
|
+
related_imports,
|
|
122
|
+
fixed_filters,
|
|
118
123
|
)
|
|
119
124
|
|
|
120
125
|
# Gerando o código da Entity
|
|
@@ -3,6 +3,7 @@ import ast
|
|
|
3
3
|
import black
|
|
4
4
|
|
|
5
5
|
from nsj_rest_lib2.compiler.edl_model.entity_model import EntityModel
|
|
6
|
+
from nsj_rest_lib2.compiler.edl_model.primitives import BasicTypes
|
|
6
7
|
from nsj_rest_lib2.compiler.util.str_util import CompilerStrUtil
|
|
7
8
|
from nsj_rest_lib2.compiler.util.type_naming_util import compile_dto_class_name
|
|
8
9
|
|
|
@@ -17,6 +18,7 @@ class DTOCompiler:
|
|
|
17
18
|
ast_dto_attributes: list[ast.stmt],
|
|
18
19
|
enum_classes: list[ast.stmt],
|
|
19
20
|
related_imports: list[tuple[str, str, str]],
|
|
21
|
+
fixed_filters: list[tuple[str, BasicTypes]],
|
|
20
22
|
) -> tuple[str, str]:
|
|
21
23
|
"""
|
|
22
24
|
Compila o código do DTO a partir do AST e retorna o código compilado.
|
|
@@ -71,6 +73,18 @@ class DTOCompiler:
|
|
|
71
73
|
names=[ast.alias(name="DTOBase", asname=None)],
|
|
72
74
|
level=0,
|
|
73
75
|
),
|
|
76
|
+
# from nsj_rest_lib.descriptor.dto_left_join_field import EntityRelationOwner
|
|
77
|
+
ast.ImportFrom(
|
|
78
|
+
module="nsj_rest_lib.descriptor.dto_left_join_field",
|
|
79
|
+
names=[ast.alias(name="EntityRelationOwner", asname=None)],
|
|
80
|
+
level=0,
|
|
81
|
+
),
|
|
82
|
+
# from nsj_rest_lib.descriptor.dto_object_field import DTOObjectField
|
|
83
|
+
ast.ImportFrom(
|
|
84
|
+
module="nsj_rest_lib.descriptor.dto_object_field",
|
|
85
|
+
names=[ast.alias(name="DTOObjectField", asname=None)],
|
|
86
|
+
level=0,
|
|
87
|
+
),
|
|
74
88
|
]
|
|
75
89
|
|
|
76
90
|
for import_ in related_imports:
|
|
@@ -89,6 +103,19 @@ class DTOCompiler:
|
|
|
89
103
|
)
|
|
90
104
|
)
|
|
91
105
|
|
|
106
|
+
# Keywords para tipos usados em fixed_filters
|
|
107
|
+
keywords_decorator_dto = []
|
|
108
|
+
for fixed_filter in fixed_filters:
|
|
109
|
+
keywords_decorator_dto.append(
|
|
110
|
+
ast.keyword(
|
|
111
|
+
arg="fixed_filters",
|
|
112
|
+
value=ast.Dict(
|
|
113
|
+
keys=[ast.Constant(value=fixed_filter[0])],
|
|
114
|
+
values=[ast.Constant(value=fixed_filter[1])],
|
|
115
|
+
),
|
|
116
|
+
)
|
|
117
|
+
)
|
|
118
|
+
|
|
92
119
|
# Criando o ast da classe
|
|
93
120
|
class_name = compile_dto_class_name(entity_model.id)
|
|
94
121
|
ast_class = ast.ClassDef(
|
|
@@ -99,7 +126,7 @@ class DTOCompiler:
|
|
|
99
126
|
ast.Call(
|
|
100
127
|
func=ast.Name(id="DTO", ctx=ast.Load()),
|
|
101
128
|
args=[],
|
|
102
|
-
keywords=
|
|
129
|
+
keywords=keywords_decorator_dto,
|
|
103
130
|
)
|
|
104
131
|
],
|
|
105
132
|
body=ast_dto_attributes,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
1
2
|
from pydantic import BaseModel, Field
|
|
2
3
|
|
|
3
4
|
from nsj_rest_lib2.compiler.edl_model.primitives import BasicTypes, PropertyType
|
|
5
|
+
from nsj_rest_lib2.compiler.edl_model.property_meta_model import DomainConfigModel
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
class TraitPropertyMetaModel(BaseModel):
|
|
@@ -8,3 +10,7 @@ class TraitPropertyMetaModel(BaseModel):
|
|
|
8
10
|
value: BasicTypes = Field(
|
|
9
11
|
..., description="Valor fixo da propriedade de condicionamento do trait."
|
|
10
12
|
)
|
|
13
|
+
domain_config: Optional[List[DomainConfigModel]] = Field(
|
|
14
|
+
None,
|
|
15
|
+
description="Lista de valores permitidos.",
|
|
16
|
+
)
|