amsdal_cli 0.4.10__py3-none-any.whl → 0.4.12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- amsdal_cli/__about__.py +1 -1
- amsdal_cli/commands/callbacks.py +7 -1
- amsdal_cli/commands/cloud/dependency/sub_commands/dependency_delete.py +3 -8
- amsdal_cli/commands/cloud/dependency/sub_commands/dependency_list.py +6 -5
- amsdal_cli/commands/cloud/dependency/sub_commands/dependency_new.py +6 -6
- amsdal_cli/commands/cloud/deploy/sub_commands/deploy_delete.py +8 -13
- amsdal_cli/commands/cloud/deploy/sub_commands/deploy_list.py +2 -5
- amsdal_cli/commands/cloud/deploy/sub_commands/deploy_new.py +1 -1
- amsdal_cli/commands/cloud/environments/sub_commands/env_checkout.py +2 -5
- amsdal_cli/commands/cloud/environments/sub_commands/env_delete.py +2 -5
- amsdal_cli/commands/cloud/environments/sub_commands/env_list.py +2 -5
- amsdal_cli/commands/cloud/environments/sub_commands/env_new.py +2 -5
- amsdal_cli/commands/cloud/secret/sub_commands/secret_delete.py +2 -5
- amsdal_cli/commands/cloud/secret/sub_commands/secret_list.py +2 -5
- amsdal_cli/commands/cloud/secret/sub_commands/secret_new.py +2 -5
- amsdal_cli/commands/cloud/security/allowlist/sub_commands/allowlist_delete.py +2 -5
- amsdal_cli/commands/cloud/security/allowlist/sub_commands/allowlist_new.py +6 -9
- amsdal_cli/commands/cloud/security/basic_auth/sub_commands/basic_auth_delete.py +2 -5
- amsdal_cli/commands/cloud/security/basic_auth/sub_commands/basic_auth_new.py +2 -5
- amsdal_cli/commands/cloud/security/basic_auth/sub_commands/basic_auth_retrieve.py +2 -5
- amsdal_cli/commands/cloud/sub_commands/expose_db.py +2 -5
- amsdal_cli/commands/cloud/sub_commands/get_monitoring_info.py +2 -5
- amsdal_cli/commands/cloud/sub_commands/sync_db.py +1 -1
- amsdal_cli/commands/migrations/sub_commands/apply.py +1 -1
- amsdal_cli/commands/migrations/sub_commands/list.py +1 -1
- amsdal_cli/commands/migrations/sub_commands/make.py +1 -1
- amsdal_cli/commands/serve/utils.py +2 -2
- amsdal_cli/config/main.py +2 -0
- {amsdal_cli-0.4.10.dist-info → amsdal_cli-0.4.12.dist-info}/METADATA +1 -1
- {amsdal_cli-0.4.10.dist-info → amsdal_cli-0.4.12.dist-info}/RECORD +33 -35
- amsdal_cli/commands/build/schemas/manager.py +0 -358
- amsdal_cli/commands/cloud/deploy/enums.py +0 -16
- {amsdal_cli-0.4.10.dist-info → amsdal_cli-0.4.12.dist-info}/WHEEL +0 -0
- {amsdal_cli-0.4.10.dist-info → amsdal_cli-0.4.12.dist-info}/entry_points.txt +0 -0
- {amsdal_cli-0.4.10.dist-info → amsdal_cli-0.4.12.dist-info}/licenses/LICENSE.txt +0 -0
amsdal_cli/__about__.py
CHANGED
amsdal_cli/commands/callbacks.py
CHANGED
|
@@ -62,7 +62,10 @@ def init_app_context(
|
|
|
62
62
|
templates_path = Path(__file__).parent / _cmd / 'templates'
|
|
63
63
|
|
|
64
64
|
if ctx.invoked_subcommand in COMMANDS_DO_NOT_REQUIRE_APP_PATH:
|
|
65
|
-
ctx.meta['config'] = CliConfig(
|
|
65
|
+
ctx.meta['config'] = CliConfig(
|
|
66
|
+
templates_path=templates_path,
|
|
67
|
+
application_uuid=settings.AMSDAL_APPLICATION_UUID,
|
|
68
|
+
)
|
|
66
69
|
|
|
67
70
|
return
|
|
68
71
|
|
|
@@ -87,6 +90,9 @@ def init_app_context(
|
|
|
87
90
|
|
|
88
91
|
config = ctx.meta['config']
|
|
89
92
|
|
|
93
|
+
if not config.application_uuid:
|
|
94
|
+
config.application_uuid = settings.AMSDAL_APPLICATION_UUID
|
|
95
|
+
|
|
90
96
|
vcs_service = get_vcs_service(config)
|
|
91
97
|
ctx.meta['vcs_service'] = vcs_service
|
|
92
98
|
|
|
@@ -40,8 +40,7 @@ def dependency_delete_command(
|
|
|
40
40
|
if cli_config.verbose:
|
|
41
41
|
rprint(
|
|
42
42
|
rich_info(
|
|
43
|
-
f'Deleting dependency {rich_highlight(dependency_name)} from environment: '
|
|
44
|
-
f'{rich_highlight(env_name)}'
|
|
43
|
+
f'Deleting dependency {rich_highlight(dependency_name)} from environment: {rich_highlight(env_name)}'
|
|
45
44
|
)
|
|
46
45
|
)
|
|
47
46
|
|
|
@@ -51,13 +50,9 @@ def dependency_delete_command(
|
|
|
51
50
|
cli_config=cli_config,
|
|
52
51
|
config_path=cli_config.config_path,
|
|
53
52
|
)
|
|
54
|
-
app_builder.build(output_path)
|
|
53
|
+
app_builder.build(output_path, is_silent=True)
|
|
55
54
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
56
|
-
|
|
57
|
-
if AmsdalConfigManager().get_config().async_mode:
|
|
58
|
-
manager = AsyncAmsdalManager()
|
|
59
|
-
else:
|
|
60
|
-
manager = AmsdalManager()
|
|
55
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
61
56
|
|
|
62
57
|
manager.authenticate()
|
|
63
58
|
|
|
@@ -68,13 +68,14 @@ def dependency_list_command(
|
|
|
68
68
|
cli_config=cli_config,
|
|
69
69
|
config_path=cli_config.config_path,
|
|
70
70
|
)
|
|
71
|
-
app_builder.build(output_path)
|
|
71
|
+
app_builder.build(output_path, is_silent=True)
|
|
72
72
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
manager = (
|
|
75
|
+
AsyncAmsdalManager(raise_on_new_signup=True)
|
|
76
|
+
if AmsdalConfigManager().get_config().async_mode
|
|
77
|
+
else AmsdalManager(raise_on_new_signup=True)
|
|
78
|
+
)
|
|
78
79
|
|
|
79
80
|
manager.authenticate()
|
|
80
81
|
|
|
@@ -54,13 +54,13 @@ def dependency_new_command(
|
|
|
54
54
|
cli_config=cli_config,
|
|
55
55
|
config_path=cli_config.config_path,
|
|
56
56
|
)
|
|
57
|
-
app_builder.build(output_path)
|
|
57
|
+
app_builder.build(output_path, is_silent=True)
|
|
58
58
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
manager = (
|
|
60
|
+
AsyncAmsdalManager(raise_on_new_signup=True)
|
|
61
|
+
if AmsdalConfigManager().get_config().async_mode
|
|
62
|
+
else AmsdalManager(raise_on_new_signup=True)
|
|
63
|
+
)
|
|
64
64
|
|
|
65
65
|
manager.authenticate()
|
|
66
66
|
|
|
@@ -35,13 +35,9 @@ def destroy_command(ctx: typer.Context, deployment_id: str) -> None:
|
|
|
35
35
|
cli_config=cli_config,
|
|
36
36
|
config_path=cli_config.config_path,
|
|
37
37
|
)
|
|
38
|
-
app_builder.build(output_path)
|
|
38
|
+
app_builder.build(output_path, is_silent=True)
|
|
39
39
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
40
|
-
|
|
41
|
-
if AmsdalConfigManager().get_config().async_mode:
|
|
42
|
-
manager = AsyncAmsdalManager()
|
|
43
|
-
else:
|
|
44
|
-
manager = AmsdalManager()
|
|
40
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
45
41
|
|
|
46
42
|
manager.authenticate()
|
|
47
43
|
|
|
@@ -65,17 +61,17 @@ def destroy_command(ctx: typer.Context, deployment_id: str) -> None:
|
|
|
65
61
|
rprint(rich_error(f'Deployment with ID {rich_highlight(deployment_id)} not found.'))
|
|
66
62
|
return
|
|
67
63
|
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
msg = (
|
|
65
|
+
(
|
|
70
66
|
f'You are about to destroy the deployment for {rich_highlight(cli_config.application_name)} '
|
|
71
67
|
f'and environment {rich_highlight(deployment_env)}.'
|
|
72
68
|
)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
msg = (
|
|
69
|
+
if cli_config.application_name
|
|
70
|
+
else (
|
|
76
71
|
f'You are about to destroy the deployment with ID {rich_highlight(deployment_id)} and '
|
|
77
72
|
f'environment {rich_highlight(deployment_env)}.'
|
|
78
73
|
)
|
|
74
|
+
)
|
|
79
75
|
|
|
80
76
|
if not CustomConfirm.ask(
|
|
81
77
|
rich_info(f'{msg} Are you sure you want to proceed?'),
|
|
@@ -94,7 +90,6 @@ def destroy_command(ctx: typer.Context, deployment_id: str) -> None:
|
|
|
94
90
|
|
|
95
91
|
rprint(
|
|
96
92
|
rich_success(
|
|
97
|
-
'Destroying process is in progress now. '
|
|
98
|
-
'After a few minutes, you can check the status of your deployment.'
|
|
93
|
+
'Destroying process is in progress now. After a few minutes, you can check the status of your deployment.'
|
|
99
94
|
)
|
|
100
95
|
)
|
|
@@ -40,13 +40,10 @@ async def list_command(
|
|
|
40
40
|
cli_config=cli_config,
|
|
41
41
|
config_path=cli_config.config_path,
|
|
42
42
|
)
|
|
43
|
-
app_builder.build(output_path)
|
|
43
|
+
app_builder.build(output_path, is_silent=True)
|
|
44
44
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
45
45
|
|
|
46
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
47
|
-
manager = AsyncAmsdalManager()
|
|
48
|
-
else:
|
|
49
|
-
manager = AmsdalManager()
|
|
46
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
50
47
|
|
|
51
48
|
manager.authenticate()
|
|
52
49
|
|
|
@@ -34,13 +34,10 @@ def environments_checkout(ctx: typer.Context, env_name: str) -> None:
|
|
|
34
34
|
cli_config=cli_config,
|
|
35
35
|
config_path=cli_config.config_path,
|
|
36
36
|
)
|
|
37
|
-
app_builder.build(output_path)
|
|
37
|
+
app_builder.build(output_path, is_silent=True)
|
|
38
38
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
39
39
|
|
|
40
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
41
|
-
manager = AsyncAmsdalManager()
|
|
42
|
-
else:
|
|
43
|
-
manager = AmsdalManager()
|
|
40
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
44
41
|
|
|
45
42
|
manager.authenticate()
|
|
46
43
|
|
|
@@ -31,13 +31,10 @@ def env_delete_command(ctx: typer.Context, env_name: str) -> None:
|
|
|
31
31
|
cli_config=cli_config,
|
|
32
32
|
config_path=cli_config.config_path,
|
|
33
33
|
)
|
|
34
|
-
app_builder.build(output_path)
|
|
34
|
+
app_builder.build(output_path, is_silent=True)
|
|
35
35
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
36
36
|
|
|
37
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
38
|
-
manager = AsyncAmsdalManager()
|
|
39
|
-
else:
|
|
40
|
-
manager = AmsdalManager()
|
|
37
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
41
38
|
|
|
42
39
|
manager.authenticate()
|
|
43
40
|
|
|
@@ -42,13 +42,10 @@ def environments_list_callback(
|
|
|
42
42
|
cli_config=cli_config,
|
|
43
43
|
config_path=cli_config.config_path,
|
|
44
44
|
)
|
|
45
|
-
app_builder.build(output_path)
|
|
45
|
+
app_builder.build(output_path, is_silent=True)
|
|
46
46
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
47
47
|
|
|
48
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
49
|
-
manager = AsyncAmsdalManager()
|
|
50
|
-
else:
|
|
51
|
-
manager = AmsdalManager()
|
|
48
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
52
49
|
|
|
53
50
|
manager.authenticate()
|
|
54
51
|
|
|
@@ -31,13 +31,10 @@ def env_add_command(ctx: typer.Context, env_name: str) -> None:
|
|
|
31
31
|
cli_config=cli_config,
|
|
32
32
|
config_path=cli_config.config_path,
|
|
33
33
|
)
|
|
34
|
-
app_builder.build(output_path)
|
|
34
|
+
app_builder.build(output_path, is_silent=True)
|
|
35
35
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
36
36
|
|
|
37
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
38
|
-
manager = AsyncAmsdalManager()
|
|
39
|
-
else:
|
|
40
|
-
manager = AmsdalManager()
|
|
37
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
41
38
|
|
|
42
39
|
manager.authenticate()
|
|
43
40
|
|
|
@@ -46,13 +46,10 @@ def secret_delete_command(
|
|
|
46
46
|
cli_config=cli_config,
|
|
47
47
|
config_path=cli_config.config_path,
|
|
48
48
|
)
|
|
49
|
-
app_builder.build(output_path)
|
|
49
|
+
app_builder.build(output_path, is_silent=True)
|
|
50
50
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
51
51
|
|
|
52
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
53
|
-
manager = AsyncAmsdalManager()
|
|
54
|
-
else:
|
|
55
|
-
manager = AmsdalManager()
|
|
52
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
56
53
|
|
|
57
54
|
manager.authenticate()
|
|
58
55
|
|
|
@@ -68,13 +68,10 @@ def secret_list_command(
|
|
|
68
68
|
cli_config=cli_config,
|
|
69
69
|
config_path=cli_config.config_path,
|
|
70
70
|
)
|
|
71
|
-
app_builder.build(output_path)
|
|
71
|
+
app_builder.build(output_path, is_silent=True)
|
|
72
72
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
73
73
|
|
|
74
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
75
|
-
manager = AsyncAmsdalManager()
|
|
76
|
-
else:
|
|
77
|
-
manager = AmsdalManager()
|
|
74
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
78
75
|
|
|
79
76
|
manager.authenticate()
|
|
80
77
|
|
|
@@ -48,13 +48,10 @@ def secret_add_command(
|
|
|
48
48
|
cli_config=cli_config,
|
|
49
49
|
config_path=cli_config.config_path,
|
|
50
50
|
)
|
|
51
|
-
app_builder.build(output_path)
|
|
51
|
+
app_builder.build(output_path, is_silent=True)
|
|
52
52
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
53
53
|
|
|
54
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
55
|
-
manager = AsyncAmsdalManager()
|
|
56
|
-
else:
|
|
57
|
-
manager = AmsdalManager()
|
|
54
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
58
55
|
|
|
59
56
|
manager.authenticate()
|
|
60
57
|
|
|
@@ -68,13 +68,10 @@ def delete_allowlist_ip_command(
|
|
|
68
68
|
cli_config=cli_config,
|
|
69
69
|
config_path=cli_config.config_path,
|
|
70
70
|
)
|
|
71
|
-
app_builder.build(output_path)
|
|
71
|
+
app_builder.build(output_path, is_silent=True)
|
|
72
72
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
73
73
|
|
|
74
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
75
|
-
manager = AsyncAmsdalManager()
|
|
76
|
-
else:
|
|
77
|
-
manager = AmsdalManager()
|
|
74
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
78
75
|
|
|
79
76
|
manager.authenticate()
|
|
80
77
|
|
|
@@ -33,10 +33,10 @@ def new_allowlist_ip_command(
|
|
|
33
33
|
Examples of usage:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
amsdal cloud security allowlist
|
|
37
|
-
amsdal cloud security allowlist
|
|
38
|
-
amsdal cloud security allowlist
|
|
39
|
-
amsdal cloud security allowlist
|
|
36
|
+
amsdal cloud security allowlist new
|
|
37
|
+
amsdal cloud security allowlist new --ip-address 0.0.0.0
|
|
38
|
+
amsdal cloud security allowlist new --ip-address 0.0.0.0/24
|
|
39
|
+
amsdal cloud security allowlist new --ip-address 0.0.0.0,1.0.0.0/24
|
|
40
40
|
```
|
|
41
41
|
"""
|
|
42
42
|
from amsdal.errors import AmsdalCloudError
|
|
@@ -65,13 +65,10 @@ def new_allowlist_ip_command(
|
|
|
65
65
|
cli_config=cli_config,
|
|
66
66
|
config_path=cli_config.config_path,
|
|
67
67
|
)
|
|
68
|
-
app_builder.build(output_path)
|
|
68
|
+
app_builder.build(output_path, is_silent=True)
|
|
69
69
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
70
70
|
|
|
71
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
72
|
-
manager = AsyncAmsdalManager()
|
|
73
|
-
else:
|
|
74
|
-
manager = AmsdalManager()
|
|
71
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
75
72
|
|
|
76
73
|
manager.authenticate()
|
|
77
74
|
|
|
@@ -45,13 +45,10 @@ def delete_basic_auth_command(
|
|
|
45
45
|
cli_config=cli_config,
|
|
46
46
|
config_path=cli_config.config_path,
|
|
47
47
|
)
|
|
48
|
-
app_builder.build(output_path)
|
|
48
|
+
app_builder.build(output_path, is_silent=True)
|
|
49
49
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
50
50
|
|
|
51
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
52
|
-
manager = AsyncAmsdalManager()
|
|
53
|
-
else:
|
|
54
|
-
manager = AmsdalManager()
|
|
51
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
55
52
|
|
|
56
53
|
manager.authenticate()
|
|
57
54
|
|
|
@@ -68,13 +68,10 @@ def new_basic_auth_command(
|
|
|
68
68
|
cli_config=cli_config,
|
|
69
69
|
config_path=cli_config.config_path,
|
|
70
70
|
)
|
|
71
|
-
app_builder.build(output_path)
|
|
71
|
+
app_builder.build(output_path, is_silent=True)
|
|
72
72
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
73
73
|
|
|
74
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
75
|
-
manager = AsyncAmsdalManager()
|
|
76
|
-
else:
|
|
77
|
-
manager = AmsdalManager()
|
|
74
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
78
75
|
|
|
79
76
|
manager.authenticate()
|
|
80
77
|
|
|
@@ -51,13 +51,10 @@ def retrieve_basic_auth_command(
|
|
|
51
51
|
cli_config=cli_config,
|
|
52
52
|
config_path=cli_config.config_path,
|
|
53
53
|
)
|
|
54
|
-
app_builder.build(output_path)
|
|
54
|
+
app_builder.build(output_path, is_silent=True)
|
|
55
55
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
56
56
|
|
|
57
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
58
|
-
manager = AsyncAmsdalManager()
|
|
59
|
-
else:
|
|
60
|
-
manager = AmsdalManager()
|
|
57
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
61
58
|
|
|
62
59
|
manager.authenticate()
|
|
63
60
|
|
|
@@ -48,13 +48,10 @@ def expose_db_command(
|
|
|
48
48
|
config_path=cli_config.config_path,
|
|
49
49
|
)
|
|
50
50
|
|
|
51
|
-
app_builder.build(output_path)
|
|
51
|
+
app_builder.build(output_path, is_silent=True)
|
|
52
52
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
53
53
|
|
|
54
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
55
|
-
manager = AsyncAmsdalManager()
|
|
56
|
-
else:
|
|
57
|
-
manager = AmsdalManager()
|
|
54
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
58
55
|
|
|
59
56
|
manager.authenticate()
|
|
60
57
|
|
|
@@ -51,14 +51,11 @@ def get_monitoring_info(
|
|
|
51
51
|
config_path=cli_config.config_path,
|
|
52
52
|
)
|
|
53
53
|
|
|
54
|
-
app_builder.build(output_path)
|
|
54
|
+
app_builder.build(output_path, is_silent=True)
|
|
55
55
|
|
|
56
56
|
manager: AsyncAmsdalManager | AmsdalManager
|
|
57
57
|
|
|
58
|
-
if AmsdalConfigManager().get_config().async_mode
|
|
59
|
-
manager = AsyncAmsdalManager()
|
|
60
|
-
else:
|
|
61
|
-
manager = AmsdalManager()
|
|
58
|
+
manager = AsyncAmsdalManager() if AmsdalConfigManager().get_config().async_mode else AmsdalManager()
|
|
62
59
|
|
|
63
60
|
manager.authenticate()
|
|
64
61
|
|
|
@@ -260,7 +260,7 @@ def apply_migrations(
|
|
|
260
260
|
cli_config=cli_config,
|
|
261
261
|
config_path=config or cli_config.config_path,
|
|
262
262
|
)
|
|
263
|
-
app_builder.build(build_dir)
|
|
263
|
+
app_builder.build(build_dir, is_silent=True)
|
|
264
264
|
|
|
265
265
|
if AmsdalConfigManager().get_config().async_mode:
|
|
266
266
|
asyncio.run(
|
|
@@ -74,7 +74,7 @@ def list_migrations(
|
|
|
74
74
|
cli_config=cli_config,
|
|
75
75
|
config_path=config or cli_config.config_path,
|
|
76
76
|
)
|
|
77
|
-
app_builder.build(build_dir)
|
|
77
|
+
app_builder.build(build_dir, is_silent=True)
|
|
78
78
|
|
|
79
79
|
if AmsdalConfigManager().get_config().async_mode:
|
|
80
80
|
_all_applied_migrations = asyncio.run(_async_fetch_migrations(build_dir / MIGRATIONS_DIR_NAME))
|
|
@@ -159,7 +159,7 @@ def make_migrations(
|
|
|
159
159
|
cli_config=cli_config,
|
|
160
160
|
config_path=config or cli_config.config_path,
|
|
161
161
|
)
|
|
162
|
-
app_builder.build(build_dir)
|
|
162
|
+
app_builder.build(build_dir, is_silent=True)
|
|
163
163
|
cli_config.models_format = ModelsFormat.PY
|
|
164
164
|
|
|
165
165
|
if AmsdalConfigManager().get_config().async_mode:
|
|
@@ -83,7 +83,7 @@ def build_app_and_check_migrations(
|
|
|
83
83
|
cli_config=cli_config,
|
|
84
84
|
config_path=config_path,
|
|
85
85
|
)
|
|
86
|
-
app_builder.build(output_path)
|
|
86
|
+
app_builder.build(output_path, is_silent=True)
|
|
87
87
|
|
|
88
88
|
amsdal_manager = AmsdalManager()
|
|
89
89
|
amsdal_manager.pre_setup()
|
|
@@ -341,7 +341,7 @@ async def async_build_app_and_check_migrations(
|
|
|
341
341
|
cli_config=cli_config,
|
|
342
342
|
config_path=config_path,
|
|
343
343
|
)
|
|
344
|
-
app_builder.build(output_path)
|
|
344
|
+
app_builder.build(output_path, is_silent=True)
|
|
345
345
|
|
|
346
346
|
amsdal_manager = AsyncAmsdalManager()
|
|
347
347
|
amsdal_manager.pre_setup()
|
amsdal_cli/config/main.py
CHANGED
|
@@ -38,6 +38,8 @@ class Settings(BaseSettings):
|
|
|
38
38
|
|
|
39
39
|
CHECK_AMSDAL_VERSIONS: bool = True
|
|
40
40
|
"""If True, the latest version of the amsdal modules will be checked and displayed."""
|
|
41
|
+
AMSDAL_APPLICATION_UUID: str | None = None
|
|
42
|
+
"""The UUID of the application."""
|
|
41
43
|
|
|
42
44
|
@field_validator('COMMANDS')
|
|
43
45
|
@classmethod
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
amsdal_cli/Third-Party Materials - AMSDAL Dependencies - License Notices.md,sha256=eHOIhsC6pZv3Wf8aKfaBNJhVi20gM6Rm2PakZTrdIOQ,66641
|
|
2
|
-
amsdal_cli/__about__.py,sha256=
|
|
2
|
+
amsdal_cli/__about__.py,sha256=gYTrUkWirZpWE2ZgeVQtuizy8s0aSITCM0NkS3m3Xdw,125
|
|
3
3
|
amsdal_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
amsdal_cli/app.py,sha256=_ucuLT5ospf1ifFKEG0IMfVnxKjnvPUQ4iMhkvOfCrc,466
|
|
5
5
|
amsdal_cli/main.py,sha256=LtH-BD1eJrAUecjKzC8Gx7kYFUstOMH1erdeJUVqFB8,144
|
|
6
6
|
amsdal_cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
amsdal_cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
amsdal_cli/commands/callbacks.py,sha256=
|
|
8
|
+
amsdal_cli/commands/callbacks.py,sha256=QzTxqkMa6c4mNhE41J5YnUn8RpD-QqWigv7nzHmtjq8,3686
|
|
9
9
|
amsdal_cli/commands/build/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
amsdal_cli/commands/build/command.py,sha256=1-Thx2Iz-xr9UDulTiBRZYValCdWhg-SgUAnF370N1o,742
|
|
11
11
|
amsdal_cli/commands/build/constants.py,sha256=an5hbofZrKzyFfxTCu4VSmNQGtAMRSrDj1_TnncyZOw,42
|
|
12
12
|
amsdal_cli/commands/build/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
amsdal_cli/commands/build/schemas/manager.py,sha256=4eldtxw6dV83hQF5sWlhXSZHQIBZyiyA5-o61JRdtq8,12844
|
|
14
13
|
amsdal_cli/commands/build/schemas/schema_json_loader.py,sha256=l8u3WftSH4l-a9PbWo2jb-Ks6jzOhmYT14Lesm3WB8A,4776
|
|
15
14
|
amsdal_cli/commands/build/schemas/data_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
15
|
amsdal_cli/commands/build/schemas/data_models/custom_code.py,sha256=slXyNHvhYW79CzBU5UH2Lnsj4DZHsoY0VAIl_oe4_JM,977
|
|
@@ -50,35 +49,34 @@ amsdal_cli/commands/cloud/dependency/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
|
|
|
50
49
|
amsdal_cli/commands/cloud/dependency/app.py,sha256=m2pcB5z3257uU7pKt9XoOdQn7J3PUys6elCs9c9qc2o,230
|
|
51
50
|
amsdal_cli/commands/cloud/dependency/command.py,sha256=6nri04NBl4fy4FlrZyorY05samMbYU1-2j88m4t2FD4,272
|
|
52
51
|
amsdal_cli/commands/cloud/dependency/sub_commands/__init__.py,sha256=ZH89xFzDRJmV2e7MdCVDgaZ30B7jxRVUKTNzHAgTFeE,419
|
|
53
|
-
amsdal_cli/commands/cloud/dependency/sub_commands/dependency_delete.py,sha256=
|
|
54
|
-
amsdal_cli/commands/cloud/dependency/sub_commands/dependency_list.py,sha256=
|
|
55
|
-
amsdal_cli/commands/cloud/dependency/sub_commands/dependency_new.py,sha256=
|
|
52
|
+
amsdal_cli/commands/cloud/dependency/sub_commands/dependency_delete.py,sha256=uD2aNvF3rZowum4h3RELUPANp4w_Pjt6RyI_k9dCtu0,2910
|
|
53
|
+
amsdal_cli/commands/cloud/dependency/sub_commands/dependency_list.py,sha256=n49qaetWboVsrsI6DDCZg5KVroXk2p_C0MhWeF4tP-Y,5297
|
|
54
|
+
amsdal_cli/commands/cloud/dependency/sub_commands/dependency_new.py,sha256=FSH7F5Hr15ThY04xQg4IkHOzqr1vWfXiqSCsTnMR0zo,2991
|
|
56
55
|
amsdal_cli/commands/cloud/deploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
56
|
amsdal_cli/commands/cloud/deploy/app.py,sha256=_t2LVD8apbyvBrcWdNv1_nXtubng1hLW9fIV97_F8VU,222
|
|
58
57
|
amsdal_cli/commands/cloud/deploy/command.py,sha256=LIX07pTU55GUA9KmTiKDtoCj5Ytx9ZDC7XQsVYUYsh8,262
|
|
59
|
-
amsdal_cli/commands/cloud/deploy/enums.py,sha256=ASZFqAJSo59hRVRoQn4xYHpwM9iZOEFWt5eKasI71BM,311
|
|
60
58
|
amsdal_cli/commands/cloud/deploy/sub_commands/__init__.py,sha256=I7MJEyceCIgCXP7JpX06nLvEA6HUkjj9LSDAb7VfTGo,353
|
|
61
|
-
amsdal_cli/commands/cloud/deploy/sub_commands/deploy_delete.py,sha256=
|
|
62
|
-
amsdal_cli/commands/cloud/deploy/sub_commands/deploy_list.py,sha256=
|
|
63
|
-
amsdal_cli/commands/cloud/deploy/sub_commands/deploy_new.py,sha256=
|
|
59
|
+
amsdal_cli/commands/cloud/deploy/sub_commands/deploy_delete.py,sha256=pRLumeigF4e_Nod32p6XkgJsYxbB9H3WSxbv0IwA5Eo,3221
|
|
60
|
+
amsdal_cli/commands/cloud/deploy/sub_commands/deploy_list.py,sha256=Nm-uaAmCjLP9UDFNM-E79QLAiqy6_9VQSTd_W8bKoE0,5532
|
|
61
|
+
amsdal_cli/commands/cloud/deploy/sub_commands/deploy_new.py,sha256=FTcILPoesHXGvZlsax8VivKE3Ghw63fKK1EAIenSoWU,12718
|
|
64
62
|
amsdal_cli/commands/cloud/environments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
65
63
|
amsdal_cli/commands/cloud/environments/app.py,sha256=kkzf_kW2jpl3d44qWuIZB5C3uWXzpNpnTIvUpuuPJHE,238
|
|
66
64
|
amsdal_cli/commands/cloud/environments/command.py,sha256=roeg2tpa53W1qzCa_3-zEn5z2xiVS4STWB9M7P5BVKA,283
|
|
67
65
|
amsdal_cli/commands/cloud/environments/constants.py,sha256=wRfOxpO2qosOxWqa4JzPchG3F67U0Wq4mGNd8rPF658,21
|
|
68
66
|
amsdal_cli/commands/cloud/environments/utils.py,sha256=Lc_91f1CnQfDw0Pmo0sopOuxV5vEVpZ-RaxyQzMkmOA,1250
|
|
69
67
|
amsdal_cli/commands/cloud/environments/sub_commands/__init__.py,sha256=aHGv5FOfgz-CJ6y4rph3wC7O4NMkVYlKZduoFrGGtG0,508
|
|
70
|
-
amsdal_cli/commands/cloud/environments/sub_commands/env_checkout.py,sha256=
|
|
71
|
-
amsdal_cli/commands/cloud/environments/sub_commands/env_delete.py,sha256=
|
|
72
|
-
amsdal_cli/commands/cloud/environments/sub_commands/env_list.py,sha256=
|
|
73
|
-
amsdal_cli/commands/cloud/environments/sub_commands/env_new.py,sha256=
|
|
68
|
+
amsdal_cli/commands/cloud/environments/sub_commands/env_checkout.py,sha256=S4wh-7i5DFls-WTqSAUZXkEkiD2vDjBbbiD0S0K_ZQA,2433
|
|
69
|
+
amsdal_cli/commands/cloud/environments/sub_commands/env_delete.py,sha256=4OlTKASd0fKCh7Pv7AUcMJlgiQYVViID1GwlQsmOsgc,1773
|
|
70
|
+
amsdal_cli/commands/cloud/environments/sub_commands/env_list.py,sha256=7QT-cVuBVQ3ddjlCLVIXf-D9PI1lkaUn96K1THW6A-Q,2789
|
|
71
|
+
amsdal_cli/commands/cloud/environments/sub_commands/env_new.py,sha256=GzemfFXc623OU1PakUhMAJ8vcJhXopXSghTSMx0joPs,1761
|
|
74
72
|
amsdal_cli/commands/cloud/secret/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
75
73
|
amsdal_cli/commands/cloud/secret/app.py,sha256=0GnTkNYAUQwGpccton4Ndy2NYTEGox53I7UteHTXX-Y,224
|
|
76
74
|
amsdal_cli/commands/cloud/secret/command.py,sha256=mvEjNIiuxowlHkxK_BNOT6dh0cYaaabkuXc4sEj48N0,253
|
|
77
75
|
amsdal_cli/commands/cloud/secret/constants.py,sha256=PV-zaetPqFqCglrKIIYaLl4vp6nx7bjo1lwRluS_0fY,374
|
|
78
76
|
amsdal_cli/commands/cloud/secret/sub_commands/__init__.py,sha256=ksQU60Ue4qzU8Wlgp9_pGNiI6L63WSdF8y_TT5W2Tg8,371
|
|
79
|
-
amsdal_cli/commands/cloud/secret/sub_commands/secret_delete.py,sha256=
|
|
80
|
-
amsdal_cli/commands/cloud/secret/sub_commands/secret_list.py,sha256=
|
|
81
|
-
amsdal_cli/commands/cloud/secret/sub_commands/secret_new.py,sha256=
|
|
77
|
+
amsdal_cli/commands/cloud/secret/sub_commands/secret_delete.py,sha256=BnrK66GkChnttI7b_PZMOC8iw2yhgcBFiIavwpqY378,2763
|
|
78
|
+
amsdal_cli/commands/cloud/secret/sub_commands/secret_list.py,sha256=VA2ardvc8puiIZWApL6QQqX4bkDS7gWabJoVSbWs5xg,5373
|
|
79
|
+
amsdal_cli/commands/cloud/secret/sub_commands/secret_new.py,sha256=7wtKfaooZAElmqk13I5KuueFeO4EZ9BmRTLOmz3yXAM,2758
|
|
82
80
|
amsdal_cli/commands/cloud/security/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
83
81
|
amsdal_cli/commands/cloud/security/app.py,sha256=N3lmXT0kmeHmGIQAXzcnO-MEwbcwZnfRLhwR5KQHttM,174
|
|
84
82
|
amsdal_cli/commands/cloud/security/command.py,sha256=JuaC3nJOczDgbrwuLMyITaC0W5rAdUMnRZWJdN3e0oE,335
|
|
@@ -86,19 +84,19 @@ amsdal_cli/commands/cloud/security/allowlist/__init__.py,sha256=47DEQpj8HBSa-_TI
|
|
|
86
84
|
amsdal_cli/commands/cloud/security/allowlist/app.py,sha256=xNJERBlSm0o_GO6S1oshJdwE4jm-AJKk61BMRtk0z7k,165
|
|
87
85
|
amsdal_cli/commands/cloud/security/allowlist/command.py,sha256=76hh337pmJ9dj6sWjdjnYngN8qW22UaCnCuHXbjrY_8,303
|
|
88
86
|
amsdal_cli/commands/cloud/security/allowlist/sub_commands/__init__.py,sha256=SYaJuNbjzTUMaaMlh0T9n7GgWNImLvE6EM_Osab4sJQ,306
|
|
89
|
-
amsdal_cli/commands/cloud/security/allowlist/sub_commands/allowlist_delete.py,sha256=
|
|
90
|
-
amsdal_cli/commands/cloud/security/allowlist/sub_commands/allowlist_new.py,sha256=
|
|
87
|
+
amsdal_cli/commands/cloud/security/allowlist/sub_commands/allowlist_delete.py,sha256=xsx15s797EJMSADAsGUeDHg2mDrJs2GompemRb0DyK4,3284
|
|
88
|
+
amsdal_cli/commands/cloud/security/allowlist/sub_commands/allowlist_new.py,sha256=0ldIAjUeXPC_e0yhG0_RNItUTKgLZVagqU3Ss9m6SXA,3182
|
|
91
89
|
amsdal_cli/commands/cloud/security/basic_auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
92
90
|
amsdal_cli/commands/cloud/security/basic_auth/app.py,sha256=l2sbhIqUoxyyQYS-LNh8WMbeMaRVRFUDmdeFDIWVfxU,168
|
|
93
91
|
amsdal_cli/commands/cloud/security/basic_auth/command.py,sha256=zaiBn9tuSHsUETKXeLqSIyCNZRDwv6pBNOLVsRatoWQ,320
|
|
94
92
|
amsdal_cli/commands/cloud/security/basic_auth/sub_commands/__init__.py,sha256=BY5_pOBj0HBJ4kKRfrdgTYVwNU80wDaPd1O4Q88kIP8,456
|
|
95
|
-
amsdal_cli/commands/cloud/security/basic_auth/sub_commands/basic_auth_delete.py,sha256=
|
|
96
|
-
amsdal_cli/commands/cloud/security/basic_auth/sub_commands/basic_auth_new.py,sha256=
|
|
97
|
-
amsdal_cli/commands/cloud/security/basic_auth/sub_commands/basic_auth_retrieve.py,sha256=
|
|
93
|
+
amsdal_cli/commands/cloud/security/basic_auth/sub_commands/basic_auth_delete.py,sha256=g69s80dJnHF8sc9eo3r7-Kc6Ua8G1WrILw-Y1vFrjRI,2324
|
|
94
|
+
amsdal_cli/commands/cloud/security/basic_auth/sub_commands/basic_auth_new.py,sha256=gdUqnV9jrN8wuSZZAjNA0SAKGtXpTFlOqtMjM5YXpn8,3566
|
|
95
|
+
amsdal_cli/commands/cloud/security/basic_auth/sub_commands/basic_auth_retrieve.py,sha256=646E891J3cm6hnztJEB8Vayjml3Db7lR5uHVbftzcdg,2846
|
|
98
96
|
amsdal_cli/commands/cloud/sub_commands/__init__.py,sha256=1BxZZulRUcVdrz_zrbwkYpzDJDIDO7ZaziKr2InmWWU,335
|
|
99
|
-
amsdal_cli/commands/cloud/sub_commands/expose_db.py,sha256=
|
|
100
|
-
amsdal_cli/commands/cloud/sub_commands/get_monitoring_info.py,sha256=
|
|
101
|
-
amsdal_cli/commands/cloud/sub_commands/sync_db.py,sha256=
|
|
97
|
+
amsdal_cli/commands/cloud/sub_commands/expose_db.py,sha256=o5Q9oPOKscyRZhkmKOUmzxe1qvLoEjS2Xq-R5IdqSnE,2309
|
|
98
|
+
amsdal_cli/commands/cloud/sub_commands/get_monitoring_info.py,sha256=ulpFGXbu80BhN8dAvtCBhIoskigEHnwRVfVVkdxGGLs,2933
|
|
99
|
+
amsdal_cli/commands/cloud/sub_commands/sync_db.py,sha256=o5yaqcanCDffaAj73jvk7vXtT4gZw7np2DDkhv6GpCE,11335
|
|
102
100
|
amsdal_cli/commands/generate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
103
101
|
amsdal_cli/commands/generate/app.py,sha256=-wEccTR0MhZyj3Y1R2VMyO9RzyGiBSrdWNPQc4ACHqc,201
|
|
104
102
|
amsdal_cli/commands/generate/command.py,sha256=j6CGiZ_7st-A6qpMTA8XYl15UeONopauQALObVWB2xc,197
|
|
@@ -137,9 +135,9 @@ amsdal_cli/commands/migrations/app.py,sha256=0HsKjZ5D2j9xkOi2Fuvs3VdlhWyQnS8XJ6p
|
|
|
137
135
|
amsdal_cli/commands/migrations/command.py,sha256=jlpdYZAc02ZUBxSdzGSzkDxEb1nlHNzoq05FdRCSzus,206
|
|
138
136
|
amsdal_cli/commands/migrations/constants.py,sha256=846-DQ-Iqcxw2akd5aBAmbnXHDmRFqEKu6vai2ZFBkU,35
|
|
139
137
|
amsdal_cli/commands/migrations/sub_commands/__init__.py,sha256=_rWbDyY3DPdN-6vE60djCtHejvSkl6d1e2Z4ScM52bo,976
|
|
140
|
-
amsdal_cli/commands/migrations/sub_commands/apply.py,sha256=
|
|
141
|
-
amsdal_cli/commands/migrations/sub_commands/list.py,sha256=
|
|
142
|
-
amsdal_cli/commands/migrations/sub_commands/make.py,sha256
|
|
138
|
+
amsdal_cli/commands/migrations/sub_commands/apply.py,sha256=J4v29EabFmT7IXmu95PFOM26vdSGcMW1RhlS3zUcE7E,9435
|
|
139
|
+
amsdal_cli/commands/migrations/sub_commands/list.py,sha256=AmYd8uR2j7ZCQjZIvg1Y1NwIFkPbb1CZaJc1ZYIkuwM,5359
|
|
140
|
+
amsdal_cli/commands/migrations/sub_commands/make.py,sha256=-CtC-2_5BS1UK9Nrjt_JqDRv1wLACn3QkAncAUi4UVk,6232
|
|
143
141
|
amsdal_cli/commands/new/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
144
142
|
amsdal_cli/commands/new/command.py,sha256=NDuDZNwreyuHsv4tbE-yrNOJViB8wk35IcKvGKQXPXo,3302
|
|
145
143
|
amsdal_cli/commands/new/templates/.amsdal-cli,sha256=PdXPovcT8AfPhqwDLI_4EWFYAS6e3J5JcsHVityBdF8,304
|
|
@@ -166,7 +164,7 @@ amsdal_cli/commands/restore/command.py,sha256=YtQNebOrCuBlxMs_kTS_hALkt8pFl7hvNo
|
|
|
166
164
|
amsdal_cli/commands/restore/enums.py,sha256=6SiKMRGlSjiLyepfbfQFXGAYqlM6Bkoeko2KscntTUQ,307
|
|
167
165
|
amsdal_cli/commands/serve/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
168
166
|
amsdal_cli/commands/serve/command.py,sha256=tjm1T0yrA2P6nlk_KDNv6Gih2Dkt5nMIN-_WUrLhn58,6541
|
|
169
|
-
amsdal_cli/commands/serve/utils.py,sha256=
|
|
167
|
+
amsdal_cli/commands/serve/utils.py,sha256=o9rVLSMXRTGDb6CGTsfgKkNXBhRqbaLyRFNUNYzElkg,17301
|
|
170
168
|
amsdal_cli/commands/serve/filters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
171
169
|
amsdal_cli/commands/serve/filters/models_watch_filter.py,sha256=cnoAjrn-PYDAFq5MtgbQ6QeCvJJmcNisVNlA8QtFv4A,170
|
|
172
170
|
amsdal_cli/commands/serve/filters/static_files_watch_filter.py,sha256=jKAF5RHq1au2v0kcOrqaAHP1x5IUjt_KgZURJLm29Tw,552
|
|
@@ -186,7 +184,7 @@ amsdal_cli/commands/worker/command.py,sha256=e3uL38VYCp71-XsVYvE1xlt2FqhP54ujlhV
|
|
|
186
184
|
amsdal_cli/commands/worker/sub_commands/__init__.py,sha256=5AVFexW1UpfPpfNfYoioA6Pix1uiRSEjVEa-_wP89j4,100
|
|
187
185
|
amsdal_cli/commands/worker/sub_commands/run.py,sha256=Bnl__gGl058IR_7JuJ915fOWbctRNH_Vqv3a-PFx8Do,4375
|
|
188
186
|
amsdal_cli/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
189
|
-
amsdal_cli/config/main.py,sha256=
|
|
187
|
+
amsdal_cli/config/main.py,sha256=A1XPNQmf7usUu2h80DlRiOPpyT8KkGVTjxUeCYHjpaU,2787
|
|
190
188
|
amsdal_cli/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
191
189
|
amsdal_cli/utils/alias_group.py,sha256=v0ninrhZGtZFuJtUH6ZZZ97Irs96nkmIBFm2gY1NdmU,991
|
|
192
190
|
amsdal_cli/utils/check_versions.py,sha256=4Q3GwY_0xgP_RV_ITuFSDigXds-f1QhqCqkUkn-CSMI,1475
|
|
@@ -201,8 +199,8 @@ amsdal_cli/utils/vcs/base.py,sha256=jC05ExJZDnyHAsW7_4IDf8gQcYgK4dXq3zNlFIX66T4,
|
|
|
201
199
|
amsdal_cli/utils/vcs/dummy.py,sha256=Lk8MT-b0YlHHUsiXsq5cvmPwcl4jTYdo8piN5_C8ORA,434
|
|
202
200
|
amsdal_cli/utils/vcs/enums.py,sha256=tYR9LN1IOr8BZFbSeX_vDlhn8fPl4IU-Yakii8lRDYs,69
|
|
203
201
|
amsdal_cli/utils/vcs/git.py,sha256=xHynbZcV6p2D3RFCwu1MGGpV9D7eK-pGUtO8kVexTQM,1269
|
|
204
|
-
amsdal_cli-0.4.
|
|
205
|
-
amsdal_cli-0.4.
|
|
206
|
-
amsdal_cli-0.4.
|
|
207
|
-
amsdal_cli-0.4.
|
|
208
|
-
amsdal_cli-0.4.
|
|
202
|
+
amsdal_cli-0.4.12.dist-info/METADATA,sha256=j3DkWjUlxhxVdYw4NNKcrFJDnzbTIBdz4191gSlf3eo,57050
|
|
203
|
+
amsdal_cli-0.4.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
204
|
+
amsdal_cli-0.4.12.dist-info/entry_points.txt,sha256=GC-8LZsD3W--Pd9_gD4W3tw3ZZyPbSvkZ-qWc9Fx0NI,47
|
|
205
|
+
amsdal_cli-0.4.12.dist-info/licenses/LICENSE.txt,sha256=hG-541PFYfNJi9WRZi_hno91UyqNg7YLK8LR3vLblZA,27355
|
|
206
|
+
amsdal_cli-0.4.12.dist-info/RECORD,,
|
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
import logging
|
|
3
|
-
from collections.abc import Iterator
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
|
|
6
|
-
from amsdal.schemas.mixins.check_dependencies_mixin import CheckDependenciesMixin
|
|
7
|
-
from amsdal.schemas.mixins.verify_schemas_mixin import VerifySchemasMixin
|
|
8
|
-
from amsdal_utils.errors import AmsdalError
|
|
9
|
-
from amsdal_utils.models.enums import ModuleType
|
|
10
|
-
from amsdal_utils.schemas.schema import ObjectSchema
|
|
11
|
-
from pydantic import ValidationError
|
|
12
|
-
|
|
13
|
-
from amsdal_cli.commands.build.schemas.data_models.schemas_directory import SchemasDirectory
|
|
14
|
-
from amsdal_cli.commands.build.schemas.extenders.custom_code_extender import CustomCodeExtender
|
|
15
|
-
from amsdal_cli.commands.build.schemas.extenders.options_extender import OptionsExtender
|
|
16
|
-
from amsdal_cli.commands.build.schemas.loaders.cli_custom_code_loader import CliCustomCodeLoader
|
|
17
|
-
from amsdal_cli.commands.build.schemas.loaders.cli_loader import CliConfigLoader
|
|
18
|
-
from amsdal_cli.commands.build.schemas.loaders.cli_options_loader import CliOptionsLoader
|
|
19
|
-
from amsdal_cli.commands.build.schemas.mixins.enrich_schemas_mixin import EnrichSchemasMixin
|
|
20
|
-
|
|
21
|
-
logger = logging.getLogger(__name__)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class BuildSchemasManager(EnrichSchemasMixin, VerifySchemasMixin, CheckDependenciesMixin):
|
|
25
|
-
"""
|
|
26
|
-
Manages the building and verification of schemas.
|
|
27
|
-
|
|
28
|
-
This class is responsible for loading, enriching, verifying, and checking dependencies of various schemas.
|
|
29
|
-
It handles type, core, contrib, and user schemas, ensuring they are properly loaded and validated.
|
|
30
|
-
"""
|
|
31
|
-
|
|
32
|
-
_type_schemas: list[ObjectSchema]
|
|
33
|
-
_core_schemas: list[ObjectSchema]
|
|
34
|
-
_contrib_schemas: list[ObjectSchema]
|
|
35
|
-
_user_schemas: list[ObjectSchema]
|
|
36
|
-
|
|
37
|
-
def __init__(self, schemas_directories: list[SchemasDirectory]):
|
|
38
|
-
self._schemas_directories = schemas_directories
|
|
39
|
-
super().__init__()
|
|
40
|
-
|
|
41
|
-
@property
|
|
42
|
-
def type_schemas(self) -> list[ObjectSchema]:
|
|
43
|
-
"""
|
|
44
|
-
Retrieves the list of type schemas.
|
|
45
|
-
|
|
46
|
-
This property method loads the type schemas if they are not already loaded and returns them.
|
|
47
|
-
|
|
48
|
-
Returns:
|
|
49
|
-
list[ObjectSchema]: A list of type schemas.
|
|
50
|
-
"""
|
|
51
|
-
if not hasattr(self, '_type_schemas'):
|
|
52
|
-
self._load_schemas()
|
|
53
|
-
|
|
54
|
-
return self._type_schemas
|
|
55
|
-
|
|
56
|
-
@property
|
|
57
|
-
def core_schemas(self) -> list[ObjectSchema]:
|
|
58
|
-
"""
|
|
59
|
-
Retrieves the list of core schemas.
|
|
60
|
-
|
|
61
|
-
This property method loads the core schemas if they are not already loaded and returns them.
|
|
62
|
-
|
|
63
|
-
Returns:
|
|
64
|
-
list[ObjectSchema]: A list of core schemas.
|
|
65
|
-
"""
|
|
66
|
-
if not hasattr(self, '_core_schemas'):
|
|
67
|
-
self._load_schemas()
|
|
68
|
-
|
|
69
|
-
return self._core_schemas
|
|
70
|
-
|
|
71
|
-
@property
|
|
72
|
-
def contrib_schemas(self) -> list[ObjectSchema]:
|
|
73
|
-
"""
|
|
74
|
-
Retrieves the list of contrib schemas.
|
|
75
|
-
|
|
76
|
-
This property method loads the contrib schemas if they are not already loaded and returns them.
|
|
77
|
-
|
|
78
|
-
Returns:
|
|
79
|
-
list[ObjectSchema]: A list of contrib schemas.
|
|
80
|
-
"""
|
|
81
|
-
if not hasattr(self, '_contrib_schemas'):
|
|
82
|
-
self._load_schemas()
|
|
83
|
-
|
|
84
|
-
return self._contrib_schemas
|
|
85
|
-
|
|
86
|
-
@property
|
|
87
|
-
def user_schemas(self) -> list[ObjectSchema]:
|
|
88
|
-
"""
|
|
89
|
-
Retrieves the list of user schemas.
|
|
90
|
-
|
|
91
|
-
This property method loads the user schemas if they are not already loaded and returns them.
|
|
92
|
-
|
|
93
|
-
Returns:
|
|
94
|
-
list[ObjectSchema]: A list of user schemas.
|
|
95
|
-
"""
|
|
96
|
-
if not hasattr(self, '_user_schemas'):
|
|
97
|
-
self._load_schemas()
|
|
98
|
-
|
|
99
|
-
return self._user_schemas
|
|
100
|
-
|
|
101
|
-
def verify(self) -> None:
|
|
102
|
-
"""
|
|
103
|
-
Loads and verifies all schemas.
|
|
104
|
-
|
|
105
|
-
This method ensures that all schemas (type, core, contrib, and user schemas) are loaded and verified.
|
|
106
|
-
|
|
107
|
-
Returns:
|
|
108
|
-
None
|
|
109
|
-
"""
|
|
110
|
-
self._load_schemas()
|
|
111
|
-
|
|
112
|
-
def _load_schemas(self) -> None:
|
|
113
|
-
_type_configs = []
|
|
114
|
-
_core_configs = []
|
|
115
|
-
_contrib_configs = []
|
|
116
|
-
_user_configs = []
|
|
117
|
-
|
|
118
|
-
for schemas_directory in self._schemas_directories:
|
|
119
|
-
try:
|
|
120
|
-
for schema in self.load_schemas_from_path(schemas_directory.path):
|
|
121
|
-
if schemas_directory.module_type == ModuleType.TYPE:
|
|
122
|
-
_type_configs.append(schema)
|
|
123
|
-
elif schemas_directory.module_type == ModuleType.CORE:
|
|
124
|
-
_core_configs.append(schema)
|
|
125
|
-
elif schemas_directory.module_type == ModuleType.CONTRIB:
|
|
126
|
-
_contrib_configs.append(schema)
|
|
127
|
-
elif schemas_directory.module_type == ModuleType.USER:
|
|
128
|
-
_user_configs.append(schema)
|
|
129
|
-
except ValidationError as e:
|
|
130
|
-
msg = f'Error loading schemas from {schemas_directory.path}: {e}'
|
|
131
|
-
|
|
132
|
-
raise AmsdalError(msg) from e
|
|
133
|
-
|
|
134
|
-
(
|
|
135
|
-
_enriched_type_configs,
|
|
136
|
-
_enriched_core_configs,
|
|
137
|
-
_enriched_contrib_configs,
|
|
138
|
-
_enriched_user_configs,
|
|
139
|
-
) = self.enrich_configs(_type_configs, _core_configs, _contrib_configs, _user_configs)
|
|
140
|
-
|
|
141
|
-
self._type_schemas = _enriched_type_configs
|
|
142
|
-
self._core_schemas = _enriched_core_configs
|
|
143
|
-
self._contrib_schemas = _enriched_contrib_configs
|
|
144
|
-
self._user_schemas = _enriched_user_configs
|
|
145
|
-
|
|
146
|
-
self.verify_schemas(
|
|
147
|
-
self._type_schemas,
|
|
148
|
-
self._core_schemas,
|
|
149
|
-
self._contrib_schemas,
|
|
150
|
-
self._user_schemas,
|
|
151
|
-
)
|
|
152
|
-
self.check_dependencies(
|
|
153
|
-
self._type_schemas,
|
|
154
|
-
self._core_schemas,
|
|
155
|
-
self._contrib_schemas,
|
|
156
|
-
self._user_schemas,
|
|
157
|
-
)
|
|
158
|
-
|
|
159
|
-
@staticmethod
|
|
160
|
-
def load_schemas_from_path(schemas_path: Path) -> Iterator[ObjectSchema]:
|
|
161
|
-
"""
|
|
162
|
-
Loads schemas from the specified path.
|
|
163
|
-
|
|
164
|
-
This method reads schemas from the given path and returns an iterator of `ObjectSchema` objects. It uses various
|
|
165
|
-
loaders and extenders to process the schemas.
|
|
166
|
-
|
|
167
|
-
Args:
|
|
168
|
-
schemas_path (Path): The path from which to load the schemas.
|
|
169
|
-
|
|
170
|
-
Returns:
|
|
171
|
-
Iterator[ObjectSchema]: An iterator of `ObjectSchema` objects.
|
|
172
|
-
"""
|
|
173
|
-
schema_reader = CliConfigLoader(schemas_path)
|
|
174
|
-
options_reader = CliOptionsLoader(schemas_path.parent)
|
|
175
|
-
options_extender = OptionsExtender(options_reader)
|
|
176
|
-
custom_code_reader = CliCustomCodeLoader(schemas_path)
|
|
177
|
-
custom_code_extender = CustomCodeExtender(custom_code_reader)
|
|
178
|
-
|
|
179
|
-
for object_schema in schema_reader.iter_configs():
|
|
180
|
-
options_extender.extend(object_schema)
|
|
181
|
-
custom_code_extender.extend(object_schema)
|
|
182
|
-
|
|
183
|
-
yield object_schema
|
|
184
|
-
|
|
185
|
-
options_extender.post_extend()
|
|
186
|
-
custom_code_extender.post_extend()
|
|
187
|
-
|
|
188
|
-
def dump_schemas(self, target_dir: Path) -> None:
|
|
189
|
-
"""
|
|
190
|
-
Dumps all schemas to the specified directory.
|
|
191
|
-
|
|
192
|
-
This method creates the target directory if it does not exist and writes the type, core, contrib,
|
|
193
|
-
and user schemas to separate JSON files within the directory.
|
|
194
|
-
|
|
195
|
-
Args:
|
|
196
|
-
target_dir (Path): The directory where the schemas will be dumped.
|
|
197
|
-
|
|
198
|
-
Returns:
|
|
199
|
-
None
|
|
200
|
-
"""
|
|
201
|
-
target_dir.mkdir(parents=True, exist_ok=True)
|
|
202
|
-
self._dump_schemas(target_dir / 'type_schemas.json', self.type_schemas)
|
|
203
|
-
self._dump_schemas(target_dir / 'core_schemas.json', self.core_schemas)
|
|
204
|
-
self._dump_schemas(target_dir / 'contrib_schemas.json', self.contrib_schemas)
|
|
205
|
-
self._dump_schemas(target_dir / 'user_schemas.json', self.user_schemas)
|
|
206
|
-
|
|
207
|
-
@staticmethod
|
|
208
|
-
def _dump_schemas(target_file: Path, schemas: list[ObjectSchema]) -> None:
|
|
209
|
-
_schemas = [schema.model_dump() for schema in schemas]
|
|
210
|
-
new_schema_titles = [schema.title for schema in schemas]
|
|
211
|
-
|
|
212
|
-
if target_file.exists():
|
|
213
|
-
# Leave out schemas that are already in the file.
|
|
214
|
-
# Should be deleted explicitly via API `DELETE /api/classes/{class_name}/`.
|
|
215
|
-
for _schema in json.loads(target_file.read_text()):
|
|
216
|
-
if _schema['title'] not in new_schema_titles:
|
|
217
|
-
_schemas.append(_schema)
|
|
218
|
-
|
|
219
|
-
target_file.write_text(json.dumps(_schemas))
|
|
220
|
-
|
|
221
|
-
@classmethod
|
|
222
|
-
def add_user_schema(cls, target_dir: Path, object_schema: ObjectSchema) -> None:
|
|
223
|
-
"""
|
|
224
|
-
Adds a user schema to the specified directory.
|
|
225
|
-
|
|
226
|
-
This method adds the given `ObjectSchema` to the `user_schemas.json` file in the target directory. If the file
|
|
227
|
-
already exists, it updates the existing schemas by removing any schema with the same title as the new schema
|
|
228
|
-
before adding the new schema.
|
|
229
|
-
|
|
230
|
-
Args:
|
|
231
|
-
target_dir (Path): The directory where the user schema will be added.
|
|
232
|
-
object_schema (ObjectSchema): The `ObjectSchema` object to add.
|
|
233
|
-
|
|
234
|
-
Returns:
|
|
235
|
-
None
|
|
236
|
-
"""
|
|
237
|
-
target_file = target_dir / 'user_schemas.json'
|
|
238
|
-
|
|
239
|
-
if target_file.exists():
|
|
240
|
-
data = [_item for _item in json.loads(target_file.read_text()) if _item['title'] != object_schema.title]
|
|
241
|
-
else:
|
|
242
|
-
data = []
|
|
243
|
-
|
|
244
|
-
data.append(object_schema.model_dump())
|
|
245
|
-
target_file.write_text(json.dumps(data))
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
class SchemaManagerHandler:
|
|
249
|
-
"""
|
|
250
|
-
Handles schema management operations.
|
|
251
|
-
|
|
252
|
-
This class is responsible for loading, invalidating, and providing access to various schemas (type, core, contrib,
|
|
253
|
-
and user schemas) from a specified directory.
|
|
254
|
-
"""
|
|
255
|
-
|
|
256
|
-
_type_schemas: list[ObjectSchema]
|
|
257
|
-
_core_schemas: list[ObjectSchema]
|
|
258
|
-
_contrib_schemas: list[ObjectSchema]
|
|
259
|
-
_user_schemas: list[ObjectSchema]
|
|
260
|
-
|
|
261
|
-
def __init__(self, schemas_directory: Path) -> None:
|
|
262
|
-
self._schemas_directory = schemas_directory
|
|
263
|
-
|
|
264
|
-
def invalidate_user_schemas(self) -> None:
|
|
265
|
-
"""
|
|
266
|
-
Invalidates the cached user schemas.
|
|
267
|
-
|
|
268
|
-
This method removes the cached user schemas, forcing them to be reloaded the next time they are accessed.
|
|
269
|
-
|
|
270
|
-
Returns:
|
|
271
|
-
None
|
|
272
|
-
"""
|
|
273
|
-
if hasattr(self, '_user_schemas'):
|
|
274
|
-
delattr(self, '_user_schemas')
|
|
275
|
-
|
|
276
|
-
@property
|
|
277
|
-
def type_schemas(self) -> list[ObjectSchema]:
|
|
278
|
-
"""
|
|
279
|
-
Retrieves the list of type schemas.
|
|
280
|
-
|
|
281
|
-
This property method loads the type schemas if they are not already loaded and returns them.
|
|
282
|
-
|
|
283
|
-
Returns:
|
|
284
|
-
list[ObjectSchema]: A list of type schemas.
|
|
285
|
-
"""
|
|
286
|
-
if not hasattr(self, '_type_schemas'):
|
|
287
|
-
self._load_schemas()
|
|
288
|
-
|
|
289
|
-
return self._type_schemas
|
|
290
|
-
|
|
291
|
-
@property
|
|
292
|
-
def core_schemas(self) -> list[ObjectSchema]:
|
|
293
|
-
"""
|
|
294
|
-
Retrieves the list of core schemas.
|
|
295
|
-
|
|
296
|
-
This property method loads the core schemas if they are not already loaded and returns them.
|
|
297
|
-
|
|
298
|
-
Returns:
|
|
299
|
-
list[ObjectSchema]: A list of core schemas.
|
|
300
|
-
"""
|
|
301
|
-
if not hasattr(self, '_core_schemas'):
|
|
302
|
-
self._load_schemas()
|
|
303
|
-
|
|
304
|
-
return self._core_schemas
|
|
305
|
-
|
|
306
|
-
@property
|
|
307
|
-
def contrib_schemas(self) -> list[ObjectSchema]:
|
|
308
|
-
"""
|
|
309
|
-
Retrieves the list of contrib schemas.
|
|
310
|
-
|
|
311
|
-
This property method loads the contrib schemas if they are not already loaded and returns them.
|
|
312
|
-
|
|
313
|
-
Returns:
|
|
314
|
-
list[ObjectSchema]: A list of contrib schemas.
|
|
315
|
-
"""
|
|
316
|
-
if not hasattr(self, '_contrib_schemas'):
|
|
317
|
-
self._load_schemas()
|
|
318
|
-
|
|
319
|
-
return self._contrib_schemas
|
|
320
|
-
|
|
321
|
-
@property
|
|
322
|
-
def user_schemas(self) -> list[ObjectSchema]:
|
|
323
|
-
"""
|
|
324
|
-
Retrieves the list of user schemas.
|
|
325
|
-
|
|
326
|
-
This property method loads the user schemas if they are not already loaded and returns them.
|
|
327
|
-
|
|
328
|
-
Returns:
|
|
329
|
-
list[ObjectSchema]: A list of user schemas.
|
|
330
|
-
"""
|
|
331
|
-
if not hasattr(self, '_user_schemas'):
|
|
332
|
-
self._load_schemas()
|
|
333
|
-
|
|
334
|
-
return self._user_schemas
|
|
335
|
-
|
|
336
|
-
@property
|
|
337
|
-
def all_schemas(self) -> list[ObjectSchema]:
|
|
338
|
-
"""
|
|
339
|
-
Retrieves the list of all schemas.
|
|
340
|
-
|
|
341
|
-
This property method combines and returns the type, core, contrib, and user schemas.
|
|
342
|
-
|
|
343
|
-
Returns:
|
|
344
|
-
list[ObjectSchema]: A list of all schemas, including type, core, contrib, and user schemas.
|
|
345
|
-
"""
|
|
346
|
-
return self.type_schemas + self.core_schemas + self.contrib_schemas + self.user_schemas
|
|
347
|
-
|
|
348
|
-
def _load_schemas(self) -> None:
|
|
349
|
-
self._type_schemas = self._load_schema(self._schemas_directory / 'type_schemas.json')
|
|
350
|
-
self._core_schemas = self._load_schema(self._schemas_directory / 'core_schemas.json')
|
|
351
|
-
self._contrib_schemas = self._load_schema(self._schemas_directory / 'contrib_schemas.json')
|
|
352
|
-
self._user_schemas = self._load_schema(self._schemas_directory / 'user_schemas.json')
|
|
353
|
-
|
|
354
|
-
def _load_schema(self, schema_file: Path) -> list[ObjectSchema]:
|
|
355
|
-
with schema_file.open() as f:
|
|
356
|
-
schemas = json.load(f)
|
|
357
|
-
|
|
358
|
-
return [ObjectSchema.model_validate(schema) for schema in schemas]
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class OutputFormat(str, Enum):
|
|
5
|
-
"""
|
|
6
|
-
Output format for CLI commands.
|
|
7
|
-
|
|
8
|
-
Attributes:
|
|
9
|
-
default (str): Default output format.
|
|
10
|
-
json (str): JSON output format.
|
|
11
|
-
wide (str): Wide output format.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
default = 'default'
|
|
15
|
-
json = 'json'
|
|
16
|
-
wide = 'wide'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|