Commit Graph

19 Commits

Author SHA1 Message Date
dc06d296a3 test(backend): test catalog HTTP error cases
Add tests for:
- moveItemsToDirectory (success, same-parent precondition, conflicts)
- createDirectory errors (parent not found, not a directory, duplicate)
- bulk delete type validation (files vs directories)- listDirectory
pagination (limit, cursor, invalid inputs)

Also fix test setup to use httperr.ErrorHandler so HTTPErrorstatus codes
are properly returned.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-05 00:45:38 +00:00
d0c2a21ffd fix: add ResolveRenameOp to handle directory renames
RenameNode was calling Resolve() which generated blob keys for
directories that don't have blobs, causing 'key not found' errors.

Added ResolveRenameOp to BlobKeyResolver interface:
- FlatKeyResolver returns nil (UUIDs don't change on rename)
- HierarchicalKeyResolver returns move op for files and directories

This allows directory renames to work correctly with flat storage,
and leverages os.Rename for atomic directory moves with hierarchical.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-04 23:58:43 +00:00
b8e1671248 test: add HTTP integration tests for catalog endpoints
Tests cover directory and file operations:
- List, fetch, create directories
- Fetch, download, rename files
- Trash and permanent delete (single and bulk)
- 404 for non-existent resources
- Verification that permanent deletes return 404

Directory rename test skipped due to VFS bug with blob
key resolution for directories.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-04 23:54:30 +00:00
86e90af5c2 feat(backend): hide drive uuid and return root dir 2026-01-04 17:48:51 +00:00
88492dd876 refactor: account model overhaul 2026-01-01 18:29:52 +00:00
19a870a4e7 feat(backend): includesExpired for file/dir shares
add includesExpired query param for file/dir shares query
2025-12-28 22:12:55 +00:00
1a1fc4743a feat: initial sharing impl 2025-12-27 19:27:08 +00:00
1024f36a9f fix: vfs list children not handling empty rows 2025-12-18 00:47:41 +00:00
f2cce889af impl: dir content pagination 2025-12-17 22:59:18 +00:00
6fb49ba61a feat: ret dir item parent id in dir content query 2025-12-16 01:47:00 +00:00
05edf69ca7 refactor: initial frontend wiring for new api 2025-12-15 00:13:10 +00:00
528aa943fa feat: migrate to OpenAPI 3.0 with oneOf unions
- Add swagger2openapi conversion step to generate OpenAPI 3.0
- Add patch-openapi.ts script to inject oneOf discriminated unions
- Update docs server to embed static openapi.json
- Update moveItemsToDirectory response to use oneOf for items
- Add docs/README.md documenting the pipeline
- Use bun instead of node for scripts
2025-12-14 16:43:05 +00:00
7b13326e22 docs: add OpenAPI documentation with Scalar UI
- Add swaggo annotations to all HTTP handlers
- Add Swagger/OpenAPI spec generation with swag
- Create separate docs server binary (drexa-docs)
- Add Makefile with build, run, and docs targets
- Configure Scalar as the API documentation UI

Run 'make docs' to regenerate, 'make run-docs' to serve.
2025-12-13 22:44:37 +00:00
918b85dfd5 feat: support bulk file move in same dir 2025-12-13 19:24:54 +00:00
085bbd4ffe fix: use db tx when creating directory 2025-12-05 00:55:41 +00:00
1c9e049448 fix: handle create dir conflict in api 2025-12-05 00:38:31 +00:00
3ea12cf51a feat: add query param to include dir path in query 2025-12-05 00:38:05 +00:00
589158a8ed feat: impl directory endpoints 2025-12-03 00:56:44 +00:00
ca9dfd90b2 feat: impl files endpoints 2025-12-02 22:08:50 +00:00