mirror of
https://github.com/cpvalente/ontime.git
synced 2026-07-26 10:38:55 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f56bef9b7 | |||
| 3ae042416f |
@@ -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');
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user