amsdal 0.3.6__cp312-cp312-macosx_10_13_universal2.whl → 0.4.0__cp312-cp312-macosx_10_13_universal2.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.
Potentially problematic release.
This version of amsdal might be problematic. Click here for more details.
- amsdal/__about__.py +1 -1
- amsdal/__migrations__/0000_initial.py +34 -25
- amsdal/__migrations__/0001_datetime_type.py +4 -4
- amsdal/__migrations__/0002_fixture_order.py +7 -3
- amsdal/__migrations__/0003_schema_type_in_class_meta.py +3 -15
- amsdal/cloud/__init__.cpython-312-darwin.so +0 -0
- amsdal/cloud/client.cpython-312-darwin.so +0 -0
- amsdal/cloud/constants.cpython-312-darwin.so +0 -0
- amsdal/cloud/enums.cpython-312-darwin.so +0 -0
- amsdal/cloud/models/__init__.cpython-312-darwin.so +0 -0
- amsdal/cloud/models/base.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/__init__.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/__init__.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/add_allowlist_ip.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/add_basic_auth.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/add_dependency.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/add_secret.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/base.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/create_deploy.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/create_env.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/create_session.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/delete_allowlist_ip.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/delete_basic_auth.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/delete_dependency.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/delete_env.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/delete_secret.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/destroy_deploy.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/expose_db.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/get_basic_auth_credentials.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/get_monitoring_info.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/list_dependencies.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/list_deploys.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/list_envs.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/list_secrets.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/manager.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/signup_action.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/actions/update_deploy.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/auth/__init__.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/auth/base.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/auth/credentials.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/auth/credentials.pyi +0 -1
- amsdal/cloud/services/auth/manager.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/auth/signup_service.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/auth/token.cpython-312-darwin.so +0 -0
- amsdal/cloud/services/auth/token.pyi +0 -1
- amsdal/configs/main.py +23 -19
- amsdal/configs/main.pyi +12 -15
- amsdal/contrib/__init__.cpython-312-darwin.so +0 -0
- amsdal/contrib/auth/lifecycle/consumer.py +10 -10
- amsdal/contrib/auth/migrations/0000_initial.py +41 -7
- amsdal/contrib/auth/models/login_session.py +66 -0
- amsdal/contrib/auth/models/login_session.pyi +33 -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/frontend_configs/conversion/convert.py +47 -15
- amsdal/contrib/frontend_configs/conversion/convert.pyi +0 -1
- amsdal/contrib/frontend_configs/lifecycle/consumer.py +32 -13
- amsdal/contrib/frontend_configs/lifecycle/consumer.pyi +1 -1
- amsdal/contrib/frontend_configs/migrations/0000_initial.py +15 -14
- 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/errors.py +0 -3
- amsdal/errors.pyi +0 -1
- amsdal/fixtures/__init__.cpython-312-darwin.so +0 -0
- amsdal/fixtures/manager.cpython-312-darwin.so +0 -0
- amsdal/fixtures/manager.pyi +72 -123
- amsdal/fixtures/utils.cpython-312-darwin.so +0 -0
- amsdal/fixtures/utils.pyi +9 -0
- amsdal/manager.cpython-312-darwin.so +0 -0
- amsdal/manager.pyi +4 -96
- amsdal/mixins/__init__.cpython-312-darwin.so +0 -0
- amsdal/mixins/class_versions_mixin.cpython-312-darwin.so +0 -0
- amsdal/models/__init__.py +0 -0
- amsdal/models/__init__.pyi +0 -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 +19 -0
- amsdal/models/core/class_property.pyi +10 -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/schemas/core/file/properties/validate_data.py +1 -1
- amsdal/schemas/interfaces.py +25 -0
- amsdal/schemas/interfaces.pyi +20 -0
- amsdal/schemas/manager.cpython-312-darwin.so +0 -0
- amsdal/schemas/manager.py +0 -116
- amsdal/schemas/manager.pyi +0 -65
- amsdal/schemas/mixins/__init__.py +0 -0
- amsdal/schemas/mixins/__init__.pyi +0 -0
- amsdal/schemas/mixins/check_dependencies_mixin.py +115 -0
- amsdal/schemas/mixins/check_dependencies_mixin.pyi +42 -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/utils.py +16 -0
- amsdal/schemas/utils.pyi +10 -0
- amsdal/services/__init__.cpython-312-darwin.so +0 -0
- amsdal/services/transaction_execution.cpython-312-darwin.so +0 -0
- amsdal/utils/rollback/__init__.py +99 -54
- amsdal/utils/tests/helpers.py +46 -37
- {amsdal-0.3.6.dist-info → amsdal-0.4.0.dist-info}/METADATA +8 -8
- {amsdal-0.3.6.dist-info → amsdal-0.4.0.dist-info}/RECORD +148 -140
- amsdal/contrib/auth/models/login_session/hooks/pre_init.py +0 -68
- amsdal/contrib/auth/models/login_session/model.json +0 -23
- amsdal/contrib/auth/models/login_session/modifiers/display_name.py +0 -11
- amsdal/contrib/auth/models/permission/fixtures/basic_permissions.json +0 -62
- amsdal/contrib/auth/models/permission/model.json +0 -18
- amsdal/contrib/auth/models/permission/modifiers/display_name.py +0 -11
- amsdal/contrib/auth/models/user/hooks/post_init.py +0 -76
- amsdal/contrib/auth/models/user/hooks/pre_create.py +0 -8
- amsdal/contrib/auth/models/user/model.json +0 -25
- amsdal/contrib/auth/models/user/modifiers/display_name.py +0 -19
- amsdal/contrib/frontend_configs/models/frontend_activator_config/model.json +0 -11
- amsdal/contrib/frontend_configs/models/frontend_config_async_validator/model.json +0 -11
- amsdal/contrib/frontend_configs/models/frontend_config_group_validator/model.json +0 -52
- amsdal/contrib/frontend_configs/models/frontend_config_option/model.json +0 -15
- amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base/model.json +0 -6
- amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base/properties/model_dump.py +0 -13
- amsdal/contrib/frontend_configs/models/frontend_config_slider_option/model.json +0 -19
- amsdal/contrib/frontend_configs/models/frontend_config_text_mask/model.json +0 -26
- amsdal/contrib/frontend_configs/models/frontend_config_validator/model.json +0 -41
- amsdal/contrib/frontend_configs/models/frontend_control_config/model.json +0 -250
- amsdal/contrib/frontend_configs/models/frontend_model_config/fixtures/permissions.json +0 -24
- amsdal/contrib/frontend_configs/models/frontend_model_config/model.json +0 -17
- amsdal/contrib/frontend_configs/models/frontent_config_control_action/model.json +0 -54
- amsdal/contrib/frontend_configs/models/frontent_config_control_action/properties/action_validate.py +0 -33
- amsdal/migration/__init__.cpython-312-darwin.so +0 -0
- amsdal/migration/base_migration_schemas.cpython-312-darwin.so +0 -0
- amsdal/migration/base_migration_schemas.pyi +0 -119
- amsdal/migration/data_classes.cpython-312-darwin.so +0 -0
- amsdal/migration/data_classes.pyi +0 -165
- amsdal/migration/executors/__init__.cpython-312-darwin.so +0 -0
- amsdal/migration/executors/base.cpython-312-darwin.so +0 -0
- amsdal/migration/executors/base.pyi +0 -117
- amsdal/migration/executors/default_executor.cpython-312-darwin.so +0 -0
- amsdal/migration/executors/default_executor.pyi +0 -184
- amsdal/migration/executors/state_executor.cpython-312-darwin.so +0 -0
- amsdal/migration/executors/state_executor.pyi +0 -151
- amsdal/migration/file_migration_executor.cpython-312-darwin.so +0 -0
- amsdal/migration/file_migration_executor.pyi +0 -122
- amsdal/migration/file_migration_generator.cpython-312-darwin.so +0 -0
- amsdal/migration/file_migration_generator.pyi +0 -229
- amsdal/migration/file_migration_store.cpython-312-darwin.so +0 -0
- amsdal/migration/file_migration_store.pyi +0 -114
- amsdal/migration/file_migration_writer.cpython-312-darwin.so +0 -0
- amsdal/migration/file_migration_writer.pyi +0 -73
- amsdal/migration/migrations.cpython-312-darwin.so +0 -0
- amsdal/migration/migrations.pyi +0 -166
- amsdal/migration/migrations_loader.cpython-312-darwin.so +0 -0
- amsdal/migration/migrations_loader.pyi +0 -32
- amsdal/migration/schemas_loaders.cpython-312-darwin.so +0 -0
- amsdal/migration/schemas_loaders.pyi +0 -37
- amsdal/migration/templates/data_migration.tmpl +0 -18
- amsdal/migration/templates/dict_validator.tmpl +0 -4
- amsdal/migration/templates/migration.tmpl +0 -6
- amsdal/migration/templates/model_class.tmpl +0 -8
- amsdal/migration/templates/model_class_layout.tmpl +0 -24
- amsdal/migration/templates/options_validator.tmpl +0 -4
- amsdal/migration/utils.cpython-312-darwin.so +0 -0
- amsdal/migration/utils.pyi +0 -58
- amsdal/mixins/build_mixin.cpython-312-darwin.so +0 -0
- amsdal/mixins/build_mixin.pyi +0 -78
- /amsdal/{migration/__init__.pyi → contrib/auth/models/__init__.py} +0 -0
- /amsdal/{migration/executors → contrib/auth/models}/__init__.pyi +0 -0
- {amsdal-0.3.6.dist-info → amsdal-0.4.0.dist-info}/LICENSE.txt +0 -0
- {amsdal-0.3.6.dist-info → amsdal-0.4.0.dist-info}/WHEEL +0 -0
- {amsdal-0.3.6.dist-info → amsdal-0.4.0.dist-info}/licenses/LICENSE.txt +0 -0
- {amsdal-0.3.6.dist-info → amsdal-0.4.0.dist-info}/top_level.txt +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# mypy: disable-error-code="arg-type"
|
|
1
2
|
import contextlib
|
|
2
3
|
import logging
|
|
3
4
|
from typing import Any
|
|
@@ -7,14 +8,14 @@ from amsdal_utils.lifecycle.consumer import LifecycleConsumer
|
|
|
7
8
|
from amsdal_utils.models.data_models.address import Address
|
|
8
9
|
from amsdal_utils.models.data_models.core import LegacyDictSchema
|
|
9
10
|
from amsdal_utils.models.data_models.enums import CoreTypes
|
|
10
|
-
from amsdal_utils.models.data_models.schema import PropertyData
|
|
11
|
-
from amsdal_utils.models.enums import SchemaTypes
|
|
12
11
|
from amsdal_utils.models.enums import Versions
|
|
12
|
+
from amsdal_utils.schemas.schema import PropertyData
|
|
13
13
|
|
|
14
14
|
logger = logging.getLogger(__name__)
|
|
15
15
|
|
|
16
16
|
core_to_frontend_types = {
|
|
17
17
|
CoreTypes.NUMBER.value: 'number',
|
|
18
|
+
CoreTypes.INTEGER.value: 'integer',
|
|
18
19
|
CoreTypes.BOOLEAN.value: 'checkbox',
|
|
19
20
|
CoreTypes.STRING.value: 'text',
|
|
20
21
|
CoreTypes.ANYTHING.value: 'text',
|
|
@@ -126,6 +127,7 @@ def populate_frontend_config_with_values(config: dict[str, Any], values: dict[st
|
|
|
126
127
|
|
|
127
128
|
if config.get('name') in values:
|
|
128
129
|
config['value'] = values[config['name']]
|
|
130
|
+
|
|
129
131
|
return config
|
|
130
132
|
|
|
131
133
|
|
|
@@ -167,23 +169,36 @@ def get_default_control(class_name: str) -> dict[str, Any]:
|
|
|
167
169
|
Returns:
|
|
168
170
|
dict[str, Any]: A dictionary representing the frontend control configuration for the given class.
|
|
169
171
|
"""
|
|
170
|
-
from amsdal_models.classes.
|
|
172
|
+
from amsdal_models.classes.class_manager import ClassManager
|
|
171
173
|
|
|
172
174
|
from amsdal.contrib.frontend_configs.conversion import convert_to_frontend_config
|
|
173
|
-
from
|
|
175
|
+
from amsdal.contrib.frontend_configs.models.frontend_control_config import (
|
|
176
|
+
FrontendControlConfig, # type: ignore[import-not-found]
|
|
177
|
+
)
|
|
178
|
+
from amsdal.models.core.file import File
|
|
174
179
|
|
|
175
180
|
target_class = None
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
target_class = ClassManager().import_class(class_name, schema_type)
|
|
179
|
-
|
|
180
|
-
if target_class:
|
|
181
|
-
break
|
|
181
|
+
with contextlib.suppress(AmsdalClassNotFoundError):
|
|
182
|
+
target_class = ClassManager().import_class(class_name)
|
|
182
183
|
|
|
183
184
|
if not target_class:
|
|
184
185
|
return {}
|
|
185
186
|
|
|
186
|
-
|
|
187
|
+
if target_class is File:
|
|
188
|
+
config = {
|
|
189
|
+
'type': 'group',
|
|
190
|
+
'name': 'File',
|
|
191
|
+
'label': 'File',
|
|
192
|
+
'controls': [
|
|
193
|
+
{'label': 'Filename', 'name': 'filename', 'type': 'text', 'required': True},
|
|
194
|
+
{'label': 'Data', 'name': 'data', 'type': 'Bytes', 'required': True},
|
|
195
|
+
{'label': 'Size', 'name': 'size', 'type': 'number', 'required': False},
|
|
196
|
+
],
|
|
197
|
+
}
|
|
198
|
+
else:
|
|
199
|
+
config = convert_to_frontend_config(target_class, is_transaction=False)
|
|
200
|
+
|
|
201
|
+
return FrontendControlConfig(**config).model_dump(
|
|
187
202
|
exclude_none=True,
|
|
188
203
|
)
|
|
189
204
|
|
|
@@ -212,7 +227,9 @@ class ProcessResponseConsumer(LifecycleConsumer):
|
|
|
212
227
|
Returns:
|
|
213
228
|
None
|
|
214
229
|
"""
|
|
215
|
-
from
|
|
230
|
+
from amsdal.contrib.frontend_configs.models.frontend_model_config import (
|
|
231
|
+
FrontendModelConfig, # type: ignore[import-not-found]
|
|
232
|
+
)
|
|
216
233
|
|
|
217
234
|
class_name = None
|
|
218
235
|
values = {}
|
|
@@ -257,7 +274,9 @@ class ProcessResponseConsumer(LifecycleConsumer):
|
|
|
257
274
|
Returns:
|
|
258
275
|
None
|
|
259
276
|
"""
|
|
260
|
-
from
|
|
277
|
+
from amsdal.contrib.frontend_configs.models.frontend_model_config import (
|
|
278
|
+
FrontendModelConfig, # type: ignore[import-not-found]
|
|
279
|
+
)
|
|
261
280
|
|
|
262
281
|
class_name = None
|
|
263
282
|
values = {}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
from amsdal.migration import migrations
|
|
1
|
+
from amsdal_models.migration import migrations
|
|
2
|
+
from amsdal_utils.models.enums import ModuleType
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
class Migration(migrations.Migration):
|
|
7
6
|
operations: list[migrations.Operation] = [
|
|
8
7
|
migrations.CreateClass(
|
|
9
|
-
|
|
8
|
+
module_type=ModuleType.CONTRIB,
|
|
10
9
|
class_name='FrontendConfigSkipNoneBase',
|
|
11
10
|
new_schema={
|
|
12
11
|
'title': 'FrontendConfigSkipNoneBase',
|
|
@@ -16,7 +15,7 @@ class Migration(migrations.Migration):
|
|
|
16
15
|
},
|
|
17
16
|
),
|
|
18
17
|
migrations.CreateClass(
|
|
19
|
-
|
|
18
|
+
module_type=ModuleType.CONTRIB,
|
|
20
19
|
class_name='FrontendConfigGroupValidator',
|
|
21
20
|
new_schema={
|
|
22
21
|
'title': 'FrontendConfigGroupValidator',
|
|
@@ -42,7 +41,7 @@ class Migration(migrations.Migration):
|
|
|
42
41
|
},
|
|
43
42
|
),
|
|
44
43
|
migrations.CreateClass(
|
|
45
|
-
|
|
44
|
+
module_type=ModuleType.CONTRIB,
|
|
46
45
|
class_name='FrontendActivatorConfig',
|
|
47
46
|
new_schema={
|
|
48
47
|
'title': 'FrontendActivatorConfig',
|
|
@@ -52,7 +51,7 @@ class Migration(migrations.Migration):
|
|
|
52
51
|
},
|
|
53
52
|
),
|
|
54
53
|
migrations.CreateClass(
|
|
55
|
-
|
|
54
|
+
module_type=ModuleType.CONTRIB,
|
|
56
55
|
class_name='FrontendConfigTextMask',
|
|
57
56
|
new_schema={
|
|
58
57
|
'title': 'FrontendConfigTextMask',
|
|
@@ -68,7 +67,7 @@ class Migration(migrations.Migration):
|
|
|
68
67
|
},
|
|
69
68
|
),
|
|
70
69
|
migrations.CreateClass(
|
|
71
|
-
|
|
70
|
+
module_type=ModuleType.CONTRIB,
|
|
72
71
|
class_name='FrontendConfigSliderOption',
|
|
73
72
|
new_schema={
|
|
74
73
|
'title': 'FrontendConfigSliderOption',
|
|
@@ -82,7 +81,7 @@ class Migration(migrations.Migration):
|
|
|
82
81
|
},
|
|
83
82
|
),
|
|
84
83
|
migrations.CreateClass(
|
|
85
|
-
|
|
84
|
+
module_type=ModuleType.CONTRIB,
|
|
86
85
|
class_name='FrontendConfigValidator',
|
|
87
86
|
new_schema={
|
|
88
87
|
'title': 'FrontendConfigValidator',
|
|
@@ -106,7 +105,7 @@ class Migration(migrations.Migration):
|
|
|
106
105
|
},
|
|
107
106
|
),
|
|
108
107
|
migrations.CreateClass(
|
|
109
|
-
|
|
108
|
+
module_type=ModuleType.CONTRIB,
|
|
110
109
|
class_name='FrontendConfigAsyncValidator',
|
|
111
110
|
new_schema={
|
|
112
111
|
'title': 'FrontendConfigAsyncValidator',
|
|
@@ -116,7 +115,7 @@ class Migration(migrations.Migration):
|
|
|
116
115
|
},
|
|
117
116
|
),
|
|
118
117
|
migrations.CreateClass(
|
|
119
|
-
|
|
118
|
+
module_type=ModuleType.CONTRIB,
|
|
120
119
|
class_name='FrontendConfigControlAction',
|
|
121
120
|
new_schema={
|
|
122
121
|
'title': 'FrontendConfigControlAction',
|
|
@@ -145,7 +144,7 @@ class Migration(migrations.Migration):
|
|
|
145
144
|
},
|
|
146
145
|
),
|
|
147
146
|
migrations.CreateClass(
|
|
148
|
-
|
|
147
|
+
module_type=ModuleType.CONTRIB,
|
|
149
148
|
class_name='FrontendConfigOption',
|
|
150
149
|
new_schema={
|
|
151
150
|
'title': 'FrontendConfigOption',
|
|
@@ -158,7 +157,7 @@ class Migration(migrations.Migration):
|
|
|
158
157
|
},
|
|
159
158
|
),
|
|
160
159
|
migrations.CreateClass(
|
|
161
|
-
|
|
160
|
+
module_type=ModuleType.CONTRIB,
|
|
162
161
|
class_name='FrontendControlConfig',
|
|
163
162
|
new_schema={
|
|
164
163
|
'title': 'FrontendControlConfig',
|
|
@@ -241,7 +240,7 @@ class Migration(migrations.Migration):
|
|
|
241
240
|
},
|
|
242
241
|
),
|
|
243
242
|
migrations.CreateClass(
|
|
244
|
-
|
|
243
|
+
module_type=ModuleType.CONTRIB,
|
|
245
244
|
class_name='FrontendModelConfig',
|
|
246
245
|
new_schema={
|
|
247
246
|
'title': 'FrontendModelConfig',
|
|
@@ -250,6 +249,8 @@ class Migration(migrations.Migration):
|
|
|
250
249
|
'class_name': {'type': 'string', 'title': 'Class Name'},
|
|
251
250
|
'control': {'type': 'FrontendControlConfig', 'title': 'Control'},
|
|
252
251
|
},
|
|
252
|
+
"primary_key": {"partition_key": ["partition_key"]},
|
|
253
|
+
"table_name": "FrontendModelConfig",
|
|
253
254
|
},
|
|
254
255
|
),
|
|
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
|
|
@@ -0,0 +1,28 @@
|
|
|
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 FrontendConfigValidator(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
|
+
function: str | None = Field(None, title='Function')
|
|
18
|
+
value: str | None = Field(None, title='Value')
|
|
19
|
+
|
|
20
|
+
@field_validator('condition')
|
|
21
|
+
@classmethod
|
|
22
|
+
def validate_value_in_options_condition(cls: type, value: Any) -> Any:
|
|
23
|
+
return validate_options(value, options=['eq', 'exist', 'gt', 'gte', 'lt', 'lte', 'neq'])
|
|
24
|
+
|
|
25
|
+
@field_validator('function')
|
|
26
|
+
@classmethod
|
|
27
|
+
def validate_value_in_options_function(cls: type, value: Any) -> Any:
|
|
28
|
+
return validate_options(value, options=['max', 'maxLength', 'min', 'minLength', 'pattern', 'required'])
|
|
@@ -0,0 +1,15 @@
|
|
|
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 FrontendConfigValidator(FrontendConfigGroupValidator):
|
|
6
|
+
__module_type__: ClassVar[ModuleType]
|
|
7
|
+
mainControl: str | None
|
|
8
|
+
dependentControls: list[str] | None
|
|
9
|
+
condition: str | None
|
|
10
|
+
function: str | None
|
|
11
|
+
value: str | None
|
|
12
|
+
@classmethod
|
|
13
|
+
def validate_value_in_options_condition(cls, value: Any) -> Any: ...
|
|
14
|
+
@classmethod
|
|
15
|
+
def validate_value_in_options_function(cls, value: Any) -> Any: ...
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from typing import ClassVar
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from amsdal_models.builder.validators.options_validators import validate_options
|
|
6
|
+
from amsdal_utils.models.enums import ModuleType
|
|
7
|
+
from pydantic.fields import Field
|
|
8
|
+
from pydantic.functional_validators import field_validator
|
|
9
|
+
|
|
10
|
+
from amsdal.contrib.frontend_configs.models.frontend_activator_config import * # noqa: F403
|
|
11
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_async_validator import * # noqa: F403
|
|
12
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_control_action import * # noqa: F403
|
|
13
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_option import * # noqa: F403
|
|
14
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import * # noqa: F403
|
|
15
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_slider_option import * # noqa: F403
|
|
16
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_text_mask import * # noqa: F403
|
|
17
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_validator import * # noqa: F403
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class FrontendControlConfig(FrontendConfigSkipNoneBase): # noqa: F405
|
|
21
|
+
__module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
|
|
22
|
+
type: str = Field(title='Type')
|
|
23
|
+
name: str = Field(title='Name')
|
|
24
|
+
label: str | None = Field(None, title='Label')
|
|
25
|
+
required: bool | None = Field(None, title='Required')
|
|
26
|
+
hideLabel: bool | None = Field(None, title='Hide Label') # noqa: N815
|
|
27
|
+
actions: list['FrontendConfigControlAction'] | None = Field(None, title='Actions') # noqa: F405
|
|
28
|
+
validators: list['FrontendConfigValidator'] | None = Field(None, title='Validators') # noqa: F405
|
|
29
|
+
asyncValidators: list['FrontendConfigAsyncValidator'] | None = Field( # noqa: F405, N815
|
|
30
|
+
None,
|
|
31
|
+
title='Async Validators',
|
|
32
|
+
)
|
|
33
|
+
activators: list['FrontendActivatorConfig'] | None = Field(None, title='Activators') # noqa: F405
|
|
34
|
+
additionalText: str | None = Field(None, title='Additional Text') # noqa: N815
|
|
35
|
+
value: Any | None = Field(None, title='Value')
|
|
36
|
+
placeholder: str | None = Field(None, title='Placeholder')
|
|
37
|
+
options: list['FrontendConfigOption'] | None = Field(None, title='Options') # noqa: F405
|
|
38
|
+
mask: Optional['FrontendConfigTextMask'] = Field(None, title='Mask') # noqa: F405
|
|
39
|
+
controls: list['FrontendControlConfig'] | None = Field(None, title='Controls')
|
|
40
|
+
showSearch: bool | None = Field(None, title='Show Search') # noqa: N815
|
|
41
|
+
sliderOptions: Optional['FrontendConfigSliderOption'] = Field(None, title='Slider Option') # noqa: F405, N815
|
|
42
|
+
customLabel: list[str] | None = Field(None, title='Custom Label') # noqa: N815
|
|
43
|
+
control: Optional['FrontendControlConfig'] = Field(None, title='Control')
|
|
44
|
+
entityType: str | None = Field(None, title='Entity Type') # noqa: N815
|
|
45
|
+
|
|
46
|
+
@field_validator('type')
|
|
47
|
+
@classmethod
|
|
48
|
+
def validate_value_in_options_type(cls: type, value: Any) -> Any: # type: ignore # noqa: A003
|
|
49
|
+
return validate_options(
|
|
50
|
+
value,
|
|
51
|
+
options=[
|
|
52
|
+
'Bytes',
|
|
53
|
+
'array',
|
|
54
|
+
'checkbox',
|
|
55
|
+
'date',
|
|
56
|
+
'dateTriplet',
|
|
57
|
+
'datetime',
|
|
58
|
+
'dict',
|
|
59
|
+
'dropzone',
|
|
60
|
+
'email',
|
|
61
|
+
'file',
|
|
62
|
+
'group',
|
|
63
|
+
'group_switch',
|
|
64
|
+
'group_toggle',
|
|
65
|
+
'info-group',
|
|
66
|
+
'infoscreen',
|
|
67
|
+
'multiselect',
|
|
68
|
+
'number',
|
|
69
|
+
'number-operations',
|
|
70
|
+
'number-slider',
|
|
71
|
+
'number_equals',
|
|
72
|
+
'number_initial',
|
|
73
|
+
'number_minus',
|
|
74
|
+
'number_plus',
|
|
75
|
+
'object',
|
|
76
|
+
'object_group',
|
|
77
|
+
'object_latest',
|
|
78
|
+
'password',
|
|
79
|
+
'phone',
|
|
80
|
+
'radio',
|
|
81
|
+
'select',
|
|
82
|
+
'text',
|
|
83
|
+
'textarea',
|
|
84
|
+
'time',
|
|
85
|
+
'toggle',
|
|
86
|
+
],
|
|
87
|
+
)
|