amsdal 0.3.3__cp311-cp311-macosx_10_9_universal2.whl → 0.5.29__cp311-cp311-macosx_10_9_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.
- amsdal/Third-Party Materials - AMSDAL Dependencies - License Notices.md +56 -2
- amsdal/__about__.py +1 -1
- amsdal/__init__.py +20 -0
- amsdal/__init__.pyi +9 -0
- amsdal/__migrations__/0000_initial.py +23 -190
- amsdal/__migrations__/0001_create_class_file.py +61 -0
- amsdal/__migrations__/0002_create_class_file.py +109 -0
- amsdal/__migrations__/0003_update_class_file.py +91 -0
- amsdal/__migrations__/0004_update_class_file.py +45 -0
- amsdal/cloud/__init__.cpython-311-darwin.so +0 -0
- amsdal/cloud/client.cpython-311-darwin.so +0 -0
- amsdal/cloud/constants.cpython-311-darwin.so +0 -0
- amsdal/cloud/enums.cpython-311-darwin.so +0 -0
- amsdal/cloud/models/__init__.cpython-311-darwin.so +0 -0
- amsdal/cloud/models/base.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/__init__.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/__init__.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/add_allowlist_ip.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/add_basic_auth.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/add_dependency.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/add_secret.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/base.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/create_deploy.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/create_env.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/create_session.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/delete_allowlist_ip.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/delete_basic_auth.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/delete_dependency.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/delete_env.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/delete_secret.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/destroy_deploy.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/expose_db.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/get_basic_auth_credentials.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/get_monitoring_info.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/list_dependencies.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/list_deploys.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/list_envs.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/list_secrets.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/manager.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/signup_action.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/actions/update_deploy.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/auth/__init__.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/auth/base.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/auth/credentials.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/auth/credentials.pyi +0 -1
- amsdal/cloud/services/auth/manager.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/auth/signup_service.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/auth/token.cpython-311-darwin.so +0 -0
- amsdal/cloud/services/auth/token.pyi +0 -1
- amsdal/configs/main.py +40 -20
- amsdal/configs/main.pyi +19 -18
- amsdal/contrib/__init__.cpython-311-darwin.so +0 -0
- amsdal/contrib/auth/errors.py +36 -0
- amsdal/contrib/auth/errors.pyi +12 -0
- amsdal/contrib/auth/fixtures/basic_permissions.json +64 -0
- amsdal/contrib/auth/lifecycle/consumer.py +13 -13
- amsdal/contrib/auth/lifecycle/consumer.pyi +3 -0
- amsdal/contrib/auth/migrations/0000_initial.py +69 -31
- amsdal/contrib/auth/migrations/0001_add_mfa_support.py +188 -0
- amsdal/contrib/auth/models/__init__.py +1 -0
- amsdal/contrib/auth/models/backup_code.py +85 -0
- amsdal/contrib/auth/models/email_mfa_device.py +108 -0
- amsdal/contrib/auth/models/login_session.py +235 -0
- amsdal/contrib/auth/models/mfa_device.py +86 -0
- amsdal/contrib/auth/models/permission.py +23 -0
- amsdal/contrib/auth/models/sms_device.py +113 -0
- amsdal/contrib/auth/models/totp_device.py +58 -0
- amsdal/contrib/auth/models/user.py +156 -0
- amsdal/contrib/auth/services/__init__.py +1 -0
- amsdal/contrib/auth/services/mfa_device_service.py +544 -0
- amsdal/contrib/auth/services/mfa_device_service.pyi +216 -0
- amsdal/contrib/auth/services/totp_service.py +358 -0
- amsdal/contrib/auth/services/totp_service.pyi +158 -0
- amsdal/contrib/auth/settings.py +8 -0
- amsdal/contrib/auth/settings.pyi +8 -0
- amsdal/contrib/auth/transactions/__init__.py +1 -0
- amsdal/contrib/auth/transactions/mfa_device_transactions.py +463 -0
- amsdal/contrib/auth/transactions/mfa_device_transactions.pyi +226 -0
- amsdal/contrib/auth/transactions/totp_transactions.py +206 -0
- amsdal/contrib/auth/transactions/totp_transactions.pyi +113 -0
- amsdal/contrib/auth/utils/__init__.py +0 -0
- amsdal/contrib/auth/utils/__init__.pyi +0 -0
- amsdal/contrib/auth/utils/mfa.py +257 -0
- amsdal/contrib/auth/utils/mfa.pyi +119 -0
- amsdal/contrib/frontend_configs/conversion/convert.py +85 -25
- 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 +167 -195
- amsdal/contrib/frontend_configs/migrations/0001_update_frontend_control_config.py +245 -0
- amsdal/contrib/frontend_configs/migrations/0002_add_button_and_invoke_actions.py +352 -0
- amsdal/contrib/frontend_configs/migrations/0003_create_class_frontendconfigdashboardelement.py +145 -0
- amsdal/contrib/frontend_configs/models/__init__.py +0 -0
- amsdal/contrib/frontend_configs/models/frontend_activator_config.py +22 -0
- amsdal/contrib/frontend_configs/models/frontend_config_async_validator.py +11 -0
- amsdal/contrib/frontend_configs/models/frontend_config_control_action.py +110 -0
- amsdal/contrib/frontend_configs/models/frontend_config_dashboard.py +51 -0
- amsdal/contrib/frontend_configs/models/frontend_config_group_validator.py +21 -0
- amsdal/contrib/frontend_configs/models/frontend_config_option.py +12 -0
- amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base.py +17 -0
- amsdal/contrib/frontend_configs/models/frontend_config_slider_option.py +13 -0
- amsdal/contrib/frontend_configs/models/frontend_config_text_mask.py +14 -0
- amsdal/contrib/frontend_configs/models/frontend_config_validator.py +28 -0
- amsdal/contrib/frontend_configs/models/frontend_control_config.py +110 -0
- amsdal/contrib/frontend_configs/models/frontend_model_config.py +14 -0
- amsdal/errors.py +0 -3
- amsdal/errors.pyi +0 -1
- amsdal/fixtures/__init__.cpython-311-darwin.so +0 -0
- amsdal/fixtures/manager.cpython-311-darwin.so +0 -0
- amsdal/fixtures/manager.pyi +73 -123
- amsdal/fixtures/utils.cpython-311-darwin.so +0 -0
- amsdal/fixtures/utils.pyi +9 -0
- amsdal/manager.cpython-311-darwin.so +0 -0
- amsdal/manager.pyi +9 -96
- amsdal/mixins/__init__.cpython-311-darwin.so +0 -0
- amsdal/mixins/class_versions_mixin.cpython-311-darwin.so +0 -0
- amsdal/models/__init__.py +19 -0
- amsdal/models/core/__init__.py +0 -0
- amsdal/models/core/class_object.py +38 -0
- amsdal/models/core/class_property.py +26 -0
- amsdal/models/core/file.py +243 -0
- amsdal/models/core/fixture.py +25 -0
- amsdal/models/core/option.py +11 -0
- amsdal/models/core/storage_metadata.py +15 -0
- amsdal/models/core/validator.py +12 -0
- amsdal/models/mixins.py +31 -0
- amsdal/models/types/__init__.py +0 -0
- amsdal/models/types/object.py +26 -0
- amsdal/queryset/__init__.py +21 -0
- amsdal/queryset/__init__.pyi +6 -0
- amsdal/schemas/core/class_object/model.json +20 -0
- amsdal/schemas/core/class_property/model.json +19 -0
- amsdal/schemas/core/file/properties/from_file.py +1 -1
- amsdal/schemas/core/file/properties/validate_data.py +3 -4
- amsdal/schemas/core/storage_metadata/model.json +52 -0
- amsdal/schemas/interfaces.py +25 -0
- amsdal/schemas/interfaces.pyi +20 -0
- amsdal/schemas/manager.cpython-311-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 +130 -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/utils.py +16 -0
- amsdal/schemas/utils.pyi +10 -0
- amsdal/services/__init__.py +11 -0
- amsdal/services/__init__.pyi +4 -0
- amsdal/services/external_connections.py +262 -0
- amsdal/services/external_connections.pyi +190 -0
- amsdal/services/external_model_generator.py +350 -0
- amsdal/services/external_model_generator.pyi +134 -0
- amsdal/services/transaction_execution.cpython-311-darwin.so +0 -0
- amsdal/services/transaction_execution.pyi +2 -1
- amsdal/storages/__init__.py +20 -0
- amsdal/storages/__init__.pyi +8 -0
- amsdal/storages/file_system.py +214 -0
- amsdal/storages/file_system.pyi +36 -0
- amsdal/transactions/__init__.py +13 -0
- amsdal/transactions/__init__.pyi +4 -0
- amsdal/utils/rollback/__init__.py +99 -54
- amsdal/utils/rollback/__init__.pyi +6 -0
- amsdal/utils/tests/enums.py +0 -2
- amsdal/utils/tests/helpers.py +253 -231
- amsdal/utils/tests/migrations.py +157 -0
- {amsdal-0.3.3.dist-info → amsdal-0.5.29.dist-info}/METADATA +17 -10
- amsdal-0.5.29.dist-info/RECORD +276 -0
- {amsdal-0.3.3.dist-info → amsdal-0.5.29.dist-info}/WHEEL +1 -1
- amsdal/__migrations__/0001_datetime_type.py +0 -18
- amsdal/__migrations__/0002_fixture_order.py +0 -40
- amsdal/__migrations__/0003_schema_type_in_class_meta.py +0 -56
- 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-311-darwin.so +0 -0
- amsdal/migration/base_migration_schemas.cpython-311-darwin.so +0 -0
- amsdal/migration/base_migration_schemas.pyi +0 -120
- amsdal/migration/data_classes.cpython-311-darwin.so +0 -0
- amsdal/migration/data_classes.pyi +0 -172
- amsdal/migration/executors/__init__.cpython-311-darwin.so +0 -0
- amsdal/migration/executors/base.cpython-311-darwin.so +0 -0
- amsdal/migration/executors/base.pyi +0 -118
- amsdal/migration/executors/default_executor.cpython-311-darwin.so +0 -0
- amsdal/migration/executors/default_executor.pyi +0 -184
- amsdal/migration/executors/state_executor.cpython-311-darwin.so +0 -0
- amsdal/migration/executors/state_executor.pyi +0 -78
- amsdal/migration/file_migration_executor.cpython-311-darwin.so +0 -0
- amsdal/migration/file_migration_executor.pyi +0 -68
- amsdal/migration/file_migration_generator.cpython-311-darwin.so +0 -0
- amsdal/migration/file_migration_generator.pyi +0 -139
- amsdal/migration/file_migration_store.cpython-311-darwin.so +0 -0
- amsdal/migration/file_migration_store.pyi +0 -61
- amsdal/migration/file_migration_writer.cpython-311-darwin.so +0 -0
- amsdal/migration/file_migration_writer.pyi +0 -73
- amsdal/migration/migrations.cpython-311-darwin.so +0 -0
- amsdal/migration/migrations.pyi +0 -166
- amsdal/migration/migrations_loader.cpython-311-darwin.so +0 -0
- amsdal/migration/migrations_loader.pyi +0 -32
- amsdal/migration/schemas_loaders.cpython-311-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-311-darwin.so +0 -0
- amsdal/migration/utils.pyi +0 -58
- amsdal/mixins/build_mixin.cpython-311-darwin.so +0 -0
- amsdal/mixins/build_mixin.pyi +0 -78
- amsdal/schemas/core/class_object_meta/model.json +0 -59
- amsdal/schemas/core/class_property_meta/model.json +0 -23
- amsdal/services/__init__.cpython-311-darwin.so +0 -0
- amsdal-0.3.3.dist-info/RECORD +0 -257
- amsdal-0.3.3.dist-info/licenses/LICENSE.txt +0 -107
- /amsdal/{migration → contrib/auth/services}/__init__.pyi +0 -0
- /amsdal/{migration/executors → contrib/auth/transactions}/__init__.pyi +0 -0
- {amsdal-0.3.3.dist-info → amsdal-0.5.29.dist-info/licenses}/LICENSE.txt +0 -0
- {amsdal-0.3.3.dist-info → amsdal-0.5.29.dist-info}/top_level.txt +0 -0
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
from amsdal.migration.data_classes import MigrateOperation as MigrateOperation, OperationTypes as OperationTypes
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
from typing import ClassVar
|
|
4
|
-
|
|
5
|
-
class FileMigrationWriter:
|
|
6
|
-
"""
|
|
7
|
-
Handles the writing of migration files.
|
|
8
|
-
|
|
9
|
-
Attributes:
|
|
10
|
-
template_path (Path): The path to the migration template file.
|
|
11
|
-
data_template_path (Path): The path to the data migration template file.
|
|
12
|
-
operation_name_map (ClassVar[dict[OperationTypes, str]]): A mapping of operation types to their
|
|
13
|
-
string representations.
|
|
14
|
-
"""
|
|
15
|
-
template_path: Path
|
|
16
|
-
data_template_path: Path
|
|
17
|
-
operation_name_map: ClassVar[dict[OperationTypes, str]]
|
|
18
|
-
@classmethod
|
|
19
|
-
def write(cls, file_path: Path, operations: list[MigrateOperation]) -> None:
|
|
20
|
-
"""
|
|
21
|
-
Writes the migration operations to a file.
|
|
22
|
-
|
|
23
|
-
Args:
|
|
24
|
-
file_path (Path): The path to the migration file.
|
|
25
|
-
operations (list[MigrateOperation]): The list of migration operations to write.
|
|
26
|
-
|
|
27
|
-
Returns:
|
|
28
|
-
None
|
|
29
|
-
"""
|
|
30
|
-
@classmethod
|
|
31
|
-
def write_data_migration(cls, file_path: Path) -> None:
|
|
32
|
-
"""
|
|
33
|
-
Writes a data migration to a file.
|
|
34
|
-
|
|
35
|
-
Args:
|
|
36
|
-
file_path (Path): The path to the data migration file.
|
|
37
|
-
|
|
38
|
-
Returns:
|
|
39
|
-
None
|
|
40
|
-
"""
|
|
41
|
-
@classmethod
|
|
42
|
-
def render(cls, operations: list[MigrateOperation]) -> str:
|
|
43
|
-
"""
|
|
44
|
-
Renders the migration operations into a string.
|
|
45
|
-
|
|
46
|
-
Args:
|
|
47
|
-
operations (list[MigrateOperation]): The list of migration operations to render.
|
|
48
|
-
|
|
49
|
-
Returns:
|
|
50
|
-
str: The rendered migration operations as a string.
|
|
51
|
-
"""
|
|
52
|
-
@classmethod
|
|
53
|
-
def render_operation(cls, operation: MigrateOperation) -> str:
|
|
54
|
-
"""
|
|
55
|
-
Renders a single migration operation into a string.
|
|
56
|
-
|
|
57
|
-
Args:
|
|
58
|
-
operation (MigrateOperation): The migration operation to render.
|
|
59
|
-
|
|
60
|
-
Returns:
|
|
61
|
-
str: The rendered migration operation as a string.
|
|
62
|
-
"""
|
|
63
|
-
@classmethod
|
|
64
|
-
def reformat(cls, content: str) -> str:
|
|
65
|
-
"""
|
|
66
|
-
Reformats the content using the Black formatter.
|
|
67
|
-
|
|
68
|
-
Args:
|
|
69
|
-
content (str): The content to reformat.
|
|
70
|
-
|
|
71
|
-
Returns:
|
|
72
|
-
str: The reformatted content.
|
|
73
|
-
"""
|
|
Binary file
|
amsdal/migration/migrations.pyi
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import abc
|
|
2
|
-
from _typeshed import Incomplete
|
|
3
|
-
from abc import ABC, abstractmethod
|
|
4
|
-
from amsdal.migration.base_migration_schemas import BaseMigrationSchemas as BaseMigrationSchemas, DefaultMigrationSchemas as DefaultMigrationSchemas
|
|
5
|
-
from amsdal.migration.executors.base import BaseMigrationExecutor as BaseMigrationExecutor
|
|
6
|
-
from amsdal_utils.models.enums import SchemaTypes as SchemaTypes
|
|
7
|
-
from collections.abc import Callable as Callable
|
|
8
|
-
from typing import Any
|
|
9
|
-
|
|
10
|
-
class Operation(ABC, metaclass=abc.ABCMeta):
|
|
11
|
-
@abstractmethod
|
|
12
|
-
def forward(self, executor: BaseMigrationExecutor) -> None: ...
|
|
13
|
-
@abstractmethod
|
|
14
|
-
def forward_schema(self, executor: BaseMigrationExecutor) -> None: ...
|
|
15
|
-
@abstractmethod
|
|
16
|
-
def backward(self, executor: BaseMigrationExecutor) -> None: ...
|
|
17
|
-
|
|
18
|
-
class SchemaOperation(Operation):
|
|
19
|
-
"""
|
|
20
|
-
Base class for schema operations.
|
|
21
|
-
|
|
22
|
-
Attributes:
|
|
23
|
-
forward_args (list[Any]): Arguments for the forward operation.
|
|
24
|
-
backward_args (list[Any]): Arguments for the backward operation.
|
|
25
|
-
forward_method_name (str): Name of the method to call for the forward operation.
|
|
26
|
-
backward_method_name (str): Name of the method to call for the backward operation.
|
|
27
|
-
"""
|
|
28
|
-
forward_args: list[Any]
|
|
29
|
-
backward_args: list[Any]
|
|
30
|
-
forward_method_name: str
|
|
31
|
-
backward_method_name: str
|
|
32
|
-
def forward(self, executor: BaseMigrationExecutor) -> None:
|
|
33
|
-
"""
|
|
34
|
-
Executes the forward operation.
|
|
35
|
-
|
|
36
|
-
Args:
|
|
37
|
-
executor (BaseMigrationExecutor): The executor responsible for running migrations.
|
|
38
|
-
|
|
39
|
-
Returns:
|
|
40
|
-
None
|
|
41
|
-
"""
|
|
42
|
-
def forward_schema(self, executor: BaseMigrationExecutor) -> None:
|
|
43
|
-
"""
|
|
44
|
-
Executes the forward schema operation.
|
|
45
|
-
|
|
46
|
-
Args:
|
|
47
|
-
executor (BaseMigrationExecutor): The executor responsible for running migrations.
|
|
48
|
-
|
|
49
|
-
Returns:
|
|
50
|
-
None
|
|
51
|
-
"""
|
|
52
|
-
def backward(self, executor: BaseMigrationExecutor) -> None:
|
|
53
|
-
"""
|
|
54
|
-
Executes the backward operation.
|
|
55
|
-
|
|
56
|
-
Args:
|
|
57
|
-
executor (BaseMigrationExecutor): The executor responsible for running migrations.
|
|
58
|
-
|
|
59
|
-
Returns:
|
|
60
|
-
None
|
|
61
|
-
"""
|
|
62
|
-
|
|
63
|
-
class CreateClass(SchemaOperation):
|
|
64
|
-
"""
|
|
65
|
-
Represents an operation to create a class schema.
|
|
66
|
-
|
|
67
|
-
Attributes:
|
|
68
|
-
forward_method_name (str): The name of the method to call for the forward operation.
|
|
69
|
-
backward_method_name (str): The name of the method to call for the backward operation.
|
|
70
|
-
forward_args (list[Any]): Arguments for the forward operation.
|
|
71
|
-
backward_args (list[Any]): Arguments for the backward operation.
|
|
72
|
-
"""
|
|
73
|
-
forward_method_name: str
|
|
74
|
-
backward_method_name: str
|
|
75
|
-
forward_args: Incomplete
|
|
76
|
-
backward_args: Incomplete
|
|
77
|
-
def __init__(self, class_name: str, new_schema: dict[str, Any], schema_type: SchemaTypes) -> None: ...
|
|
78
|
-
|
|
79
|
-
class UpdateClass(SchemaOperation):
|
|
80
|
-
"""
|
|
81
|
-
Represents an operation to update a class schema.
|
|
82
|
-
|
|
83
|
-
Attributes:
|
|
84
|
-
forward_method_name (str): The name of the method to call for the forward operation.
|
|
85
|
-
backward_method_name (str): The name of the method to call for the backward operation.
|
|
86
|
-
forward_args (list[Any]): Arguments for the forward operation.
|
|
87
|
-
backward_args (list[Any]): Arguments for the backward operation.
|
|
88
|
-
"""
|
|
89
|
-
forward_method_name: str
|
|
90
|
-
backward_method_name: str
|
|
91
|
-
forward_args: Incomplete
|
|
92
|
-
backward_args: Incomplete
|
|
93
|
-
def __init__(self, class_name: str, old_schema: dict[str, Any], new_schema: dict[str, Any], schema_type: SchemaTypes) -> None: ...
|
|
94
|
-
|
|
95
|
-
class DeleteClass(SchemaOperation):
|
|
96
|
-
"""
|
|
97
|
-
Represents an operation to delete a class schema.
|
|
98
|
-
|
|
99
|
-
Attributes:
|
|
100
|
-
forward_method_name (str): The name of the method to call for the forward operation.
|
|
101
|
-
backward_method_name (str): The name of the method to call for the backward operation.
|
|
102
|
-
forward_args (list[Any]): Arguments for the forward operation.
|
|
103
|
-
backward_args (list[Any]): Arguments for the backward operation.
|
|
104
|
-
"""
|
|
105
|
-
forward_method_name: str
|
|
106
|
-
backward_method_name: str
|
|
107
|
-
forward_args: Incomplete
|
|
108
|
-
backward_args: Incomplete
|
|
109
|
-
def __init__(self, class_name: str, old_schema: dict[str, Any], schema_type: SchemaTypes) -> None: ...
|
|
110
|
-
|
|
111
|
-
class MigrationSchemas(DefaultMigrationSchemas): ...
|
|
112
|
-
|
|
113
|
-
class MigrateData(Operation):
|
|
114
|
-
"""
|
|
115
|
-
Represents a data migration operation.
|
|
116
|
-
|
|
117
|
-
Attributes:
|
|
118
|
-
forward_migration (Callable[[MigrationSchemas \\| BaseMigrationSchemas], None]): The function to call for
|
|
119
|
-
the forward migration.
|
|
120
|
-
backward_migration (Callable[[MigrationSchemas \\| BaseMigrationSchemas], None]): The function to call for
|
|
121
|
-
the backward migration.
|
|
122
|
-
"""
|
|
123
|
-
@staticmethod
|
|
124
|
-
def noop(schemas: MigrationSchemas) -> None: ...
|
|
125
|
-
forward_migration: Incomplete
|
|
126
|
-
backward_migration: Incomplete
|
|
127
|
-
def __init__(self, forward_migration: Callable[[MigrationSchemas | BaseMigrationSchemas], None], backward_migration: Callable[[MigrationSchemas | BaseMigrationSchemas], None]) -> None: ...
|
|
128
|
-
def forward(self, executor: BaseMigrationExecutor) -> None:
|
|
129
|
-
"""
|
|
130
|
-
Executes the forward data migration.
|
|
131
|
-
|
|
132
|
-
Args:
|
|
133
|
-
executor (BaseMigrationExecutor): The executor responsible for running migrations.
|
|
134
|
-
|
|
135
|
-
Returns:
|
|
136
|
-
None
|
|
137
|
-
"""
|
|
138
|
-
def backward(self, executor: BaseMigrationExecutor) -> None:
|
|
139
|
-
"""
|
|
140
|
-
Executes the backward data migration.
|
|
141
|
-
|
|
142
|
-
Args:
|
|
143
|
-
executor (BaseMigrationExecutor): The executor responsible for running migrations.
|
|
144
|
-
|
|
145
|
-
Returns:
|
|
146
|
-
None
|
|
147
|
-
"""
|
|
148
|
-
def forward_schema(self, executor: BaseMigrationExecutor) -> None:
|
|
149
|
-
"""
|
|
150
|
-
No-op for forward schema in data migration.
|
|
151
|
-
|
|
152
|
-
Args:
|
|
153
|
-
executor (BaseMigrationExecutor): The executor responsible for running migrations.
|
|
154
|
-
|
|
155
|
-
Returns:
|
|
156
|
-
None
|
|
157
|
-
"""
|
|
158
|
-
|
|
159
|
-
class Migration:
|
|
160
|
-
"""
|
|
161
|
-
Represents a collection of migration operations.
|
|
162
|
-
|
|
163
|
-
Attributes:
|
|
164
|
-
operations (list[Operation]): The list of migration operations.
|
|
165
|
-
"""
|
|
166
|
-
operations: list[Operation]
|
|
Binary file
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from _typeshed import Incomplete
|
|
2
|
-
from amsdal.migration.data_classes import MigrationFile as MigrationFile, ModuleTypes as ModuleTypes
|
|
3
|
-
from collections.abc import Iterator
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
|
|
6
|
-
class MigrationsLoader:
|
|
7
|
-
"""
|
|
8
|
-
Loads and manages migration files from a specified directory.
|
|
9
|
-
"""
|
|
10
|
-
_migrations_path: Incomplete
|
|
11
|
-
_module_type: Incomplete
|
|
12
|
-
_module_name: Incomplete
|
|
13
|
-
_migrations_files: Incomplete
|
|
14
|
-
def __init__(self, migrations_dir: Path, module_type: ModuleTypes, module_name: str | None = None) -> None: ...
|
|
15
|
-
@property
|
|
16
|
-
def has_initial_migration(self) -> bool:
|
|
17
|
-
"""
|
|
18
|
-
Checks if there is an initial migration file.
|
|
19
|
-
|
|
20
|
-
Returns:
|
|
21
|
-
bool: True if there is an initial migration file, False otherwise.
|
|
22
|
-
"""
|
|
23
|
-
@property
|
|
24
|
-
def last_migration_number(self) -> int:
|
|
25
|
-
"""
|
|
26
|
-
Gets the number of the last migration file.
|
|
27
|
-
|
|
28
|
-
Returns:
|
|
29
|
-
int: The number of the last migration file, or -1 if there are no migration files.
|
|
30
|
-
"""
|
|
31
|
-
def __iter__(self) -> Iterator[MigrationFile]: ...
|
|
32
|
-
def _load_migration_files(self) -> None: ...
|
|
Binary file
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import abc
|
|
2
|
-
from _typeshed import Incomplete
|
|
3
|
-
from abc import ABC, abstractmethod
|
|
4
|
-
from amsdal.configs.constants import CORE_SCHEMAS_PATH as CORE_SCHEMAS_PATH, TYPE_SCHEMAS_PATH as TYPE_SCHEMAS_PATH
|
|
5
|
-
from amsdal.configs.main import settings as settings
|
|
6
|
-
from amsdal.migration.data_classes import ClassSchema as ClassSchema, ModuleTypes as ModuleTypes
|
|
7
|
-
from amsdal_models.schemas.mixins.enrich_schemas_mixin import EnrichSchemasMixin
|
|
8
|
-
from amsdal_utils.models.data_models.schema import ObjectSchema as ObjectSchema
|
|
9
|
-
from collections.abc import Iterator
|
|
10
|
-
from pathlib import Path
|
|
11
|
-
|
|
12
|
-
class BaseClassSchemaLoader(ABC, metaclass=abc.ABCMeta):
|
|
13
|
-
@abstractmethod
|
|
14
|
-
def iter_app_schemas(self) -> Iterator[ClassSchema]: ...
|
|
15
|
-
|
|
16
|
-
class JsonClassSchemaLoader(EnrichSchemasMixin, BaseClassSchemaLoader):
|
|
17
|
-
"""
|
|
18
|
-
Loads and enriches JSON class schemas from a specified root path.
|
|
19
|
-
|
|
20
|
-
Attributes:
|
|
21
|
-
schemas_root_path (Path): The root path to the JSON schemas.
|
|
22
|
-
module_type (ModuleTypes): The type of the module for the schemas.
|
|
23
|
-
"""
|
|
24
|
-
schemas_root_path: Incomplete
|
|
25
|
-
module_type: Incomplete
|
|
26
|
-
def __init__(self, schemas_root_path: Path, module_type: ModuleTypes = ...) -> None: ...
|
|
27
|
-
def iter_app_schemas(self) -> Iterator[ClassSchema]:
|
|
28
|
-
"""
|
|
29
|
-
Iterates over the application schemas.
|
|
30
|
-
|
|
31
|
-
Yields:
|
|
32
|
-
ClassSchema: The next class schema in the iteration.
|
|
33
|
-
"""
|
|
34
|
-
def _enriched_user_schemas(self) -> list[ObjectSchema]: ...
|
|
35
|
-
@staticmethod
|
|
36
|
-
def _load_schemas(schemas_path: Path) -> list[ObjectSchema]: ...
|
|
37
|
-
def _load_contrib_schemas(self) -> list[ObjectSchema]: ...
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
from amsdal.migration import migrations
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def forward_migration(schemas: migrations.MigrationSchemas) -> None:
|
|
5
|
-
...
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def backward_migration(schemas: migrations.MigrationSchemas) -> None:
|
|
9
|
-
...
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class Migration(migrations.Migration):
|
|
13
|
-
operations: list[migrations.Operation] = [
|
|
14
|
-
migrations.MigrateData(
|
|
15
|
-
forward_migration=forward_migration,
|
|
16
|
-
backward_migration=backward_migration,
|
|
17
|
-
),
|
|
18
|
-
]
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
|
-
from datetime import date
|
|
3
|
-
|
|
4
|
-
from typing import ClassVar
|
|
5
|
-
from typing import Optional
|
|
6
|
-
from typing import Union
|
|
7
|
-
from typing import List
|
|
8
|
-
from typing import Dict
|
|
9
|
-
from typing import Any
|
|
10
|
-
|
|
11
|
-
from amsdal_models.classes.builder.validators.dict_validators import validate_non_empty_keys
|
|
12
|
-
from amsdal_models.classes.builder.validators.options_validators import validate_options
|
|
13
|
-
from amsdal_models.classes.model import LegacyModel
|
|
14
|
-
from amsdal_models.classes.model import Model
|
|
15
|
-
from amsdal_models.classes.model import TypeModel
|
|
16
|
-
from amsdal_utils.models.data_models.reference import Reference
|
|
17
|
-
from amsdal_utils.models.enums import SchemaTypes
|
|
18
|
-
from pydantic.functional_validators import field_validator
|
|
19
|
-
|
|
20
|
-
{{imports}}
|
|
21
|
-
|
|
22
|
-
{{classes}}
|
|
23
|
-
|
|
24
|
-
{{classes_model_rebuild}}
|
|
Binary file
|
amsdal/migration/utils.pyi
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
from _typeshed import Incomplete
|
|
2
|
-
from amsdal.migration.data_classes import ModuleTypes as ModuleTypes
|
|
3
|
-
from amsdal.schemas.manager import SchemaManager as SchemaManager
|
|
4
|
-
from amsdal_models.classes.model import Model
|
|
5
|
-
from amsdal_utils.models.data_models.core import DictSchema, LegacyDictSchema, TypeData as TypeData
|
|
6
|
-
from amsdal_utils.models.data_models.schema import ObjectSchema as ObjectSchema, PropertyData as PropertyData
|
|
7
|
-
from amsdal_utils.models.data_models.table_schema import ArraySchemaModel, DictSchemaModel, JsonSchemaModel, NestedSchemaModel, TableColumnSchema, TableSchema
|
|
8
|
-
from amsdal_utils.models.enums import SchemaTypes
|
|
9
|
-
from pathlib import Path
|
|
10
|
-
|
|
11
|
-
reference_schema: Incomplete
|
|
12
|
-
|
|
13
|
-
def object_schema_to_table_schema(object_schema: ObjectSchema) -> TableSchema:
|
|
14
|
-
"""
|
|
15
|
-
Converts an ObjectSchema to a TableSchema.
|
|
16
|
-
|
|
17
|
-
Args:
|
|
18
|
-
object_schema (ObjectSchema): The object schema to convert.
|
|
19
|
-
|
|
20
|
-
Returns:
|
|
21
|
-
TableSchema: The converted table schema.
|
|
22
|
-
"""
|
|
23
|
-
def _process_properties(properties: dict[str, PropertyData] | None, required: list[str]) -> list[TableColumnSchema]: ...
|
|
24
|
-
def _process_property_type(property_type: str, items: TypeData | DictSchema | LegacyDictSchema | None = None, context: dict[str, type | Model | NestedSchemaModel] | None = None) -> type | NestedSchemaModel | ArraySchemaModel | DictSchemaModel | type[JsonSchemaModel]: ...
|
|
25
|
-
def schema_to_nested_column_schema(schema: ObjectSchema, context: dict[str, type | Model | NestedSchemaModel]) -> NestedSchemaModel | type:
|
|
26
|
-
"""
|
|
27
|
-
Converts an ObjectSchema to a NestedSchemaModel or type.
|
|
28
|
-
|
|
29
|
-
Args:
|
|
30
|
-
schema (ObjectSchema): The schema to convert.
|
|
31
|
-
context (dict[str, type | Model | NestedSchemaModel]): The context for the conversion.
|
|
32
|
-
|
|
33
|
-
Returns:
|
|
34
|
-
NestedSchemaModel | type: The converted nested schema model or type.
|
|
35
|
-
"""
|
|
36
|
-
def contrib_to_module_root_path(contrib: str) -> Path:
|
|
37
|
-
"""
|
|
38
|
-
Converts a contrib string to the root path of the module.
|
|
39
|
-
|
|
40
|
-
Args:
|
|
41
|
-
contrib (str): The contrib string to convert.
|
|
42
|
-
|
|
43
|
-
Returns:
|
|
44
|
-
Path: The root path of the module.
|
|
45
|
-
"""
|
|
46
|
-
def map_module_type_to_schema_type(module_type: ModuleTypes) -> SchemaTypes:
|
|
47
|
-
"""
|
|
48
|
-
Maps a ModuleTypes value to a SchemaTypes value.
|
|
49
|
-
|
|
50
|
-
Args:
|
|
51
|
-
module_type (ModuleTypes): The module type to map.
|
|
52
|
-
|
|
53
|
-
Returns:
|
|
54
|
-
SchemaTypes: The corresponding schema type.
|
|
55
|
-
|
|
56
|
-
Raises:
|
|
57
|
-
ValueError: If the module type is unknown.
|
|
58
|
-
"""
|
|
Binary file
|
amsdal/mixins/build_mixin.pyi
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
from _typeshed import Incomplete
|
|
2
|
-
from amsdal.configs.constants import CORE_SCHEMAS_PATH as CORE_SCHEMAS_PATH, TYPE_SCHEMAS_PATH as TYPE_SCHEMAS_PATH
|
|
3
|
-
from amsdal.configs.main import settings as settings
|
|
4
|
-
from amsdal_models.schemas.loaders.cli_fixtures_loader import CliFixturesLoader
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
class CliMultiFixturesLoader(CliFixturesLoader):
|
|
8
|
-
"""
|
|
9
|
-
Loads multiple fixtures from specified schema directories.
|
|
10
|
-
|
|
11
|
-
Attributes:
|
|
12
|
-
models_with_fixtures (list[tuple[Path, ObjectSchema]]): List of tuples containing the path and object schema
|
|
13
|
-
of models with fixtures.
|
|
14
|
-
"""
|
|
15
|
-
models_with_fixtures: Incomplete
|
|
16
|
-
def __init__(self, schema_dirs: list[Path]) -> None: ...
|
|
17
|
-
|
|
18
|
-
class BuildMixin:
|
|
19
|
-
"""
|
|
20
|
-
Provides methods to build models, transactions, static files, migrations, and fixtures for a CLI application.
|
|
21
|
-
"""
|
|
22
|
-
@classmethod
|
|
23
|
-
def build_models(cls, user_schemas_path: Path) -> None:
|
|
24
|
-
"""
|
|
25
|
-
Builds models from the specified user schemas path and predefined schema directories.
|
|
26
|
-
|
|
27
|
-
Args:
|
|
28
|
-
user_schemas_path (Path): The path to the user schemas directory.
|
|
29
|
-
|
|
30
|
-
Returns:
|
|
31
|
-
None
|
|
32
|
-
"""
|
|
33
|
-
@staticmethod
|
|
34
|
-
def build_transactions(cli_app_path: Path) -> None:
|
|
35
|
-
"""
|
|
36
|
-
Builds transactions from the specified CLI application path.
|
|
37
|
-
|
|
38
|
-
Args:
|
|
39
|
-
cli_app_path (Path): The path to the CLI application directory.
|
|
40
|
-
|
|
41
|
-
Returns:
|
|
42
|
-
None
|
|
43
|
-
"""
|
|
44
|
-
@staticmethod
|
|
45
|
-
def build_static_files(cli_app_path: Path) -> None:
|
|
46
|
-
"""
|
|
47
|
-
Builds static files from the specified CLI application path.
|
|
48
|
-
|
|
49
|
-
Args:
|
|
50
|
-
cli_app_path (Path): The path to the CLI application directory.
|
|
51
|
-
|
|
52
|
-
Returns:
|
|
53
|
-
None
|
|
54
|
-
"""
|
|
55
|
-
@staticmethod
|
|
56
|
-
def build_migrations(cli_app_path: Path) -> None:
|
|
57
|
-
"""
|
|
58
|
-
Builds migrations from the specified CLI application path.
|
|
59
|
-
|
|
60
|
-
Args:
|
|
61
|
-
cli_app_path (Path): The path to the CLI application directory.
|
|
62
|
-
|
|
63
|
-
Returns:
|
|
64
|
-
None
|
|
65
|
-
"""
|
|
66
|
-
@staticmethod
|
|
67
|
-
def build_fixtures(cli_app_path: Path) -> None:
|
|
68
|
-
"""
|
|
69
|
-
Builds fixtures from the specified CLI application path.
|
|
70
|
-
|
|
71
|
-
Args:
|
|
72
|
-
cli_app_path (Path): The path to the CLI application directory.
|
|
73
|
-
|
|
74
|
-
Returns:
|
|
75
|
-
None
|
|
76
|
-
"""
|
|
77
|
-
@staticmethod
|
|
78
|
-
def _reimport_models() -> None: ...
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "ClassObjectMeta",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"title": {
|
|
6
|
-
"title": "Title",
|
|
7
|
-
"type": "string"
|
|
8
|
-
},
|
|
9
|
-
"type": {
|
|
10
|
-
"title": "Type",
|
|
11
|
-
"type": "string"
|
|
12
|
-
},
|
|
13
|
-
"default": {
|
|
14
|
-
"title": "Default",
|
|
15
|
-
"type": "anything"
|
|
16
|
-
},
|
|
17
|
-
"class_schema_type": {
|
|
18
|
-
"title": "Schema Type",
|
|
19
|
-
"type": "string"
|
|
20
|
-
},
|
|
21
|
-
"properties": {
|
|
22
|
-
"title": "Properties",
|
|
23
|
-
"type": "dictionary",
|
|
24
|
-
"items": {
|
|
25
|
-
"key": {
|
|
26
|
-
"type": "string"
|
|
27
|
-
},
|
|
28
|
-
"value": {
|
|
29
|
-
"type": "ClassPropertyMeta"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"indexed": {
|
|
34
|
-
"title": "Indexed",
|
|
35
|
-
"type": "array",
|
|
36
|
-
"items": {
|
|
37
|
-
"type": "string"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"unique": {
|
|
41
|
-
"title": "Unique Fields",
|
|
42
|
-
"type": "array",
|
|
43
|
-
"items": {
|
|
44
|
-
"type": "array",
|
|
45
|
-
"items": {
|
|
46
|
-
"type": "string"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"custom_code": {
|
|
51
|
-
"title": "Custom Code",
|
|
52
|
-
"type": "string"
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"required": [
|
|
56
|
-
"title",
|
|
57
|
-
"type"
|
|
58
|
-
]
|
|
59
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "ClassPropertyMeta",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"title": {
|
|
6
|
-
"title": "Title",
|
|
7
|
-
"type": "string"
|
|
8
|
-
},
|
|
9
|
-
"default": {
|
|
10
|
-
"title": "Default",
|
|
11
|
-
"type": "anything"
|
|
12
|
-
},
|
|
13
|
-
"options": {
|
|
14
|
-
"title": "Options",
|
|
15
|
-
"type": "array",
|
|
16
|
-
"items": {
|
|
17
|
-
"type": "Option"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"required": [],
|
|
22
|
-
"meta_class": "TypeMeta"
|
|
23
|
-
}
|
|
Binary file
|