amsdal 0.2.5__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of amsdal might be problematic. Click here for more details.
- amsdal/Third-Party Materials - AMSDAL Dependencies - License Notices.md +1308 -0
- amsdal/__about__.py +4 -0
- amsdal/__about__.pyi +1 -0
- amsdal/__init__.py +3 -0
- amsdal/__init__.pyi +0 -0
- amsdal/__migrations__/0000_initial.py +203 -0
- amsdal/__migrations__/0001_datetime_type.py +18 -0
- amsdal/__migrations__/0002_fixture_order.py +40 -0
- amsdal/cloud/__init__.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/__init__.pyi +0 -0
- amsdal/cloud/client.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/client.pyi +57 -0
- amsdal/cloud/constants.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/constants.pyi +13 -0
- amsdal/cloud/enums.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/enums.pyi +68 -0
- amsdal/cloud/models/__init__.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/models/__init__.pyi +0 -0
- amsdal/cloud/models/base.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/models/base.pyi +247 -0
- amsdal/cloud/services/__init__.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/__init__.pyi +0 -0
- amsdal/cloud/services/actions/__init__.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/__init__.pyi +0 -0
- amsdal/cloud/services/actions/add_allowlist_ip.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/add_allowlist_ip.pyi +19 -0
- amsdal/cloud/services/actions/add_basic_auth.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/add_basic_auth.pyi +21 -0
- amsdal/cloud/services/actions/add_dependency.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/add_dependency.pyi +19 -0
- amsdal/cloud/services/actions/add_secret.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/add_secret.pyi +20 -0
- amsdal/cloud/services/actions/base.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/base.pyi +122 -0
- amsdal/cloud/services/actions/create_deploy.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/create_deploy.pyi +41 -0
- amsdal/cloud/services/actions/create_env.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/create_env.pyi +19 -0
- amsdal/cloud/services/actions/create_session.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/create_session.pyi +17 -0
- amsdal/cloud/services/actions/delete_allowlist_ip.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/delete_allowlist_ip.pyi +19 -0
- amsdal/cloud/services/actions/delete_basic_auth.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/delete_basic_auth.pyi +20 -0
- amsdal/cloud/services/actions/delete_dependency.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/delete_dependency.pyi +21 -0
- amsdal/cloud/services/actions/delete_env.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/delete_env.pyi +21 -0
- amsdal/cloud/services/actions/delete_secret.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/delete_secret.pyi +21 -0
- amsdal/cloud/services/actions/destroy_deploy.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/destroy_deploy.pyi +18 -0
- amsdal/cloud/services/actions/expose_db.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/expose_db.pyi +22 -0
- amsdal/cloud/services/actions/get_basic_auth_credentials.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/get_basic_auth_credentials.pyi +21 -0
- amsdal/cloud/services/actions/get_monitoring_info.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/get_monitoring_info.pyi +21 -0
- amsdal/cloud/services/actions/list_dependencies.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/list_dependencies.pyi +21 -0
- amsdal/cloud/services/actions/list_deploys.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/list_deploys.pyi +19 -0
- amsdal/cloud/services/actions/list_envs.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/list_envs.pyi +20 -0
- amsdal/cloud/services/actions/list_secrets.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/list_secrets.pyi +22 -0
- amsdal/cloud/services/actions/manager.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/manager.pyi +278 -0
- amsdal/cloud/services/actions/signup_action.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/signup_action.pyi +20 -0
- amsdal/cloud/services/actions/update_deploy.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/actions/update_deploy.pyi +19 -0
- amsdal/cloud/services/auth/__init__.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/auth/__init__.pyi +0 -0
- amsdal/cloud/services/auth/base.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/auth/base.pyi +6 -0
- amsdal/cloud/services/auth/credentials.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/auth/credentials.pyi +31 -0
- amsdal/cloud/services/auth/manager.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/auth/manager.pyi +26 -0
- amsdal/cloud/services/auth/signup_service.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/auth/signup_service.pyi +32 -0
- amsdal/cloud/services/auth/token.cp312-win_amd64.pyd +0 -0
- amsdal/cloud/services/auth/token.pyi +28 -0
- amsdal/configs/__init__.py +0 -0
- amsdal/configs/__init__.pyi +0 -0
- amsdal/configs/constants.py +33 -0
- amsdal/configs/constants.pyi +22 -0
- amsdal/configs/main.py +254 -0
- amsdal/configs/main.pyi +177 -0
- amsdal/context/__init__.py +0 -0
- amsdal/context/__init__.pyi +0 -0
- amsdal/context/manager.py +69 -0
- amsdal/context/manager.pyi +50 -0
- amsdal/contrib/__init__.cp312-win_amd64.pyd +0 -0
- amsdal/contrib/__init__.pyi +0 -0
- amsdal/contrib/app_config.py +7 -0
- amsdal/contrib/app_config.pyi +6 -0
- amsdal/contrib/auth/__init__.py +0 -0
- amsdal/contrib/auth/__init__.pyi +0 -0
- amsdal/contrib/auth/app.py +27 -0
- amsdal/contrib/auth/app.pyi +15 -0
- amsdal/contrib/auth/decorators/__init__.py +20 -0
- amsdal/contrib/auth/decorators/__init__.pyi +6 -0
- amsdal/contrib/auth/errors.py +7 -0
- amsdal/contrib/auth/errors.pyi +4 -0
- amsdal/contrib/auth/lifecycle/__init__.py +0 -0
- amsdal/contrib/auth/lifecycle/__init__.pyi +0 -0
- amsdal/contrib/auth/lifecycle/consumer.py +222 -0
- amsdal/contrib/auth/lifecycle/consumer.pyi +69 -0
- amsdal/contrib/auth/migrations/0000_initial.py +49 -0
- amsdal/contrib/auth/models/login_session/hooks/pre_init.py +64 -0
- amsdal/contrib/auth/models/login_session/model.json +23 -0
- amsdal/contrib/auth/models/login_session/modifiers/display_name.py +11 -0
- amsdal/contrib/auth/models/permission/fixtures/basic_permissions.json +62 -0
- amsdal/contrib/auth/models/permission/model.json +18 -0
- amsdal/contrib/auth/models/permission/modifiers/display_name.py +11 -0
- amsdal/contrib/auth/models/user/hooks/post_init.py +58 -0
- amsdal/contrib/auth/models/user/hooks/pre_create.py +8 -0
- amsdal/contrib/auth/models/user/model.json +25 -0
- amsdal/contrib/auth/models/user/modifiers/display_name.py +19 -0
- amsdal/contrib/auth/settings.py +36 -0
- amsdal/contrib/auth/settings.pyi +26 -0
- amsdal/contrib/frontend_configs/__init__.py +0 -0
- amsdal/contrib/frontend_configs/__init__.pyi +0 -0
- amsdal/contrib/frontend_configs/app.py +24 -0
- amsdal/contrib/frontend_configs/app.pyi +19 -0
- amsdal/contrib/frontend_configs/constants.py +1 -0
- amsdal/contrib/frontend_configs/constants.pyi +1 -0
- amsdal/contrib/frontend_configs/conversion/__init__.py +5 -0
- amsdal/contrib/frontend_configs/conversion/__init__.pyi +3 -0
- amsdal/contrib/frontend_configs/conversion/convert.py +250 -0
- amsdal/contrib/frontend_configs/conversion/convert.pyi +23 -0
- amsdal/contrib/frontend_configs/lifecycle/__init__.py +0 -0
- amsdal/contrib/frontend_configs/lifecycle/__init__.pyi +0 -0
- amsdal/contrib/frontend_configs/lifecycle/consumer.py +242 -0
- amsdal/contrib/frontend_configs/lifecycle/consumer.pyi +86 -0
- amsdal/contrib/frontend_configs/migrations/0000_initial.py +255 -0
- amsdal/contrib/frontend_configs/models/frontend_activator_config/model.json +11 -0
- amsdal/contrib/frontend_configs/models/frontend_config_async_validator/model.json +11 -0
- amsdal/contrib/frontend_configs/models/frontend_config_group_validator/model.json +52 -0
- amsdal/contrib/frontend_configs/models/frontend_config_option/model.json +15 -0
- amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base/model.json +6 -0
- amsdal/contrib/frontend_configs/models/frontend_config_skip_none_base/properties/model_dump.py +13 -0
- amsdal/contrib/frontend_configs/models/frontend_config_slider_option/model.json +19 -0
- amsdal/contrib/frontend_configs/models/frontend_config_text_mask/model.json +26 -0
- amsdal/contrib/frontend_configs/models/frontend_config_validator/model.json +41 -0
- amsdal/contrib/frontend_configs/models/frontend_control_config/model.json +250 -0
- amsdal/contrib/frontend_configs/models/frontend_model_config/fixtures/permissions.json +24 -0
- amsdal/contrib/frontend_configs/models/frontend_model_config/model.json +17 -0
- amsdal/contrib/frontend_configs/models/frontent_config_control_action/model.json +54 -0
- amsdal/contrib/frontend_configs/models/frontent_config_control_action/properties/action_validate.py +33 -0
- amsdal/contrib/frontend_configs/utils.py +29 -0
- amsdal/contrib/frontend_configs/utils.pyi +17 -0
- amsdal/errors.py +31 -0
- amsdal/errors.pyi +12 -0
- amsdal/fixtures/__init__.cp312-win_amd64.pyd +0 -0
- amsdal/fixtures/__init__.pyi +0 -0
- amsdal/fixtures/manager.cp312-win_amd64.pyd +0 -0
- amsdal/fixtures/manager.pyi +118 -0
- amsdal/manager.cp312-win_amd64.pyd +0 -0
- amsdal/manager.pyi +183 -0
- amsdal/migration/__init__.cp312-win_amd64.pyd +0 -0
- amsdal/migration/__init__.pyi +0 -0
- amsdal/migration/base_migration_schemas.cp312-win_amd64.pyd +0 -0
- amsdal/migration/base_migration_schemas.pyi +120 -0
- amsdal/migration/data_classes.cp312-win_amd64.pyd +0 -0
- amsdal/migration/data_classes.pyi +178 -0
- amsdal/migration/executors/__init__.cp312-win_amd64.pyd +0 -0
- amsdal/migration/executors/__init__.pyi +0 -0
- amsdal/migration/executors/base.cp312-win_amd64.pyd +0 -0
- amsdal/migration/executors/base.pyi +106 -0
- amsdal/migration/executors/default_executor.cp312-win_amd64.pyd +0 -0
- amsdal/migration/executors/default_executor.pyi +96 -0
- amsdal/migration/executors/state_executor.cp312-win_amd64.pyd +0 -0
- amsdal/migration/executors/state_executor.pyi +78 -0
- amsdal/migration/file_migration_executor.cp312-win_amd64.pyd +0 -0
- amsdal/migration/file_migration_executor.pyi +68 -0
- amsdal/migration/file_migration_generator.cp312-win_amd64.pyd +0 -0
- amsdal/migration/file_migration_generator.pyi +139 -0
- amsdal/migration/file_migration_store.cp312-win_amd64.pyd +0 -0
- amsdal/migration/file_migration_store.pyi +61 -0
- amsdal/migration/file_migration_writer.cp312-win_amd64.pyd +0 -0
- amsdal/migration/file_migration_writer.pyi +73 -0
- amsdal/migration/migrations.cp312-win_amd64.pyd +0 -0
- amsdal/migration/migrations.pyi +166 -0
- amsdal/migration/migrations_loader.cp312-win_amd64.pyd +0 -0
- amsdal/migration/migrations_loader.pyi +32 -0
- amsdal/migration/schemas_loaders.cp312-win_amd64.pyd +0 -0
- amsdal/migration/schemas_loaders.pyi +37 -0
- amsdal/migration/templates/data_migration.tmpl +18 -0
- amsdal/migration/templates/dict_validator.tmpl +4 -0
- amsdal/migration/templates/migration.tmpl +6 -0
- amsdal/migration/templates/model_class.tmpl +8 -0
- amsdal/migration/templates/model_class_layout.tmpl +24 -0
- amsdal/migration/templates/options_validator.tmpl +4 -0
- amsdal/migration/utils.cp312-win_amd64.pyd +0 -0
- amsdal/migration/utils.pyi +58 -0
- amsdal/mixins/__init__.cp312-win_amd64.pyd +0 -0
- amsdal/mixins/__init__.pyi +0 -0
- amsdal/mixins/build_mixin.cp312-win_amd64.pyd +0 -0
- amsdal/mixins/build_mixin.pyi +78 -0
- amsdal/mixins/class_versions_mixin.cp312-win_amd64.pyd +0 -0
- amsdal/mixins/class_versions_mixin.pyi +6 -0
- amsdal/py.typed +0 -0
- amsdal/schemas/__init__.py +0 -0
- amsdal/schemas/__init__.pyi +0 -0
- amsdal/schemas/core/class_object/model.json +31 -0
- amsdal/schemas/core/class_object/properties/display_name.py +9 -0
- amsdal/schemas/core/class_object_meta/model.json +55 -0
- amsdal/schemas/core/class_property/model.json +22 -0
- amsdal/schemas/core/class_property_meta/model.json +23 -0
- amsdal/schemas/core/file/hooks/pre_create.py +11 -0
- amsdal/schemas/core/file/hooks/pre_update.py +11 -0
- amsdal/schemas/core/file/model.json +23 -0
- amsdal/schemas/core/file/properties/from_file.py +34 -0
- amsdal/schemas/core/file/properties/mimetype.py +13 -0
- amsdal/schemas/core/file/properties/str.py +6 -0
- amsdal/schemas/core/file/properties/to_file.py +24 -0
- amsdal/schemas/core/file/properties/validate_data.py +32 -0
- amsdal/schemas/core/fixture/model.json +35 -0
- amsdal/schemas/core/option/model.json +19 -0
- amsdal/schemas/core/validator/model.json +19 -0
- amsdal/schemas/manager.cp312-win_amd64.pyd +0 -0
- amsdal/schemas/manager.py +116 -0
- amsdal/schemas/manager.pyi +65 -0
- amsdal/schemas/types/anything/model.json +7 -0
- amsdal/schemas/types/array/model.json +7 -0
- amsdal/schemas/types/binary/model.json +7 -0
- amsdal/schemas/types/boolean/model.json +17 -0
- amsdal/schemas/types/date/model.json +7 -0
- amsdal/schemas/types/datetime/model.json +7 -0
- amsdal/schemas/types/dictionary/model.json +8 -0
- amsdal/schemas/types/number/model.json +8 -0
- amsdal/schemas/types/object/model.json +53 -0
- amsdal/schemas/types/string/model.json +8 -0
- amsdal/services/__init__.cp312-win_amd64.pyd +0 -0
- amsdal/services/__init__.pyi +0 -0
- amsdal/services/transaction_execution.cp312-win_amd64.pyd +0 -0
- amsdal/services/transaction_execution.pyi +76 -0
- amsdal/utils/__init__.py +0 -0
- amsdal/utils/__init__.pyi +0 -0
- amsdal/utils/contrib_paths.py +23 -0
- amsdal/utils/contrib_paths.pyi +14 -0
- amsdal/utils/tests/__init__.py +0 -0
- amsdal/utils/tests/enums.py +18 -0
- amsdal/utils/tests/factories.py +49 -0
- amsdal/utils/tests/helpers.py +309 -0
- amsdal-0.2.5.dist-info/LICENSE.txt +107 -0
- amsdal-0.2.5.dist-info/METADATA +366 -0
- amsdal-0.2.5.dist-info/RECORD +254 -0
- amsdal-0.2.5.dist-info/WHEEL +5 -0
- amsdal-0.2.5.dist-info/license_check.py +35 -0
- amsdal-0.2.5.dist-info/top_level.txt +1 -0
amsdal/__about__.py
ADDED
amsdal/__about__.pyi
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__: str
|
amsdal/__init__.py
ADDED
amsdal/__init__.pyi
ADDED
|
File without changes
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
from amsdal_utils.models.enums import SchemaTypes
|
|
2
|
+
|
|
3
|
+
from amsdal.migration import migrations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
operations: list[migrations.Operation] = [
|
|
8
|
+
migrations.CreateClass(
|
|
9
|
+
schema_type=SchemaTypes.TYPE,
|
|
10
|
+
class_name='Object',
|
|
11
|
+
new_schema={
|
|
12
|
+
'title': 'Object',
|
|
13
|
+
'properties': {
|
|
14
|
+
'title': {'type': 'string', 'title': 'Title'},
|
|
15
|
+
'type': {'type': 'string', 'title': 'Type'},
|
|
16
|
+
'default': {'type': 'anything', 'title': 'Default'},
|
|
17
|
+
'properties': {
|
|
18
|
+
'type': 'dictionary',
|
|
19
|
+
'items': {'key': {'type': 'string'}, 'value': {'type': 'anything'}},
|
|
20
|
+
'title': 'Properties',
|
|
21
|
+
},
|
|
22
|
+
'required': {'type': 'array', 'items': {'type': 'string'}, 'title': 'Required'},
|
|
23
|
+
'unique': {
|
|
24
|
+
'type': 'array',
|
|
25
|
+
'items': {'type': 'array', 'items': {'type': 'string'}},
|
|
26
|
+
'title': 'Unique Fields',
|
|
27
|
+
},
|
|
28
|
+
'custom_code': {'type': 'string', 'title': 'Custom Code'},
|
|
29
|
+
'meta_class': {'type': 'string', 'title': 'Meta Class'},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
),
|
|
33
|
+
migrations.CreateClass(
|
|
34
|
+
schema_type=SchemaTypes.TYPE,
|
|
35
|
+
class_name='Binary',
|
|
36
|
+
new_schema={'title': 'Binary', 'properties': {}, 'meta_class': 'TypeMeta'},
|
|
37
|
+
),
|
|
38
|
+
migrations.CreateClass(
|
|
39
|
+
schema_type=SchemaTypes.TYPE,
|
|
40
|
+
class_name='Dictionary',
|
|
41
|
+
new_schema={'title': 'Dictionary', 'properties': {}, 'meta_class': 'TypeMeta'},
|
|
42
|
+
),
|
|
43
|
+
migrations.CreateClass(
|
|
44
|
+
schema_type=SchemaTypes.TYPE,
|
|
45
|
+
class_name='Anything',
|
|
46
|
+
new_schema={'title': 'Anything', 'properties': {}, 'meta_class': 'TypeMeta'},
|
|
47
|
+
),
|
|
48
|
+
migrations.CreateClass(
|
|
49
|
+
schema_type=SchemaTypes.TYPE,
|
|
50
|
+
class_name='String',
|
|
51
|
+
new_schema={'title': 'String', 'default': '', 'properties': {}, 'meta_class': 'TypeMeta'},
|
|
52
|
+
),
|
|
53
|
+
migrations.CreateClass(
|
|
54
|
+
schema_type=SchemaTypes.TYPE,
|
|
55
|
+
class_name='Array',
|
|
56
|
+
new_schema={'title': 'Array', 'properties': {}, 'meta_class': 'TypeMeta'},
|
|
57
|
+
),
|
|
58
|
+
migrations.CreateClass(
|
|
59
|
+
schema_type=SchemaTypes.TYPE,
|
|
60
|
+
class_name='Number',
|
|
61
|
+
new_schema={'title': 'Number', 'properties': {}, 'meta_class': 'TypeMeta'},
|
|
62
|
+
),
|
|
63
|
+
migrations.CreateClass(
|
|
64
|
+
schema_type=SchemaTypes.TYPE,
|
|
65
|
+
class_name='Boolean',
|
|
66
|
+
new_schema={
|
|
67
|
+
'title': 'Boolean',
|
|
68
|
+
'properties': {},
|
|
69
|
+
'options': [{'key': 'true', 'value': True}, {'key': 'false', 'value': False}],
|
|
70
|
+
'meta_class': 'TypeMeta',
|
|
71
|
+
},
|
|
72
|
+
),
|
|
73
|
+
migrations.CreateClass(
|
|
74
|
+
schema_type=SchemaTypes.CORE,
|
|
75
|
+
class_name='Option',
|
|
76
|
+
new_schema={
|
|
77
|
+
'title': 'Option',
|
|
78
|
+
'required': ['key', 'value'],
|
|
79
|
+
'properties': {
|
|
80
|
+
'key': {'type': 'string', 'title': 'Key'},
|
|
81
|
+
'value': {'type': 'string', 'title': 'Value Type'},
|
|
82
|
+
},
|
|
83
|
+
'meta_class': 'TypeMeta',
|
|
84
|
+
},
|
|
85
|
+
),
|
|
86
|
+
migrations.CreateClass(
|
|
87
|
+
schema_type=SchemaTypes.CORE,
|
|
88
|
+
class_name='Validator',
|
|
89
|
+
new_schema={
|
|
90
|
+
'title': 'Validator',
|
|
91
|
+
'required': ['name', 'data'],
|
|
92
|
+
'properties': {
|
|
93
|
+
'name': {'type': 'string', 'title': 'Validator Name'},
|
|
94
|
+
'data': {'type': 'anything', 'title': 'Validator Data'},
|
|
95
|
+
},
|
|
96
|
+
'meta_class': 'TypeMeta',
|
|
97
|
+
},
|
|
98
|
+
),
|
|
99
|
+
migrations.CreateClass(
|
|
100
|
+
schema_type=SchemaTypes.CORE,
|
|
101
|
+
class_name='ClassPropertyMeta',
|
|
102
|
+
new_schema={
|
|
103
|
+
'title': 'ClassPropertyMeta',
|
|
104
|
+
'properties': {
|
|
105
|
+
'title': {'type': 'string', 'title': 'Title'},
|
|
106
|
+
'default': {'type': 'anything', 'title': 'Default'},
|
|
107
|
+
'options': {'type': 'array', 'items': {'type': 'Option'}, 'title': 'Options'},
|
|
108
|
+
},
|
|
109
|
+
'meta_class': 'TypeMeta',
|
|
110
|
+
},
|
|
111
|
+
),
|
|
112
|
+
migrations.CreateClass(
|
|
113
|
+
schema_type=SchemaTypes.CORE,
|
|
114
|
+
class_name='ClassProperty',
|
|
115
|
+
new_schema={
|
|
116
|
+
'title': 'ClassProperty',
|
|
117
|
+
'required': ['type'],
|
|
118
|
+
'properties': {
|
|
119
|
+
'type': {'type': 'string', 'title': 'Type'},
|
|
120
|
+
'items': {
|
|
121
|
+
'type': 'dictionary',
|
|
122
|
+
'items': {'key': {'type': 'string'}, 'value': {'type': 'anything'}},
|
|
123
|
+
'title': 'Items',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
'meta_class': 'TypeMeta',
|
|
127
|
+
},
|
|
128
|
+
),
|
|
129
|
+
migrations.CreateClass(
|
|
130
|
+
schema_type=SchemaTypes.CORE,
|
|
131
|
+
class_name='ClassObject',
|
|
132
|
+
new_schema={
|
|
133
|
+
'title': 'ClassObject',
|
|
134
|
+
'properties': {
|
|
135
|
+
'properties': {
|
|
136
|
+
'type': 'dictionary',
|
|
137
|
+
'items': {'key': {'type': 'string'}, 'value': {'type': 'ClassProperty'}},
|
|
138
|
+
'title': 'Properties',
|
|
139
|
+
},
|
|
140
|
+
'required': {'type': 'array', 'items': {'type': 'string'}, 'title': 'Required'},
|
|
141
|
+
'meta_class': {'type': 'string', 'default': 'ClassObject', 'title': 'Meta Class'},
|
|
142
|
+
},
|
|
143
|
+
'custom_code': '@property # type: ignore[misc]\ndef display_name(self) -> str: # type: ignore[no-untyped-def]\n return self.title',
|
|
144
|
+
},
|
|
145
|
+
),
|
|
146
|
+
migrations.CreateClass(
|
|
147
|
+
schema_type=SchemaTypes.CORE,
|
|
148
|
+
class_name='ClassObjectMeta',
|
|
149
|
+
new_schema={
|
|
150
|
+
'title': 'ClassObjectMeta',
|
|
151
|
+
'required': ['title', 'type'],
|
|
152
|
+
'properties': {
|
|
153
|
+
'title': {'type': 'string', 'title': 'Title'},
|
|
154
|
+
'type': {'type': 'string', 'title': 'Type'},
|
|
155
|
+
'default': {'type': 'anything', 'title': 'Default'},
|
|
156
|
+
'properties': {
|
|
157
|
+
'type': 'dictionary',
|
|
158
|
+
'items': {'key': {'type': 'string'}, 'value': {'type': 'ClassPropertyMeta'}},
|
|
159
|
+
'title': 'Properties',
|
|
160
|
+
},
|
|
161
|
+
'indexed': {'type': 'array', 'items': {'type': 'string'}, 'title': 'Indexed'},
|
|
162
|
+
'unique': {
|
|
163
|
+
'type': 'array',
|
|
164
|
+
'items': {'type': 'array', 'items': {'type': 'string'}},
|
|
165
|
+
'title': 'Unique Fields',
|
|
166
|
+
},
|
|
167
|
+
'custom_code': {'type': 'string', 'title': 'Custom Code'},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
),
|
|
171
|
+
migrations.CreateClass(
|
|
172
|
+
schema_type=SchemaTypes.CORE,
|
|
173
|
+
class_name='Fixture',
|
|
174
|
+
new_schema={
|
|
175
|
+
'title': 'Fixture',
|
|
176
|
+
'required': ['data', 'external_id'],
|
|
177
|
+
'properties': {
|
|
178
|
+
'class_name': {'type': 'string', 'title': 'Class Name'},
|
|
179
|
+
'external_id': {'type': 'string', 'title': 'External ID'},
|
|
180
|
+
'data': {
|
|
181
|
+
'type': 'dictionary',
|
|
182
|
+
'items': {'key': {'type': 'string'}, 'value': {'type': 'anything'}},
|
|
183
|
+
'title': 'Data',
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
'unique': [['external_id']],
|
|
187
|
+
},
|
|
188
|
+
),
|
|
189
|
+
migrations.CreateClass(
|
|
190
|
+
schema_type=SchemaTypes.CORE,
|
|
191
|
+
class_name='File',
|
|
192
|
+
new_schema={
|
|
193
|
+
'title': 'File',
|
|
194
|
+
'required': ['filename', 'data'],
|
|
195
|
+
'properties': {
|
|
196
|
+
'filename': {'type': 'string', 'title': 'Filename'},
|
|
197
|
+
'data': {'type': 'binary', 'title': 'Data'},
|
|
198
|
+
'size': {'type': 'number', 'title': 'Size'},
|
|
199
|
+
},
|
|
200
|
+
'custom_code': "def pre_update(self): # type: ignore[no-untyped-def]\n self.size = len(self.data or b'')\n\ndef pre_create(self) -> None: # type: ignore[no-untyped-def]\n self.size = len(self.data or b'')\n\nfrom pathlib import Path\nfrom typing import BinaryIO\n\n\ndef to_file(self, file_or_path: Path | BinaryIO) -> None: # type: ignore[no-untyped-def]\n if isinstance(file_or_path, Path):\n if file_or_path.is_dir():\n file_or_path = file_or_path / self.name\n file_or_path.write_bytes(self.data) # type: ignore[union-attr]\n else:\n file_or_path.write(self.data)\n file_or_path.seek(0)\n\nfrom pathlib import Path\nfrom typing import BinaryIO\n\n\n@classmethod # type: ignore[misc, no-untyped-def]\ndef from_file(\n cls,\n file_or_path: Path | BinaryIO,\n) -> 'File': # type: ignore[name-defined] # noqa: F821\n if isinstance(file_or_path, Path):\n if file_or_path.is_dir():\n msg = f'{file_or_path} is a directory'\n raise ValueError(msg)\n\n data = file_or_path.read_bytes()\n filename = file_or_path.name\n else:\n file_or_path.seek(0)\n data = file_or_path.read()\n filename = Path(file_or_path.name).name\n\n return cls(data=data, filename=filename)\n\nimport base64\n\nfrom pydantic import field_validator\n\n\n@field_validator('data') # type: ignore[misc]\n@classmethod\ndef data_base64_decode(cls, v: bytes) -> bytes: # type: ignore[no-untyped-def] # noqa: ARG001\n is_base64: bool = False\n\n try:\n is_base64 = base64.b64encode(base64.b64decode(v)) == v\n except Exception:\n ...\n\n if is_base64:\n return base64.b64decode(v)\n\n return v\n\n@property # type: ignore[misc]\ndef mimetype(self) -> str | None: # type: ignore[no-untyped-def]\n import mimetypes\n\n return mimetypes.guess_type(self.filename)[0]",
|
|
201
|
+
},
|
|
202
|
+
),
|
|
203
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from amsdal_utils.models.enums import SchemaTypes
|
|
2
|
+
|
|
3
|
+
from amsdal.migration import migrations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
operations: list[migrations.Operation] = [
|
|
8
|
+
migrations.CreateClass(
|
|
9
|
+
schema_type=SchemaTypes.TYPE,
|
|
10
|
+
class_name='Date',
|
|
11
|
+
new_schema={'title': 'Date', 'properties': {}, 'meta_class': 'TypeMeta'},
|
|
12
|
+
),
|
|
13
|
+
migrations.CreateClass(
|
|
14
|
+
schema_type=SchemaTypes.TYPE,
|
|
15
|
+
class_name='Datetime',
|
|
16
|
+
new_schema={'title': 'Datetime', 'properties': {}, 'meta_class': 'TypeMeta'},
|
|
17
|
+
),
|
|
18
|
+
]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from amsdal.migration import migrations
|
|
2
|
+
from amsdal_utils.models.enums import SchemaTypes
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Migration(migrations.Migration):
|
|
6
|
+
operations: list[migrations.Operation] = [
|
|
7
|
+
migrations.UpdateClass(
|
|
8
|
+
schema_type=SchemaTypes.CORE,
|
|
9
|
+
class_name='Fixture',
|
|
10
|
+
old_schema={
|
|
11
|
+
'title': 'Fixture',
|
|
12
|
+
'required': ['data', 'external_id'],
|
|
13
|
+
'properties': {
|
|
14
|
+
'class_name': {'type': 'string', 'title': 'Class Name'},
|
|
15
|
+
'external_id': {'type': 'string', 'title': 'External ID'},
|
|
16
|
+
'data': {
|
|
17
|
+
'type': 'dictionary',
|
|
18
|
+
'items': {'key': {'type': 'string'}, 'value': {'type': 'anything'}},
|
|
19
|
+
'title': 'Data',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
'unique': [['external_id']],
|
|
23
|
+
},
|
|
24
|
+
new_schema={
|
|
25
|
+
'title': 'Fixture',
|
|
26
|
+
'required': ['data', 'external_id'],
|
|
27
|
+
'properties': {
|
|
28
|
+
'class_name': {'type': 'string', 'title': 'Class Name'},
|
|
29
|
+
'order': {'type': 'number', 'title': 'Order'},
|
|
30
|
+
'external_id': {'type': 'string', 'title': 'External ID'},
|
|
31
|
+
'data': {
|
|
32
|
+
'type': 'dictionary',
|
|
33
|
+
'items': {'key': {'type': 'string'}, 'value': {'type': 'anything'}},
|
|
34
|
+
'title': 'Data',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
'unique': [['external_id']],
|
|
38
|
+
},
|
|
39
|
+
),
|
|
40
|
+
]
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
amsdal/cloud/client.pyi
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import httpx
|
|
2
|
+
from amsdal.cloud.constants import BASE_AUTH_URL as BASE_AUTH_URL
|
|
3
|
+
from amsdal.errors import AmsdalAuthConnectionError as AmsdalAuthConnectionError
|
|
4
|
+
from typing import Any, Protocol
|
|
5
|
+
|
|
6
|
+
class HttpFunction(Protocol):
|
|
7
|
+
"""
|
|
8
|
+
Protocol for HTTP function callables.
|
|
9
|
+
|
|
10
|
+
This protocol defines the structure for callables that perform HTTP requests, ensuring they accept a URL and
|
|
11
|
+
additional keyword arguments.
|
|
12
|
+
"""
|
|
13
|
+
def __call__(self, url: str, **kwargs: Any) -> httpx.Response: ...
|
|
14
|
+
|
|
15
|
+
class AuthClientService:
|
|
16
|
+
"""
|
|
17
|
+
Service to handle HTTP requests for authentication.
|
|
18
|
+
|
|
19
|
+
This class provides functionality to perform HTTP GET and POST requests to the authentication server,
|
|
20
|
+
handling connection errors and setting default timeouts.
|
|
21
|
+
"""
|
|
22
|
+
DEFAULT_TIMEOUT: int
|
|
23
|
+
def _default_handler(self, calling_function: HttpFunction, path: str, **kwargs: Any) -> httpx.Response: ...
|
|
24
|
+
def post(self, path: str, **kwargs: Any) -> httpx.Response:
|
|
25
|
+
"""
|
|
26
|
+
Sends an HTTP POST request to the specified path.
|
|
27
|
+
|
|
28
|
+
This method constructs the full URL using the base authentication URL and the provided path,
|
|
29
|
+
sets a default timeout, and sends an HTTP POST request.
|
|
30
|
+
|
|
31
|
+
Args:
|
|
32
|
+
path (str): The path to append to the base authentication URL.
|
|
33
|
+
**kwargs (Any): Additional keyword arguments to pass to the `httpx.post` function.
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
httpx.Response: The response from the HTTP POST request.
|
|
37
|
+
|
|
38
|
+
Raises:
|
|
39
|
+
AmsdalAuthConnectionError: If there is a connection error.
|
|
40
|
+
"""
|
|
41
|
+
def get(self, path: str, **kwargs: Any) -> httpx.Response:
|
|
42
|
+
"""
|
|
43
|
+
Sends an HTTP GET request to the specified path.
|
|
44
|
+
|
|
45
|
+
This method constructs the full URL using the base authentication URL and the provided path,
|
|
46
|
+
sets a default timeout, and sends an HTTP GET request.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
path (str): The path to append to the base authentication URL.
|
|
50
|
+
**kwargs (Any): Additional keyword arguments to pass to the `httpx.get` function.
|
|
51
|
+
|
|
52
|
+
Returns:
|
|
53
|
+
httpx.Response: The response from the HTTP GET request.
|
|
54
|
+
|
|
55
|
+
Raises:
|
|
56
|
+
AmsdalAuthConnectionError: If there is a connection error.
|
|
57
|
+
"""
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from pydantic_settings import BaseSettings
|
|
3
|
+
|
|
4
|
+
class Settings(BaseSettings):
|
|
5
|
+
model_config: Incomplete
|
|
6
|
+
AMSDAL_SANDBOX_ENVIRONMENT: bool | None
|
|
7
|
+
|
|
8
|
+
JWT_PUBLIC_KEY: str
|
|
9
|
+
ENCRYPT_PUBLIC_KEY: str
|
|
10
|
+
cloud_settings: Incomplete
|
|
11
|
+
SYNC_KEY: bytes
|
|
12
|
+
AMSDAL_ENV_SUBDOMAIN: Incomplete
|
|
13
|
+
BASE_AUTH_URL: Incomplete
|
|
Binary file
|
amsdal/cloud/enums.pyi
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
class AuthType(Enum):
|
|
4
|
+
"""
|
|
5
|
+
Enumeration for authentication types.
|
|
6
|
+
|
|
7
|
+
This enum defines the types of authentication methods available.
|
|
8
|
+
|
|
9
|
+
Attributes:
|
|
10
|
+
CREDENTIALS: Authentication using credentials.
|
|
11
|
+
TOKEN: Authentication using a token.
|
|
12
|
+
"""
|
|
13
|
+
CREDENTIALS = ...
|
|
14
|
+
TOKEN = ...
|
|
15
|
+
|
|
16
|
+
class DeployType(str, Enum):
|
|
17
|
+
"""
|
|
18
|
+
Enumeration for deployment types.
|
|
19
|
+
|
|
20
|
+
This enum defines the types of deployment methods available.
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
lakehouse_only: Deployment only to the lakehouse.
|
|
24
|
+
include_state_db: Deployment including the state database.
|
|
25
|
+
"""
|
|
26
|
+
lakehouse_only = 'lakehouse_only'
|
|
27
|
+
include_state_db = 'include_state_db'
|
|
28
|
+
|
|
29
|
+
class StateOption(str, Enum):
|
|
30
|
+
"""
|
|
31
|
+
Enumeration for state options.
|
|
32
|
+
|
|
33
|
+
This enum defines the types of state database options available.
|
|
34
|
+
|
|
35
|
+
Attributes:
|
|
36
|
+
sqlite: State database using SQLite.
|
|
37
|
+
postgres: State database using PostgreSQL.
|
|
38
|
+
"""
|
|
39
|
+
sqlite = 'sqlite'
|
|
40
|
+
postgres = 'postgres'
|
|
41
|
+
|
|
42
|
+
class LakehouseOption(str, Enum):
|
|
43
|
+
"""
|
|
44
|
+
Enumeration for lakehouse options.
|
|
45
|
+
|
|
46
|
+
This enum defines the types of lakehouse options available.
|
|
47
|
+
|
|
48
|
+
Attributes:
|
|
49
|
+
spark: Lakehouse option using Spark.
|
|
50
|
+
postgres: Lakehouse option using PostgreSQL.
|
|
51
|
+
postgres_immutable: Lakehouse option using immutable PostgreSQL.
|
|
52
|
+
"""
|
|
53
|
+
spark = 'spark'
|
|
54
|
+
postgres = 'postgres'
|
|
55
|
+
postgres_immutable = 'postgres-immutable'
|
|
56
|
+
|
|
57
|
+
class ResponseStatus(str, Enum):
|
|
58
|
+
"""
|
|
59
|
+
Enumeration for response statuses.
|
|
60
|
+
|
|
61
|
+
This enum defines the types of response statuses available.
|
|
62
|
+
|
|
63
|
+
Attributes:
|
|
64
|
+
success: Indicates a successful response.
|
|
65
|
+
error: Indicates an error response.
|
|
66
|
+
"""
|
|
67
|
+
success = 'success'
|
|
68
|
+
error = 'error'
|
|
Binary file
|
|
File without changes
|
|
Binary file
|