amsdal_cli 0.5.6__py3-none-any.whl → 0.5.8__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/build/schemas/loaders/base.py +11 -1
- amsdal_cli/commands/build/services/builder.py +7 -2
- amsdal_cli/commands/build/services/mixin.py +25 -0
- amsdal_cli/commands/cloud/deploy/sub_commands/deploy_new.py +1 -2
- amsdal_cli/commands/generate/enums.py +0 -1
- amsdal_cli/commands/generate/sub_commands/__init__.py +2 -0
- amsdal_cli/commands/generate/sub_commands/generate_external_models.py +365 -0
- amsdal_cli/commands/generate/sub_commands/generate_model.py +3 -4
- amsdal_cli/commands/generate/sub_commands/generate_permission.py +1 -2
- amsdal_cli/commands/generate/sub_commands/generate_tests.py +1 -2
- amsdal_cli/commands/generate/sub_commands/generate_transaction.py +1 -2
- amsdal_cli/commands/generate/utils/build_base_path.py +1 -2
- amsdal_cli/commands/generate/utils/tests/conftest_utils.py +1 -2
- amsdal_cli/commands/generate/utils/tests/unit.py +2 -3
- amsdal_cli/commands/migrations/sub_commands/apply.py +2 -2
- amsdal_cli/commands/migrations/sub_commands/make.py +2 -4
- amsdal_cli/commands/migrations/sub_commands/make_contrib.py +2 -4
- amsdal_cli/commands/new/command.py +1 -2
- amsdal_cli/commands/plugin/command.py +14 -5
- amsdal_cli/commands/plugin/templates/.amsdal-cli +1 -0
- amsdal_cli/commands/plugin/templates/pyproject.toml +1 -1
- amsdal_cli/commands/register_connection/command.py +1 -2
- amsdal_cli/commands/register_connection/utils/build.py +1 -2
- amsdal_cli/commands/restore/command.py +1 -2
- amsdal_cli/commands/serve/command.py +1 -2
- amsdal_cli/commands/serve/utils.py +2 -4
- amsdal_cli/commands/tests/command.py +2 -3
- amsdal_cli/commands/verify/command.py +1 -2
- amsdal_cli/commands/worker/sub_commands/run.py +1 -2
- amsdal_cli/utils/cli_config.py +1 -0
- amsdal_cli/utils/schema_repository.py +1 -2
- {amsdal_cli-0.5.6.dist-info → amsdal_cli-0.5.8.dist-info}/METADATA +1 -1
- {amsdal_cli-0.5.6.dist-info → amsdal_cli-0.5.8.dist-info}/RECORD +37 -36
- {amsdal_cli-0.5.6.dist-info → amsdal_cli-0.5.8.dist-info}/WHEEL +0 -0
- {amsdal_cli-0.5.6.dist-info → amsdal_cli-0.5.8.dist-info}/entry_points.txt +0 -0
- {amsdal_cli-0.5.6.dist-info → amsdal_cli-0.5.8.dist-info}/licenses/LICENSE.txt +0 -0
amsdal_cli/__about__.py
CHANGED
|
@@ -81,7 +81,17 @@ class ConfigReaderMixin:
|
|
|
81
81
|
"""
|
|
82
82
|
object_config = next(cls.read_configs_from_file(json_file))
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
# Exclude fixtures
|
|
85
|
+
if object_config.type == 'Fixture':
|
|
86
|
+
return False
|
|
87
|
+
|
|
88
|
+
# Exclude external models (models with __connection__ attribute)
|
|
89
|
+
# Check model_extra (Pydantic v2) for extra fields
|
|
90
|
+
if hasattr(object_config, 'model_extra') and object_config.model_extra:
|
|
91
|
+
if '__connection__' in object_config.model_extra:
|
|
92
|
+
return False
|
|
93
|
+
|
|
94
|
+
return True
|
|
85
95
|
|
|
86
96
|
@staticmethod
|
|
87
97
|
def read_configs_from_file(json_file: Path) -> Iterator[ObjectSchema]:
|
|
@@ -4,7 +4,6 @@ from typing import TYPE_CHECKING
|
|
|
4
4
|
from rich import print as rprint
|
|
5
5
|
|
|
6
6
|
from amsdal_cli.commands.build.services.mixin import BuildMixin
|
|
7
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
8
7
|
|
|
9
8
|
if TYPE_CHECKING:
|
|
10
9
|
from amsdal_cli.utils.cli_config import CliConfig
|
|
@@ -15,7 +14,7 @@ class AppBuilder(BuildMixin):
|
|
|
15
14
|
from amsdal_models.classes.class_manager import ClassManager
|
|
16
15
|
|
|
17
16
|
self.cli_config = cli_config
|
|
18
|
-
self.source_path = cli_config.app_directory /
|
|
17
|
+
self.source_path = cli_config.app_directory / cli_config.src_dir
|
|
19
18
|
self.config_path = config_path
|
|
20
19
|
self.class_manager = ClassManager()
|
|
21
20
|
|
|
@@ -39,6 +38,12 @@ class AppBuilder(BuildMixin):
|
|
|
39
38
|
self.build_models(self.cli_config)
|
|
40
39
|
elif (self.source_path / 'models').exists():
|
|
41
40
|
self.copy_class_models(self.source_path / 'models')
|
|
41
|
+
|
|
42
|
+
# Copy external models if they exist
|
|
43
|
+
external_models_path = self.cli_config.app_directory / 'models' / 'external'
|
|
44
|
+
if external_models_path.exists():
|
|
45
|
+
self.copy_external_models(external_models_path)
|
|
46
|
+
|
|
42
47
|
if not is_silent:
|
|
43
48
|
rprint(rich_success('OK!'))
|
|
44
49
|
|
|
@@ -53,6 +53,31 @@ class BuildMixin:
|
|
|
53
53
|
dirs_exist_ok=True,
|
|
54
54
|
)
|
|
55
55
|
|
|
56
|
+
@staticmethod
|
|
57
|
+
def copy_external_models(external_models_path: Path) -> None:
|
|
58
|
+
"""Copy external models to the build directory.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
external_models_path: Path to the external models directory (e.g., models/external)
|
|
62
|
+
"""
|
|
63
|
+
from amsdal.configs.main import settings
|
|
64
|
+
|
|
65
|
+
if not settings.USER_MODELS_MODULE_PATH:
|
|
66
|
+
return
|
|
67
|
+
|
|
68
|
+
# External models go to USER_MODELS_MODULE_PATH/external
|
|
69
|
+
target_path = settings.USER_MODELS_MODULE_PATH / 'external'
|
|
70
|
+
|
|
71
|
+
# Skip copy if source and target are the same (e.g., when building in place)
|
|
72
|
+
if external_models_path.resolve() == target_path.resolve():
|
|
73
|
+
return
|
|
74
|
+
|
|
75
|
+
shutil.copytree(
|
|
76
|
+
external_models_path,
|
|
77
|
+
target_path,
|
|
78
|
+
dirs_exist_ok=True,
|
|
79
|
+
)
|
|
80
|
+
|
|
56
81
|
@staticmethod
|
|
57
82
|
def build_transactions(cli_app_path: Path) -> None:
|
|
58
83
|
"""
|
|
@@ -70,7 +70,6 @@ async def _deploy(
|
|
|
70
70
|
|
|
71
71
|
from amsdal_cli.commands.build.services.builder import AppBuilder
|
|
72
72
|
from amsdal_cli.commands.cloud.environments.utils import get_current_env
|
|
73
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
74
73
|
from amsdal_cli.utils.cli_config import CliConfig
|
|
75
74
|
from amsdal_cli.utils.text import CustomConfirm
|
|
76
75
|
from amsdal_cli.utils.text import rich_error
|
|
@@ -79,7 +78,7 @@ async def _deploy(
|
|
|
79
78
|
from amsdal_cli.utils.text import rich_warning
|
|
80
79
|
|
|
81
80
|
cli_config: CliConfig = ctx.meta['config']
|
|
82
|
-
app_source_path = cli_config.app_directory /
|
|
81
|
+
app_source_path = cli_config.app_directory / cli_config.src_dir
|
|
83
82
|
env_name = env_name or get_current_env(cli_config)
|
|
84
83
|
|
|
85
84
|
if cli_config.verbose:
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from amsdal_cli.commands.generate.sub_commands.generate_external_models import generate_external_models
|
|
1
2
|
from amsdal_cli.commands.generate.sub_commands.generate_frontend_config import generate_frontend_config
|
|
2
3
|
from amsdal_cli.commands.generate.sub_commands.generate_hook import generate_hook
|
|
3
4
|
from amsdal_cli.commands.generate.sub_commands.generate_model import generate_model
|
|
@@ -8,6 +9,7 @@ from amsdal_cli.commands.generate.sub_commands.generate_tests import generate_te
|
|
|
8
9
|
from amsdal_cli.commands.generate.sub_commands.generate_transaction import generate_transaction
|
|
9
10
|
|
|
10
11
|
__all__ = [
|
|
12
|
+
'generate_external_models',
|
|
11
13
|
'generate_frontend_config',
|
|
12
14
|
'generate_hook',
|
|
13
15
|
'generate_model',
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
"""Generate ExternalModel classes from external database connections."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
import typer
|
|
8
|
+
|
|
9
|
+
from amsdal_cli.commands.generate.app import sub_app
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from amsdal_cli.utils.cli_config import CliConfig
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@sub_app.command(name='external-models, ext-models, em')
|
|
16
|
+
def generate_external_models(
|
|
17
|
+
ctx: typer.Context,
|
|
18
|
+
connection_name: str = typer.Argument(
|
|
19
|
+
...,
|
|
20
|
+
help='The name of the external connection configured in config',
|
|
21
|
+
),
|
|
22
|
+
output_dir: Path = typer.Option( # noqa: B008
|
|
23
|
+
None,
|
|
24
|
+
'--output',
|
|
25
|
+
'-o',
|
|
26
|
+
help='Output directory for generated models (defaults to models/external/)',
|
|
27
|
+
),
|
|
28
|
+
tables: list[str] = typer.Option( # noqa: B008
|
|
29
|
+
None,
|
|
30
|
+
'--table',
|
|
31
|
+
'-t',
|
|
32
|
+
help='Specific table names to generate models for (generates all if not specified)',
|
|
33
|
+
),
|
|
34
|
+
format_type: str = typer.Option( # noqa: B008
|
|
35
|
+
'python',
|
|
36
|
+
'--format',
|
|
37
|
+
'-f',
|
|
38
|
+
help='Output format: "python" or "json"',
|
|
39
|
+
),
|
|
40
|
+
schema: str | None = typer.Option( # noqa: B008, ARG001
|
|
41
|
+
None,
|
|
42
|
+
'--schema',
|
|
43
|
+
'-s',
|
|
44
|
+
help='Database schema name (for databases that support schemas like PostgreSQL)',
|
|
45
|
+
),
|
|
46
|
+
) -> None:
|
|
47
|
+
"""Generate ExternalModel classes from external database connections.
|
|
48
|
+
|
|
49
|
+
This command introspects an external database connection and generates
|
|
50
|
+
ExternalModel classes for the tables. The generated models can be used
|
|
51
|
+
immediately to query the external database.
|
|
52
|
+
|
|
53
|
+
**Examples:**
|
|
54
|
+
|
|
55
|
+
Generate models for all tables in an external connection:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
amsdal generate external-models my_external_db
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Generate models for specific tables only:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
amsdal generate external-models my_external_db -t users -t posts -t comments
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Generate models in JSON format:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
amsdal generate external-models my_external_db --format json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Specify custom output directory:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
amsdal generate external-models my_external_db -o src/external_models
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Generate models for a specific PostgreSQL schema:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
amsdal generate external-models pg_db --schema public
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Prerequisites:**
|
|
86
|
+
|
|
87
|
+
1. The external connection must be configured in your AMSDAL config
|
|
88
|
+
2. The connection must support schema introspection (SQLite, PostgreSQL)
|
|
89
|
+
3. The ExternalConnectionManager must be properly set up
|
|
90
|
+
|
|
91
|
+
**Generated Output:**
|
|
92
|
+
|
|
93
|
+
For Python format:
|
|
94
|
+
- Creates a module for each model: `models/external/{table_name}.py`
|
|
95
|
+
- Each module contains an ExternalModel class ready to use
|
|
96
|
+
|
|
97
|
+
For JSON format:
|
|
98
|
+
- Creates JSON schema files: `models/external/{table_name}/model.json`
|
|
99
|
+
- Can be loaded dynamically by AMSDAL framework
|
|
100
|
+
"""
|
|
101
|
+
from amsdal.services.external_connections import ExternalConnectionManager
|
|
102
|
+
from amsdal.services.external_model_generator import ExternalModelGenerator
|
|
103
|
+
from amsdal_data.application import DataApplication
|
|
104
|
+
from amsdal_utils.config.manager import AmsdalConfigManager
|
|
105
|
+
from amsdal_utils.utils.text import to_snake_case
|
|
106
|
+
|
|
107
|
+
from amsdal_cli.utils.cli_config import CliConfig
|
|
108
|
+
|
|
109
|
+
cli_config: CliConfig = ctx.meta['config']
|
|
110
|
+
|
|
111
|
+
# Validate format
|
|
112
|
+
if format_type not in ('python', 'json'):
|
|
113
|
+
typer.echo(f"Error: Invalid format '{format_type}'. Must be 'python' or 'json'.", err=True)
|
|
114
|
+
raise typer.Exit(1)
|
|
115
|
+
|
|
116
|
+
# Set default output directory
|
|
117
|
+
if output_dir is None:
|
|
118
|
+
output_dir = Path.cwd() / 'models' / 'external'
|
|
119
|
+
|
|
120
|
+
# Ensure output directory exists
|
|
121
|
+
output_dir.mkdir(parents=True, exist_ok=True)
|
|
122
|
+
|
|
123
|
+
# Initialize AMSDAL components
|
|
124
|
+
config_manager = AmsdalConfigManager()
|
|
125
|
+
config = config_manager.get_config()
|
|
126
|
+
|
|
127
|
+
# Verify connection exists in config
|
|
128
|
+
if connection_name not in config.connections:
|
|
129
|
+
typer.echo(
|
|
130
|
+
f"Error: Connection '{connection_name}' not found in configuration.\n"
|
|
131
|
+
f'Available connections: {", ".join(config.connections.keys())}',
|
|
132
|
+
err=True,
|
|
133
|
+
)
|
|
134
|
+
raise typer.Exit(1)
|
|
135
|
+
|
|
136
|
+
# Initialize DataApplication
|
|
137
|
+
app = DataApplication()
|
|
138
|
+
app.setup(config)
|
|
139
|
+
|
|
140
|
+
# Initialize ExternalConnectionManager
|
|
141
|
+
manager = ExternalConnectionManager()
|
|
142
|
+
manager.setup(data_application=app)
|
|
143
|
+
|
|
144
|
+
# Initialize ExternalModelGenerator
|
|
145
|
+
generator = ExternalModelGenerator()
|
|
146
|
+
|
|
147
|
+
try:
|
|
148
|
+
# Generate models
|
|
149
|
+
typer.echo(f"Generating external models from connection '{connection_name}'...")
|
|
150
|
+
|
|
151
|
+
if tables:
|
|
152
|
+
typer.echo(f'Tables: {", ".join(tables)}')
|
|
153
|
+
else:
|
|
154
|
+
typer.echo('Generating models for all tables...')
|
|
155
|
+
|
|
156
|
+
models_dict = generator.generate_models_for_connection(
|
|
157
|
+
connection_name=connection_name,
|
|
158
|
+
table_names=tables if tables else None,
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
if not models_dict:
|
|
162
|
+
typer.echo('No tables found or no models generated.', err=True)
|
|
163
|
+
raise typer.Exit(1)
|
|
164
|
+
|
|
165
|
+
typer.echo(f'Successfully generated {len(models_dict)} model(s)')
|
|
166
|
+
|
|
167
|
+
# Write models to files
|
|
168
|
+
if format_type == 'python':
|
|
169
|
+
_write_python_models(models_dict, output_dir, cli_config)
|
|
170
|
+
else:
|
|
171
|
+
_write_json_models(models_dict, output_dir, cli_config, connection_name)
|
|
172
|
+
|
|
173
|
+
typer.echo(f'\nGenerated models written to: {output_dir}')
|
|
174
|
+
typer.echo('\nYou can now import and use these models:')
|
|
175
|
+
typer.echo('```python')
|
|
176
|
+
first_model = next(iter(models_dict.keys()))
|
|
177
|
+
typer.echo(f'from models.external.{to_snake_case(first_model)} import {first_model}')
|
|
178
|
+
typer.echo(f'{first_model}.objects.all().execute()')
|
|
179
|
+
typer.echo('```')
|
|
180
|
+
|
|
181
|
+
except ValueError as e:
|
|
182
|
+
typer.echo(f'Error: {e}', err=True)
|
|
183
|
+
raise typer.Exit(1) from e
|
|
184
|
+
except ConnectionError as e:
|
|
185
|
+
typer.echo(f'Connection error: {e}', err=True)
|
|
186
|
+
raise typer.Exit(1) from e
|
|
187
|
+
except Exception as e:
|
|
188
|
+
typer.echo(f'Unexpected error: {e}', err=True)
|
|
189
|
+
raise typer.Exit(1) from e
|
|
190
|
+
finally:
|
|
191
|
+
# Clean up
|
|
192
|
+
app.teardown()
|
|
193
|
+
ExternalConnectionManager.invalidate()
|
|
194
|
+
AmsdalConfigManager.invalidate()
|
|
195
|
+
DataApplication.invalidate()
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def _write_python_models(
|
|
199
|
+
models_dict: dict[str, type],
|
|
200
|
+
output_dir: Path,
|
|
201
|
+
cli_config: 'CliConfig', # noqa: F821
|
|
202
|
+
) -> None:
|
|
203
|
+
"""Write generated models as Python files."""
|
|
204
|
+
from amsdal_utils.utils.text import to_snake_case
|
|
205
|
+
|
|
206
|
+
# Create __init__.py for the package
|
|
207
|
+
init_file = output_dir / '__init__.py'
|
|
208
|
+
init_file.touch(exist_ok=True)
|
|
209
|
+
|
|
210
|
+
# Write each model to a separate file
|
|
211
|
+
for model_name, model_class in models_dict.items():
|
|
212
|
+
module_name = to_snake_case(model_name)
|
|
213
|
+
file_path = output_dir / f'{module_name}.py'
|
|
214
|
+
|
|
215
|
+
# Generate the model file content
|
|
216
|
+
content = _generate_python_model_content(model_class, cli_config)
|
|
217
|
+
|
|
218
|
+
# Write to file
|
|
219
|
+
file_path.write_text(content)
|
|
220
|
+
typer.echo(f' ✓ {module_name}.py')
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def _generate_python_model_content(model_class: type, cli_config: 'CliConfig') -> str: # noqa: F821
|
|
224
|
+
"""Generate Python code for an ExternalModel class."""
|
|
225
|
+
model_name = model_class.__name__
|
|
226
|
+
table_name = model_class.__table_name__ # type: ignore[attr-defined]
|
|
227
|
+
connection = model_class.__connection__ # type: ignore[attr-defined]
|
|
228
|
+
|
|
229
|
+
# Get annotations
|
|
230
|
+
annotations = getattr(model_class, '__annotations__', {})
|
|
231
|
+
|
|
232
|
+
# Build imports
|
|
233
|
+
imports = {'from amsdal_models.classes.external_model import ExternalModel'}
|
|
234
|
+
|
|
235
|
+
# Build field definitions
|
|
236
|
+
field_lines = []
|
|
237
|
+
indent = ' ' * cli_config.indent
|
|
238
|
+
|
|
239
|
+
for field_name, field_type in annotations.items():
|
|
240
|
+
type_str = _get_type_annotation(field_type)
|
|
241
|
+
field_lines.append(f'{indent}{field_name}: {type_str}')
|
|
242
|
+
|
|
243
|
+
# Build class definition
|
|
244
|
+
lines = [
|
|
245
|
+
'"""',
|
|
246
|
+
f'External model for {table_name} table.',
|
|
247
|
+
'',
|
|
248
|
+
f'Generated from external connection: {connection}',
|
|
249
|
+
'"""',
|
|
250
|
+
'',
|
|
251
|
+
*sorted(imports),
|
|
252
|
+
'',
|
|
253
|
+
'',
|
|
254
|
+
f'class {model_name}(ExternalModel):',
|
|
255
|
+
f'{indent}"""External model for {table_name}."""',
|
|
256
|
+
'',
|
|
257
|
+
f"{indent}__table_name__ = '{table_name}'",
|
|
258
|
+
f"{indent}__connection__ = '{connection}'",
|
|
259
|
+
]
|
|
260
|
+
|
|
261
|
+
# Add primary key if present
|
|
262
|
+
if hasattr(model_class, '__primary_key__'):
|
|
263
|
+
pk = model_class.__primary_key__
|
|
264
|
+
if isinstance(pk, list):
|
|
265
|
+
lines.append(f'{indent}__primary_key__ = {pk!r}')
|
|
266
|
+
else:
|
|
267
|
+
lines.append(f"{indent}__primary_key__ = '{pk}'")
|
|
268
|
+
|
|
269
|
+
# Add field definitions
|
|
270
|
+
if field_lines:
|
|
271
|
+
lines.append('')
|
|
272
|
+
lines.extend(field_lines)
|
|
273
|
+
|
|
274
|
+
return '\n'.join(lines) + '\n'
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def _get_type_annotation(python_type: type) -> str:
|
|
278
|
+
"""Convert Python type to string annotation."""
|
|
279
|
+
type_mapping = {
|
|
280
|
+
str: 'str',
|
|
281
|
+
int: 'int',
|
|
282
|
+
float: 'float',
|
|
283
|
+
bool: 'bool',
|
|
284
|
+
bytes: 'bytes',
|
|
285
|
+
list: 'list',
|
|
286
|
+
dict: 'dict',
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return type_mapping.get(python_type, 'str')
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
def _write_json_models(
|
|
293
|
+
models_dict: dict[str, type],
|
|
294
|
+
output_dir: Path,
|
|
295
|
+
cli_config: 'CliConfig', # noqa: F821
|
|
296
|
+
connection_name: str,
|
|
297
|
+
) -> None:
|
|
298
|
+
"""Write generated models as JSON schema files."""
|
|
299
|
+
import json
|
|
300
|
+
|
|
301
|
+
from amsdal_utils.utils.text import to_snake_case
|
|
302
|
+
|
|
303
|
+
for model_name, model_class in models_dict.items():
|
|
304
|
+
module_name = to_snake_case(model_name)
|
|
305
|
+
model_dir = output_dir / module_name
|
|
306
|
+
model_dir.mkdir(exist_ok=True, parents=True)
|
|
307
|
+
|
|
308
|
+
json_file = model_dir / 'model.json'
|
|
309
|
+
|
|
310
|
+
# Build JSON schema
|
|
311
|
+
schema = _generate_json_schema(model_class, connection_name)
|
|
312
|
+
|
|
313
|
+
# Write to file
|
|
314
|
+
json_file.write_text(json.dumps(schema, indent=cli_config.indent, ensure_ascii=False))
|
|
315
|
+
typer.echo(f' ✓ {module_name}/model.json')
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
def _generate_json_schema(model_class: type, connection_name: str) -> dict[str, Any]:
|
|
319
|
+
"""Generate JSON schema for an ExternalModel class."""
|
|
320
|
+
model_name = model_class.__name__
|
|
321
|
+
table_name = model_class.__table_name__ # type: ignore[attr-defined]
|
|
322
|
+
annotations = getattr(model_class, '__annotations__', {})
|
|
323
|
+
|
|
324
|
+
# Build properties
|
|
325
|
+
properties = {}
|
|
326
|
+
for field_name, field_type in annotations.items():
|
|
327
|
+
properties[field_name] = {
|
|
328
|
+
'type': _python_type_to_json_type(field_type),
|
|
329
|
+
'title': field_name,
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
schema: dict[str, Any] = {
|
|
333
|
+
'title': model_name,
|
|
334
|
+
'type': 'object',
|
|
335
|
+
'properties': properties,
|
|
336
|
+
'__table_name__': table_name,
|
|
337
|
+
'__connection__': connection_name,
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
# Add primary key if present
|
|
341
|
+
if hasattr(model_class, '__primary_key__'):
|
|
342
|
+
pk = model_class.__primary_key__
|
|
343
|
+
if isinstance(pk, str):
|
|
344
|
+
schema['__primary_key__'] = [pk]
|
|
345
|
+
else:
|
|
346
|
+
schema['__primary_key__'] = list(pk)
|
|
347
|
+
|
|
348
|
+
return schema
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
def _python_type_to_json_type(python_type: type) -> str:
|
|
352
|
+
"""Convert Python type to JSON schema type string."""
|
|
353
|
+
from amsdal_utils.models.data_models.enums import CoreTypes
|
|
354
|
+
|
|
355
|
+
type_mapping = {
|
|
356
|
+
str: CoreTypes.STRING.value,
|
|
357
|
+
int: CoreTypes.INTEGER.value,
|
|
358
|
+
float: CoreTypes.NUMBER.value,
|
|
359
|
+
bool: CoreTypes.BOOLEAN.value,
|
|
360
|
+
bytes: CoreTypes.BINARY.value,
|
|
361
|
+
list: CoreTypes.ARRAY.value,
|
|
362
|
+
dict: CoreTypes.DICTIONARY.value,
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
return type_mapping.get(python_type, CoreTypes.STRING.value)
|
|
@@ -75,7 +75,6 @@ def generate_model(
|
|
|
75
75
|
from amsdal_utils.utils.text import to_snake_case
|
|
76
76
|
|
|
77
77
|
from amsdal_cli.commands.generate.enums import MODEL_JSON_FILE
|
|
78
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
79
78
|
from amsdal_cli.commands.generate.utils.model_attributes import parse_attributes
|
|
80
79
|
from amsdal_cli.utils.cli_config import CliConfig
|
|
81
80
|
from amsdal_cli.utils.cli_config import ModelsFormat
|
|
@@ -122,7 +121,7 @@ def generate_model(
|
|
|
122
121
|
json_schema['properties'][attr.name] = property_info
|
|
123
122
|
|
|
124
123
|
if cli_config.models_format == ModelsFormat.JSON:
|
|
125
|
-
output_path = cli_config.app_directory /
|
|
124
|
+
output_path = cli_config.app_directory / cli_config.src_dir / 'models' / name
|
|
126
125
|
|
|
127
126
|
write_file(
|
|
128
127
|
json.dumps(json_schema, indent=cli_config.indent),
|
|
@@ -138,11 +137,11 @@ def generate_model(
|
|
|
138
137
|
|
|
139
138
|
from amsdal_cli.utils.schema_repository import build_schema_repository
|
|
140
139
|
|
|
141
|
-
output_path = cli_config.app_directory /
|
|
140
|
+
output_path = cli_config.app_directory / cli_config.src_dir / 'models'
|
|
142
141
|
output_path.mkdir(exist_ok=True, parents=True)
|
|
143
142
|
(output_path / '__init__.py').touch(exist_ok=True)
|
|
144
143
|
|
|
145
|
-
sys.path.insert(0, str((cli_config.app_directory /
|
|
144
|
+
sys.path.insert(0, str((cli_config.app_directory / cli_config.src_dir).absolute()))
|
|
146
145
|
|
|
147
146
|
schema_repository = build_schema_repository(cli_config=cli_config)
|
|
148
147
|
class_builder = ClassBuilder()
|
|
@@ -24,7 +24,6 @@ def generate_permission(
|
|
|
24
24
|
from amsdal_utils.utils.text import to_snake_case
|
|
25
25
|
|
|
26
26
|
from amsdal_cli.commands.generate.enums import FIXTURES
|
|
27
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
28
27
|
from amsdal_cli.utils.cli_config import CliConfig
|
|
29
28
|
from amsdal_cli.utils.copier import write_file
|
|
30
29
|
|
|
@@ -57,7 +56,7 @@ def generate_permission(
|
|
|
57
56
|
}
|
|
58
57
|
)
|
|
59
58
|
|
|
60
|
-
base_path = cli_config.app_directory /
|
|
59
|
+
base_path = cli_config.app_directory / cli_config.src_dir
|
|
61
60
|
(base_path / FIXTURES).mkdir(parents=True, exist_ok=True)
|
|
62
61
|
permissions_file = base_path / FIXTURES / f'{model_snake_case}_permissions.json'
|
|
63
62
|
|
|
@@ -68,7 +68,6 @@ async def _generate_tests(
|
|
|
68
68
|
from amsdal.manager import AmsdalManager
|
|
69
69
|
from amsdal.manager import AsyncAmsdalManager
|
|
70
70
|
|
|
71
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
72
71
|
from amsdal_cli.commands.generate.utils.tests.conftest_utils import create_conftest_if_not_exist
|
|
73
72
|
from amsdal_cli.commands.generate.utils.tests.unit import generate_and_save_unit_tests
|
|
74
73
|
from amsdal_cli.commands.serve.utils import async_build_app_and_check_migrations
|
|
@@ -88,7 +87,7 @@ async def _generate_tests(
|
|
|
88
87
|
config_manager.load_config(config_path)
|
|
89
88
|
|
|
90
89
|
create_conftest_if_not_exist(cli_config)
|
|
91
|
-
app_source_path = cli_config.app_directory /
|
|
90
|
+
app_source_path = cli_config.app_directory / cli_config.src_dir
|
|
92
91
|
|
|
93
92
|
manager: AmsdalManager | AsyncAmsdalManager
|
|
94
93
|
if config_manager.get_config().async_mode:
|
|
@@ -21,14 +21,13 @@ def generate_transaction(
|
|
|
21
21
|
from amsdal_utils.utils.text import classify
|
|
22
22
|
from amsdal_utils.utils.text import to_snake_case
|
|
23
23
|
|
|
24
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
25
24
|
from amsdal_cli.utils.cli_config import CliConfig
|
|
26
25
|
from amsdal_cli.utils.copier import copy_blueprint
|
|
27
26
|
|
|
28
27
|
cli_config: CliConfig = ctx.meta['config']
|
|
29
28
|
config_path = cli_config.config_path
|
|
30
29
|
name = to_snake_case(transaction_name)
|
|
31
|
-
output_path = cli_config.app_directory /
|
|
30
|
+
output_path = cli_config.app_directory / cli_config.src_dir / 'transactions'
|
|
32
31
|
config_manager = AmsdalConfigManager()
|
|
33
32
|
config_manager.load_config(config_path)
|
|
34
33
|
|
|
@@ -3,7 +3,6 @@ from pathlib import Path
|
|
|
3
3
|
import typer
|
|
4
4
|
from rich import print as rprint
|
|
5
5
|
|
|
6
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
7
6
|
from amsdal_cli.utils.cli_config import CliConfig
|
|
8
7
|
from amsdal_cli.utils.text import rich_error
|
|
9
8
|
|
|
@@ -23,7 +22,7 @@ def build_model_base_path(ctx: typer.Context, model_name: str) -> Path:
|
|
|
23
22
|
|
|
24
23
|
cli_config: CliConfig = ctx.meta['config']
|
|
25
24
|
model = to_snake_case(model_name)
|
|
26
|
-
model_path = cli_config.app_directory /
|
|
25
|
+
model_path = cli_config.app_directory / cli_config.src_dir / 'models' / model
|
|
27
26
|
|
|
28
27
|
if cli_config.check_model_exists and not (
|
|
29
28
|
(model_path / 'model.json').exists() or (model_path / 'model.py').exists()
|
|
@@ -2,14 +2,13 @@ from pathlib import Path
|
|
|
2
2
|
|
|
3
3
|
from amsdal_utils.config.manager import AmsdalConfigManager
|
|
4
4
|
|
|
5
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
6
5
|
from amsdal_cli.utils.cli_config import CliConfig
|
|
7
6
|
|
|
8
7
|
CURRENT_DIR = Path(__file__).parent
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
def create_conftest_if_not_exist(cli_config: CliConfig) -> None:
|
|
12
|
-
test_dir = cli_config.app_directory /
|
|
11
|
+
test_dir = cli_config.app_directory / cli_config.src_dir / 'tests'
|
|
13
12
|
test_dir.mkdir(parents=True, exist_ok=True)
|
|
14
13
|
conftest_file_path = test_dir / 'conftest.py'
|
|
15
14
|
|
|
@@ -11,7 +11,6 @@ from amsdal_utils.utils.text import classify
|
|
|
11
11
|
from amsdal_utils.utils.text import to_snake_case
|
|
12
12
|
from black.mode import TargetVersion
|
|
13
13
|
|
|
14
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
15
14
|
from amsdal_cli.commands.generate.enums import TestDataType
|
|
16
15
|
from amsdal_cli.commands.generate.utils.tests.async_mode_utils import maybe_await
|
|
17
16
|
from amsdal_cli.commands.generate.utils.tests.function_utils import test_function_arguments
|
|
@@ -581,7 +580,7 @@ def generate_unit_tests(
|
|
|
581
580
|
cli_config: CliConfig,
|
|
582
581
|
test_data_type: TestDataType,
|
|
583
582
|
) -> str:
|
|
584
|
-
models_dir = cli_config.app_directory /
|
|
583
|
+
models_dir = cli_config.app_directory / cli_config.src_dir / 'models'
|
|
585
584
|
|
|
586
585
|
object_schema = get_class_schema(models_dir, model_name, cli_config)
|
|
587
586
|
|
|
@@ -661,7 +660,7 @@ def generate_and_save_unit_tests(
|
|
|
661
660
|
model_name = classify(model_name)
|
|
662
661
|
model_name_snake_case = to_snake_case(model_name)
|
|
663
662
|
|
|
664
|
-
unit_test_dir = cli_config.app_directory /
|
|
663
|
+
unit_test_dir = cli_config.app_directory / cli_config.src_dir / 'tests' / 'unit'
|
|
665
664
|
unit_test_dir.mkdir(parents=True, exist_ok=True)
|
|
666
665
|
|
|
667
666
|
filename = f'test_{model_name_snake_case}.py'
|
|
@@ -55,7 +55,7 @@ def _sync_apply(
|
|
|
55
55
|
core_migrations_path=CORE_MIGRATIONS_PATH,
|
|
56
56
|
app_migrations_loader=app_migrations_loader,
|
|
57
57
|
executor=DefaultMigrationExecutor(schemas),
|
|
58
|
-
contrib=settings.CONTRIBS,
|
|
58
|
+
contrib=settings.CONTRIBS, # type: ignore[arg-type]
|
|
59
59
|
contrib_migrations_directory_name=settings.CONTRIB_MIGRATIONS_DIRECTORY_NAME,
|
|
60
60
|
)
|
|
61
61
|
|
|
@@ -132,7 +132,7 @@ async def _async_sync_apply(
|
|
|
132
132
|
core_migrations_path=CORE_MIGRATIONS_PATH,
|
|
133
133
|
app_migrations_loader=app_migrations_loader,
|
|
134
134
|
executor=DefaultAsyncMigrationExecutor(schemas),
|
|
135
|
-
contrib=settings.CONTRIBS,
|
|
135
|
+
contrib=settings.CONTRIBS, # type: ignore[arg-type]
|
|
136
136
|
contrib_migrations_directory_name=settings.CONTRIB_MIGRATIONS_DIRECTORY_NAME,
|
|
137
137
|
)
|
|
138
138
|
|
|
@@ -27,7 +27,6 @@ def _sync_make_migrations(
|
|
|
27
27
|
from amsdal_models.migration.file_migration_generator import FileMigrationGenerator
|
|
28
28
|
from amsdal_utils.utils.text import to_snake_case
|
|
29
29
|
|
|
30
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
31
30
|
from amsdal_cli.commands.migrations.constants import MIGRATIONS_DIR_NAME
|
|
32
31
|
from amsdal_cli.utils.schema_repository import build_schema_repository
|
|
33
32
|
from amsdal_cli.utils.text import rich_info
|
|
@@ -40,7 +39,7 @@ def _sync_make_migrations(
|
|
|
40
39
|
amsdal_manager.post_setup() # type: ignore[call-arg]
|
|
41
40
|
|
|
42
41
|
schema_repository = build_schema_repository(cli_config=cli_config)
|
|
43
|
-
migrations_dir: Path = cli_config.app_directory /
|
|
42
|
+
migrations_dir: Path = cli_config.app_directory / cli_config.src_dir / MIGRATIONS_DIR_NAME
|
|
44
43
|
|
|
45
44
|
generator = FileMigrationGenerator(
|
|
46
45
|
core_migrations_path=CORE_MIGRATIONS_PATH,
|
|
@@ -81,7 +80,6 @@ async def _async_make_migrations(
|
|
|
81
80
|
from amsdal_models.migration.file_migration_generator import AsyncFileMigrationGenerator
|
|
82
81
|
from amsdal_utils.utils.text import to_snake_case
|
|
83
82
|
|
|
84
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
85
83
|
from amsdal_cli.commands.migrations.constants import MIGRATIONS_DIR_NAME
|
|
86
84
|
from amsdal_cli.utils.schema_repository import build_schema_repository
|
|
87
85
|
from amsdal_cli.utils.text import rich_info
|
|
@@ -94,7 +92,7 @@ async def _async_make_migrations(
|
|
|
94
92
|
await amsdal_manager.post_setup() # type: ignore[call-arg, misc]
|
|
95
93
|
|
|
96
94
|
schema_repository = build_schema_repository(cli_config=cli_config)
|
|
97
|
-
migrations_dir: Path = cli_config.app_directory /
|
|
95
|
+
migrations_dir: Path = cli_config.app_directory / cli_config.src_dir / MIGRATIONS_DIR_NAME
|
|
98
96
|
|
|
99
97
|
generator = AsyncFileMigrationGenerator(
|
|
100
98
|
core_migrations_path=CORE_MIGRATIONS_PATH,
|
|
@@ -26,7 +26,6 @@ def _sync_make_contrib_migrations(
|
|
|
26
26
|
from amsdal_models.migration.file_migration_generator import FileMigrationGenerator
|
|
27
27
|
from amsdal_utils.utils.text import to_snake_case
|
|
28
28
|
|
|
29
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
30
29
|
from amsdal_cli.commands.migrations.constants import MIGRATIONS_DIR_NAME
|
|
31
30
|
from amsdal_cli.utils.schema_repository import build_schema_repository
|
|
32
31
|
from amsdal_cli.utils.text import rich_info
|
|
@@ -39,7 +38,7 @@ def _sync_make_contrib_migrations(
|
|
|
39
38
|
amsdal_manager.post_setup() # type: ignore[call-arg]
|
|
40
39
|
|
|
41
40
|
schema_repository = build_schema_repository(cli_config=cli_config)
|
|
42
|
-
migrations_dir: Path = cli_config.app_directory /
|
|
41
|
+
migrations_dir: Path = cli_config.app_directory / cli_config.src_dir / MIGRATIONS_DIR_NAME
|
|
43
42
|
|
|
44
43
|
generator = FileMigrationGenerator(
|
|
45
44
|
core_migrations_path=CORE_MIGRATIONS_PATH,
|
|
@@ -79,7 +78,6 @@ async def _async_make_contrib_migrations(
|
|
|
79
78
|
from amsdal_models.migration.file_migration_generator import AsyncFileMigrationGenerator
|
|
80
79
|
from amsdal_utils.utils.text import to_snake_case
|
|
81
80
|
|
|
82
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
83
81
|
from amsdal_cli.commands.migrations.constants import MIGRATIONS_DIR_NAME
|
|
84
82
|
from amsdal_cli.utils.schema_repository import build_schema_repository
|
|
85
83
|
from amsdal_cli.utils.text import rich_info
|
|
@@ -92,7 +90,7 @@ async def _async_make_contrib_migrations(
|
|
|
92
90
|
await amsdal_manager.post_setup() # type: ignore[call-arg, misc]
|
|
93
91
|
|
|
94
92
|
schema_repository = build_schema_repository(cli_config=cli_config)
|
|
95
|
-
migrations_dir: Path = cli_config.app_directory /
|
|
93
|
+
migrations_dir: Path = cli_config.app_directory / cli_config.src_dir / MIGRATIONS_DIR_NAME
|
|
96
94
|
|
|
97
95
|
generator = AsyncFileMigrationGenerator(
|
|
98
96
|
core_migrations_path=CORE_MIGRATIONS_PATH,
|
|
@@ -50,7 +50,6 @@ def new_command(
|
|
|
50
50
|
from amsdal_utils.utils.text import slugify
|
|
51
51
|
from amsdal_utils.utils.text import to_snake_case
|
|
52
52
|
|
|
53
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
54
53
|
from amsdal_cli.utils.copier import copy_blueprints_from_directory
|
|
55
54
|
from amsdal_cli.utils.text import rich_error
|
|
56
55
|
from amsdal_cli.utils.text import rich_success
|
|
@@ -90,6 +89,6 @@ def new_command(
|
|
|
90
89
|
'state_backend': SQLITE_ASYNC_ALIAS if is_async_mode else SQLITE_STATE_ALIAS,
|
|
91
90
|
},
|
|
92
91
|
)
|
|
93
|
-
(output_path /
|
|
92
|
+
(output_path / 'src').mkdir(exist_ok=True)
|
|
94
93
|
|
|
95
94
|
rprint(rich_success(f'The application is successfully created in {output_path.resolve()}'))
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import random
|
|
2
|
+
import shutil
|
|
2
3
|
import string
|
|
3
4
|
import uuid
|
|
4
5
|
from pathlib import Path
|
|
@@ -47,7 +48,6 @@ def plugin_command(
|
|
|
47
48
|
from amsdal_utils.utils.text import slugify
|
|
48
49
|
from amsdal_utils.utils.text import to_snake_case
|
|
49
50
|
|
|
50
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
51
51
|
from amsdal_cli.utils.copier import copy_blueprints_from_directory
|
|
52
52
|
from amsdal_cli.utils.text import rich_error
|
|
53
53
|
from amsdal_cli.utils.text import rich_success
|
|
@@ -73,7 +73,9 @@ def plugin_command(
|
|
|
73
73
|
|
|
74
74
|
application_uuid = (random.choice(string.ascii_lowercase) + uuid.uuid4().hex[:31]).lower() # noqa: S311
|
|
75
75
|
|
|
76
|
+
src_dir = plugin_name.strip().lower().replace(' ', '_').replace('-', '_')
|
|
76
77
|
context = {
|
|
78
|
+
'src_dir': src_dir,
|
|
77
79
|
'application_uuid': application_uuid,
|
|
78
80
|
'plugin_name': plugin_name,
|
|
79
81
|
'plugin_name_slugify': slugify(plugin_name),
|
|
@@ -90,19 +92,26 @@ def plugin_command(
|
|
|
90
92
|
destination_path=output_path,
|
|
91
93
|
context=context,
|
|
92
94
|
)
|
|
93
|
-
|
|
95
|
+
# move src to src_dir
|
|
96
|
+
shutil.move(str(output_path / 'src'), str(output_path / src_dir))
|
|
97
|
+
(output_path / src_dir).mkdir(exist_ok=True)
|
|
94
98
|
|
|
95
99
|
# Create example model based on format
|
|
96
|
-
_create_example_model(output_path, models_format, context)
|
|
100
|
+
_create_example_model(output_path, models_format, context, src_dir=src_dir)
|
|
97
101
|
|
|
98
102
|
rprint(rich_success(f'The plugin is successfully created in {output_path.resolve()}'))
|
|
99
103
|
|
|
100
104
|
|
|
101
|
-
def _create_example_model(
|
|
105
|
+
def _create_example_model(
|
|
106
|
+
output_path: Path,
|
|
107
|
+
models_format: ModelsFormat,
|
|
108
|
+
context: dict[str, Any],
|
|
109
|
+
src_dir: str,
|
|
110
|
+
) -> None:
|
|
102
111
|
"""Create an example model based on the specified format."""
|
|
103
112
|
from amsdal_cli.utils.copier import write_file
|
|
104
113
|
|
|
105
|
-
models_dir = output_path /
|
|
114
|
+
models_dir = output_path / src_dir / 'models'
|
|
106
115
|
|
|
107
116
|
if models_format == ModelsFormat.JSON:
|
|
108
117
|
# Create JSON model
|
|
@@ -7,7 +7,6 @@ import typer
|
|
|
7
7
|
|
|
8
8
|
from amsdal_cli.app import app
|
|
9
9
|
from amsdal_cli.commands.cloud.enums import DBType
|
|
10
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
11
10
|
from amsdal_cli.commands.register_connection.utils.config_updater import ConfigUpdater
|
|
12
11
|
from amsdal_cli.commands.register_connection.utils.credentials import process_credentials
|
|
13
12
|
from amsdal_cli.commands.register_connection.utils.meta import process_meta
|
|
@@ -135,7 +134,7 @@ async def _register_connection_command(
|
|
|
135
134
|
generator = ModelGenerator(
|
|
136
135
|
config_path=_config,
|
|
137
136
|
meta=_meta,
|
|
138
|
-
output_dir=cli_config.app_directory /
|
|
137
|
+
output_dir=cli_config.app_directory / cli_config.src_dir / 'models',
|
|
139
138
|
models_format=cli_config.models_format,
|
|
140
139
|
)
|
|
141
140
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
|
|
3
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
4
3
|
from amsdal_cli.utils.cli_config import CliConfig
|
|
5
4
|
from amsdal_cli.utils.cli_config import ModelsFormat
|
|
6
5
|
|
|
@@ -12,7 +11,7 @@ def build_models(
|
|
|
12
11
|
) -> None:
|
|
13
12
|
from amsdal_cli.commands.build.services.builder import AppBuilder
|
|
14
13
|
|
|
15
|
-
source_path = cli_config.app_directory /
|
|
14
|
+
source_path = cli_config.app_directory / cli_config.src_dir
|
|
16
15
|
app_builder = AppBuilder(
|
|
17
16
|
cli_config=cli_config,
|
|
18
17
|
config_path=config_path,
|
|
@@ -58,9 +58,8 @@ def _restore_models(cli_config: 'CliConfig', config: Path | None) -> None:
|
|
|
58
58
|
from amsdal_utils.config.manager import AmsdalConfigManager
|
|
59
59
|
|
|
60
60
|
from amsdal_cli.commands.build.services.builder import AppBuilder
|
|
61
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
62
61
|
|
|
63
|
-
app_source_path = cli_config.app_directory /
|
|
62
|
+
app_source_path = cli_config.app_directory / cli_config.src_dir
|
|
64
63
|
app_source_path.mkdir(exist_ok=True)
|
|
65
64
|
|
|
66
65
|
app_builder = AppBuilder(
|
|
@@ -97,14 +97,13 @@ def serve_command(
|
|
|
97
97
|
from amsdal_utils.lifecycle.enum import LifecycleEvent
|
|
98
98
|
from amsdal_utils.lifecycle.producer import LifecycleProducer
|
|
99
99
|
|
|
100
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
101
100
|
from amsdal_cli.commands.serve.services.supervisor import Supervisor
|
|
102
101
|
from amsdal_cli.commands.serve.utils import build_app_and_check_migrations
|
|
103
102
|
from amsdal_cli.commands.serve.utils import cleanup_app
|
|
104
103
|
from amsdal_cli.utils.cli_config import CliConfig
|
|
105
104
|
|
|
106
105
|
cli_config: CliConfig = ctx.meta['config']
|
|
107
|
-
app_source_path = cli_config.app_directory /
|
|
106
|
+
app_source_path = cli_config.app_directory / cli_config.src_dir
|
|
108
107
|
server_port = port or cli_config.http_port
|
|
109
108
|
|
|
110
109
|
try:
|
|
@@ -176,13 +176,12 @@ def _check_migrations_generated_and_applied(
|
|
|
176
176
|
from amsdal.configs.main import settings
|
|
177
177
|
from amsdal_models.migration.file_migration_generator import FileMigrationGenerator
|
|
178
178
|
|
|
179
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
180
179
|
from amsdal_cli.commands.migrations.constants import MIGRATIONS_DIR_NAME
|
|
181
180
|
from amsdal_cli.utils.cli_config import ModelsFormat
|
|
182
181
|
from amsdal_cli.utils.schema_repository import build_schema_repository
|
|
183
182
|
from amsdal_cli.utils.text import rich_warning
|
|
184
183
|
|
|
185
|
-
app_source_path = app_path /
|
|
184
|
+
app_source_path = app_path / cli_config.src_dir
|
|
186
185
|
migrations_dir = app_source_path / MIGRATIONS_DIR_NAME
|
|
187
186
|
|
|
188
187
|
cli_config.models_format = ModelsFormat.PY
|
|
@@ -517,13 +516,12 @@ async def _async_check_migrations_generated_and_applied(
|
|
|
517
516
|
from amsdal.configs.main import settings
|
|
518
517
|
from amsdal_models.migration.file_migration_generator import AsyncFileMigrationGenerator
|
|
519
518
|
|
|
520
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
521
519
|
from amsdal_cli.commands.migrations.constants import MIGRATIONS_DIR_NAME
|
|
522
520
|
from amsdal_cli.utils.cli_config import ModelsFormat
|
|
523
521
|
from amsdal_cli.utils.schema_repository import build_schema_repository
|
|
524
522
|
from amsdal_cli.utils.text import rich_warning
|
|
525
523
|
|
|
526
|
-
app_source_path = app_path /
|
|
524
|
+
app_source_path = app_path / cli_config.src_dir
|
|
527
525
|
migrations_dir = app_source_path / MIGRATIONS_DIR_NAME
|
|
528
526
|
|
|
529
527
|
cli_config.models_format = ModelsFormat.PY
|
|
@@ -90,14 +90,13 @@ def run_tests(
|
|
|
90
90
|
|
|
91
91
|
from amsdal_utils.config.manager import AmsdalConfigManager
|
|
92
92
|
|
|
93
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
94
93
|
from amsdal_cli.utils.cli_config import CliConfig
|
|
95
94
|
|
|
96
95
|
cli_config: CliConfig = ctx.meta['config']
|
|
97
96
|
config_manager = AmsdalConfigManager()
|
|
98
97
|
config_manager.load_config(cli_config.config_path)
|
|
99
98
|
config_path = cli_config.config_path
|
|
100
|
-
app_source_path = cli_config.app_directory /
|
|
99
|
+
app_source_path = cli_config.app_directory / cli_config.src_dir
|
|
101
100
|
|
|
102
101
|
if AmsdalConfigManager().get_config().async_mode:
|
|
103
102
|
asyncio.run(_async_init(cli_config=cli_config, app_source_path=app_source_path, config_path=config_path))
|
|
@@ -109,7 +108,7 @@ def run_tests(
|
|
|
109
108
|
with Popen( # noqa: S603
|
|
110
109
|
[
|
|
111
110
|
PYTEST_COMMAND,
|
|
112
|
-
|
|
111
|
+
cli_config.src_dir,
|
|
113
112
|
'--color=yes',
|
|
114
113
|
'--db_execution_type',
|
|
115
114
|
db_execution_type,
|
|
@@ -20,7 +20,6 @@ def verify_command(
|
|
|
20
20
|
|
|
21
21
|
from amsdal_cli.commands.build.services.builder import AppBuilder
|
|
22
22
|
from amsdal_cli.commands.generate.enums import MODEL_JSON_FILE
|
|
23
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
24
23
|
from amsdal_cli.commands.verify.utils.verify_json_model import verify_json_model
|
|
25
24
|
from amsdal_cli.commands.verify.utils.verify_python_file import verify_python_file
|
|
26
25
|
from amsdal_cli.utils.cli_config import CliConfig
|
|
@@ -34,7 +33,7 @@ def verify_command(
|
|
|
34
33
|
|
|
35
34
|
rprint(rich_info('Syntax checking...'), end=' ')
|
|
36
35
|
|
|
37
|
-
for file_item in walk(cli_config.app_directory /
|
|
36
|
+
for file_item in walk(cli_config.app_directory / cli_config.src_dir):
|
|
38
37
|
if file_item.name == MODEL_JSON_FILE:
|
|
39
38
|
errors.extend(verify_json_model(file_item))
|
|
40
39
|
elif file_item.name.endswith('.py'):
|
|
@@ -103,11 +103,10 @@ def run_worker(
|
|
|
103
103
|
"""
|
|
104
104
|
from amsdal_utils.config.manager import AmsdalConfigManager
|
|
105
105
|
|
|
106
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
107
106
|
from amsdal_cli.utils.cli_config import CliConfig
|
|
108
107
|
|
|
109
108
|
cli_config: CliConfig = ctx.meta['config']
|
|
110
|
-
app_source_path = cli_config.app_directory /
|
|
109
|
+
app_source_path = cli_config.app_directory / cli_config.src_dir
|
|
111
110
|
config_path = cli_config.config_path
|
|
112
111
|
config_manager = AmsdalConfigManager()
|
|
113
112
|
config_manager.load_config(config_path)
|
amsdal_cli/utils/cli_config.py
CHANGED
|
@@ -36,7 +36,6 @@ def build_schema_repository(
|
|
|
36
36
|
|
|
37
37
|
from amsdal_cli.commands.build.schemas.data_models.schemas_directory import SchemasDirectory
|
|
38
38
|
from amsdal_cli.commands.build.schemas.schema_json_loader import SchemaJsonLoader
|
|
39
|
-
from amsdal_cli.commands.generate.enums import SOURCES_DIR
|
|
40
39
|
from amsdal_cli.utils.cli_config import ModelsFormat
|
|
41
40
|
|
|
42
41
|
_contrib_modules_paths: list[str] = []
|
|
@@ -63,7 +62,7 @@ def build_schema_repository(
|
|
|
63
62
|
class_filter=lambda cls: cls.__module_type__ == target_module_type,
|
|
64
63
|
) # type: ignore[assignment]
|
|
65
64
|
else:
|
|
66
|
-
_models_path = cli_config.app_directory /
|
|
65
|
+
_models_path = cli_config.app_directory / cli_config.src_dir / 'models'
|
|
67
66
|
user_schema_loader = SchemaJsonLoader( # type: ignore[assignment]
|
|
68
67
|
SchemasDirectory(
|
|
69
68
|
path=_models_path,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
amsdal_cli/Third-Party Materials - AMSDAL Dependencies - License Notices.md,sha256=uHJlGG0D4tbpUi8cq-497NNO9ltQ67a5448k-T14HTw,68241
|
|
2
|
-
amsdal_cli/__about__.py,sha256=
|
|
2
|
+
amsdal_cli/__about__.py,sha256=JGF3XlJObn428GEyZLeDPPWqGJueIxTc_Bg3msQ3gts,124
|
|
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
|
|
@@ -30,7 +30,7 @@ amsdal_cli/commands/build/schemas/extenders/__init__.py,sha256=47DEQpj8HBSa-_TIm
|
|
|
30
30
|
amsdal_cli/commands/build/schemas/extenders/custom_code_extender.py,sha256=wE3jvJkaanPWFiafLWDiIry70WMLxeF6_GEppT1jgvw,1586
|
|
31
31
|
amsdal_cli/commands/build/schemas/extenders/options_extender.py,sha256=WInuTtkOwPXA9tPvRy4pWFaNFziDdX24U7WGjvIeR94,2007
|
|
32
32
|
amsdal_cli/commands/build/schemas/loaders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
-
amsdal_cli/commands/build/schemas/loaders/base.py,sha256
|
|
33
|
+
amsdal_cli/commands/build/schemas/loaders/base.py,sha256=Jk5PRTTv4wNz5WeX6SVrjVYliaoVFOP9vVyUYaZ3W9k,2939
|
|
34
34
|
amsdal_cli/commands/build/schemas/loaders/cli_custom_code_loader.py,sha256=gbcS0JdfeS6XNWA-Q6O4MCqmV2V1RkQWLWpCtShUFFo,4611
|
|
35
35
|
amsdal_cli/commands/build/schemas/loaders/cli_loader.py,sha256=LpqmrR5iVpHqur-bHAHi-E2EyhlLK0RD0xgn_Pu9Kks,2259
|
|
36
36
|
amsdal_cli/commands/build/schemas/loaders/cli_options_loader.py,sha256=RusYssXNPY_FDO942PqZ2Y7OPiEMvMLq9N9C8311fdE,2822
|
|
@@ -42,8 +42,8 @@ amsdal_cli/commands/build/schemas/mixins/enrich_schemas_mixin.py,sha256=4TvvIuev
|
|
|
42
42
|
amsdal_cli/commands/build/schemas/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
43
|
amsdal_cli/commands/build/schemas/utils/merger.py,sha256=8dlSV3qgGAGNbOtGGx8zQ7yC99dihxg8JwPHMDboU2w,2229
|
|
44
44
|
amsdal_cli/commands/build/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
|
-
amsdal_cli/commands/build/services/builder.py,sha256=
|
|
46
|
-
amsdal_cli/commands/build/services/mixin.py,sha256=
|
|
45
|
+
amsdal_cli/commands/build/services/builder.py,sha256=MR3wQ0CEv7FOQDQboTtUHUHJ1pqt7kjdNKfJ8BN9mp0,3402
|
|
46
|
+
amsdal_cli/commands/build/services/mixin.py,sha256=1hC2nYEgoTIrxJaC1oa4srIARCCWwbAkpGnAdvOBbOY,6565
|
|
47
47
|
amsdal_cli/commands/build/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
48
|
amsdal_cli/commands/build/utils/build_config_file.py,sha256=65s3rP_nnr5FJLQlYStGF2JNYxExq5tWZvIU_h8Ae7I,2009
|
|
49
49
|
amsdal_cli/commands/ci_cd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -69,7 +69,7 @@ amsdal_cli/commands/cloud/deploy/command.py,sha256=LIX07pTU55GUA9KmTiKDtoCj5Ytx9
|
|
|
69
69
|
amsdal_cli/commands/cloud/deploy/sub_commands/__init__.py,sha256=I7MJEyceCIgCXP7JpX06nLvEA6HUkjj9LSDAb7VfTGo,353
|
|
70
70
|
amsdal_cli/commands/cloud/deploy/sub_commands/deploy_delete.py,sha256=pRLumeigF4e_Nod32p6XkgJsYxbB9H3WSxbv0IwA5Eo,3221
|
|
71
71
|
amsdal_cli/commands/cloud/deploy/sub_commands/deploy_list.py,sha256=ozr7tVbPrTnx_YscyAb1_ZockFfQQSwd6XDijrkZSWk,5534
|
|
72
|
-
amsdal_cli/commands/cloud/deploy/sub_commands/deploy_new.py,sha256=
|
|
72
|
+
amsdal_cli/commands/cloud/deploy/sub_commands/deploy_new.py,sha256=n87MNWad-oOFYXRpQvWqZZtRo0NXaQZSb3GQkMFE0ls,12692
|
|
73
73
|
amsdal_cli/commands/cloud/environments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
74
|
amsdal_cli/commands/cloud/environments/app.py,sha256=kkzf_kW2jpl3d44qWuIZB5C3uWXzpNpnTIvUpuuPJHE,238
|
|
75
75
|
amsdal_cli/commands/cloud/environments/command.py,sha256=roeg2tpa53W1qzCa_3-zEn5z2xiVS4STWB9M7P5BVKA,283
|
|
@@ -111,16 +111,17 @@ amsdal_cli/commands/cloud/sub_commands/sync_db.py,sha256=o5yaqcanCDffaAj73jvk7vX
|
|
|
111
111
|
amsdal_cli/commands/generate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
112
112
|
amsdal_cli/commands/generate/app.py,sha256=-wEccTR0MhZyj3Y1R2VMyO9RzyGiBSrdWNPQc4ACHqc,201
|
|
113
113
|
amsdal_cli/commands/generate/command.py,sha256=j6CGiZ_7st-A6qpMTA8XYl15UeONopauQALObVWB2xc,197
|
|
114
|
-
amsdal_cli/commands/generate/enums.py,sha256=
|
|
115
|
-
amsdal_cli/commands/generate/sub_commands/__init__.py,sha256=
|
|
114
|
+
amsdal_cli/commands/generate/enums.py,sha256=SQ_ZFW6F9RbvM__Ohz5r3Ld54MlKoxid83kqiVqaZwY,3696
|
|
115
|
+
amsdal_cli/commands/generate/sub_commands/__init__.py,sha256=afAyY3hWNb6a4e3lapQX-GsR1SB6EHZi9hwtsWzrPKY,1077
|
|
116
|
+
amsdal_cli/commands/generate/sub_commands/generate_external_models.py,sha256=QH54RuiRyzFzmiEQsw7mbLk1d_vSbLAPqp4F-oJGwD8,11515
|
|
116
117
|
amsdal_cli/commands/generate/sub_commands/generate_frontend_config.py,sha256=SkEzx7-mWgrPINwPXGRmYO1SVA0RZojOd6BZFQRmG0Q,2574
|
|
117
118
|
amsdal_cli/commands/generate/sub_commands/generate_hook.py,sha256=C0Oy5VokM3BXPq33Kknjvtjwd7hdfSxQFKxJcHu_bgg,1738
|
|
118
|
-
amsdal_cli/commands/generate/sub_commands/generate_model.py,sha256=
|
|
119
|
+
amsdal_cli/commands/generate/sub_commands/generate_model.py,sha256=yjZEfadjDf2zRkXh9z5RWYqnO9vFVu8tzVQzxWZPWY4,5885
|
|
119
120
|
amsdal_cli/commands/generate/sub_commands/generate_modifier.py,sha256=NyN7vMTBGaQv6u815WT1lqAlqI4xP1AmIZWq5edZ-5g,1426
|
|
120
|
-
amsdal_cli/commands/generate/sub_commands/generate_permission.py,sha256=
|
|
121
|
+
amsdal_cli/commands/generate/sub_commands/generate_permission.py,sha256=7vnweAhPlJpX0Ji40baPXXAbE5wuGsleQD3ty4Ul3FI,2768
|
|
121
122
|
amsdal_cli/commands/generate/sub_commands/generate_property.py,sha256=XrCjf48oEzuMPqsTuC5Qsn1WbIQzUVW8BNOmXssfUM8,1599
|
|
122
|
-
amsdal_cli/commands/generate/sub_commands/generate_tests.py,sha256=
|
|
123
|
-
amsdal_cli/commands/generate/sub_commands/generate_transaction.py,sha256=
|
|
123
|
+
amsdal_cli/commands/generate/sub_commands/generate_tests.py,sha256=BYCuaj36sg0SBhkku3fz0xCIL9Ww4F8Q1BqXZXByQPs,4562
|
|
124
|
+
amsdal_cli/commands/generate/sub_commands/generate_transaction.py,sha256=IS1vr8N09f0r93kk-k8E-_fmjWPcW0xCgzEN-FEM5d8,1584
|
|
124
125
|
amsdal_cli/commands/generate/templates/async_transaction.pyt,sha256=HDnJpIzSuf5h0lYLXDYv_w4LqjJNEl6FMybeT9A19uI,173
|
|
125
126
|
amsdal_cli/commands/generate/templates/hook.pyt,sha256=nqToFKu6GIxrXWlpg5IN9rK8nkZ07F4sH-aZEQaTfpY,261
|
|
126
127
|
amsdal_cli/commands/generate/templates/property.pyt,sha256=ApOdptmK_KchBhMR_XgG249AK76th6ChfBdeMjyio4s,85
|
|
@@ -129,16 +130,16 @@ amsdal_cli/commands/generate/templates/modifier/constructor.pyt,sha256=ue_cMby-9
|
|
|
129
130
|
amsdal_cli/commands/generate/templates/modifier/display_name.pyt,sha256=YN_LT4aBnkwqzAK-UVkHP1znSHYZhAETzLi-3hHl5Jk,81
|
|
130
131
|
amsdal_cli/commands/generate/templates/modifier/version_name.pyt,sha256=Gt53bNJnKAgQl9cZGsNQmUt_rydZYTcsOdZztY4QnrA,81
|
|
131
132
|
amsdal_cli/commands/generate/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
132
|
-
amsdal_cli/commands/generate/utils/build_base_path.py,sha256=
|
|
133
|
+
amsdal_cli/commands/generate/utils/build_base_path.py,sha256=bFB1TpNcF9YpRR1a1FKDEoucBqKjthz2z8H7wQI8je4,970
|
|
133
134
|
amsdal_cli/commands/generate/utils/cast_to_attribute_type.py,sha256=mptQHTUFWDCo463ZjV8GjPKeGGOdORL_v1szA1pFZaQ,850
|
|
134
135
|
amsdal_cli/commands/generate/utils/model_attributes.py,sha256=IPfONQAgRpaoEJhIvB15QDILOztCSVOUZdBctC_AWlk,7511
|
|
135
136
|
amsdal_cli/commands/generate/utils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
136
137
|
amsdal_cli/commands/generate/utils/tests/async_mode_utils.py,sha256=iub84Pj5TMa38W90Pr5HgkFQLXpUdbmcm9HOx98Oh6o,309
|
|
137
|
-
amsdal_cli/commands/generate/utils/tests/conftest_utils.py,sha256=
|
|
138
|
+
amsdal_cli/commands/generate/utils/tests/conftest_utils.py,sha256=Ma0yRcrwzGwN_IdnAoYgVnYVjgLy0CgQveqXHuhn5RA,786
|
|
138
139
|
amsdal_cli/commands/generate/utils/tests/function_utils.py,sha256=Bkk9JDbANX2aSreNRr1Bste5rPwVKc2HV5xLFg2dQK4,496
|
|
139
140
|
amsdal_cli/commands/generate/utils/tests/model_utils.py,sha256=CBfR9AcL6Q1boEejjmOD16F0kgJFdIjYYWNE3vQMkfE,4051
|
|
140
141
|
amsdal_cli/commands/generate/utils/tests/type_utils.py,sha256=yglZHcvAQ0m6JnwQEBxHdcWxlkHY65P-Cp81fCrC3q8,9325
|
|
141
|
-
amsdal_cli/commands/generate/utils/tests/unit.py,sha256=
|
|
142
|
+
amsdal_cli/commands/generate/utils/tests/unit.py,sha256=XEoTmgZP-8dSmFqA6lPk5U8k3AfDbDom92CviXgzFtw,27696
|
|
142
143
|
amsdal_cli/commands/generate/utils/tests/templates/async/conftest.py,sha256=9GfoV_HzwuWtglI7uz0fP5_pOsPk2f56elaoinuPa80,1632
|
|
143
144
|
amsdal_cli/commands/generate/utils/tests/templates/sync/conftest.py,sha256=wMmnKQnVTSJsS5MdH25ChRcc-aQevQYqIZhXwLnZl0U,1564
|
|
144
145
|
amsdal_cli/commands/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -147,12 +148,12 @@ amsdal_cli/commands/migrations/command.py,sha256=jlpdYZAc02ZUBxSdzGSzkDxEb1nlHNz
|
|
|
147
148
|
amsdal_cli/commands/migrations/constants.py,sha256=846-DQ-Iqcxw2akd5aBAmbnXHDmRFqEKu6vai2ZFBkU,35
|
|
148
149
|
amsdal_cli/commands/migrations/utils.py,sha256=Fvu6NlIFL3OAz0MhLkvnucIsHBZlDDCOZZ38VhNahws,2700
|
|
149
150
|
amsdal_cli/commands/migrations/sub_commands/__init__.py,sha256=HHxiJxcbJUQLv6QOLwcvcSjTYJTixiRJ89IUb1H7sRo,1100
|
|
150
|
-
amsdal_cli/commands/migrations/sub_commands/apply.py,sha256=
|
|
151
|
+
amsdal_cli/commands/migrations/sub_commands/apply.py,sha256=n4-BzBlAjjmt69iD0QQjMyy_A_4YxeIgU7y_P7eBr5k,8748
|
|
151
152
|
amsdal_cli/commands/migrations/sub_commands/list.py,sha256=vC-oeTVHjYNzI_HhiylZSNeOsIFvnDZ6TRwrqQ-wpUk,5833
|
|
152
|
-
amsdal_cli/commands/migrations/sub_commands/make.py,sha256=
|
|
153
|
-
amsdal_cli/commands/migrations/sub_commands/make_contrib.py,sha256=
|
|
153
|
+
amsdal_cli/commands/migrations/sub_commands/make.py,sha256=Qh3_4djVgdT67oRZ46AF2dqSyUDEiipOOkW5_-n4DOY,6429
|
|
154
|
+
amsdal_cli/commands/migrations/sub_commands/make_contrib.py,sha256=JdlD8hGjNMrbWFIqSw5eXRSxUd1hW6D2UcxWR6-6uTg,6337
|
|
154
155
|
amsdal_cli/commands/new/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
155
|
-
amsdal_cli/commands/new/command.py,sha256=
|
|
156
|
+
amsdal_cli/commands/new/command.py,sha256=B-chjS_TAEzH4CIr_vBtxFWn7Y4xWm8vpUetCf1lwKo,3233
|
|
156
157
|
amsdal_cli/commands/new/templates/.amsdal-cli,sha256=PdXPovcT8AfPhqwDLI_4EWFYAS6e3J5JcsHVityBdF8,304
|
|
157
158
|
amsdal_cli/commands/new/templates/.gitignore,sha256=u7cZFs8VyeZahreeYtkoRnAQduko23Lz4SoGCyMSOQc,153
|
|
158
159
|
amsdal_cli/commands/new/templates/README.md,sha256=SM_MPq4HNWIxo2B4HJmfM1kfJYawW4YneuZxFqZnDo4,21552
|
|
@@ -162,20 +163,20 @@ amsdal_cli/commands/new/templates/.amsdal/.dependencies,sha256=47DEQpj8HBSa-_TIm
|
|
|
162
163
|
amsdal_cli/commands/new/templates/.amsdal/.environment,sha256=DW5AeeNnA-vTfAByL1iR0osOKBHcEUsSkhUSOtzONgU,4
|
|
163
164
|
amsdal_cli/commands/new/templates/.amsdal/.secrets,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
164
165
|
amsdal_cli/commands/plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
165
|
-
amsdal_cli/commands/plugin/command.py,sha256=
|
|
166
|
-
amsdal_cli/commands/plugin/templates/.amsdal-cli,sha256=
|
|
166
|
+
amsdal_cli/commands/plugin/command.py,sha256=yiqf7lOKlOlTha1pVlEE0B3yYrREbAQUxa2ehDaMsk0,4982
|
|
167
|
+
amsdal_cli/commands/plugin/templates/.amsdal-cli,sha256=HkC4Dh_3zm3NYdk_sNgiWKzsXyBRt8Tctr3bLMONTqM,325
|
|
167
168
|
amsdal_cli/commands/plugin/templates/README.md,sha256=FMwYTXOJ0ZsrhY-wq-c3pH8OeT-oAckjK48s5kh9lW4,1231
|
|
168
169
|
amsdal_cli/commands/plugin/templates/config.yml,sha256=ZEjr5RA0iSG3Nwf_N11WFwpNI8xKbcqoEip_BZgtOtw,635
|
|
169
|
-
amsdal_cli/commands/plugin/templates/pyproject.toml,sha256=
|
|
170
|
+
amsdal_cli/commands/plugin/templates/pyproject.toml,sha256=DNwO1JotsNRbCf1U-NtuY1Bt149pMkJCxpnEWaH_D-k,400
|
|
170
171
|
amsdal_cli/commands/plugin/templates/src/__about__.py,sha256=IMjkMO3twhQzluVTo8Z6rE7Eg-9U79_LGKMcsWLKBkY,22
|
|
171
172
|
amsdal_cli/commands/plugin/templates/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
172
173
|
amsdal_cli/commands/plugin/templates/src/models/__init__.py,sha256=93F5MjA9NayBY6wY_ypyf55KYER3eovgj5K0IM8w3Qs,49
|
|
173
174
|
amsdal_cli/commands/plugin/templates/src/transactions/__init__.py,sha256=NzpIjXV6XKtBiZoteisyuWYjZNebuh3EAZ3tzrkAFvU,55
|
|
174
175
|
amsdal_cli/commands/plugin/templates/src/transactions/example_transaction.py,sha256=UFSXw7UbYtTSAFuKji0E6c-XTIVASjduOLFAvQJmqVE,1328
|
|
175
176
|
amsdal_cli/commands/register_connection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
176
|
-
amsdal_cli/commands/register_connection/command.py,sha256=
|
|
177
|
+
amsdal_cli/commands/register_connection/command.py,sha256=yOeggn7aYwqWbmOEpu2M2_u9h3ilVaSyKhpoNmy5S60,5093
|
|
177
178
|
amsdal_cli/commands/register_connection/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
178
|
-
amsdal_cli/commands/register_connection/utils/build.py,sha256=
|
|
179
|
+
amsdal_cli/commands/register_connection/utils/build.py,sha256=nsx2EeN-KhZHg1IwICeRSTfUJS1ajNy1LrP33lXoD4s,710
|
|
179
180
|
amsdal_cli/commands/register_connection/utils/config_updater.py,sha256=CDsaCuli5tCsHoNrzfeWoVDPlyOTWvi8TPdbM4Fzo4o,4204
|
|
180
181
|
amsdal_cli/commands/register_connection/utils/credentials.py,sha256=iaAF5STbKJNIoT8vL30DafTn4uzYnrjumtM3XNHuOS8,1066
|
|
181
182
|
amsdal_cli/commands/register_connection/utils/initialize.py,sha256=9NvfAWOvWQVrSfVNZnGBqeKcQ7bxpTf56oj8239jgc8,1279
|
|
@@ -184,20 +185,20 @@ amsdal_cli/commands/register_connection/utils/migrate_models.py,sha256=oU_5oZcwU
|
|
|
184
185
|
amsdal_cli/commands/register_connection/utils/model_generator.py,sha256=w0vz-i-tMdimcQYmFbtfpOZJF8heTTRIzu1yTdbKBpc,10853
|
|
185
186
|
amsdal_cli/commands/register_connection/utils/tables.py,sha256=FOwbWOpEw485Leoqe8LXCVY5osGKTKlMqWD9oqosapk,474
|
|
186
187
|
amsdal_cli/commands/restore/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
187
|
-
amsdal_cli/commands/restore/command.py,sha256=
|
|
188
|
+
amsdal_cli/commands/restore/command.py,sha256=yrtF0y3HHmv6RXrMKQCnUIDhEQecDWY7THI_erh6WtA,35976
|
|
188
189
|
amsdal_cli/commands/restore/enums.py,sha256=6SiKMRGlSjiLyepfbfQFXGAYqlM6Bkoeko2KscntTUQ,307
|
|
189
190
|
amsdal_cli/commands/serve/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
190
|
-
amsdal_cli/commands/serve/command.py,sha256=
|
|
191
|
-
amsdal_cli/commands/serve/utils.py,sha256=
|
|
191
|
+
amsdal_cli/commands/serve/command.py,sha256=rdeS9obphECV6UsGIExVEWUiFL8ntqbNfLiNTMUD4nM,6543
|
|
192
|
+
amsdal_cli/commands/serve/utils.py,sha256=2APwAytxKBuS8PbfGJ0MVLgi_9Q3p-OfBCiZoAMt0bU,18490
|
|
192
193
|
amsdal_cli/commands/serve/filters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
193
194
|
amsdal_cli/commands/serve/filters/models_watch_filter.py,sha256=cnoAjrn-PYDAFq5MtgbQ6QeCvJJmcNisVNlA8QtFv4A,170
|
|
194
195
|
amsdal_cli/commands/serve/filters/static_files_watch_filter.py,sha256=jKAF5RHq1au2v0kcOrqaAHP1x5IUjt_KgZURJLm29Tw,552
|
|
195
196
|
amsdal_cli/commands/serve/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
196
197
|
amsdal_cli/commands/serve/services/supervisor.py,sha256=YAt8pT8qev5DN_u8zpiEsDvAKJpPdoqczxAwSSlSJpU,15216
|
|
197
198
|
amsdal_cli/commands/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
198
|
-
amsdal_cli/commands/tests/command.py,sha256=
|
|
199
|
+
amsdal_cli/commands/tests/command.py,sha256=_UYFGYgd9VDJMjLRSPSudTh2DQuZLV3yk1fZekPlJE0,3800
|
|
199
200
|
amsdal_cli/commands/verify/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
200
|
-
amsdal_cli/commands/verify/command.py,sha256=
|
|
201
|
+
amsdal_cli/commands/verify/command.py,sha256=WVLHI3q1g0Zx09wktM6PWsu6jUsP9AuOA7FGzmzYg7c,2186
|
|
201
202
|
amsdal_cli/commands/verify/models.py,sha256=u9kvoRqNv0wbp0hDUi1GvgWbk417RifFmRvT6AVr2NE,444
|
|
202
203
|
amsdal_cli/commands/verify/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
203
204
|
amsdal_cli/commands/verify/utils/verify_json_model.py,sha256=95BC1kE2URW4gFaRNlccJ8wOvoumDKC7fxu68b84_VA,1110
|
|
@@ -206,25 +207,25 @@ amsdal_cli/commands/worker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
|
206
207
|
amsdal_cli/commands/worker/app.py,sha256=X0irXtvo7Gq2g-tsRTPxi9KkgM38DsIvtDMaeGnqZJY,148
|
|
207
208
|
amsdal_cli/commands/worker/command.py,sha256=e3uL38VYCp71-XsVYvE1xlt2FqhP54ujlhVFhK7_9Jw,186
|
|
208
209
|
amsdal_cli/commands/worker/sub_commands/__init__.py,sha256=5AVFexW1UpfPpfNfYoioA6Pix1uiRSEjVEa-_wP89j4,100
|
|
209
|
-
amsdal_cli/commands/worker/sub_commands/run.py,sha256=
|
|
210
|
+
amsdal_cli/commands/worker/sub_commands/run.py,sha256=lOqH_1VWdF1fmzE5-KHIvaxLTnPaGxs6qBDlY9ezh3Q,4299
|
|
210
211
|
amsdal_cli/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
211
212
|
amsdal_cli/config/main.py,sha256=leYnDJlzhzIAYWOH65QhPLu4zk3ii26ogMBWGYx3uqM,2874
|
|
212
213
|
amsdal_cli/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
213
214
|
amsdal_cli/utils/alias_group.py,sha256=v0ninrhZGtZFuJtUH6ZZZ97Irs96nkmIBFm2gY1NdmU,991
|
|
214
215
|
amsdal_cli/utils/check_versions.py,sha256=4Q3GwY_0xgP_RV_ITuFSDigXds-f1QhqCqkUkn-CSMI,1475
|
|
215
|
-
amsdal_cli/utils/cli_config.py,sha256=
|
|
216
|
+
amsdal_cli/utils/cli_config.py,sha256=4trzdWfbvR0jc9rgyahgl7sKGlodRJMEa7NvZAzENRM,2797
|
|
216
217
|
amsdal_cli/utils/copier.py,sha256=nKo0-P1AhWIb7IjbndYr3Vnvd_avCa566iIbXLK_5a0,5122
|
|
217
218
|
amsdal_cli/utils/markdown_patch.py,sha256=RW58pJhRoUYW1fhId70hw8MD2DF-UqXTYfv7JrSGz5I,1816
|
|
218
219
|
amsdal_cli/utils/render_template.py,sha256=wVjw6K4JZDKz0VElC76Dkgme8di4yfhHIb6hVju9el4,645
|
|
219
|
-
amsdal_cli/utils/schema_repository.py,sha256=
|
|
220
|
+
amsdal_cli/utils/schema_repository.py,sha256=nq3PUYyghTAapzBYeRpbrEkaOHh6dkUqVsOgj0JwtAk,2973
|
|
220
221
|
amsdal_cli/utils/text.py,sha256=oAC6H6nhuH_jSdKqbC3vRKpgzs2Qot7DluojWOwh9GU,2489
|
|
221
222
|
amsdal_cli/utils/vcs/__init__.py,sha256=WWxqfpYP5AK9zGj6_KzKfbQCX6H1FCLqHfQyVnRof9E,513
|
|
222
223
|
amsdal_cli/utils/vcs/base.py,sha256=jC05ExJZDnyHAsW7_4IDf8gQcYgK4dXq3zNlFIX66T4,422
|
|
223
224
|
amsdal_cli/utils/vcs/dummy.py,sha256=Lk8MT-b0YlHHUsiXsq5cvmPwcl4jTYdo8piN5_C8ORA,434
|
|
224
225
|
amsdal_cli/utils/vcs/enums.py,sha256=tYR9LN1IOr8BZFbSeX_vDlhn8fPl4IU-Yakii8lRDYs,69
|
|
225
226
|
amsdal_cli/utils/vcs/git.py,sha256=xHynbZcV6p2D3RFCwu1MGGpV9D7eK-pGUtO8kVexTQM,1269
|
|
226
|
-
amsdal_cli-0.5.
|
|
227
|
-
amsdal_cli-0.5.
|
|
228
|
-
amsdal_cli-0.5.
|
|
229
|
-
amsdal_cli-0.5.
|
|
230
|
-
amsdal_cli-0.5.
|
|
227
|
+
amsdal_cli-0.5.8.dist-info/METADATA,sha256=z4h-NRFwmwAl9Qef3vSadlk0_s2-CU5MgOsdg_tsnAc,57105
|
|
228
|
+
amsdal_cli-0.5.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
229
|
+
amsdal_cli-0.5.8.dist-info/entry_points.txt,sha256=GC-8LZsD3W--Pd9_gD4W3tw3ZZyPbSvkZ-qWc9Fx0NI,47
|
|
230
|
+
amsdal_cli-0.5.8.dist-info/licenses/LICENSE.txt,sha256=hG-541PFYfNJi9WRZi_hno91UyqNg7YLK8LR3vLblZA,27355
|
|
231
|
+
amsdal_cli-0.5.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|