amsdal 0.0.40__cp311-cp311-macosx_10_9_universal2.whl → 0.1.0__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.

Potentially problematic release.


This version of amsdal might be problematic. Click here for more details.

Files changed (121) hide show
  1. amsdal/__about__.py +1 -1
  2. amsdal/cloud/__init__.cpython-311-darwin.so +0 -0
  3. amsdal/cloud/client.cpython-311-darwin.so +0 -0
  4. amsdal/cloud/constants.cpython-311-darwin.so +0 -0
  5. amsdal/cloud/enums.cpython-311-darwin.so +0 -0
  6. amsdal/cloud/models/__init__.cpython-311-darwin.so +0 -0
  7. amsdal/cloud/models/base.cpython-311-darwin.so +0 -0
  8. amsdal/cloud/services/__init__.cpython-311-darwin.so +0 -0
  9. amsdal/cloud/services/actions/__init__.cpython-311-darwin.so +0 -0
  10. amsdal/cloud/services/actions/add_dependency.cpython-311-darwin.so +0 -0
  11. amsdal/cloud/services/actions/add_secret.cpython-311-darwin.so +0 -0
  12. amsdal/cloud/services/actions/base.cpython-311-darwin.so +0 -0
  13. amsdal/cloud/services/actions/create_deploy.cpython-311-darwin.so +0 -0
  14. amsdal/cloud/services/actions/create_session.cpython-311-darwin.so +0 -0
  15. amsdal/cloud/services/actions/delete_dependency.cpython-311-darwin.so +0 -0
  16. amsdal/cloud/services/actions/delete_secret.cpython-311-darwin.so +0 -0
  17. amsdal/cloud/services/actions/destroy_deploy.cpython-311-darwin.so +0 -0
  18. amsdal/cloud/services/actions/expose_db.cpython-311-darwin.so +0 -0
  19. amsdal/cloud/services/actions/list_dependencies.cpython-311-darwin.so +0 -0
  20. amsdal/cloud/services/actions/list_deploys.cpython-311-darwin.so +0 -0
  21. amsdal/cloud/services/actions/list_secrets.cpython-311-darwin.so +0 -0
  22. amsdal/cloud/services/actions/manager.cpython-311-darwin.so +0 -0
  23. amsdal/cloud/services/actions/signup_action.cpython-311-darwin.so +0 -0
  24. amsdal/cloud/services/actions/update_deploy.cpython-311-darwin.so +0 -0
  25. amsdal/cloud/services/auth/__init__.cpython-311-darwin.so +0 -0
  26. amsdal/cloud/services/auth/base.cpython-311-darwin.so +0 -0
  27. amsdal/cloud/services/auth/credentials.cpython-311-darwin.so +0 -0
  28. amsdal/cloud/services/auth/manager.cpython-311-darwin.so +0 -0
  29. amsdal/cloud/services/auth/signup_service.cpython-311-darwin.so +0 -0
  30. amsdal/cloud/services/auth/token.cpython-311-darwin.so +0 -0
  31. amsdal/configs/constants.py +2 -0
  32. amsdal/configs/constants.pyi +1 -0
  33. amsdal/configs/main.py +6 -0
  34. amsdal/configs/main.pyi +3 -0
  35. amsdal/contrib/__init__.cpython-311-darwin.so +0 -0
  36. amsdal/contrib/frontend_configs/conversion/convert.py +19 -9
  37. amsdal/contrib/frontend_configs/conversion/convert.pyi +2 -2
  38. amsdal/fixtures/__init__.cpython-311-darwin.so +0 -0
  39. amsdal/fixtures/manager.cpython-311-darwin.so +0 -0
  40. amsdal/manager.cpython-311-darwin.so +0 -0
  41. amsdal/manager.pyi +9 -3
  42. amsdal/migration/__init__.cpython-311-darwin.so +0 -0
  43. amsdal/migration/base_migration_schemas.cpython-311-darwin.so +0 -0
  44. amsdal/migration/base_migration_schemas.pyi +44 -0
  45. amsdal/migration/data_classes.cpython-311-darwin.so +0 -0
  46. amsdal/migration/data_classes.pyi +78 -0
  47. amsdal/migration/executors/__init__.cpython-311-darwin.so +0 -0
  48. amsdal/migration/executors/base.cpython-311-darwin.so +0 -0
  49. amsdal/migration/executors/base.pyi +21 -0
  50. amsdal/migration/executors/default_executor.cpython-311-darwin.so +0 -0
  51. amsdal/migration/executors/default_executor.pyi +20 -0
  52. amsdal/migration/executors/state_executor.cpython-311-darwin.so +0 -0
  53. amsdal/migration/executors/state_executor.pyi +14 -0
  54. amsdal/migration/file_migration_executor.cpython-311-darwin.so +0 -0
  55. amsdal/migration/file_migration_executor.pyi +35 -0
  56. amsdal/migration/file_migration_generator.cpython-311-darwin.so +0 -0
  57. amsdal/migration/file_migration_generator.pyi +49 -0
  58. amsdal/migration/file_migration_store.cpython-311-darwin.so +0 -0
  59. amsdal/migration/file_migration_store.pyi +33 -0
  60. amsdal/migration/file_migration_writer.cpython-311-darwin.so +0 -0
  61. amsdal/migration/file_migration_writer.pyi +18 -0
  62. amsdal/migration/migrations.cpython-311-darwin.so +0 -0
  63. amsdal/migration/migrations.pyi +57 -0
  64. amsdal/migration/migrations_loader.cpython-311-darwin.so +0 -0
  65. amsdal/migration/migrations_loader.pyi +17 -0
  66. amsdal/migration/schemas_loaders.cpython-311-darwin.so +0 -0
  67. amsdal/migration/schemas_loaders.pyi +24 -0
  68. amsdal/migration/utils.cpython-311-darwin.so +0 -0
  69. amsdal/migration/utils.pyi +5 -0
  70. amsdal/mixins/__init__.cpython-311-darwin.so +0 -0
  71. amsdal/mixins/build_mixin.cpython-311-darwin.so +0 -0
  72. amsdal/mixins/build_mixin.pyi +2 -0
  73. amsdal/mixins/class_versions_mixin.cpython-311-darwin.so +0 -0
  74. amsdal/mixins/class_versions_mixin.pyi +1 -1
  75. amsdal/operations/__init__.cpython-311-darwin.so +0 -0
  76. amsdal/operations/manager.cpython-311-darwin.so +0 -0
  77. amsdal/operations/manager.pyi +3 -1
  78. amsdal/schemas/core/class_object/model.json +5 -58
  79. amsdal/schemas/core/class_object_meta/model.json +55 -0
  80. amsdal/schemas/core/class_property/model.json +0 -19
  81. amsdal/schemas/core/class_property_meta/model.json +23 -0
  82. amsdal/schemas/manager.cpython-311-darwin.so +0 -0
  83. amsdal/schemas/manager.py +15 -4
  84. amsdal/schemas/manager.pyi +2 -0
  85. amsdal/schemas/types/object/model.json +12 -2
  86. amsdal/services/__init__.cpython-311-darwin.so +0 -0
  87. amsdal/services/transaction_execution.cpython-311-darwin.so +0 -0
  88. {amsdal-0.0.40.dist-info → amsdal-0.1.0.dist-info}/METADATA +14 -14
  89. {amsdal-0.0.40.dist-info → amsdal-0.1.0.dist-info}/RECORD +93 -94
  90. amsdal/contrib/auth/models/__init__.py +0 -0
  91. amsdal/contrib/auth/models/login_session/hooks/pre_init.py +0 -51
  92. amsdal/contrib/auth/models/login_session/model.json +0 -23
  93. amsdal/contrib/auth/models/login_session/modifiers/display_name.py +0 -3
  94. amsdal/contrib/auth/models/permission/fixtures/basic_permissions.json +0 -62
  95. amsdal/contrib/auth/models/permission/model.json +0 -18
  96. amsdal/contrib/auth/models/permission/modifiers/display_name.py +0 -3
  97. amsdal/contrib/auth/models/user/hooks/pre_create.py +0 -2
  98. amsdal/contrib/auth/models/user/hooks/pre_init.py +0 -25
  99. amsdal/contrib/auth/models/user/model.json +0 -25
  100. amsdal/contrib/auth/models/user/modifiers/display_name.py +0 -3
  101. amsdal/contrib/frontend_configs/models/__init__.py +0 -0
  102. amsdal/contrib/frontend_configs/models/__init__.pyi +0 -0
  103. amsdal/contrib/frontend_configs/models/frontend_activator_config/model.json +0 -11
  104. amsdal/contrib/frontend_configs/models/frontend_config_async_validator/model.json +0 -11
  105. amsdal/contrib/frontend_configs/models/frontend_config_group_validator/model.json +0 -52
  106. amsdal/contrib/frontend_configs/models/frontend_config_option/model.json +0 -15
  107. amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base/model.json +0 -6
  108. amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base/properties/model_dump.py +0 -13
  109. amsdal/contrib/frontend_configs/models/frontend_config_slider_option/model.json +0 -19
  110. amsdal/contrib/frontend_configs/models/frontend_config_text_mask/model.json +0 -26
  111. amsdal/contrib/frontend_configs/models/frontend_config_validator/model.json +0 -41
  112. amsdal/contrib/frontend_configs/models/frontend_control_config/model.json +0 -250
  113. amsdal/contrib/frontend_configs/models/frontend_model_config/model.json +0 -17
  114. amsdal/contrib/frontend_configs/models/frontent_config_control_action/model.json +0 -54
  115. amsdal/contrib/frontend_configs/models/frontent_config_control_action/properties/action_validate.py +0 -17
  116. amsdal/migration/manager.cpython-311-darwin.so +0 -0
  117. amsdal/migration/manager.pyi +0 -20
  118. /amsdal/{contrib/auth/models → migration/executors}/__init__.pyi +0 -0
  119. {amsdal-0.0.40.dist-info → amsdal-0.1.0.dist-info}/LICENSE.txt +0 -0
  120. {amsdal-0.0.40.dist-info → amsdal-0.1.0.dist-info}/WHEEL +0 -0
  121. {amsdal-0.0.40.dist-info → amsdal-0.1.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,18 @@
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
+ template_path: Path
7
+ data_template_path: Path
8
+ operation_name_map: ClassVar[dict[OperationTypes, str]]
9
+ @classmethod
10
+ def write(cls, file_path: Path, operations: list[MigrateOperation]) -> None: ...
11
+ @classmethod
12
+ def write_data_migration(cls, file_path: Path) -> None: ...
13
+ @classmethod
14
+ def render(cls, operations: list[MigrateOperation]) -> str: ...
15
+ @classmethod
16
+ def render_operation(cls, operation: MigrateOperation) -> str: ...
17
+ @classmethod
18
+ def reformat(cls, content: str) -> str: ...
@@ -0,0 +1,57 @@
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 backward(self, executor: BaseMigrationExecutor) -> None: ...
15
+
16
+ class SchemaOperation(Operation):
17
+ forward_args: list[Any]
18
+ backward_args: list[Any]
19
+ forward_method_name: str
20
+ backward_method_name: str
21
+ def forward(self, executor: BaseMigrationExecutor) -> None: ...
22
+ def backward(self, executor: BaseMigrationExecutor) -> None: ...
23
+
24
+ class CreateClass(SchemaOperation):
25
+ forward_method_name: str
26
+ backward_method_name: str
27
+ forward_args: Incomplete
28
+ backward_args: Incomplete
29
+ def __init__(self, class_name: str, new_schema: dict[str, Any], schema_type: SchemaTypes) -> None: ...
30
+
31
+ class UpdateClass(SchemaOperation):
32
+ forward_method_name: str
33
+ backward_method_name: str
34
+ forward_args: Incomplete
35
+ backward_args: Incomplete
36
+ def __init__(self, class_name: str, old_schema: dict[str, Any], new_schema: dict[str, Any], schema_type: SchemaTypes) -> None: ...
37
+
38
+ class DeleteClass(SchemaOperation):
39
+ forward_method_name: str
40
+ backward_method_name: str
41
+ forward_args: Incomplete
42
+ backward_args: Incomplete
43
+ def __init__(self, class_name: str, old_schema: dict[str, Any], schema_type: SchemaTypes) -> None: ...
44
+
45
+ class MigrationSchemas(DefaultMigrationSchemas): ...
46
+
47
+ class MigrateData(Operation):
48
+ @staticmethod
49
+ def noop(schemas: MigrationSchemas) -> None: ...
50
+ forward_migration: Incomplete
51
+ backward_migration: Incomplete
52
+ def __init__(self, forward_migration: Callable[[MigrationSchemas | BaseMigrationSchemas], None], backward_migration: Callable[[MigrationSchemas | BaseMigrationSchemas], None]) -> None: ...
53
+ def forward(self, executor: BaseMigrationExecutor) -> None: ...
54
+ def backward(self, executor: BaseMigrationExecutor) -> None: ...
55
+
56
+ class Migration:
57
+ operations: list[Operation]
@@ -0,0 +1,17 @@
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
+ _migrations_path: Incomplete
8
+ _module_type: Incomplete
9
+ _module_name: Incomplete
10
+ _migrations_files: Incomplete
11
+ def __init__(self, migrations_dir: Path, module_type: ModuleTypes, module_name: str | None = None) -> None: ...
12
+ @property
13
+ def has_initial_migration(self) -> bool: ...
14
+ @property
15
+ def last_migration_number(self) -> int: ...
16
+ def __iter__(self) -> Iterator[MigrationFile]: ...
17
+ def _load_migration_files(self) -> None: ...
@@ -0,0 +1,24 @@
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.data_models.schema import ObjectSchema
8
+ from amsdal_models.schemas.mixins.enrich_schemas_mixin import EnrichSchemasMixin
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
+ schemas_root_path: Incomplete
18
+ module_type: Incomplete
19
+ def __init__(self, schemas_root_path: Path, module_type: ModuleTypes = ...) -> None: ...
20
+ def iter_app_schemas(self) -> Iterator[ClassSchema]: ...
21
+ def _enriched_user_schemas(self) -> list[ObjectSchema]: ...
22
+ @staticmethod
23
+ def _load_schemas(schemas_path: Path) -> list[ObjectSchema]: ...
24
+ def _load_contrib_schemas(self) -> list[ObjectSchema]: ...
@@ -1,9 +1,12 @@
1
1
  from _typeshed import Incomplete
2
+ from amsdal.migration.data_classes import ModuleTypes as ModuleTypes
2
3
  from amsdal.schemas.manager import SchemaManager as SchemaManager
3
4
  from amsdal_models.classes.model import Model
4
5
  from amsdal_models.schemas.data_models.core import DictSchema, LegacyDictSchema, TypeData
5
6
  from amsdal_models.schemas.data_models.schema import ObjectSchema, PropertyData
6
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
7
10
 
8
11
  reference_schema: Incomplete
9
12
 
@@ -11,3 +14,5 @@ def object_schema_to_table_schema(object_schema: ObjectSchema) -> TableSchema: .
11
14
  def _process_properties(properties: dict[str, PropertyData] | None, required: list[str]) -> list[TableColumnSchema]: ...
12
15
  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]: ...
