fix: normalize bridge errors and support nested group paths

Distinguish invalid KeePass requests from backend failures in the Python bridge, improve nested group path resolution, and add coverage for nested group creation plus payload forwarding.
This commit is contained in:
2026-05-10 00:56:58 +02:00
parent ee0e2c85f4
commit 5fa30414d7
8 changed files with 99 additions and 23 deletions
+5 -1
View File
@@ -85,6 +85,8 @@ Creates a new entry in the target database and persists it immediately.
- `notes`: optional notes
- `groupPath`: optional target group path
`groupPath` is resolved as an existing group path when possible. Nested paths such as `Folder1/SubFolder` are supported when the target group exists.
### `createGroup(group)`
Creates a new group and persists it immediately.
@@ -92,6 +94,8 @@ Creates a new group and persists it immediately.
- `name`: group name
- `path`: optional parent group path
`path` is resolved as an existing parent group path when possible, including nested paths.
### `save()`
Persists the current database state.
@@ -102,7 +106,7 @@ No-op for now.
- The bridge currently launches a Python process per call.
- This is simple and robust for a first version.
- Errors from the Python bridge are propagated to the TypeScript API, including invalid or empty output.
- Errors from the Python bridge are propagated to the TypeScript API, including invalid or empty output. Bridge failures are normalized to distinguish invalid requests and backend errors.
- A persistent Python process can be added later if needed.
- Write operations currently open, modify, and save the database per command.
- Bundled fixtures include `tests/fixtures/data.kdbx` and `tests/fixtures/empty.kdbx`; the companion JSON file stores the password and expected content for tests/examples.