amsdal 0.4.13__cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.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.
- amsdal/Third-Party Materials - AMSDAL Dependencies - License Notices.md +1334 -0
- amsdal/__about__.py +4 -0
- amsdal/__about__.pyi +1 -0
- amsdal/__init__.py +23 -0
- amsdal/__init__.pyi +9 -0
- amsdal/__migrations__/0000_initial.py +217 -0
- amsdal/__migrations__/0001_datetime_type.py +18 -0
- amsdal/__migrations__/0002_fixture_order.py +44 -0
- amsdal/__migrations__/0003_schema_type_in_class_meta.py +44 -0
- amsdal/cloud/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/__init__.pyi +0 -0
- amsdal/cloud/client.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/client.pyi +57 -0
- amsdal/cloud/constants.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/constants.pyi +13 -0
- amsdal/cloud/enums.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/enums.pyi +68 -0
- amsdal/cloud/models/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/models/__init__.pyi +0 -0
- amsdal/cloud/models/base.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/models/base.pyi +247 -0
- amsdal/cloud/services/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/__init__.pyi +0 -0
- amsdal/cloud/services/actions/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/__init__.pyi +0 -0
- amsdal/cloud/services/actions/add_allowlist_ip.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/add_allowlist_ip.pyi +19 -0
- amsdal/cloud/services/actions/add_basic_auth.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/add_basic_auth.pyi +21 -0
- amsdal/cloud/services/actions/add_dependency.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/add_dependency.pyi +19 -0
- amsdal/cloud/services/actions/add_secret.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/add_secret.pyi +20 -0
- amsdal/cloud/services/actions/base.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/base.pyi +122 -0
- amsdal/cloud/services/actions/create_deploy.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/create_deploy.pyi +41 -0
- amsdal/cloud/services/actions/create_env.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/create_env.pyi +19 -0
- amsdal/cloud/services/actions/create_session.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/create_session.pyi +17 -0
- amsdal/cloud/services/actions/delete_allowlist_ip.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/delete_allowlist_ip.pyi +19 -0
- amsdal/cloud/services/actions/delete_basic_auth.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/delete_basic_auth.pyi +20 -0
- amsdal/cloud/services/actions/delete_dependency.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/delete_dependency.pyi +21 -0
- amsdal/cloud/services/actions/delete_env.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/delete_env.pyi +21 -0
- amsdal/cloud/services/actions/delete_secret.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/delete_secret.pyi +21 -0
- amsdal/cloud/services/actions/destroy_deploy.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/destroy_deploy.pyi +18 -0
- amsdal/cloud/services/actions/expose_db.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/expose_db.pyi +22 -0
- amsdal/cloud/services/actions/get_basic_auth_credentials.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/get_basic_auth_credentials.pyi +21 -0
- amsdal/cloud/services/actions/get_monitoring_info.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/get_monitoring_info.pyi +21 -0
- amsdal/cloud/services/actions/list_dependencies.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/list_dependencies.pyi +21 -0
- amsdal/cloud/services/actions/list_deploys.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/list_deploys.pyi +19 -0
- amsdal/cloud/services/actions/list_envs.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/list_envs.pyi +20 -0
- amsdal/cloud/services/actions/list_secrets.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/list_secrets.pyi +22 -0
- amsdal/cloud/services/actions/manager.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/manager.pyi +278 -0
- amsdal/cloud/services/actions/signup_action.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/signup_action.pyi +20 -0
- amsdal/cloud/services/actions/update_deploy.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/update_deploy.pyi +19 -0
- amsdal/cloud/services/auth/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/auth/__init__.pyi +0 -0
- amsdal/cloud/services/auth/base.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/auth/base.pyi +6 -0
- amsdal/cloud/services/auth/credentials.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/auth/credentials.pyi +30 -0
- amsdal/cloud/services/auth/manager.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/auth/manager.pyi +26 -0
- amsdal/cloud/services/auth/signup_service.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/auth/signup_service.pyi +32 -0
- amsdal/cloud/services/auth/token.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/auth/token.pyi +27 -0
- amsdal/configs/__init__.py +0 -0
- amsdal/configs/__init__.pyi +0 -0
- amsdal/configs/constants.py +33 -0
- amsdal/configs/constants.pyi +22 -0
- amsdal/configs/main.py +258 -0
- amsdal/configs/main.pyi +173 -0
- amsdal/context/__init__.py +0 -0
- amsdal/context/__init__.pyi +0 -0
- amsdal/context/manager.py +69 -0
- amsdal/context/manager.pyi +50 -0
- amsdal/contrib/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/contrib/__init__.pyi +0 -0
- amsdal/contrib/app_config.py +7 -0
- amsdal/contrib/app_config.pyi +6 -0
- amsdal/contrib/auth/__init__.py +0 -0
- amsdal/contrib/auth/__init__.pyi +0 -0
- amsdal/contrib/auth/app.py +27 -0
- amsdal/contrib/auth/app.pyi +15 -0
- amsdal/contrib/auth/decorators/__init__.py +35 -0
- amsdal/contrib/auth/decorators/__init__.pyi +6 -0
- amsdal/contrib/auth/errors.py +7 -0
- amsdal/contrib/auth/errors.pyi +4 -0
- amsdal/contrib/auth/fixtures/basic_permissions.json +64 -0
- amsdal/contrib/auth/lifecycle/__init__.py +0 -0
- amsdal/contrib/auth/lifecycle/__init__.pyi +0 -0
- amsdal/contrib/auth/lifecycle/consumer.py +394 -0
- amsdal/contrib/auth/lifecycle/consumer.pyi +108 -0
- amsdal/contrib/auth/migrations/0000_initial.py +84 -0
- amsdal/contrib/auth/models/__init__.py +0 -0
- amsdal/contrib/auth/models/__init__.pyi +0 -0
- amsdal/contrib/auth/models/login_session.py +118 -0
- amsdal/contrib/auth/models/login_session.pyi +37 -0
- amsdal/contrib/auth/models/permission.py +23 -0
- amsdal/contrib/auth/models/permission.pyi +18 -0
- amsdal/contrib/auth/models/user.py +106 -0
- amsdal/contrib/auth/models/user.pyi +46 -0
- amsdal/contrib/auth/settings.py +36 -0
- amsdal/contrib/auth/settings.pyi +26 -0
- amsdal/contrib/frontend_configs/__init__.py +0 -0
- amsdal/contrib/frontend_configs/__init__.pyi +0 -0
- amsdal/contrib/frontend_configs/app.py +24 -0
- amsdal/contrib/frontend_configs/app.pyi +19 -0
- amsdal/contrib/frontend_configs/constants.py +1 -0
- amsdal/contrib/frontend_configs/constants.pyi +1 -0
- amsdal/contrib/frontend_configs/conversion/__init__.py +5 -0
- amsdal/contrib/frontend_configs/conversion/__init__.pyi +3 -0
- amsdal/contrib/frontend_configs/conversion/convert.py +286 -0
- amsdal/contrib/frontend_configs/conversion/convert.pyi +22 -0
- amsdal/contrib/frontend_configs/lifecycle/__init__.py +0 -0
- amsdal/contrib/frontend_configs/lifecycle/__init__.pyi +0 -0
- amsdal/contrib/frontend_configs/lifecycle/consumer.py +306 -0
- amsdal/contrib/frontend_configs/lifecycle/consumer.pyi +98 -0
- amsdal/contrib/frontend_configs/migrations/0000_initial.py +256 -0
- amsdal/contrib/frontend_configs/models/__init__.py +0 -0
- amsdal/contrib/frontend_configs/models/__init__.pyi +0 -0
- amsdal/contrib/frontend_configs/models/frontend_activator_config.py +22 -0
- amsdal/contrib/frontend_configs/models/frontend_activator_config.pyi +12 -0
- amsdal/contrib/frontend_configs/models/frontend_config_async_validator.py +11 -0
- amsdal/contrib/frontend_configs/models/frontend_config_async_validator.pyi +7 -0
- amsdal/contrib/frontend_configs/models/frontend_config_control_action.py +54 -0
- amsdal/contrib/frontend_configs/models/frontend_config_control_action.pyi +32 -0
- amsdal/contrib/frontend_configs/models/frontend_config_group_validator.py +21 -0
- amsdal/contrib/frontend_configs/models/frontend_config_group_validator.pyi +11 -0
- amsdal/contrib/frontend_configs/models/frontend_config_option.py +12 -0
- amsdal/contrib/frontend_configs/models/frontend_config_option.pyi +8 -0
- amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base.py +17 -0
- amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base.pyi +8 -0
- amsdal/contrib/frontend_configs/models/frontend_config_slider_option.py +13 -0
- amsdal/contrib/frontend_configs/models/frontend_config_slider_option.pyi +9 -0
- amsdal/contrib/frontend_configs/models/frontend_config_text_mask.py +14 -0
- amsdal/contrib/frontend_configs/models/frontend_config_text_mask.pyi +10 -0
- amsdal/contrib/frontend_configs/models/frontend_config_validator.py +28 -0
- amsdal/contrib/frontend_configs/models/frontend_config_validator.pyi +15 -0
- amsdal/contrib/frontend_configs/models/frontend_control_config.py +87 -0
- amsdal/contrib/frontend_configs/models/frontend_control_config.pyi +35 -0
- amsdal/contrib/frontend_configs/models/frontend_model_config.py +14 -0
- amsdal/contrib/frontend_configs/models/frontend_model_config.pyi +9 -0
- amsdal/contrib/frontend_configs/utils.py +29 -0
- amsdal/contrib/frontend_configs/utils.pyi +17 -0
- amsdal/errors.py +31 -0
- amsdal/errors.pyi +12 -0
- amsdal/fixtures/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/fixtures/__init__.pyi +0 -0
- amsdal/fixtures/manager.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/fixtures/manager.pyi +170 -0
- amsdal/fixtures/utils.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/fixtures/utils.pyi +9 -0
- amsdal/manager.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/manager.pyi +265 -0
- amsdal/mixins/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/mixins/__init__.pyi +0 -0
- amsdal/mixins/class_versions_mixin.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/mixins/class_versions_mixin.pyi +12 -0
- amsdal/models/__init__.py +19 -0
- amsdal/models/__init__.pyi +9 -0
- amsdal/models/core/__init__.py +0 -0
- amsdal/models/core/__init__.pyi +0 -0
- amsdal/models/core/class_object.py +37 -0
- amsdal/models/core/class_object.pyi +24 -0
- amsdal/models/core/class_object_meta.py +26 -0
- amsdal/models/core/class_object_meta.pyi +15 -0
- amsdal/models/core/class_property.py +20 -0
- amsdal/models/core/class_property.pyi +11 -0
- amsdal/models/core/class_property_meta.py +15 -0
- amsdal/models/core/class_property_meta.pyi +10 -0
- amsdal/models/core/file.py +156 -0
- amsdal/models/core/file.pyi +104 -0
- amsdal/models/core/fixture.py +25 -0
- amsdal/models/core/fixture.pyi +14 -0
- amsdal/models/core/option.py +11 -0
- amsdal/models/core/option.pyi +8 -0
- amsdal/models/core/validator.py +12 -0
- amsdal/models/core/validator.pyi +8 -0
- amsdal/models/types/__init__.py +0 -0
- amsdal/models/types/__init__.pyi +0 -0
- amsdal/models/types/object.py +26 -0
- amsdal/models/types/object.pyi +16 -0
- amsdal/py.typed +0 -0
- amsdal/queryset/__init__.py +21 -0
- amsdal/queryset/__init__.pyi +6 -0
- amsdal/schemas/__init__.py +0 -0
- amsdal/schemas/__init__.pyi +0 -0
- amsdal/schemas/core/class_object/model.json +31 -0
- amsdal/schemas/core/class_object/properties/display_name.py +9 -0
- amsdal/schemas/core/class_object_meta/model.json +59 -0
- amsdal/schemas/core/class_property/model.json +22 -0
- amsdal/schemas/core/class_property_meta/model.json +23 -0
- amsdal/schemas/core/file/hooks/pre_create.py +24 -0
- amsdal/schemas/core/file/hooks/pre_update.py +24 -0
- amsdal/schemas/core/file/model.json +23 -0
- amsdal/schemas/core/file/properties/from_file.py +34 -0
- amsdal/schemas/core/file/properties/mimetype.py +13 -0
- amsdal/schemas/core/file/properties/str.py +6 -0
- amsdal/schemas/core/file/properties/to_file.py +24 -0
- amsdal/schemas/core/file/properties/validate_data.py +32 -0
- amsdal/schemas/core/fixture/model.json +35 -0
- amsdal/schemas/core/option/model.json +19 -0
- amsdal/schemas/core/validator/model.json +19 -0
- amsdal/schemas/interfaces.py +25 -0
- amsdal/schemas/interfaces.pyi +20 -0
- amsdal/schemas/manager.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/schemas/manager.py +0 -0
- amsdal/schemas/manager.pyi +0 -0
- amsdal/schemas/mixins/__init__.py +0 -0
- amsdal/schemas/mixins/__init__.pyi +0 -0
- amsdal/schemas/mixins/check_dependencies_mixin.py +125 -0
- amsdal/schemas/mixins/check_dependencies_mixin.pyi +45 -0
- amsdal/schemas/mixins/verify_schemas_mixin.py +96 -0
- amsdal/schemas/mixins/verify_schemas_mixin.pyi +33 -0
- amsdal/schemas/repository.py +84 -0
- amsdal/schemas/repository.pyi +22 -0
- amsdal/schemas/types/anything/model.json +7 -0
- amsdal/schemas/types/array/model.json +7 -0
- amsdal/schemas/types/binary/model.json +7 -0
- amsdal/schemas/types/boolean/model.json +17 -0
- amsdal/schemas/types/date/model.json +7 -0
- amsdal/schemas/types/datetime/model.json +7 -0
- amsdal/schemas/types/dictionary/model.json +8 -0
- amsdal/schemas/types/number/model.json +8 -0
- amsdal/schemas/types/object/model.json +53 -0
- amsdal/schemas/types/string/model.json +8 -0
- amsdal/schemas/utils.py +16 -0
- amsdal/schemas/utils.pyi +10 -0
- amsdal/services/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/services/__init__.pyi +0 -0
- amsdal/services/transaction_execution.cpython-311-x86_64-linux-gnu.so +0 -0
- amsdal/services/transaction_execution.pyi +93 -0
- amsdal/transactions/__init__.py +13 -0
- amsdal/transactions/__init__.pyi +4 -0
- amsdal/utils/__init__.py +0 -0
- amsdal/utils/__init__.pyi +0 -0
- amsdal/utils/contrib_paths.py +23 -0
- amsdal/utils/contrib_paths.pyi +14 -0
- amsdal/utils/rollback/__init__.py +440 -0
- amsdal/utils/rollback/__init__.pyi +38 -0
- amsdal/utils/tests/__init__.py +0 -0
- amsdal/utils/tests/enums.py +18 -0
- amsdal/utils/tests/factories.py +49 -0
- amsdal/utils/tests/helpers.py +499 -0
- amsdal-0.4.13.dist-info/METADATA +369 -0
- amsdal-0.4.13.dist-info/RECORD +269 -0
- amsdal-0.4.13.dist-info/WHEEL +6 -0
- amsdal-0.4.13.dist-info/licenses/LICENSE.txt +107 -0
- amsdal-0.4.13.dist-info/top_level.txt +1 -0
@@ -0,0 +1,98 @@
|
|
1
|
+
from _typeshed import Incomplete
|
2
|
+
from amsdal_utils.lifecycle.consumer import LifecycleConsumer
|
3
|
+
from amsdal_utils.schemas.schema import PropertyData
|
4
|
+
from typing import Any
|
5
|
+
|
6
|
+
logger: Incomplete
|
7
|
+
core_to_frontend_types: Incomplete
|
8
|
+
|
9
|
+
def process_property(field_name: str, property_data: PropertyData) -> dict[str, Any]:
|
10
|
+
"""
|
11
|
+
Processes a property and converts it to a frontend configuration dictionary.
|
12
|
+
|
13
|
+
This function takes a field name and property data, and converts them into a dictionary
|
14
|
+
that represents the configuration for a frontend form control. It handles various types
|
15
|
+
such as core types, arrays, dictionaries, and files.
|
16
|
+
|
17
|
+
Args:
|
18
|
+
field_name (str): The name of the field to be processed.
|
19
|
+
property_data (PropertyData): The property data to be processed.
|
20
|
+
|
21
|
+
Returns:
|
22
|
+
dict[str, Any]: A dictionary representing the frontend configuration for the given property.
|
23
|
+
"""
|
24
|
+
def populate_frontend_config_with_values(config: dict[str, Any], values: dict[str, Any]) -> dict[str, Any]:
|
25
|
+
"""
|
26
|
+
Populates a frontend configuration dictionary with values.
|
27
|
+
|
28
|
+
This function takes a frontend configuration dictionary and a dictionary of values,
|
29
|
+
and populates the configuration with the corresponding values. It recursively processes
|
30
|
+
nested controls to ensure all values are populated.
|
31
|
+
|
32
|
+
Args:
|
33
|
+
config (dict[str, Any]): The frontend configuration dictionary to be populated.
|
34
|
+
values (dict[str, Any]): The dictionary of values to populate the configuration with.
|
35
|
+
|
36
|
+
Returns:
|
37
|
+
dict[str, Any]: The populated frontend configuration dictionary.
|
38
|
+
"""
|
39
|
+
def get_values_from_response(response: dict[str, Any] | list[dict[str, Any]]) -> dict[str, Any]:
|
40
|
+
"""
|
41
|
+
Extracts values from a response dictionary or list of dictionaries.
|
42
|
+
|
43
|
+
This function processes a response to extract the relevant values. It checks if the response
|
44
|
+
is a dictionary containing a 'rows' key and processes the rows to find the appropriate values.
|
45
|
+
If the response is not in the expected format, it returns an empty dictionary.
|
46
|
+
|
47
|
+
Args:
|
48
|
+
response (dict[str, Any] | list[dict[str, Any]]): The response to extract values from.
|
49
|
+
|
50
|
+
Returns:
|
51
|
+
dict[str, Any]: A dictionary containing the extracted values.
|
52
|
+
"""
|
53
|
+
def get_default_control(class_name: str) -> dict[str, Any]:
|
54
|
+
"""
|
55
|
+
Retrieves the default frontend control configuration for a given class name.
|
56
|
+
|
57
|
+
This function attempts to import a class by its name from various schema types.
|
58
|
+
If the class is found, it converts it to a frontend configuration dictionary
|
59
|
+
and returns it. If the class is not found, it returns an empty dictionary.
|
60
|
+
|
61
|
+
Args:
|
62
|
+
class_name (str): The name of the class to retrieve the default control for.
|
63
|
+
|
64
|
+
Returns:
|
65
|
+
dict[str, Any]: A dictionary representing the frontend control configuration for the given class.
|
66
|
+
"""
|
67
|
+
|
68
|
+
class ProcessResponseConsumer(LifecycleConsumer):
|
69
|
+
"""
|
70
|
+
Consumer class for processing responses and populating frontend configurations.
|
71
|
+
|
72
|
+
This class extends the LifecycleConsumer and processes responses to populate
|
73
|
+
frontend configurations based on the class name and values extracted from the response.
|
74
|
+
"""
|
75
|
+
def on_event(self, request: Any, response: dict[str, Any]) -> None:
|
76
|
+
"""
|
77
|
+
Handles the event by extracting the class name and values from the request and response,
|
78
|
+
and populates the frontend configuration accordingly.
|
79
|
+
|
80
|
+
Args:
|
81
|
+
request (Any): The request object containing query and path parameters.
|
82
|
+
response (dict[str, Any]): The response dictionary to be processed.
|
83
|
+
|
84
|
+
Returns:
|
85
|
+
None
|
86
|
+
"""
|
87
|
+
async def on_event_async(self, request: Any, response: dict[str, Any]) -> None:
|
88
|
+
"""
|
89
|
+
Handles the event by extracting the class name and values from the request and response,
|
90
|
+
and populates the frontend configuration accordingly.
|
91
|
+
|
92
|
+
Args:
|
93
|
+
request (Any): The request object containing query and path parameters.
|
94
|
+
response (dict[str, Any]): The response dictionary to be processed.
|
95
|
+
|
96
|
+
Returns:
|
97
|
+
None
|
98
|
+
"""
|
@@ -0,0 +1,256 @@
|
|
1
|
+
from amsdal_models.migration import migrations
|
2
|
+
from amsdal_utils.models.enums import ModuleType
|
3
|
+
|
4
|
+
|
5
|
+
class Migration(migrations.Migration):
|
6
|
+
operations: list[migrations.Operation] = [
|
7
|
+
migrations.CreateClass(
|
8
|
+
module_type=ModuleType.CONTRIB,
|
9
|
+
class_name='FrontendConfigSkipNoneBase',
|
10
|
+
new_schema={
|
11
|
+
'title': 'FrontendConfigSkipNoneBase',
|
12
|
+
'properties': {},
|
13
|
+
'meta_class': 'TypeMeta',
|
14
|
+
'custom_code': "from typing import Any\n\n\ndef model_dump(self, **kwargs: Any) -> dict[str, Any]: # type: ignore[no-untyped-def] # noqa: ARG001\n kwargs['exclude_none'] = True\n\n return super().model_dump(**kwargs) # type: ignore[misc]\n\n\ndef model_dump_json(self, **kwargs: Any) -> str: # type: ignore[no-untyped-def] # noqa: ARG001\n kwargs['exclude_none'] = True\n\n return super().model_dump_json(**kwargs) # type: ignore[misc]",
|
15
|
+
},
|
16
|
+
),
|
17
|
+
migrations.CreateClass(
|
18
|
+
module_type=ModuleType.CONTRIB,
|
19
|
+
class_name='FrontendConfigGroupValidator',
|
20
|
+
new_schema={
|
21
|
+
'title': 'FrontendConfigGroupValidator',
|
22
|
+
'type': 'FrontendConfigSkipNoneBase',
|
23
|
+
'properties': {
|
24
|
+
'mainControl': {'type': 'string', 'title': 'Main Control'},
|
25
|
+
'dependentControls': {'type': 'array', 'items': {'type': 'string'}, 'title': 'Dependent Controls'},
|
26
|
+
'condition': {
|
27
|
+
'type': 'string',
|
28
|
+
'title': 'Condition',
|
29
|
+
'options': [
|
30
|
+
{'key': 'Less Than', 'value': 'lt'},
|
31
|
+
{'key': 'Less Than or Equal', 'value': 'lte'},
|
32
|
+
{'key': 'Greater Than', 'value': 'gt'},
|
33
|
+
{'key': 'Greater Than or Equal', 'value': 'gte'},
|
34
|
+
{'key': 'Equal', 'value': 'eq'},
|
35
|
+
{'key': 'Not Equal', 'value': 'neq'},
|
36
|
+
{'key': 'Exist', 'value': 'exist'},
|
37
|
+
],
|
38
|
+
},
|
39
|
+
},
|
40
|
+
'meta_class': 'TypeMeta',
|
41
|
+
},
|
42
|
+
),
|
43
|
+
migrations.CreateClass(
|
44
|
+
module_type=ModuleType.CONTRIB,
|
45
|
+
class_name='FrontendActivatorConfig',
|
46
|
+
new_schema={
|
47
|
+
'title': 'FrontendActivatorConfig',
|
48
|
+
'type': 'FrontendConfigGroupValidator',
|
49
|
+
'properties': {'value': {'type': 'anything', 'title': 'Value'}},
|
50
|
+
'meta_class': 'TypeMeta',
|
51
|
+
},
|
52
|
+
),
|
53
|
+
migrations.CreateClass(
|
54
|
+
module_type=ModuleType.CONTRIB,
|
55
|
+
class_name='FrontendConfigTextMask',
|
56
|
+
new_schema={
|
57
|
+
'title': 'FrontendConfigTextMask',
|
58
|
+
'type': 'FrontendConfigSkipNoneBase',
|
59
|
+
'required': ['mask_string'],
|
60
|
+
'properties': {
|
61
|
+
'mask_string': {'type': 'string', 'title': 'Mask String'},
|
62
|
+
'prefix': {'type': 'string', 'title': 'Prefix'},
|
63
|
+
'suffix': {'type': 'string', 'title': 'Suffix'},
|
64
|
+
'thousands_separator': {'type': 'string', 'title': 'Thousands Separator'},
|
65
|
+
},
|
66
|
+
'meta_class': 'TypeMeta',
|
67
|
+
},
|
68
|
+
),
|
69
|
+
migrations.CreateClass(
|
70
|
+
module_type=ModuleType.CONTRIB,
|
71
|
+
class_name='FrontendConfigSliderOption',
|
72
|
+
new_schema={
|
73
|
+
'title': 'FrontendConfigSliderOption',
|
74
|
+
'type': 'FrontendConfigSkipNoneBase',
|
75
|
+
'properties': {
|
76
|
+
'min': {'type': 'number', 'title': 'Minimum'},
|
77
|
+
'max': {'type': 'number', 'title': 'Maximum'},
|
78
|
+
'range': {'type': 'boolean', 'title': 'Range'},
|
79
|
+
},
|
80
|
+
'meta_class': 'TypeMeta',
|
81
|
+
},
|
82
|
+
),
|
83
|
+
migrations.CreateClass(
|
84
|
+
module_type=ModuleType.CONTRIB,
|
85
|
+
class_name='FrontendConfigValidator',
|
86
|
+
new_schema={
|
87
|
+
'title': 'FrontendConfigValidator',
|
88
|
+
'type': 'FrontendConfigGroupValidator',
|
89
|
+
'properties': {
|
90
|
+
'function': {
|
91
|
+
'type': 'string',
|
92
|
+
'title': 'Function',
|
93
|
+
'options': [
|
94
|
+
{'key': 'Minimum', 'value': 'min'},
|
95
|
+
{'key': 'Maximum', 'value': 'max'},
|
96
|
+
{'key': 'Minimum Length', 'value': 'minLength'},
|
97
|
+
{'key': 'Maximum Length', 'value': 'maxLength'},
|
98
|
+
{'key': 'Required', 'value': 'required'},
|
99
|
+
{'key': 'Pattern', 'value': 'pattern'},
|
100
|
+
],
|
101
|
+
},
|
102
|
+
'value': {'type': 'string', 'title': 'Value'},
|
103
|
+
},
|
104
|
+
'meta_class': 'TypeMeta',
|
105
|
+
},
|
106
|
+
),
|
107
|
+
migrations.CreateClass(
|
108
|
+
module_type=ModuleType.CONTRIB,
|
109
|
+
class_name='FrontendConfigAsyncValidator',
|
110
|
+
new_schema={
|
111
|
+
'title': 'FrontendConfigAsyncValidator',
|
112
|
+
'type': 'FrontendConfigSkipNoneBase',
|
113
|
+
'properties': {'endpoint': {'type': 'string', 'title': 'Endpoint'}},
|
114
|
+
'meta_class': 'TypeMeta',
|
115
|
+
},
|
116
|
+
),
|
117
|
+
migrations.CreateClass(
|
118
|
+
module_type=ModuleType.CONTRIB,
|
119
|
+
class_name='FrontendConfigControlAction',
|
120
|
+
new_schema={
|
121
|
+
'title': 'FrontendConfigControlAction',
|
122
|
+
'type': 'FrontendConfigSkipNoneBase',
|
123
|
+
'required': ['action', 'text', 'type'],
|
124
|
+
'properties': {
|
125
|
+
'action': {'type': 'string', 'title': 'Action'},
|
126
|
+
'text': {'type': 'string', 'title': 'Text'},
|
127
|
+
'type': {
|
128
|
+
'type': 'string',
|
129
|
+
'title': 'Type',
|
130
|
+
'options': [
|
131
|
+
{'key': 'Arrow Next', 'value': 'arrow-next'},
|
132
|
+
{'key': 'Arrow Prev', 'value': 'arrow-prev'},
|
133
|
+
{'key': 'Action Button', 'value': 'action-button'},
|
134
|
+
{'key': 'Text Next', 'value': 'text-next'},
|
135
|
+
{'key': 'Text Prev', 'value': 'text-prev'},
|
136
|
+
],
|
137
|
+
},
|
138
|
+
'dataLayerEvent': {'type': 'string', 'title': 'Data Layer Event'},
|
139
|
+
'activator': {'type': 'string', 'title': 'Activator'},
|
140
|
+
'icon': {'type': 'string', 'title': 'Icon'},
|
141
|
+
},
|
142
|
+
'meta_class': 'TypeMeta',
|
143
|
+
'custom_code': "from pydantic import field_validator\n\n\n@field_validator('action', mode='after') # type: ignore[misc]\n@classmethod\ndef validate_action(cls, v: str) -> str: # type: ignore[no-untyped-def] # noqa: ARG001\n if not v.startswith('navigate::') and v not in [\n 'goPrev',\n 'goNext',\n 'goNextWithSubmit',\n 'submit',\n 'submitWithDataLayer',\n ]:\n msg = 'Action must be one of: goPrev, goNext, goNextWithSubmit, submit, submitWithDataLayer, navigate::{string}'\n raise ValueError(msg)\n\n return v",
|
144
|
+
},
|
145
|
+
),
|
146
|
+
migrations.CreateClass(
|
147
|
+
module_type=ModuleType.CONTRIB,
|
148
|
+
class_name='FrontendConfigOption',
|
149
|
+
new_schema={
|
150
|
+
'title': 'FrontendConfigOption',
|
151
|
+
'type': 'FrontendConfigSkipNoneBase',
|
152
|
+
'properties': {
|
153
|
+
'label': {'type': 'string', 'title': 'Label'},
|
154
|
+
'value': {'type': 'string', 'title': 'Value'},
|
155
|
+
},
|
156
|
+
'meta_class': 'TypeMeta',
|
157
|
+
},
|
158
|
+
),
|
159
|
+
migrations.CreateClass(
|
160
|
+
module_type=ModuleType.CONTRIB,
|
161
|
+
class_name='FrontendControlConfig',
|
162
|
+
new_schema={
|
163
|
+
'title': 'FrontendControlConfig',
|
164
|
+
'type': 'FrontendConfigSkipNoneBase',
|
165
|
+
'required': ['type', 'name'],
|
166
|
+
'properties': {
|
167
|
+
'type': {
|
168
|
+
'type': 'string',
|
169
|
+
'title': 'Type',
|
170
|
+
'options': [
|
171
|
+
{'key': 'Infoscreen', 'value': 'infoscreen'},
|
172
|
+
{'key': 'Info Group', 'value': 'info-group'},
|
173
|
+
{'key': 'Text', 'value': 'text'},
|
174
|
+
{'key': 'Number', 'value': 'number'},
|
175
|
+
{'key': 'Select', 'value': 'select'},
|
176
|
+
{'key': 'Object Group', 'value': 'object_group'},
|
177
|
+
{'key': 'Group', 'value': 'group'},
|
178
|
+
{'key': 'Group Toggle', 'value': 'group_toggle'},
|
179
|
+
{'key': 'Group Switch', 'value': 'group_switch'},
|
180
|
+
{'key': 'Password', 'value': 'password'},
|
181
|
+
{'key': 'Email', 'value': 'email'},
|
182
|
+
{'key': 'Phone', 'value': 'phone'},
|
183
|
+
{'key': 'textarea', 'value': 'textarea'},
|
184
|
+
{'key': 'Multiselect', 'value': 'multiselect'},
|
185
|
+
{'key': 'number_initial', 'value': 'number_initial'},
|
186
|
+
{'key': 'number_plus', 'value': 'number_plus'},
|
187
|
+
{'key': 'number_minus', 'value': 'number_minus'},
|
188
|
+
{'key': 'number_equals', 'value': 'number_equals'},
|
189
|
+
{'key': 'toggle', 'value': 'toggle'},
|
190
|
+
{'key': 'radio', 'value': 'radio'},
|
191
|
+
{'key': 'checkbox', 'value': 'checkbox'},
|
192
|
+
{'key': 'number-slider', 'value': 'number-slider'},
|
193
|
+
{'key': 'number-operations', 'value': 'number-operations'},
|
194
|
+
{'key': 'date', 'value': 'date'},
|
195
|
+
{'key': 'dateTriplet', 'value': 'dateTriplet'},
|
196
|
+
{'key': 'array', 'value': 'array'},
|
197
|
+
{'key': 'object', 'value': 'object'},
|
198
|
+
{'key': 'file', 'value': 'file'},
|
199
|
+
{'key': 'dropzone', 'value': 'dropzone'},
|
200
|
+
{'key': 'object_latest', 'value': 'object_latest'},
|
201
|
+
{'key': 'Dictionary', 'value': 'dict'},
|
202
|
+
{'key': 'Time', 'value': 'time'},
|
203
|
+
{'key': 'Datetime', 'value': 'datetime'},
|
204
|
+
{'key': 'Bytes', 'value': 'Bytes'},
|
205
|
+
],
|
206
|
+
},
|
207
|
+
'name': {'type': 'string', 'title': 'Name'},
|
208
|
+
'label': {'type': 'string', 'title': 'Label'},
|
209
|
+
'required': {'type': 'boolean', 'title': 'Required'},
|
210
|
+
'hideLabel': {'type': 'boolean', 'title': 'Hide Label'},
|
211
|
+
'actions': {'type': 'array', 'items': {'type': 'FrontendConfigControlAction'}, 'title': 'Actions'},
|
212
|
+
'validators': {
|
213
|
+
'type': 'array',
|
214
|
+
'items': {'type': 'FrontendConfigValidator'},
|
215
|
+
'title': 'Validators',
|
216
|
+
},
|
217
|
+
'asyncValidators': {
|
218
|
+
'type': 'array',
|
219
|
+
'items': {'type': 'FrontendConfigAsyncValidator'},
|
220
|
+
'title': 'Async Validators',
|
221
|
+
},
|
222
|
+
'activators': {
|
223
|
+
'type': 'array',
|
224
|
+
'items': {'type': 'FrontendActivatorConfig'},
|
225
|
+
'title': 'Activators',
|
226
|
+
},
|
227
|
+
'additionalText': {'type': 'string', 'title': 'Additional Text'},
|
228
|
+
'value': {'type': 'anything', 'title': 'Value'},
|
229
|
+
'placeholder': {'type': 'string', 'title': 'Placeholder'},
|
230
|
+
'options': {'type': 'array', 'items': {'type': 'FrontendConfigOption'}, 'title': 'Options'},
|
231
|
+
'mask': {'type': 'FrontendConfigTextMask', 'title': 'Mask'},
|
232
|
+
'controls': {'type': 'array', 'items': {'type': 'FrontendControlConfig'}, 'title': 'Controls'},
|
233
|
+
'showSearch': {'type': 'boolean', 'title': 'Show Search'},
|
234
|
+
'sliderOptions': {'type': 'FrontendConfigSliderOption', 'title': 'Slider Option'},
|
235
|
+
'customLabel': {'type': 'array', 'items': {'type': 'string'}, 'title': 'Custom Label'},
|
236
|
+
'control': {'type': 'FrontendControlConfig', 'title': 'Control'},
|
237
|
+
'entityType': {'type': 'string', 'title': 'Entity Type'},
|
238
|
+
},
|
239
|
+
'meta_class': 'TypeMeta',
|
240
|
+
},
|
241
|
+
),
|
242
|
+
migrations.CreateClass(
|
243
|
+
module_type=ModuleType.CONTRIB,
|
244
|
+
class_name='FrontendModelConfig',
|
245
|
+
new_schema={
|
246
|
+
'title': 'FrontendModelConfig',
|
247
|
+
'required': ['class_name'],
|
248
|
+
'properties': {
|
249
|
+
'class_name': {'type': 'string', 'title': 'Class Name'},
|
250
|
+
'control': {'type': 'FrontendControlConfig', 'title': 'Control'},
|
251
|
+
},
|
252
|
+
"primary_key": ["partition_key"],
|
253
|
+
"table_name": "FrontendModelConfig",
|
254
|
+
},
|
255
|
+
),
|
256
|
+
]
|
File without changes
|
File without changes
|
@@ -0,0 +1,22 @@
|
|
1
|
+
from typing import Any
|
2
|
+
from typing import ClassVar
|
3
|
+
|
4
|
+
from amsdal_models.builder.validators.options_validators import validate_options
|
5
|
+
from amsdal_utils.models.enums import ModuleType
|
6
|
+
from pydantic.fields import Field
|
7
|
+
from pydantic.functional_validators import field_validator
|
8
|
+
|
9
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_group_validator import * # noqa: F403
|
10
|
+
|
11
|
+
|
12
|
+
class FrontendActivatorConfig(FrontendConfigGroupValidator): # noqa: F405
|
13
|
+
__module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
|
14
|
+
mainControl: str | None = Field(None, title='Main Control') # noqa: N815
|
15
|
+
dependentControls: list[str] | None = Field(None, title='Dependent Controls') # noqa: N815
|
16
|
+
condition: str | None = Field(None, title='Condition')
|
17
|
+
value: Any | None = Field(None, title='Value')
|
18
|
+
|
19
|
+
@field_validator('condition')
|
20
|
+
@classmethod
|
21
|
+
def validate_value_in_options_condition(cls: type, value: Any) -> Any:
|
22
|
+
return validate_options(value, options=['eq', 'exist', 'gt', 'gte', 'lt', 'lte', 'neq'])
|
@@ -0,0 +1,12 @@
|
|
1
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_group_validator import *
|
2
|
+
from amsdal_utils.models.enums import ModuleType
|
3
|
+
from typing import Any, ClassVar
|
4
|
+
|
5
|
+
class FrontendActivatorConfig(FrontendConfigGroupValidator):
|
6
|
+
__module_type__: ClassVar[ModuleType]
|
7
|
+
mainControl: str | None
|
8
|
+
dependentControls: list[str] | None
|
9
|
+
condition: str | None
|
10
|
+
value: Any | None
|
11
|
+
@classmethod
|
12
|
+
def validate_value_in_options_condition(cls, value: Any) -> Any: ...
|
@@ -0,0 +1,11 @@
|
|
1
|
+
from typing import ClassVar
|
2
|
+
|
3
|
+
from amsdal_utils.models.enums import ModuleType
|
4
|
+
from pydantic.fields import Field
|
5
|
+
|
6
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import * # noqa: F403
|
7
|
+
|
8
|
+
|
9
|
+
class FrontendConfigAsyncValidator(FrontendConfigSkipNoneBase): # noqa: F405
|
10
|
+
__module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
|
11
|
+
endpoint: str | None = Field(None, title='Endpoint')
|
@@ -0,0 +1,7 @@
|
|
1
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import *
|
2
|
+
from amsdal_utils.models.enums import ModuleType
|
3
|
+
from typing import ClassVar
|
4
|
+
|
5
|
+
class FrontendConfigAsyncValidator(FrontendConfigSkipNoneBase):
|
6
|
+
__module_type__: ClassVar[ModuleType]
|
7
|
+
endpoint: str | None
|
@@ -0,0 +1,54 @@
|
|
1
|
+
from typing import Any
|
2
|
+
from typing import ClassVar
|
3
|
+
|
4
|
+
from amsdal_models.builder.validators.options_validators import validate_options
|
5
|
+
from amsdal_utils.models.enums import ModuleType
|
6
|
+
from pydantic import field_validator
|
7
|
+
from pydantic.fields import Field
|
8
|
+
|
9
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import * # noqa: F403
|
10
|
+
|
11
|
+
|
12
|
+
class FrontendConfigControlAction(FrontendConfigSkipNoneBase): # noqa: F405
|
13
|
+
__module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
|
14
|
+
action: str = Field(title='Action')
|
15
|
+
text: str = Field(title='Text')
|
16
|
+
type: str = Field(title='Type')
|
17
|
+
dataLayerEvent: str | None = Field(None, title='Data Layer Event') # noqa: N815
|
18
|
+
activator: str | None = Field(None, title='Activator')
|
19
|
+
icon: str | None = Field(None, title='Icon')
|
20
|
+
|
21
|
+
@field_validator('type')
|
22
|
+
@classmethod
|
23
|
+
def validate_value_in_options_type(cls: type, value: Any) -> Any: # type: ignore # noqa: A003
|
24
|
+
return validate_options(value, options=['action-button', 'arrow-next', 'arrow-prev', 'text-next', 'text-prev'])
|
25
|
+
|
26
|
+
@field_validator('action', mode='after')
|
27
|
+
@classmethod
|
28
|
+
def validate_action(cls, v: str) -> str:
|
29
|
+
"""
|
30
|
+
Validates the action string to ensure it is one of the allowed values.
|
31
|
+
|
32
|
+
This method checks if the action string starts with 'navigate::' or is one of the predefined
|
33
|
+
actions. If the action string is invalid, it raises a ValueError.
|
34
|
+
|
35
|
+
Args:
|
36
|
+
cls: The class this method is attached to.
|
37
|
+
v (str): The action string to validate.
|
38
|
+
|
39
|
+
Returns:
|
40
|
+
str: The validated action string.
|
41
|
+
|
42
|
+
Raises:
|
43
|
+
ValueError: If the action string is not valid.
|
44
|
+
"""
|
45
|
+
if not v.startswith('navigate::') and v not in [
|
46
|
+
'goPrev',
|
47
|
+
'goNext',
|
48
|
+
'goNextWithSubmit',
|
49
|
+
'submit',
|
50
|
+
'submitWithDataLayer',
|
51
|
+
]:
|
52
|
+
msg = 'Action must be one of: goPrev, goNext, goNextWithSubmit, submit, submitWithDataLayer, navigate::{string}' # noqa: E501
|
53
|
+
raise ValueError(msg)
|
54
|
+
return v
|
@@ -0,0 +1,32 @@
|
|
1
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import *
|
2
|
+
from amsdal_utils.models.enums import ModuleType
|
3
|
+
from typing import Any, ClassVar
|
4
|
+
|
5
|
+
class FrontendConfigControlAction(FrontendConfigSkipNoneBase):
|
6
|
+
__module_type__: ClassVar[ModuleType]
|
7
|
+
action: str
|
8
|
+
text: str
|
9
|
+
type: str
|
10
|
+
dataLayerEvent: str | None
|
11
|
+
activator: str | None
|
12
|
+
icon: str | None
|
13
|
+
@classmethod
|
14
|
+
def validate_value_in_options_type(cls, value: Any) -> Any: ...
|
15
|
+
@classmethod
|
16
|
+
def validate_action(cls, v: str) -> str:
|
17
|
+
"""
|
18
|
+
Validates the action string to ensure it is one of the allowed values.
|
19
|
+
|
20
|
+
This method checks if the action string starts with 'navigate::' or is one of the predefined
|
21
|
+
actions. If the action string is invalid, it raises a ValueError.
|
22
|
+
|
23
|
+
Args:
|
24
|
+
cls: The class this method is attached to.
|
25
|
+
v (str): The action string to validate.
|
26
|
+
|
27
|
+
Returns:
|
28
|
+
str: The validated action string.
|
29
|
+
|
30
|
+
Raises:
|
31
|
+
ValueError: If the action string is not valid.
|
32
|
+
"""
|
@@ -0,0 +1,21 @@
|
|
1
|
+
from typing import Any
|
2
|
+
from typing import ClassVar
|
3
|
+
|
4
|
+
from amsdal_models.builder.validators.options_validators import validate_options
|
5
|
+
from amsdal_utils.models.enums import ModuleType
|
6
|
+
from pydantic.fields import Field
|
7
|
+
from pydantic.functional_validators import field_validator
|
8
|
+
|
9
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import * # noqa: F403
|
10
|
+
|
11
|
+
|
12
|
+
class FrontendConfigGroupValidator(FrontendConfigSkipNoneBase): # noqa: F405
|
13
|
+
__module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
|
14
|
+
mainControl: str | None = Field(None, title='Main Control') # noqa: N815
|
15
|
+
dependentControls: list[str] | None = Field(None, title='Dependent Controls') # noqa: N815
|
16
|
+
condition: str | None = Field(None, title='Condition')
|
17
|
+
|
18
|
+
@field_validator('condition')
|
19
|
+
@classmethod
|
20
|
+
def validate_value_in_options_condition(cls: type, value: Any) -> Any:
|
21
|
+
return validate_options(value, options=['eq', 'exist', 'gt', 'gte', 'lt', 'lte', 'neq'])
|
@@ -0,0 +1,11 @@
|
|
1
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import *
|
2
|
+
from amsdal_utils.models.enums import ModuleType
|
3
|
+
from typing import Any, ClassVar
|
4
|
+
|
5
|
+
class FrontendConfigGroupValidator(FrontendConfigSkipNoneBase):
|
6
|
+
__module_type__: ClassVar[ModuleType]
|
7
|
+
mainControl: str | None
|
8
|
+
dependentControls: list[str] | None
|
9
|
+
condition: str | None
|
10
|
+
@classmethod
|
11
|
+
def validate_value_in_options_condition(cls, value: Any) -> Any: ...
|
@@ -0,0 +1,12 @@
|
|
1
|
+
from typing import ClassVar
|
2
|
+
|
3
|
+
from amsdal_utils.models.enums import ModuleType
|
4
|
+
from pydantic.fields import Field
|
5
|
+
|
6
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import * # noqa: F403
|
7
|
+
|
8
|
+
|
9
|
+
class FrontendConfigOption(FrontendConfigSkipNoneBase): # noqa: F405
|
10
|
+
__module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
|
11
|
+
label: str | None = Field(None, title='Label')
|
12
|
+
value: str | None = Field(None, title='Value')
|
@@ -0,0 +1,8 @@
|
|
1
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import *
|
2
|
+
from amsdal_utils.models.enums import ModuleType
|
3
|
+
from typing import ClassVar
|
4
|
+
|
5
|
+
class FrontendConfigOption(FrontendConfigSkipNoneBase):
|
6
|
+
__module_type__: ClassVar[ModuleType]
|
7
|
+
label: str | None
|
8
|
+
value: str | None
|
@@ -0,0 +1,17 @@
|
|
1
|
+
from typing import Any
|
2
|
+
from typing import ClassVar
|
3
|
+
|
4
|
+
from amsdal_models.classes.model import TypeModel
|
5
|
+
from amsdal_utils.models.enums import ModuleType
|
6
|
+
|
7
|
+
|
8
|
+
class FrontendConfigSkipNoneBase(TypeModel):
|
9
|
+
__module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
|
10
|
+
|
11
|
+
def model_dump(self, **kwargs: Any) -> dict[str, Any]:
|
12
|
+
kwargs['exclude_none'] = True
|
13
|
+
return super().model_dump(**kwargs)
|
14
|
+
|
15
|
+
def model_dump_json(self, **kwargs: Any) -> str:
|
16
|
+
kwargs['exclude_none'] = True
|
17
|
+
return super().model_dump_json(**kwargs)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
from amsdal_models.classes.model import TypeModel
|
2
|
+
from amsdal_utils.models.enums import ModuleType
|
3
|
+
from typing import Any, ClassVar
|
4
|
+
|
5
|
+
class FrontendConfigSkipNoneBase(TypeModel):
|
6
|
+
__module_type__: ClassVar[ModuleType]
|
7
|
+
def model_dump(self, **kwargs: Any) -> dict[str, Any]: ...
|
8
|
+
def model_dump_json(self, **kwargs: Any) -> str: ...
|
@@ -0,0 +1,13 @@
|
|
1
|
+
from typing import ClassVar
|
2
|
+
|
3
|
+
from amsdal_utils.models.enums import ModuleType
|
4
|
+
from pydantic.fields import Field
|
5
|
+
|
6
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import * # noqa: F403
|
7
|
+
|
8
|
+
|
9
|
+
class FrontendConfigSliderOption(FrontendConfigSkipNoneBase): # noqa: F405
|
10
|
+
__module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
|
11
|
+
min: float | None = Field(None, title='Minimum')
|
12
|
+
max: float | None = Field(None, title='Maximum')
|
13
|
+
range: bool | None = Field(None, title='Range')
|
@@ -0,0 +1,9 @@
|
|
1
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import *
|
2
|
+
from amsdal_utils.models.enums import ModuleType
|
3
|
+
from typing import ClassVar
|
4
|
+
|
5
|
+
class FrontendConfigSliderOption(FrontendConfigSkipNoneBase):
|
6
|
+
__module_type__: ClassVar[ModuleType]
|
7
|
+
min: float | None
|
8
|
+
max: float | None
|
9
|
+
range: bool | None
|
@@ -0,0 +1,14 @@
|
|
1
|
+
from typing import ClassVar
|
2
|
+
|
3
|
+
from amsdal_utils.models.enums import ModuleType
|
4
|
+
from pydantic.fields import Field
|
5
|
+
|
6
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import * # noqa: F403
|
7
|
+
|
8
|
+
|
9
|
+
class FrontendConfigTextMask(FrontendConfigSkipNoneBase): # noqa: F405
|
10
|
+
__module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
|
11
|
+
mask_string: str = Field(title='Mask String')
|
12
|
+
prefix: str | None = Field(None, title='Prefix')
|
13
|
+
suffix: str | None = Field(None, title='Suffix')
|
14
|
+
thousands_separator: str | None = Field(None, title='Thousands Separator')
|
@@ -0,0 +1,10 @@
|
|
1
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import *
|
2
|
+
from amsdal_utils.models.enums import ModuleType
|
3
|
+
from typing import ClassVar
|
4
|
+
|
5
|
+
class FrontendConfigTextMask(FrontendConfigSkipNoneBase):
|
6
|
+
__module_type__: ClassVar[ModuleType]
|
7
|
+
mask_string: str
|
8
|
+
prefix: str | None
|
9
|
+
suffix: str | None
|
10
|
+
thousands_separator: str | None
|