13
16
  def schema_to_nested_column_schema(schema: ObjectSchema, context: dict[str, type | Model | NestedSchemaModel]) -> NestedSchemaModel | type: ...
17
+ def contrib_to_module_root_path(contrib: str) -> Path: ...
18
+ def map_module_type_to_schema_type(module_type: ModuleTypes) -> SchemaTypes: ...
@@ -16,6 +16,8 @@ class BuildMixin:
16
16
  @staticmethod
17
17
  def build_static_files(cli_app_path: Path) -> None: ...
18
18
  @staticmethod
19
+ def build_migrations(cli_app_path: Path) -> None: ...
20
+ @staticmethod
19
21
  def build_fixtures(cli_app_path: Path) -> None: ...
20
22
  @staticmethod
21
23
  def _reimport_models() -> None:
@@ -3,7 +3,7 @@ from amsdal_models.classes.model import Model
3
3
 
4
4
  class ClassVersionsMixin:
5
5
  @classmethod
6
- def _create_table(cls, schema_object: Model) -> None: ...
6
+ def _create_table(cls, class_object: Model, *, skip_class_meta: bool = False) -> None: ...
7
7
  @classmethod
8
8
  def init_class_versions(cls, *, create_tables: bool = False) -> None: ...
9
9
  @staticmethod
