Audit the project and secure toolbox data
This commit is contained in:
parent
96af62edf0
commit
e87edda5c7
40 changed files with 2324 additions and 125 deletions
23
e2e/helpers/toolboxImport.js
Normal file
23
e2e/helpers/toolboxImport.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Rôle : construit des fichiers d'import toolbox v2 canoniques pour les parcours navigateur.
|
||||
import { createToolboxExportPayload } from "../../website/src/features/toolboxes/storage/toolboxStorage.js";
|
||||
|
||||
export function createToolboxImportPayload({ id, name, modules, moduleData = {} }) {
|
||||
const moduleIds = modules.map((module) => module.id);
|
||||
const toolbox = {
|
||||
id,
|
||||
name,
|
||||
modules,
|
||||
spaces: [{
|
||||
id: "default",
|
||||
name: "Défaut",
|
||||
moduleOrder: { one: moduleIds, two: [moduleIds, []] }
|
||||
}],
|
||||
defaultSpaceId: "default",
|
||||
activeSpaceId: "default",
|
||||
updatedAt: "2026-10-14T12:00:00.000Z"
|
||||
};
|
||||
const storedModuleData = Object.fromEntries(
|
||||
Object.entries(moduleData).map(([moduleId, data]) => [`${id}:${moduleId}`, data])
|
||||
);
|
||||
return createToolboxExportPayload(toolbox, storedModuleData);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue