sokko-g/e2e/helpers/toolboxImport.js
Shinuwa 22b397ebfa Document Sokko G's architecture and folders, and move JavaScript file headers to JSDoc @file blocks
Add ARCHITECTURE.md (layers, flows, folder map, glossary), CONTRIBUTING.md
(setup and step-by-step recipes) and a README in each main folder, with an
index of docs/. Convert the 511 JavaScript headers from "// Rôle :" lines to
JSDoc @file blocks, define a three-level header template in website/AGENTS.md
and check the header in tests/file-headers.test.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:42:13 +01:00

26 lines
843 B
JavaScript

/**
* @file 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);
}