@@ -6,12 +6,14 @@ from amsdal_data.operations.enums import OperationType
6
6
  from amsdal_data.operations.manager import OperationsManagerBase
7
7
  from amsdal_models.classes.model import Model
8
8
  from amsdal_utils.models.data_models.address import Address
9
+ from amsdal_utils.models.data_models.metadata import Metadata as Metadata
9
10
  from typing import Any
10
11
 
11
12
  class OperationsManager(OperationsManagerBase):
12
13
  def _get_connections(self, obj: Model, using: str | None) -> list[ConnectionBase]: ...
13
14
  def _perform_state_operation(self, obj: Model, data_dump: dict[str, Any], operation: OperationType, connection: StateConnectionBase) -> None: ...
14
- def _clear_data(self, _value: Any) -> Any: ...
15
+ @classmethod
16
+ def clear_data(cls, _value: Any) -> Any: ...
15
17
  def _is_reference(self, _value: Any) -> bool: ...
16
18
  def _create_references(self, address: Address, data: Any, connection: HistoricalConnectionBase) -> None: ...
17
19
  def _perform_historical_operation(self, obj: Model, data_dump: dict[str, Any], operation: OperationType, connection: HistoricalConnectionBase) -> None: ...
@@ -2,36 +2,6 @@
2
2
  "title": "ClassObject",
