amsdal 0.4.13__cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. amsdal/Third-Party Materials - AMSDAL Dependencies - License Notices.md +1334 -0
  2. amsdal/__about__.py +4 -0
  3. amsdal/__about__.pyi +1 -0
  4. amsdal/__init__.py +23 -0
  5. amsdal/__init__.pyi +9 -0
  6. amsdal/__migrations__/0000_initial.py +217 -0
  7. amsdal/__migrations__/0001_datetime_type.py +18 -0
  8. amsdal/__migrations__/0002_fixture_order.py +44 -0
  9. amsdal/__migrations__/0003_schema_type_in_class_meta.py +44 -0
  10. amsdal/cloud/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
  11. amsdal/cloud/__init__.pyi +0 -0
  12. amsdal/cloud/client.cpython-311-x86_64-linux-gnu.so +0 -0
  13. amsdal/cloud/client.pyi +57 -0
  14. amsdal/cloud/constants.cpython-311-x86_64-linux-gnu.so +0 -0
  15. amsdal/cloud/constants.pyi +13 -0
  16. amsdal/cloud/enums.cpython-311-x86_64-linux-gnu.so +0 -0
  17. amsdal/cloud/enums.pyi +68 -0
  18. amsdal/cloud/models/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
  19. amsdal/cloud/models/__init__.pyi +0 -0
  20. amsdal/cloud/models/base.cpython-311-x86_64-linux-gnu.so +0 -0
  21. amsdal/cloud/models/base.pyi +247 -0
  22. amsdal/cloud/services/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
  23. amsdal/cloud/services/__init__.pyi +0 -0
  24. amsdal/cloud/services/actions/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
  25. amsdal/cloud/services/actions/__init__.pyi +0 -0
  26. amsdal/cloud/services/actions/add_allowlist_ip.cpython-311-x86_64-linux-gnu.so +0 -0
  27. amsdal/cloud/services/actions/add_allowlist_ip.pyi +19 -0
  28. amsdal/cloud/services/actions/add_basic_auth.cpython-311-x86_64-linux-gnu.so +0 -0
  29. amsdal/cloud/services/actions/add_basic_auth.pyi +21 -0
  30. amsdal/cloud/services/actions/add_dependency.cpython-311-x86_64-linux-gnu.so +0 -0
  31. amsdal/cloud/services/actions/add_dependency.pyi +19 -0
  32. amsdal/cloud/services/actions/add_secret.cpython-311-x86_64-linux-gnu.so +0 -0
  33. amsdal/cloud/services/actions/add_secret.pyi +20 -0
  34. amsdal/cloud/services/actions/base.cpython-311-x86_64-linux-gnu.so +0 -0
  35. amsdal/cloud/services/actions/base.pyi +122 -0
  36. amsdal/cloud/services/actions/create_deploy.cpython-311-x86_64-linux-gnu.so +0 -0
  37. amsdal/cloud/services/actions/create_deploy.pyi +41 -0
  38. amsdal/cloud/services/actions/create_env.cpython-311-x86_64-linux-gnu.so +0 -0
  39. amsdal/cloud/services/actions/create_env.pyi +19 -0
  40. amsdal/cloud/services/actions/create_session.cpython-311-x86_64-linux-gnu.so +0 -0
  41. amsdal/cloud/services/actions/create_session.pyi +17 -0
  42. amsdal/cloud/services/actions/delete_allowlist_ip.cpython-311-x86_64-linux-gnu.so +0 -0
  43. amsdal/cloud/services/actions/delete_allowlist_ip.pyi +19 -0
  44. amsdal/cloud/services/actions/delete_basic_auth.cpython-311-x86_64-linux-gnu.so +0 -0
  45. amsdal/cloud/services/actions/delete_basic_auth.pyi +20 -0
  46. amsdal/cloud/services/actions/delete_dependency.cpython-311-x86_64-linux-gnu.so +0 -0
  47. amsdal/cloud/services/actions/delete_dependency.pyi +21 -0
  48. amsdal/cloud/services/actions/delete_env.cpython-311-x86_64-linux-gnu.so +0 -0
  49. amsdal/cloud/services/actions/delete_env.pyi +21 -0
  50. amsdal/cloud/services/actions/delete_secret.cpython-311-x86_64-linux-gnu.so +0 -0
  51. amsdal/cloud/services/actions/delete_secret.pyi +21 -0
  52. amsdal/cloud/services/actions/destroy_deploy.cpython-311-x86_64-linux-gnu.so +0 -0
  53. amsdal/cloud/services/actions/destroy_deploy.pyi +18 -0
  54. amsdal/cloud/services/actions/expose_db.cpython-311-x86_64-linux-gnu.so +0 -0
  55. amsdal/cloud/services/actions/expose_db.pyi +22 -0
  56. amsdal/cloud/services/actions/get_basic_auth_credentials.cpython-311-x86_64-linux-gnu.so +0 -0
  57. amsdal/cloud/services/actions/get_basic_auth_credentials.pyi +21 -0
  58. amsdal/cloud/services/actions/get_monitoring_info.cpython-311-x86_64-linux-gnu.so +0 -0
  59. amsdal/cloud/services/actions/get_monitoring_info.pyi +21 -0
  60. amsdal/cloud/services/actions/list_dependencies.cpython-311-x86_64-linux-gnu.so +0 -0
  61. amsdal/cloud/services/actions/list_dependencies.pyi +21 -0
  62. amsdal/cloud/services/actions/list_deploys.cpython-311-x86_64-linux-gnu.so +0 -0
  63. amsdal/cloud/services/actions/list_deploys.pyi +19 -0
  64. amsdal/cloud/services/actions/list_envs.cpython-311-x86_64-linux-gnu.so +0 -0
  65. amsdal/cloud/services/actions/list_envs.pyi +20 -0
  66. amsdal/cloud/services/actions/list_secrets.cpython-311-x86_64-linux-gnu.so +0 -0
  67. amsdal/cloud/services/actions/list_secrets.pyi +22 -0
  68. amsdal/cloud/services/actions/manager.cpython-311-x86_64-linux-gnu.so +0 -0
  69. amsdal/cloud/services/actions/manager.pyi +278 -0
  70. amsdal/cloud/services/actions/signup_action.cpython-311-x86_64-linux-gnu.so +0 -0
  71. amsdal/cloud/services/actions/signup_action.pyi +20 -0
  72. amsdal/cloud/services/actions/update_deploy.cpython-311-x86_64-linux-gnu.so +0 -0
  73. amsdal/cloud/services/actions/update_deploy.pyi +19 -0
  74. amsdal/cloud/services/auth/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
  75. amsdal/cloud/services/auth/__init__.pyi +0 -0
  76. amsdal/cloud/services/auth/base.cpython-311-x86_64-linux-gnu.so +0 -0
  77. amsdal/cloud/services/auth/base.pyi +6 -0
  78. amsdal/cloud/services/auth/credentials.cpython-311-x86_64-linux-gnu.so +0 -0
  79. amsdal/cloud/services/auth/credentials.pyi +30 -0
  80. amsdal/cloud/services/auth/manager.cpython-311-x86_64-linux-gnu.so +0 -0
  81. amsdal/cloud/services/auth/manager.pyi +26 -0
  82. amsdal/cloud/services/auth/signup_service.cpython-311-x86_64-linux-gnu.so +0 -0
  83. amsdal/cloud/services/auth/signup_service.pyi +32 -0
  84. amsdal/cloud/services/auth/token.cpython-311-x86_64-linux-gnu.so +0 -0
  85. amsdal/cloud/services/auth/token.pyi +27 -0
  86. amsdal/configs/__init__.py +0 -0
  87. amsdal/configs/__init__.pyi +0 -0
  88. amsdal/configs/constants.py +33 -0
  89. amsdal/configs/constants.pyi +22 -0
  90. amsdal/configs/main.py +258 -0
  91. amsdal/configs/main.pyi +173 -0
  92. amsdal/context/__init__.py +0 -0
  93. amsdal/context/__init__.pyi +0 -0
  94. amsdal/context/manager.py +69 -0
  95. amsdal/context/manager.pyi +50 -0
  96. amsdal/contrib/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
  97. amsdal/contrib/__init__.pyi +0 -0
  98. amsdal/contrib/app_config.py +7 -0
  99. amsdal/contrib/app_config.pyi +6 -0
  100. amsdal/contrib/auth/__init__.py +0 -0
  101. amsdal/contrib/auth/__init__.pyi +0 -0
  102. amsdal/contrib/auth/app.py +27 -0
  103. amsdal/contrib/auth/app.pyi +15 -0
  104. amsdal/contrib/auth/decorators/__init__.py +35 -0
  105. amsdal/contrib/auth/decorators/__init__.pyi +6 -0
  106. amsdal/contrib/auth/errors.py +7 -0
  107. amsdal/contrib/auth/errors.pyi +4 -0
  108. amsdal/contrib/auth/fixtures/basic_permissions.json +64 -0
  109. amsdal/contrib/auth/lifecycle/__init__.py +0 -0
  110. amsdal/contrib/auth/lifecycle/__init__.pyi +0 -0
  111. amsdal/contrib/auth/lifecycle/consumer.py +394 -0
  112. amsdal/contrib/auth/lifecycle/consumer.pyi +108 -0
  113. amsdal/contrib/auth/migrations/0000_initial.py +84 -0
  114. amsdal/contrib/auth/models/__init__.py +0 -0
  115. amsdal/contrib/auth/models/__init__.pyi +0 -0
  116. amsdal/contrib/auth/models/login_session.py +118 -0
  117. amsdal/contrib/auth/models/login_session.pyi +37 -0
  118. amsdal/contrib/auth/models/permission.py +23 -0
  119. amsdal/contrib/auth/models/permission.pyi +18 -0
  120. amsdal/contrib/auth/models/user.py +106 -0
  121. amsdal/contrib/auth/models/user.pyi +46 -0
  122. amsdal/contrib/auth/settings.py +36 -0
  123. amsdal/contrib/auth/settings.pyi +26 -0
  124. amsdal/contrib/frontend_configs/__init__.py +0 -0
  125. amsdal/contrib/frontend_configs/__init__.pyi +0 -0
  126. amsdal/contrib/frontend_configs/app.py +24 -0
  127. amsdal/contrib/frontend_configs/app.pyi +19 -0
  128. amsdal/contrib/frontend_configs/constants.py +1 -0
  129. amsdal/contrib/frontend_configs/constants.pyi +1 -0
  130. amsdal/contrib/frontend_configs/conversion/__init__.py +5 -0
  131. amsdal/contrib/frontend_configs/conversion/__init__.pyi +3 -0
  132. amsdal/contrib/frontend_configs/conversion/convert.py +286 -0
  133. amsdal/contrib/frontend_configs/conversion/convert.pyi +22 -0
  134. amsdal/contrib/frontend_configs/lifecycle/__init__.py +0 -0
  135. amsdal/contrib/frontend_configs/lifecycle/__init__.pyi +0 -0
  136. amsdal/contrib/frontend_configs/lifecycle/consumer.py +306 -0
  137. amsdal/contrib/frontend_configs/lifecycle/consumer.pyi +98 -0
  138. amsdal/contrib/frontend_configs/migrations/0000_initial.py +256 -0
  139. amsdal/contrib/frontend_configs/models/__init__.py +0 -0
  140. amsdal/contrib/frontend_configs/models/__init__.pyi +0 -0
  141. amsdal/contrib/frontend_configs/models/frontend_activator_config.py +22 -0
  142. amsdal/contrib/frontend_configs/models/frontend_activator_config.pyi +12 -0
  143. amsdal/contrib/frontend_configs/models/frontend_config_async_validator.py +11 -0
  144. amsdal/contrib/frontend_configs/models/frontend_config_async_validator.pyi +7 -0
  145. amsdal/contrib/frontend_configs/models/frontend_config_control_action.py +54 -0
  146. amsdal/contrib/frontend_configs/models/frontend_config_control_action.pyi +32 -0
  147. amsdal/contrib/frontend_configs/models/frontend_config_group_validator.py +21 -0
  148. amsdal/contrib/frontend_configs/models/frontend_config_group_validator.pyi +11 -0
  149. amsdal/contrib/frontend_configs/models/frontend_config_option.py +12 -0
  150. amsdal/contrib/frontend_configs/models/frontend_config_option.pyi +8 -0
  151. amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base.py +17 -0
  152. amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base.pyi +8 -0
  153. amsdal/contrib/frontend_configs/models/frontend_config_slider_option.py +13 -0
  154. amsdal/contrib/frontend_configs/models/frontend_config_slider_option.pyi +9 -0
  155. amsdal/contrib/frontend_configs/models/frontend_config_text_mask.py +14 -0
  156. amsdal/contrib/frontend_configs/models/frontend_config_text_mask.pyi +10 -0
  157. amsdal/contrib/frontend_configs/models/frontend_config_validator.py +28 -0
  158. amsdal/contrib/frontend_configs/models/frontend_config_validator.pyi +15 -0
  159. amsdal/contrib/frontend_configs/models/frontend_control_config.py +87 -0
  160. amsdal/contrib/frontend_configs/models/frontend_control_config.pyi +35 -0
  161. amsdal/contrib/frontend_configs/models/frontend_model_config.py +14 -0
  162. amsdal/contrib/frontend_configs/models/frontend_model_config.pyi +9 -0
  163. amsdal/contrib/frontend_configs/utils.py +29 -0
  164. amsdal/contrib/frontend_configs/utils.pyi +17 -0
  165. amsdal/errors.py +31 -0
  166. amsdal/errors.pyi +12 -0
  167. amsdal/fixtures/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
  168. amsdal/fixtures/__init__.pyi +0 -0
  169. amsdal/fixtures/manager.cpython-311-x86_64-linux-gnu.so +0 -0
  170. amsdal/fixtures/manager.pyi +170 -0
  171. amsdal/fixtures/utils.cpython-311-x86_64-linux-gnu.so +0 -0
  172. amsdal/fixtures/utils.pyi +9 -0
  173. amsdal/manager.cpython-311-x86_64-linux-gnu.so +0 -0
  174. amsdal/manager.pyi +265 -0
  175. amsdal/mixins/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
  176. amsdal/mixins/__init__.pyi +0 -0
  177. amsdal/mixins/class_versions_mixin.cpython-311-x86_64-linux-gnu.so +0 -0
  178. amsdal/mixins/class_versions_mixin.pyi +12 -0
  179. amsdal/models/__init__.py +19 -0
  180. amsdal/models/__init__.pyi +9 -0
  181. amsdal/models/core/__init__.py +0 -0
  182. amsdal/models/core/__init__.pyi +0 -0
  183. amsdal/models/core/class_object.py +37 -0
  184. amsdal/models/core/class_object.pyi +24 -0
  185. amsdal/models/core/class_object_meta.py +26 -0
  186. amsdal/models/core/class_object_meta.pyi +15 -0
  187. amsdal/models/core/class_property.py +20 -0
  188. amsdal/models/core/class_property.pyi +11 -0
  189. amsdal/models/core/class_property_meta.py +15 -0
  190. amsdal/models/core/class_property_meta.pyi +10 -0
  191. amsdal/models/core/file.py +156 -0
  192. amsdal/models/core/file.pyi +104 -0
  193. amsdal/models/core/fixture.py +25 -0
  194. amsdal/models/core/fixture.pyi +14 -0
  195. amsdal/models/core/option.py +11 -0
  196. amsdal/models/core/option.pyi +8 -0
  197. amsdal/models/core/validator.py +12 -0
  198. amsdal/models/core/validator.pyi +8 -0
  199. amsdal/models/types/__init__.py +0 -0
  200. amsdal/models/types/__init__.pyi +0 -0
  201. amsdal/models/types/object.py +26 -0
  202. amsdal/models/types/object.pyi +16 -0
  203. amsdal/py.typed +0 -0
  204. amsdal/queryset/__init__.py +21 -0
  205. amsdal/queryset/__init__.pyi +6 -0
  206. amsdal/schemas/__init__.py +0 -0
  207. amsdal/schemas/__init__.pyi +0 -0
  208. amsdal/schemas/core/class_object/model.json +31 -0
  209. amsdal/schemas/core/class_object/properties/display_name.py +9 -0
  210. amsdal/schemas/core/class_object_meta/model.json +59 -0
  211. amsdal/schemas/core/class_property/model.json +22 -0
  212. amsdal/schemas/core/class_property_meta/model.json +23 -0
  213. amsdal/schemas/core/file/hooks/pre_create.py +24 -0
  214. amsdal/schemas/core/file/hooks/pre_update.py +24 -0
  215. amsdal/schemas/core/file/model.json +23 -0
  216. amsdal/schemas/core/file/properties/from_file.py +34 -0
  217. amsdal/schemas/core/file/properties/mimetype.py +13 -0
  218. amsdal/schemas/core/file/properties/str.py +6 -0
  219. amsdal/schemas/core/file/properties/to_file.py +24 -0
  220. amsdal/schemas/core/file/properties/validate_data.py +32 -0
  221. amsdal/schemas/core/fixture/model.json +35 -0
  222. amsdal/schemas/core/option/model.json +19 -0
  223. amsdal/schemas/core/validator/model.json +19 -0
  224. amsdal/schemas/interfaces.py +25 -0
  225. amsdal/schemas/interfaces.pyi +20 -0
  226. amsdal/schemas/manager.cpython-311-x86_64-linux-gnu.so +0 -0
  227. amsdal/schemas/manager.py +0 -0
  228. amsdal/schemas/manager.pyi +0 -0
  229. amsdal/schemas/mixins/__init__.py +0 -0
  230. amsdal/schemas/mixins/__init__.pyi +0 -0
  231. amsdal/schemas/mixins/check_dependencies_mixin.py +125 -0
  232. amsdal/schemas/mixins/check_dependencies_mixin.pyi +45 -0
  233. amsdal/schemas/mixins/verify_schemas_mixin.py +96 -0
  234. amsdal/schemas/mixins/verify_schemas_mixin.pyi +33 -0
  235. amsdal/schemas/repository.py +84 -0
  236. amsdal/schemas/repository.pyi +22 -0
  237. amsdal/schemas/types/anything/model.json +7 -0
  238. amsdal/schemas/types/array/model.json +7 -0
  239. amsdal/schemas/types/binary/model.json +7 -0
  240. amsdal/schemas/types/boolean/model.json +17 -0
  241. amsdal/schemas/types/date/model.json +7 -0
  242. amsdal/schemas/types/datetime/model.json +7 -0
  243. amsdal/schemas/types/dictionary/model.json +8 -0
  244. amsdal/schemas/types/number/model.json +8 -0
  245. amsdal/schemas/types/object/model.json +53 -0
  246. amsdal/schemas/types/string/model.json +8 -0
  247. amsdal/schemas/utils.py +16 -0
  248. amsdal/schemas/utils.pyi +10 -0
  249. amsdal/services/__init__.cpython-311-x86_64-linux-gnu.so +0 -0
  250. amsdal/services/__init__.pyi +0 -0
  251. amsdal/services/transaction_execution.cpython-311-x86_64-linux-gnu.so +0 -0
  252. amsdal/services/transaction_execution.pyi +93 -0
  253. amsdal/transactions/__init__.py +13 -0
  254. amsdal/transactions/__init__.pyi +4 -0
  255. amsdal/utils/__init__.py +0 -0
  256. amsdal/utils/__init__.pyi +0 -0
  257. amsdal/utils/contrib_paths.py +23 -0
  258. amsdal/utils/contrib_paths.pyi +14 -0
  259. amsdal/utils/rollback/__init__.py +440 -0
  260. amsdal/utils/rollback/__init__.pyi +38 -0
  261. amsdal/utils/tests/__init__.py +0 -0
  262. amsdal/utils/tests/enums.py +18 -0
  263. amsdal/utils/tests/factories.py +49 -0
  264. amsdal/utils/tests/helpers.py +499 -0
  265. amsdal-0.4.13.dist-info/METADATA +369 -0
  266. amsdal-0.4.13.dist-info/RECORD +269 -0
  267. amsdal-0.4.13.dist-info/WHEEL +6 -0
  268. amsdal-0.4.13.dist-info/licenses/LICENSE.txt +107 -0
  269. 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): ...
File without changes
@@ -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
+ """
@@ -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: ...