amsdal 0.4.13__cp312-cp312-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-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/__init__.pyi +0 -0
- amsdal/cloud/client.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/client.pyi +57 -0
- amsdal/cloud/constants.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/constants.pyi +13 -0
- amsdal/cloud/enums.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/enums.pyi +68 -0
- amsdal/cloud/models/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/models/__init__.pyi +0 -0
- amsdal/cloud/models/base.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/models/base.pyi +247 -0
- amsdal/cloud/services/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/__init__.pyi +0 -0
- amsdal/cloud/services/actions/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/__init__.pyi +0 -0
- amsdal/cloud/services/actions/add_allowlist_ip.cpython-312-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-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/add_basic_auth.pyi +21 -0
- amsdal/cloud/services/actions/add_dependency.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/add_dependency.pyi +19 -0
- amsdal/cloud/services/actions/add_secret.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/add_secret.pyi +20 -0
- amsdal/cloud/services/actions/base.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/base.pyi +122 -0
- amsdal/cloud/services/actions/create_deploy.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/create_deploy.pyi +41 -0
- amsdal/cloud/services/actions/create_env.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/create_env.pyi +19 -0
- amsdal/cloud/services/actions/create_session.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/create_session.pyi +17 -0
- amsdal/cloud/services/actions/delete_allowlist_ip.cpython-312-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-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/delete_basic_auth.pyi +20 -0
- amsdal/cloud/services/actions/delete_dependency.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/delete_dependency.pyi +21 -0
- amsdal/cloud/services/actions/delete_env.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/delete_env.pyi +21 -0
- amsdal/cloud/services/actions/delete_secret.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/delete_secret.pyi +21 -0
- amsdal/cloud/services/actions/destroy_deploy.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/destroy_deploy.pyi +18 -0
- amsdal/cloud/services/actions/expose_db.cpython-312-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-312-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-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/get_monitoring_info.pyi +21 -0
- amsdal/cloud/services/actions/list_dependencies.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/list_dependencies.pyi +21 -0
- amsdal/cloud/services/actions/list_deploys.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/list_deploys.pyi +19 -0
- amsdal/cloud/services/actions/list_envs.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/list_envs.pyi +20 -0
- amsdal/cloud/services/actions/list_secrets.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/list_secrets.pyi +22 -0
- amsdal/cloud/services/actions/manager.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/manager.pyi +278 -0
- amsdal/cloud/services/actions/signup_action.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/signup_action.pyi +20 -0
- amsdal/cloud/services/actions/update_deploy.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/actions/update_deploy.pyi +19 -0
- amsdal/cloud/services/auth/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/auth/__init__.pyi +0 -0
- amsdal/cloud/services/auth/base.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/auth/base.pyi +6 -0
- amsdal/cloud/services/auth/credentials.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/auth/credentials.pyi +30 -0
- amsdal/cloud/services/auth/manager.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/auth/manager.pyi +26 -0
- amsdal/cloud/services/auth/signup_service.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/cloud/services/auth/signup_service.pyi +32 -0
- amsdal/cloud/services/auth/token.cpython-312-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-312-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-312-x86_64-linux-gnu.so +0 -0
- amsdal/fixtures/__init__.pyi +0 -0
- amsdal/fixtures/manager.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/fixtures/manager.pyi +170 -0
- amsdal/fixtures/utils.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/fixtures/utils.pyi +9 -0
- amsdal/manager.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/manager.pyi +265 -0
- amsdal/mixins/__init__.cpython-312-x86_64-linux-gnu.so +0 -0
- amsdal/mixins/__init__.pyi +0 -0
- amsdal/mixins/class_versions_mixin.cpython-312-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-312-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-312-x86_64-linux-gnu.so +0 -0
- amsdal/services/__init__.pyi +0 -0
- amsdal/services/transaction_execution.cpython-312-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,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
|
+
)
|
@@ -0,0 +1,35 @@
|
|
1
|
+
from amsdal.contrib.frontend_configs.models.frontend_activator_config import *
|
2
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_async_validator import *
|
3
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_control_action import *
|
4
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_option import *
|
5
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_skip_none_base import *
|
6
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_slider_option import *
|
7
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_text_mask import *
|
8
|
+
from amsdal.contrib.frontend_configs.models.frontend_config_validator import *
|
9
|
+
from amsdal_utils.models.enums import ModuleType
|
10
|
+
from typing import Any, ClassVar
|
11
|
+
|
12
|
+
class FrontendControlConfig(FrontendConfigSkipNoneBase):
|
13
|
+
__module_type__: ClassVar[ModuleType]
|
14
|
+
type: str
|
15
|
+
name: str
|
16
|
+
label: str | None
|
17
|
+
required: bool | None
|
18
|
+
hideLabel: bool | None
|
19
|
+
actions: list['FrontendConfigControlAction'] | None
|
20
|
+
validators: list['FrontendConfigValidator'] | None
|
21
|
+
asyncValidators: list['FrontendConfigAsyncValidator'] | None
|
22
|
+
activators: list['FrontendActivatorConfig'] | None
|
23
|
+
additionalText: str | None
|
24
|
+
value: Any | None
|
25
|
+
placeholder: str | None
|
26
|
+
options: list['FrontendConfigOption'] | None
|
27
|
+
mask: FrontendConfigTextMask | None
|
28
|
+
controls: list['FrontendControlConfig'] | None
|
29
|
+
showSearch: bool | None
|
30
|
+
sliderOptions: FrontendConfigSliderOption | None
|
31
|
+
customLabel: list[str] | None
|
32
|
+
control: FrontendControlConfig | None
|
33
|
+
entityType: str | None
|
34
|
+
@classmethod
|
35
|
+
def validate_value_in_options_type(cls, value: Any) -> Any: ...
|
@@ -0,0 +1,14 @@
|
|
1
|
+
from typing import ClassVar
|
2
|
+
from typing import Optional
|
3
|
+
|
4
|
+
from amsdal_models.classes.model import Model
|
5
|
+
from amsdal_utils.models.enums import ModuleType
|
6
|
+
from pydantic.fields import Field
|
7
|
+
|
8
|
+
from amsdal.contrib.frontend_configs.models.frontend_control_config import * # noqa: F403
|
9
|
+
|
10
|
+
|
11
|
+
class FrontendModelConfig(Model):
|
12
|
+
__module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
|
13
|
+
class_name: str = Field(title='Class Name')
|
14
|
+
control: Optional['FrontendControlConfig'] = Field(None, title='Control') # noqa: F405
|
@@ -0,0 +1,9 @@
|
|
1
|
+
from amsdal.contrib.frontend_configs.models.frontend_control_config import *
|
2
|
+
from amsdal_models.classes.model import Model
|
3
|
+
from amsdal_utils.models.enums import ModuleType
|
4
|
+
from typing import ClassVar
|
5
|
+
|
6
|
+
class FrontendModelConfig(Model):
|
7
|
+
__module_type__: ClassVar[ModuleType] = ...
|
8
|
+
class_name: str = ...
|
9
|
+
control: FrontendControlConfig | None = ...
|
@@ -0,0 +1,29 @@
|
|
1
|
+
from typing import Any
|
2
|
+
|
3
|
+
|
4
|
+
def merge_ui_configs(base: dict[str, Any], override: dict[str, Any]) -> dict[str, Any]:
|
5
|
+
"""
|
6
|
+
Merges two UI configs together. The override config will take precedence over the base config.
|
7
|
+
|
8
|
+
This function recursively merges two dictionaries representing UI configurations.
|
9
|
+
If a key exists in both dictionaries, the value from the override dictionary will be used.
|
10
|
+
If the value is a dictionary or a list, the function will merge them recursively.
|
11
|
+
|
12
|
+
Args:
|
13
|
+
base (dict[str, Any]): The base UI configuration dictionary.
|
14
|
+
override (dict[str, Any]): The override UI configuration dictionary.
|
15
|
+
|
16
|
+
Returns:
|
17
|
+
dict[str, Any]: The merged UI configuration dictionary.
|
18
|
+
"""
|
19
|
+
for key, value in override.items():
|
20
|
+
if key not in base:
|
21
|
+
base[key] = value
|
22
|
+
elif isinstance(value, dict):
|
23
|
+
base[key] = merge_ui_configs(base[key], value)
|
24
|
+
elif isinstance(value, list):
|
25
|
+
base[key] = [merge_ui_configs(base[key], item) for item in value]
|
26
|
+
else:
|
27
|
+
base[key] = value
|
28
|
+
|
29
|
+
return base
|
@@ -0,0 +1,17 @@
|
|
1
|
+
from typing import Any
|
2
|
+
|
3
|
+
def merge_ui_configs(base: dict[str, Any], override: dict[str, Any]) -> dict[str, Any]:
|
4
|
+
"""
|
5
|
+
Merges two UI configs together. The override config will take precedence over the base config.
|
6
|
+
|
7
|
+
This function recursively merges two dictionaries representing UI configurations.
|
8
|
+
If a key exists in both dictionaries, the value from the override dictionary will be used.
|
9
|
+
If the value is a dictionary or a list, the function will merge them recursively.
|
10
|
+
|
11
|
+
Args:
|
12
|
+
base (dict[str, Any]): The base UI configuration dictionary.
|
13
|
+
override (dict[str, Any]): The override UI configuration dictionary.
|
14
|
+
|
15
|
+
Returns:
|
16
|
+
dict[str, Any]: The merged UI configuration dictionary.
|
17
|
+
"""
|
amsdal/errors.py
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
from amsdal_utils.errors import AmsdalError
|
2
|
+
|
3
|
+
|
4
|
+
class AmsdalRuntimeError(AmsdalError): ...
|
5
|
+
|
6
|
+
|
7
|
+
class TransactionNotFoundError(AmsdalError): ...
|
8
|
+
|
9
|
+
|
10
|
+
class AmsdalAuthenticationError(AmsdalRuntimeError): ...
|
11
|
+
|
12
|
+
|
13
|
+
class AmsdalDeployError(AmsdalRuntimeError): ...
|
14
|
+
|
15
|
+
|
16
|
+
class AmsdalCloudError(AmsdalRuntimeError): ...
|
17
|
+
|
18
|
+
|
19
|
+
class AmsdalCloudAlreadyDeployedError(AmsdalCloudError): ...
|
20
|
+
|
21
|
+
|
22
|
+
class AmsdalCloudCredentialsError(AmsdalCloudError): ...
|
23
|
+
|
24
|
+
|
25
|
+
class AmsdalMissingCredentialsError(AmsdalAuthenticationError): ...
|
26
|
+
|
27
|
+
|
28
|
+
class AmsdalAuthConnectionError(AmsdalAuthenticationError): ...
|
29
|
+
|
30
|
+
|
31
|
+
class AmsdalSignupError(AmsdalAuthenticationError): ...
|
amsdal/errors.pyi
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
from amsdal_utils.errors import AmsdalError
|
2
|
+
|
3
|
+
class AmsdalRuntimeError(AmsdalError): ...
|
4
|
+
class TransactionNotFoundError(AmsdalError): ...
|
5
|
+
class AmsdalAuthenticationError(AmsdalRuntimeError): ...
|
6
|
+
class AmsdalDeployError(AmsdalRuntimeError): ...
|
7
|
+
class AmsdalCloudError(AmsdalRuntimeError): ...
|
8
|
+
class AmsdalCloudAlreadyDeployedError(AmsdalCloudError): ...
|
9
|
+
class AmsdalCloudCredentialsError(AmsdalCloudError): ...
|
10
|
+
class AmsdalMissingCredentialsError(AmsdalAuthenticationError): ...
|
11
|
+
class AmsdalAuthConnectionError(AmsdalAuthenticationError): ...
|
12
|
+
class AmsdalSignupError(AmsdalAuthenticationError): ...
|
Binary file
|
File without changes
|
Binary file
|
@@ -0,0 +1,170 @@
|
|
1
|
+
from _typeshed import Incomplete
|
2
|
+
from amsdal.fixtures.utils import process_fixture_value as process_fixture_value
|
3
|
+
from amsdal_models.classes.model import Model
|
4
|
+
from collections.abc import Generator
|
5
|
+
from pathlib import Path
|
6
|
+
from pydantic import BaseModel
|
7
|
+
from pydantic.fields import FieldInfo as FieldInfo
|
8
|
+
from typing import Any
|
9
|
+
|
10
|
+
logger: Incomplete
|
11
|
+
|
12
|
+
class FixtureData(BaseModel):
|
13
|
+
class_name: str
|
14
|
+
external_id: str
|
15
|
+
order: float
|
16
|
+
data: dict[str, Any]
|
17
|
+
|
18
|
+
class BaseFixturesManager:
|
19
|
+
ORDER_MULTIPLIER: int
|
20
|
+
fixtures_paths: Incomplete
|
21
|
+
fixtures: dict[str | int, list[tuple[float, FixtureData]]]
|
22
|
+
_class_manager: Incomplete
|
23
|
+
_config_manager: Incomplete
|
24
|
+
def __init__(self, fixtures_paths: list[Path]) -> None: ...
|
25
|
+
def load_fixtures(self) -> None:
|
26
|
+
"""
|
27
|
+
Loads fixture data from the specified path.
|
28
|
+
|
29
|
+
This method reads fixture data from a JSON file located at the `fixtures_path`.
|
30
|
+
It populates the `fixtures` dictionary with the loaded data, where each fixture
|
31
|
+
is indexed by its external ID.
|
32
|
+
|
33
|
+
Returns:
|
34
|
+
None
|
35
|
+
"""
|
36
|
+
def _load_fixtures(self, fixtures_path: Path, order_shift: int = 0) -> None: ...
|
37
|
+
def iter_fixtures(self) -> Generator[FixtureData, None, None]: ...
|
38
|
+
def _process_object_data(self, data: dict[str, Any], model_fields: dict[str, FieldInfo], m2m_fields: dict[str, type[Model]]) -> dict[str, Any]: ...
|
39
|
+
|
40
|
+
class FixturesManager(BaseFixturesManager):
|
41
|
+
"""
|
42
|
+
Manager class for handling fixture data.
|
43
|
+
|
44
|
+
This class is responsible for loading, processing, and applying fixture data
|
45
|
+
to the database. It supports nested object construction, data processing,
|
46
|
+
and file fixture handling.
|
47
|
+
"""
|
48
|
+
def apply_file_fixtures(self) -> None:
|
49
|
+
"""
|
50
|
+
Applies file fixtures from the specified directory.
|
51
|
+
|
52
|
+
This method processes file fixtures located in the 'files' directory adjacent to the
|
53
|
+
`fixtures_path`. It iterates through each file, reads its content, and processes it
|
54
|
+
as a fixture. If the file fixture already exists in the database, it updates the
|
55
|
+
existing fixture; otherwise, it creates a new one.
|
56
|
+
|
57
|
+
Returns:
|
58
|
+
None
|
59
|
+
"""
|
60
|
+
def _apply_file_fixtures(self, file_dir: Path) -> None: ...
|
61
|
+
def _apply_file_fixtures_rec(self, nested_dir: Path, base_dir: Path) -> None: ...
|
62
|
+
def apply_fixtures(self) -> None:
|
63
|
+
"""
|
64
|
+
Applies all loaded fixtures to the database.
|
65
|
+
|
66
|
+
This method processes each fixture in the `fixtures` dictionary in the order
|
67
|
+
specified by their 'order' value. It calls the `process_fixture` method for
|
68
|
+
each fixture and then processes the data in the processing queue.
|
69
|
+
|
70
|
+
Returns:
|
71
|
+
None
|
72
|
+
"""
|
73
|
+
def _process_file_fixture(self, file_path: Path, file_key: str) -> None: ...
|
74
|
+
def _process_fixture(self, fixture: FixtureData) -> FixtureData | None:
|
75
|
+
"""
|
76
|
+
Processes a single fixture and adds it to the processing queue.
|
77
|
+
|
78
|
+
This method takes a fixture dictionary, checks if the fixture already exists in the database,
|
79
|
+
and either updates the existing fixture or creates a new one. It then adds the fixture data
|
80
|
+
to the processing queue for further processing.
|
81
|
+
|
82
|
+
Args:
|
83
|
+
fixture (dict[str, Any]): The fixture dictionary containing the external ID, class name,
|
84
|
+
and data of the fixture.
|
85
|
+
|
86
|
+
Returns:
|
87
|
+
None
|
88
|
+
"""
|
89
|
+
def _process_fixture_object_data(self, class_name: str, external_id: str, data: dict[str, Any]) -> None:
|
90
|
+
"""
|
91
|
+
Processes and saves fixture object data to the database.
|
92
|
+
|
93
|
+
This method takes the class name, external ID, and data dictionary of a fixture object,
|
94
|
+
processes the data according to the class schema, and saves the object to the database.
|
95
|
+
If the object already exists, it updates the existing object with the new data.
|
96
|
+
|
97
|
+
Args:
|
98
|
+
class_name (str): The name of the class to which the fixture object belongs.
|
99
|
+
external_id (str): The external ID of the fixture object.
|
100
|
+
data (dict[str, Any]): The data dictionary of the fixture object.
|
101
|
+
|
102
|
+
Returns:
|
103
|
+
None
|
104
|
+
"""
|
105
|
+
|
106
|
+
class AsyncFixturesManager(BaseFixturesManager):
|
107
|
+
"""
|
108
|
+
Manager class for handling fixture data asynchronously.
|
109
|
+
|
110
|
+
This class is responsible for loading, processing, and applying fixture data
|
111
|
+
to the database. It supports nested object construction, data processing,
|
112
|
+
and file fixture handling.
|
113
|
+
"""
|
114
|
+
async def apply_file_fixtures(self) -> None:
|
115
|
+
"""
|
116
|
+
Applies file fixtures from the specified directory.
|
117
|
+
|
118
|
+
This method processes file fixtures located in the 'files' directory adjacent to the
|
119
|
+
`fixtures_path`. It iterates through each file, reads its content, and processes it
|
120
|
+
as a fixture. If the file fixture already exists in the database, it updates the
|
121
|
+
existing fixture; otherwise, it creates a new one.
|
122
|
+
|
123
|
+
Returns:
|
124
|
+
None
|
125
|
+
"""
|
126
|
+
async def _apply_file_fixtures(self, file_dir: Path) -> None: ...
|
127
|
+
async def _apply_file_fixtures_rec(self, nested_dir: Path, base_dir: Path) -> None: ...
|
128
|
+
async def apply_fixtures(self) -> None:
|
129
|
+
"""
|
130
|
+
Applies all loaded fixtures to the database.
|
131
|
+
|
132
|
+
This method processes each fixture in the `fixtures` dictionary in the order
|
133
|
+
specified by their 'order' value. It calls the `process_fixture` method for
|
134
|
+
each fixture and then processes the data in the processing queue.
|
135
|
+
|
136
|
+
Returns:
|
137
|
+
None
|
138
|
+
"""
|
139
|
+
async def _process_file_fixture(self, file_path: Path, file_key: str) -> None: ...
|
140
|
+
async def _process_fixture(self, fixture: FixtureData) -> FixtureData | None:
|
141
|
+
"""
|
142
|
+
Processes a single fixture and adds it to the processing queue.
|
143
|
+
|
144
|
+
This method takes a fixture dictionary, checks if the fixture already exists in the database,
|
145
|
+
and either updates the existing fixture or creates a new one. It then adds the fixture data
|
146
|
+
to the processing queue for further processing.
|
147
|
+
|
148
|
+
Args:
|
149
|
+
fixture (dict[str, Any]): The fixture dictionary containing the external ID, class name,
|
150
|
+
and data of the fixture.
|
151
|
+
|
152
|
+
Returns:
|
153
|
+
None
|
154
|
+
"""
|
155
|
+
async def _process_fixture_object_data(self, class_name: str, external_id: str, data: dict[str, Any]) -> None:
|
156
|
+
"""
|
157
|
+
Processes and saves fixture object data to the database.
|
158
|
+
|
159
|
+
This method takes the class name, external ID, and data dictionary of a fixture object,
|
160
|
+
processes the data according to the class schema, and saves the object to the database.
|
161
|
+
If the object already exists, it updates the existing object with the new data.
|
162
|
+
|
163
|
+
Args:
|
164
|
+
class_name (str): The name of the class to which the fixture object belongs.
|
165
|
+
external_id (str): The external ID of the fixture object.
|
166
|
+
data (dict[str, Any]): The data dictionary of the fixture object.
|
167
|
+
|
168
|
+
Returns:
|
169
|
+
None
|
170
|
+
"""
|
Binary file
|
@@ -0,0 +1,9 @@
|
|
1
|
+
from amsdal_utils.models.data_models.reference import Reference
|
2
|
+
from types import GenericAlias
|
3
|
+
from typing import Any
|
4
|
+
|
5
|
+
def process_fixture_value(annotation: Any, value: Any) -> Any: ...
|
6
|
+
def _cast_value_to_type(value_type: type | GenericAlias, value: Any) -> Any: ...
|
7
|
+
def _is_optional(annotation: Any) -> bool: ...
|
8
|
+
def _resolve_type_from_optional(annotation: Any) -> Any: ...
|
9
|
+
def _construct_reference_value(class_name: str, object_id: Any) -> Reference: ...
|
Binary file
|