3
3
  "type": "object",
4
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
- "options": {
18
- "title": "Options",
19
- "type": "array",
20
- "items": {
21
- "type": "Option"
22
- }
23
- },
24
- "options_list_name": {
25
- "title": "Options List Name",
26
- "type": "string"
27
- },
28
- "validation": {
29
- "title": "Validation",
30
- "type": "array",
31
- "items": {
32
- "type": "Validator"
33
- }
34
- },
35
5
  "properties": {
36
6
  "title": "Properties",
37
7
  "type": "dictionary",
@@ -51,34 +21,11 @@
51
21
  "type": "string"
52
22
  }
53
23
  },
54
- "indexed": {
55
- "title": "Indexed",
56
- "type": "array",
57
- "items": {
58
- "type": "string"
59
- }
60
- },
61
- "unique_properties": {
62
- "title": "Unique Fields",
63
- "type": "array",
64
- "items": {
65
- "type": "array",
66
- "items": {
67
- "type": "string"
68
- }
69
- }
70
- },
71
- "method_code": {
72
- "title": "Method Code",
73
- "type": "string"
74
- },
75
- "class_schema": {
76
- "title": "Class Schema",
77
- "type": "string"
24
+ "meta_class": {
25
+ "title": "Meta Class",
26
+ "type": "string",
27
+ "default": "ClassObject"
78
28
  }
79
29
  },
