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
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2

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 }
)); ));