style: format code biome
Local Build and Deploy / deploy (push) Failing after 46s

This commit is contained in:
openhands committed 2026-07-13 21:57:41 +02:00
1 parent 8efd032cc6
commit df38dccbf1
735 files changed
+128321 -120870

No files matched your search

+45 -39
View File
@@ -2,48 +2,54 @@ import { withAdmin } from "@/lib/api-handler";
import { apiError } from "@/lib/api-response";
import { PERMS } from "@/lib/permissions";
import { logAudit } from "@/lib/services/audit";
import { ensureEffectDirs, importSingleEffect } from "@/lib/services/effect-import";
import {
ensureEffectDirs,
importSingleEffect,
} from "@/lib/services/effect-import";
import { runSseBatch } from "@/lib/services/import/core/sse-batch";
import type { EffectMapEntry } from "@/types/effects";
export const POST = withAdmin({ permission: PERMS.ASSETS_IMPORT }, async (request, ctx) => {
const body = await request.json();
const rawItems: EffectMapEntry[] = body.items || [];
const concurrency = body.concurrency || 3;
if (rawItems.length === 0) return apiError("No effects to import", 400);
export const POST = withAdmin(
{ permission: PERMS.ASSETS_IMPORT },
async (request, ctx) => {
const body = await request.json();
const rawItems: EffectMapEntry[] = body.items || [];
const concurrency = body.concurrency || 3;
if (rawItems.length === 0) return apiError("No effects to import", 400);
// Dedupe by lib (the .nitro filename) to avoid double work in one request.
const seen = new Set<string>();
const items = rawItems.filter((it) => {
if (seen.has(it.lib)) return false;
seen.add(it.lib);
return true;
});
// Dedupe by lib (the .nitro filename) to avoid double work in one request.
const seen = new Set<string>();
const items = rawItems.filter((it) => {
if (seen.has(it.lib)) return false;
seen.add(it.lib);
return true;
});
await ensureEffectDirs();
await ensureEffectDirs();
return runSseBatch<EffectMapEntry>({
items,
concurrency,
labelOf: (it) => it.lib,
worker: async (it, _index, report) => {
const r = await importSingleEffect({
id: it.id,
lib: it.lib,
type: it.type,
revision: it.revision,
onProgress: report,
});
if (r.ok) {
logAudit({
userId: ctx.session.user.id,
action: "effect_import",
target: "EffectMap",
targetId: 0,
after: { id: it.id, lib: it.lib, type: it.type, batch: true },
});
}
return { ok: r.ok, warnings: r.warnings, error: r.error };
},
});
});
return runSseBatch<EffectMapEntry>({
items,
concurrency,
labelOf: (it) => it.lib,
worker: async (it, _index, report) => {
const r = await importSingleEffect({
id: it.id,
lib: it.lib,
type: it.type,
revision: it.revision,
onProgress: report,
});
if (r.ok) {
logAudit({
userId: ctx.session.user.id,
action: "effect_import",
target: "EffectMap",
targetId: 0,
after: { id: it.id, lib: it.lib, type: it.type, batch: true },
});
}
return { ok: r.ok, warnings: r.warnings, error: r.error };
},
});
},
);