80
- "required": [
81
- "title",
82
- "type"
83
- ]
30
+ "required": []
84
31
  }
@@ -0,0 +1,55 @@
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
+ "properties": {
18
+ "title": "Properties",
19
+ "type": "dictionary",
20
+ "items": {
21
+ "key": {
22
+ "type": "string"
23
+ },
24
+ "value": {
25
+ "type": "ClassPropertyMeta"
26
+ }
27
+ }
28
+ },
29
+ "indexed": {
30
+ "title": "Indexed",
31
+ "type": "array",
32
+ "items": {
33
+ "type": "string"
34
+ }
35
+ },
36
+ "unique": {
37
+ "title": "Unique Fields",
38
+ "type": "array",
39
+ "items": {
40
+ "type": "array",
41
+ "items": {
42
+ "type": "string"
43
+ }
44
+ }
45
+ },
46
+ "custom_code": {
47
+ "title": "Custom Code",
48
+ "type": "string"
49
+ }
50
+ },
51
+ "required": [
52
+ "title",
53
+ "type"
54
+ ]
55
+ }
@@ -2,25 +2,10 @@
2
2
  "title": "ClassProperty",
3
3
  "type": "object",
4
4
  "properties": {
5
- "title": {
6
- "title": "Title",
7
- "type": "string"
8
- },
9
5
  "type": {
10
6
  "title": "Type",
11
7
  "type": "string"
12
8
  },
13
- "default": {
14
- "title": "Default",
15
- "type": "anything"
16
- },
17
- "options": {
18
- "title": "Options",
19
- "type": "array",
20
- "items": {
21
- "type": "Option"
22
- }
23
- },
24
9
  "items": {
25
10
  "title": "Items",
26
11
  "type": "dictionary",
@@ -28,10 +13,6 @@
28
13
  "key": {"type": "string"},
29
14
  "value": {"type": "anything"}
30
15
  }
31
- },
32
- "order": {
33
- "title": "Order",
34
- "type": "number"
35
16
  }
36
17
  },
37
18
  "required": [
@@ -0,0 +1,23 @@
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
+ }
amsdal/schemas/manager.py CHANGED
@@ -21,14 +21,25 @@ class SchemaManager(metaclass=Singleton):
21
21
  for type_schema in self._schema_manager_handler.type_schemas
22
22
  if type_schema.title == BaseClasses.OBJECT
23
23
  ]
24
- + sorted(
25
- [(core_schema, SchemaTypes.CORE) for core_schema in self._schema_manager_handler.core_schemas],
26
- key=lambda x: int(x[0].title != BaseClasses.CLASS_OBJECT),
27
- )
24
+ + [
25
+ (core_schema, SchemaTypes.CORE)
26
+ for core_schema in sorted(self._schema_manager_handler.core_schemas, key=self._sort_key_for_schema)
27
+ ]
28
28
  + [(user_schema, SchemaTypes.USER) for user_schema in self._schema_manager_handler.user_schemas]
