commiter-cli 0.3.0__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.
- commiter/__init__.py +3 -0
- commiter/adapters/__init__.py +0 -0
- commiter/adapters/base.py +96 -0
- commiter/adapters/django_rest.py +247 -0
- commiter/adapters/express.py +204 -0
- commiter/adapters/fastapi.py +170 -0
- commiter/adapters/flask.py +169 -0
- commiter/adapters/nextjs.py +180 -0
- commiter/adapters/prisma.py +76 -0
- commiter/adapters/raw_sql.py +191 -0
- commiter/adapters/react.py +129 -0
- commiter/adapters/sqlalchemy.py +99 -0
- commiter/adapters/supabase.py +68 -0
- commiter/auth.py +130 -0
- commiter/cli.py +667 -0
- commiter/correlator.py +208 -0
- commiter/extractors/__init__.py +0 -0
- commiter/extractors/api_calls.py +91 -0
- commiter/extractors/api_endpoints.py +354 -0
- commiter/extractors/backend_files.py +33 -0
- commiter/extractors/base.py +40 -0
- commiter/extractors/db_operations.py +69 -0
- commiter/extractors/dependencies.py +219 -0
- commiter/generic_resolver.py +204 -0
- commiter/handler_index.py +97 -0
- commiter/lib.py +63 -0
- commiter/middleware_index.py +350 -0
- commiter/models.py +117 -0
- commiter/parser.py +1283 -0
- commiter/prefix_index.py +211 -0
- commiter/report/__init__.py +0 -0
- commiter/report/ai.py +120 -0
- commiter/report/api_guide.py +217 -0
- commiter/report/architecture.py +930 -0
- commiter/report/console.py +254 -0
- commiter/report/json_output.py +122 -0
- commiter/report/markdown.py +163 -0
- commiter/scanner.py +383 -0
- commiter/type_index.py +304 -0
- commiter/uploader.py +46 -0
- commiter/utils/__init__.py +0 -0
- commiter/utils/env_reader.py +78 -0
- commiter/utils/file_classifier.py +187 -0
- commiter/utils/path_helpers.py +73 -0
- commiter/utils/tsconfig_resolver.py +281 -0
- commiter/wrapper_index.py +288 -0
- commiter_cli-0.3.0.dist-info/METADATA +14 -0
- commiter_cli-0.3.0.dist-info/RECORD +96 -0
- commiter_cli-0.3.0.dist-info/WHEEL +5 -0
- commiter_cli-0.3.0.dist-info/entry_points.txt +2 -0
- commiter_cli-0.3.0.dist-info/top_level.txt +2 -0
- tests/__init__.py +0 -0
- tests/fixtures/arch_backend/app.py +22 -0
- tests/fixtures/arch_backend/middleware/__init__.py +0 -0
- tests/fixtures/arch_backend/middleware/rate_limit.py +4 -0
- tests/fixtures/arch_backend/routes/__init__.py +0 -0
- tests/fixtures/arch_backend/routes/analytics.py +20 -0
- tests/fixtures/arch_backend/routes/auth.py +29 -0
- tests/fixtures/arch_backend/routes/projects.py +60 -0
- tests/fixtures/arch_backend/routes/users.py +55 -0
- tests/fixtures/arch_monorepo/apps/api/app.py +30 -0
- tests/fixtures/arch_monorepo/apps/api/middleware/__init__.py +0 -0
- tests/fixtures/arch_monorepo/apps/api/middleware/auth.py +17 -0
- tests/fixtures/arch_monorepo/apps/api/middleware/rate_limit.py +10 -0
- tests/fixtures/arch_monorepo/apps/api/routes/__init__.py +0 -0
- tests/fixtures/arch_monorepo/apps/api/routes/auth.py +46 -0
- tests/fixtures/arch_monorepo/apps/api/routes/invites.py +30 -0
- tests/fixtures/arch_monorepo/apps/api/routes/notifications.py +25 -0
- tests/fixtures/arch_monorepo/apps/api/routes/projects.py +80 -0
- tests/fixtures/arch_monorepo/apps/api/routes/tasks.py +91 -0
- tests/fixtures/arch_monorepo/apps/api/routes/users.py +48 -0
- tests/fixtures/arch_monorepo/apps/api/services/__init__.py +0 -0
- tests/fixtures/arch_monorepo/apps/api/services/email.py +11 -0
- tests/fixtures/backend_b/app.py +17 -0
- tests/fixtures/fastapi_app/app.py +48 -0
- tests/fixtures/fastapi_crossfile/routes.py +18 -0
- tests/fixtures/fastapi_crossfile/schemas.py +21 -0
- tests/fixtures/flask_app/app.py +33 -0
- tests/fixtures/flask_blueprint/app.py +7 -0
- tests/fixtures/flask_blueprint/routes/items.py +13 -0
- tests/fixtures/flask_blueprint/routes/users.py +20 -0
- tests/fixtures/middleware_test_flask/routes/public.py +8 -0
- tests/fixtures/middleware_test_flask/routes/users.py +26 -0
- tests/fixtures/python_deep_imports/app/__init__.py +0 -0
- tests/fixtures/python_deep_imports/app/api/__init__.py +0 -0
- tests/fixtures/python_deep_imports/app/api/health.py +11 -0
- tests/fixtures/python_deep_imports/app/api/v1/__init__.py +0 -0
- tests/fixtures/python_deep_imports/app/api/v1/items.py +18 -0
- tests/fixtures/python_deep_imports/app/api/v1/users.py +27 -0
- tests/fixtures/python_deep_imports/app/schemas/__init__.py +0 -0
- tests/fixtures/python_deep_imports/app/schemas/item.py +13 -0
- tests/fixtures/python_deep_imports/app/schemas/user.py +15 -0
- tests/fixtures/python_deep_imports/app/shared/__init__.py +0 -0
- tests/fixtures/python_deep_imports/app/shared/models.py +7 -0
- tests/fixtures/raw_sql_test/app.py +54 -0
- tests/test_architecture.py +757 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from pydantic import BaseModel
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class ItemCreate(BaseModel):
|
|
6
|
+
name: str
|
|
7
|
+
price: float
|
|
8
|
+
description: Optional[str] = None
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ItemUpdate(BaseModel):
|
|
12
|
+
name: Optional[str] = None
|
|
13
|
+
price: Optional[float] = None
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from pydantic import BaseModel
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class UserCreate(BaseModel):
|
|
6
|
+
email: str
|
|
7
|
+
password: str
|
|
8
|
+
display_name: str
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class UserResponse(BaseModel):
|
|
12
|
+
id: int
|
|
13
|
+
email: str
|
|
14
|
+
display_name: str
|
|
15
|
+
is_active: bool = True
|
|
File without changes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import psycopg2
|
|
2
|
+
from flask import Flask, request, jsonify
|
|
3
|
+
|
|
4
|
+
app = Flask(__name__)
|
|
5
|
+
conn = psycopg2.connect("postgresql://localhost/mydb")
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@app.route("/api/users", methods=["GET"])
|
|
9
|
+
def list_users():
|
|
10
|
+
cursor = conn.cursor()
|
|
11
|
+
cursor.execute("SELECT id, name, email FROM users ORDER BY created_at DESC")
|
|
12
|
+
rows = cursor.fetchall()
|
|
13
|
+
return jsonify(users=rows)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@app.route("/api/users/<user_id>", methods=["GET"])
|
|
17
|
+
def get_user(user_id):
|
|
18
|
+
cursor = conn.cursor()
|
|
19
|
+
cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))
|
|
20
|
+
user = cursor.fetchone()
|
|
21
|
+
return jsonify(user=user)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@app.route("/api/users", methods=["POST"])
|
|
25
|
+
def create_user():
|
|
26
|
+
name = request.json["name"]
|
|
27
|
+
email = request.json["email"]
|
|
28
|
+
cursor = conn.cursor()
|
|
29
|
+
cursor.execute("INSERT INTO users (name, email) VALUES (%s, %s) RETURNING id", (name, email))
|
|
30
|
+
user_id = cursor.fetchone()[0]
|
|
31
|
+
conn.commit()
|
|
32
|
+
return jsonify(id=user_id)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@app.route("/api/orders", methods=["GET"])
|
|
36
|
+
def list_orders():
|
|
37
|
+
cursor = conn.cursor()
|
|
38
|
+
cursor.execute("""
|
|
39
|
+
SELECT o.id, o.total, u.name
|
|
40
|
+
FROM orders o
|
|
41
|
+
JOIN users u ON o.user_id = u.id
|
|
42
|
+
WHERE o.status = 'active'
|
|
43
|
+
ORDER BY o.created_at DESC
|
|
44
|
+
""")
|
|
45
|
+
return jsonify(orders=cursor.fetchall())
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@app.route("/api/orders/<order_id>", methods=["DELETE"])
|
|
49
|
+
def cancel_order(order_id):
|
|
50
|
+
cursor = conn.cursor()
|
|
51
|
+
cursor.execute("UPDATE orders SET status = 'cancelled' WHERE id = %s", (order_id,))
|
|
52
|
+
cursor.execute("DELETE FROM order_items WHERE order_id = %s", (order_id,))
|
|
53
|
+
conn.commit()
|
|
54
|
+
return jsonify(status="cancelled")
|