cycls 0.0.2.103__tar.gz → 0.0.2.104__tar.gz
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.
- {cycls-0.0.2.103 → cycls-0.0.2.104}/PKG-INFO +1 -1
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/web.py +7 -7
- {cycls-0.0.2.103 → cycls-0.0.2.104}/pyproject.toml +1 -1
- {cycls-0.0.2.103 → cycls-0.0.2.104}/.gitignore +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/README.md +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/__init__.py +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/app.py +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/auth.py +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/cli.py +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/function.py +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/themes/default/assets/FileSaver.min-BN40akLc.js +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/themes/default/assets/html2canvas.esm-QH1iLAAe.js +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/themes/default/assets/index-3AQCbjkB.js +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/themes/default/assets/index-CjN0qc53.css +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/themes/default/assets/index-qcHL6SRo.js +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/themes/default/assets/index.es-BmxgotDY.js +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/themes/default/assets/jspdf.es.min-CvOy4co6.js +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/themes/default/assets/purify.es-B9ZVCkUG.js +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/themes/default/index.html +0 -0
- {cycls-0.0.2.103 → cycls-0.0.2.104}/cycls/themes/dev/index.html +0 -0
|
@@ -137,22 +137,22 @@ def web(func, config):
|
|
|
137
137
|
async def get_config():
|
|
138
138
|
return config
|
|
139
139
|
|
|
140
|
-
@app.post("/
|
|
141
|
-
async def
|
|
140
|
+
@app.post("/attachments")
|
|
141
|
+
async def upload_attachment(file: UploadFile = File(...), jwt: dict = Depends(validate)):
|
|
142
142
|
user_id = jwt["user"]["id"]
|
|
143
|
-
user_dir = Path(f"/workspace/{user_id}/
|
|
143
|
+
user_dir = Path(f"/workspace/{user_id}/attachments")
|
|
144
144
|
user_dir.mkdir(parents=True, exist_ok=True)
|
|
145
145
|
|
|
146
146
|
file_path = user_dir / file.filename
|
|
147
147
|
with open(file_path, "wb") as f:
|
|
148
148
|
f.write(await file.read())
|
|
149
149
|
|
|
150
|
-
return {"url": f"/
|
|
150
|
+
return {"url": f"/attachments/{file.filename}"}
|
|
151
151
|
|
|
152
|
-
@app.get("/
|
|
153
|
-
async def
|
|
152
|
+
@app.get("/attachments/{filename}")
|
|
153
|
+
async def get_attachment(filename: str, jwt: dict = Depends(validate)):
|
|
154
154
|
user_id = jwt["user"]["id"]
|
|
155
|
-
file_path = Path(f"/workspace/{user_id}/
|
|
155
|
+
file_path = Path(f"/workspace/{user_id}/attachments") / filename
|
|
156
156
|
|
|
157
157
|
if not file_path.exists():
|
|
158
158
|
raise HTTPException(status_code=404, detail="File not found")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|