29
29
  + [(contrib_schema, SchemaTypes.CONTRIB) for contrib_schema in self._schema_manager_handler.contrib_schemas]
30
30
  )
31
31
 
32
+ @staticmethod
33
+ def _sort_key_for_schema(schema: ObjectSchema) -> int:
34
+ # We need to register ClassObject first, coz ClassObjectMeta has a reference to it.
35
+ # All other classes have reference to ClassObject
36
+ if schema.title == BaseClasses.CLASS_OBJECT:
37
+ return 0
38
+ elif schema.title == BaseClasses.CLASS_OBJECT_META:
39
+ return 1
40
+ else:
41
+ return 2
42
+
32
43
  def get_schema_by_name(self, title: str, schema_type: SchemaTypes | None = None) -> ObjectSchema | None:
33
44
  _schemas = self.get_schemas(schema_type)
34
45
 
@@ -9,5 +9,7 @@ class SchemaManager(metaclass=Singleton):
9
9
  def __init__(self) -> None: ...
10
10
  def invalidate_user_schemas(self) -> None: ...
11
11
  def class_schemas(self) -> list[tuple[ObjectSchema, SchemaTypes]]: ...
12
+ @staticmethod
13
+ def _sort_key_for_schema(schema: ObjectSchema) -> int: ...
12
14
  def get_schema_by_name(self, title: str, schema_type: SchemaTypes | None = None) -> ObjectSchema | None: ...
13
15
  def get_schemas(self, schema_type: SchemaTypes | None = None) -> list[ObjectSchema]: ...
@@ -30,8 +30,18 @@
30
30
  "type": "string"
31
31
  }
32
32
  },
33
- "class_schema": {
34
- "title": "Class Schema",
33
+ "unique": {
34
+ "title": "Unique Fields",
35
+ "type": "array",
36
+ "items": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "string"
40
+ }
41
+ }
42
+ },
43
+ "custom_code": {
44
+ "title": "Custom Code",
35
45
  "type": "string"
36
46
  },
37
47
  "meta_class": {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: amsdal
3
- Version: 0.0.40
3
+ Version: 0.1.0
4
4
  Summary: AMSDAL
5
5
  License: AMSDAL End User License Agreement
6
6
 
@@ -122,22 +122,22 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
122
122
  Requires-Python: >=3.10
123
123
  Description-Content-Type: text/markdown
124
124
  License-File: LICENSE.txt
125
- Requires-Dist: pydantic ==2.3.0
126
- Requires-Dist: pydantic-settings ==2.0.3
127
- Requires-Dist: PyJWT ==2.8.0
128
- Requires-Dist: cryptography ==40.0.2
129
- Requires-Dist: httpx ==0.25.2
130
- Requires-Dist: bcrypt ==4.0.1
131
- Requires-Dist: black >=24.1.1
132
- Requires-Dist: amsdal-utils ==0.0.*
133
- Requires-Dist: amsdal-data[iceberg-lakehouse,postgres] ==0.0.*
134
- Requires-Dist: amsdal-models ==0.0.*
125
+ Requires-Dist: pydantic ~=2.3
126
+ Requires-Dist: pydantic-settings ~=2.0
127
+ Requires-Dist: PyJWT ~=2.8
128
+ Requires-Dist: cryptography ~=42.0
129
+ Requires-Dist: httpx ~=0.25
130
+ Requires-Dist: bcrypt ~=4.0
131
+ Requires-Dist: black >=24.3.0
132
+ Requires-Dist: amsdal-utils ==0.1.*
133
+ Requires-Dist: amsdal-data[iceberg-lakehouse,postgres] ==0.1.*
134
+ Requires-Dist: amsdal-models ==0.1.*
135
135
  Provides-Extra: cli
136
- Requires-Dist: amsdal-cli ==0.0.* ; extra == 'cli'
136
+ Requires-Dist: amsdal-cli ==0.1.* ; extra == 'cli'
137
137
  Provides-Extra: redis-lock
138
- Requires-Dist: amsdal-data[redis-lock] ==0.0.* ; extra == 'redis-lock'
138
+ Requires-Dist: amsdal-data[redis-lock] ==0.1.* ; extra == 'redis-lock'
139
139
  Provides-Extra: server
140
- Requires-Dist: amsdal-server ==0.0.* ; extra == 'server'
140
+ Requires-Dist: amsdal-server ==0.1.* ; extra == 'server'
141
141
 
142
142
  # AMSDAL
143
143