Some ignored filles was missing

This commit is contained in:
Janus C. H. Knudsen 2026-02-03 00:02:25 +01:00
parent 7db22245e2
commit fd5ab6bc0d
268 changed files with 31970 additions and 4 deletions

View file

@ -0,0 +1,62 @@
/**
* MockEventRepository - Loads event data from local JSON file (LEGACY)
*
* This repository implementation fetches mock event data from a static JSON file.
* DEPRECATED: Use IndexedDBEventRepository for offline-first functionality.
*
* Data Source: data/mock-events.json
*
* NOTE: Create/Update/Delete operations are not supported - throws errors.
* This is intentional to encourage migration to IndexedDBEventRepository.
*/
export class MockEventRepository {
constructor() {
this.dataUrl = 'data/mock-events.json';
}
async loadEvents() {
try {
const response = await fetch(this.dataUrl);
if (!response.ok) {
throw new Error(`Failed to load mock events: ${response.status} ${response.statusText}`);
}
const rawData = await response.json();
return this.processCalendarData(rawData);
}
catch (error) {
console.error('Failed to load event data:', error);
throw error;
}
}
/**
* NOT SUPPORTED - MockEventRepository is read-only
* Use IndexedDBEventRepository instead
*/
async createEvent(event, source) {
throw new Error('MockEventRepository does not support createEvent. Use IndexedDBEventRepository instead.');
}
/**
* NOT SUPPORTED - MockEventRepository is read-only
* Use IndexedDBEventRepository instead
*/
async updateEvent(id, updates, source) {
throw new Error('MockEventRepository does not support updateEvent. Use IndexedDBEventRepository instead.');
}
/**
* NOT SUPPORTED - MockEventRepository is read-only
* Use IndexedDBEventRepository instead
*/
async deleteEvent(id, source) {
throw new Error('MockEventRepository does not support deleteEvent. Use IndexedDBEventRepository instead.');
}
processCalendarData(data) {
return data.map((event) => ({
...event,
start: new Date(event.start),
end: new Date(event.end),
type: event.type,
allDay: event.allDay || false,
syncStatus: 'synced'
}));
}
}
//# sourceMappingURL=MockEventRepository.js.map