Files
stephen schuresko 0831ee943c feat(api): enhance image module management and export functionality
- Added read-write access to the darktable SQLite catalog for module parameter edits.
- Implemented new endpoints for exporting images and retrieving full-resolution images.
- Introduced PATCH method for updating module parameters with optional preview.
- Added comprehensive tests for new API functionalities, including module retrieval and error handling.
- Updated CORS headers to support new HTTP methods.
- Created detailed documentation for new API endpoints and module operations.
2026-06-10 19:50:56 -04:00

80 lines
2.4 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
meta {
name: List Modules
type: http
seq: 1
}
get {
url: {{baseUrl}}/api/v1/images/{{imageId}}/modules
body: none
auth: bearer
}
auth:bearer {
token: {{accessToken}}
}
tests {
test("returns 200", function() {
expect(res.status).to.equal(200);
});
test("has image_id", function() {
expect(res.body.image_id).to.equal(Number(bru.getVar("imageId")));
});
test("has items array", function() {
expect(res.body.items).to.be.an("array");
expect(res.body.items.length).to.be.above(0);
});
test("each item has required fields", function() {
res.body.items.forEach(function(m) {
expect(m.operation).to.be.a("string");
expect(m.enabled).to.be.a("boolean");
expect(m.module_version).to.be.a("number");
expect(m.history_num).to.be.a("number");
});
});
test("known modules have decoded params", function() {
var known = res.body.items.filter(function(m) {
return ["exposure","temperature","filmicrgb","highlights",
"channelmixerrgb","flip","gamma","rawprepare","demosaic"].indexOf(m.operation) >= 0;
});
known.forEach(function(m) {
expect(m.params).to.not.be.null;
expect(typeof m.params).to.equal("object");
});
});
test("unknown modules have params_b64", function() {
var unknown = res.body.items.filter(function(m) { return m.params === undefined || m.params === null; });
unknown.forEach(function(m) {
expect(m.params_b64).to.be.a("string");
});
});
// Save the first module op for subsequent tests
bru.setVar("moduleOp", res.body.items[0].operation);
}
docs {
## List Modules
Returns all active development modules (history stack entries) for the image.
Each item includes:
- `operation` – module name (e.g. `"exposure"`, `"filmicrgb"`)
- `enabled` – whether the module is currently active in the pipeline
- `module_version` – params struct version stored in the database
- `multi_name` – user label for multi-instance modules (empty for single-instance)
- `history_num` – position in the history stack (higher = more recent)
- `params` – decoded named parameters (for supported modules)
- `params_b64` – base64-encoded raw binary blob (for unsupported modules)
### Supported modules (params decoded)
`exposure`, `temperature`, `filmicrgb`, `channelmixerrgb`, `highlights`,
`flip`, `gamma`, `rawprepare`, `demosaic`
}