/
rykit
/
lifequest-app
Обзор
Документация
Войти
/
rykit
/
lifequest-app
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
server/src/modules/sync/sync.service.ts
33 строки
881 B
Rykitik
add: реализовал минимальный sync bootstrap для account mode
26 апр 2026, 22:38
26 апр 2026, 22:38
3ddd89e
Код
Авторство
О чём код?
import type { SyncBootstrapCollections, SyncBootstrapResponse } from './sync.types.js' import { SYNC_SCHEMA_VERSION } from './sync.types.js' function createEmptyCollections(): SyncBootstrapCollections { return { quests: [], todayRoute: [], progress: [], bodyLogs: [], moneyLogs: [], rescueLogs: [], companionProfile: [], settingsProfile: [], promptPreferences: [], } } function createBootstrapCursor(userId: string, serverTime: string) { return `bootstrap_${userId}_${serverTime}` } export async function getSyncBootstrapState(userId: string): Promise<SyncBootstrapResponse> { const serverTime = new Date().toISOString() return { userId, serverTime, latestSyncCursor: createBootstrapCursor(userId, serverTime), schemaVersion: SYNC_SCHEMA_VERSION, collections: createEmptyCollections(), conflicts: [], } }