Files
pulse-signage/src/common.js
T
lzstealth 2ea8d389fa This PR breaks the large web and player bootstrap files into smaller modules with clearer ownership.
Web changes:

Split shared helpers, bootstrap logic, route groups, and upload-sync behavior out of web.js.
Kept web.js focused on wiring and server startup.
Fixed screen playlist reassignment so changing a screen’s playlist now triggers a refresh.
Fixed single-slide playlist refresh behavior so updates do not get stuck behind the current slide.
Player changes:

Split websocket/runtime handling into runtime.js.
Split playlist assembly and revision hashing into playlist.js.
Split onboarding and player HTTP routes into dedicated modules.
Split render utilities and template loading into render-helpers.js.
Kept player.js mostly as startup/orchestration.
Validation:

Rebuilt both services with Docker Compose.
Smoke-checked web and player routes after the refactor.
Verified get_errors was clean on the touched modules.
2026-07-20 23:58:27 +01:00

29 lines
1.1 KiB
JavaScript

const db = require('./db');
const data = require('./data');
const player = require('./player/render');
module.exports = {
createPool: db.createPool,
ensureSchema: db.ensureSchema,
slugify: data.slugify,
uniqueScreenSlug: data.uniqueScreenSlug,
parseJsonSafe: data.parseJsonSafe,
fetchAdminData: data.fetchAdminData,
fetchPlaylistById: data.fetchPlaylistById,
fetchScreenById: data.fetchScreenById,
fetchScreenEditData: data.fetchScreenEditData,
fetchTemplateById: data.fetchTemplateById,
fetchSlideById: data.fetchSlideById,
fetchTemplatesData: data.fetchTemplatesData,
fetchCanvasSizesData: data.fetchCanvasSizesData,
fetchCanvasSizeById: data.fetchCanvasSizeById,
buildCanvasSizePayload: data.buildCanvasSizePayload,
buildSlidePayload: data.buildSlidePayload,
extractTemplateRegions: data.extractTemplateRegions,
buildTemplatePayload: data.buildTemplatePayload,
mediaKind: player.mediaKind,
renderPlayerPage: player.renderPlayerPage,
renderPlayerOnboardingLandingPage: player.renderPlayerOnboardingLandingPage,
renderPlayerOnboardingFormPage: player.renderPlayerOnboardingFormPage
};