Compare commits

...

2 Commits

Author SHA1 Message Date
alex-arc 8f56bef9b7 chore: export client in resolver 2026-05-17 21:01:40 +02:00
alex-arc 3ae042416f feat: add load rundown api endpoint 2026-05-17 21:01:40 +02:00
3 changed files with 29 additions and 3 deletions
+3
View File
@@ -14,6 +14,9 @@ export { TimerPhase, Playback, runtimeStorePlaceholder, OffsetMode } from 'ontim
export type { SimpleTimerState } from 'ontime-types';
export { SimplePlayback, SimpleDirection } from 'ontime-types';
// Client
export type { ClientList, Client } from 'ontime-types';
// entries
export type {
OntimeEntry,
@@ -12,7 +12,7 @@ import { DeepPartial } from 'ts-essentials';
import { socket } from '../adapters/WebsocketAdapter.js';
import { getCurrentRundown, getProjectCustomFields } from '../api-data/rundown/rundown.dao.js';
import { editEntry } from '../api-data/rundown/rundown.service.js';
import { editEntry, loadRundown } from '../api-data/rundown/rundown.service.js';
import { willCauseRegeneration } from '../api-data/rundown/rundown.utils.js';
import { ONTIME_VERSION } from '../ONTIME_VERSION.js';
import { auxTimerService } from '../services/aux-timer-service/AuxTimerService.js';
@@ -307,6 +307,15 @@ const actionHandlers: Record<ApiActionTag, ActionHandler> = {
runtimeService.setOffsetMode(mode);
return { payload: 'success' };
},
rundown: async (payload) => {
assert.isObject(payload);
if ('load' in payload) {
assert.isString(payload.load);
await loadRundown(payload.load);
return { payload: 'success' };
}
throw new Error('No matching method provided');
},
};
/**
+16 -2
View File
@@ -142,6 +142,18 @@ export type OffsetmodeResponse = {
payload: 'success';
};
export type RundownAction = {
tag: 'rundown';
payload: {
/** load a rundown by id */
load: string;
};
};
export type RundownLoadResponse = {
tag: 'rundown-load';
payload: 'success';
};
export type ApiAction =
| VersionAction
| PollAction
@@ -156,7 +168,8 @@ export type ApiAction =
| AddtimeAction
| AuxtimerAction
| ClientAction
| OffsetmodeAction;
| OffsetmodeAction
| RundownAction;
export type ApiResponse =
| VersionResponse
@@ -172,6 +185,7 @@ export type ApiResponse =
| AddtimeResponse
| AuxtimerResponse
| ClientResponse
| OffsetmodeResponse;
| OffsetmodeResponse
| RundownLoadResponse;
export type ApiActionTag = ApiAction['tag'];