api/processing/request: backwards compat with boolean localProcessing

This commit is contained in:
wukko
2025-06-22 16:21:55 +06:00
parent 28ab2747ce
commit ac85ce86c0

View File

@@ -114,6 +114,11 @@ export function createResponse(responseType, responseData) {
} }
export function normalizeRequest(request) { export function normalizeRequest(request) {
// TODO: remove after backwards compatibility period
if ("localProcessing" in request && typeof request.localProcessing === "boolean") {
request.localProcessing = request.localProcessing ? "preferred" : "disabled";
}
return apiSchema.safeParseAsync(request).catch(() => ( return apiSchema.safeParseAsync(request).catch(() => (
{ success: false } { success: false }
)); ));