mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-07 16:33:51 +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 type { SimpleTimerState } from 'ontime-types';
|
||||||
export { SimplePlayback, SimpleDirection } from 'ontime-types';
|
export { SimplePlayback, SimpleDirection } from 'ontime-types';
|
||||||
|
|
||||||
|
// Client
|
||||||
|
export type { ClientList, Client } from 'ontime-types';
|
||||||
|
|
||||||
// entries
|
// entries
|
||||||
export type {
|
export type {
|
||||||
OntimeEntry,
|
OntimeEntry,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { DeepPartial } from 'ts-essentials';
|
|||||||
|
|
||||||
import { socket } from '../adapters/WebsocketAdapter.js';
|
import { socket } from '../adapters/WebsocketAdapter.js';
|
||||||
import { getCurrentRundown, getProjectCustomFields } from '../api-data/rundown/rundown.dao.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 { willCauseRegeneration } from '../api-data/rundown/rundown.utils.js';
|
||||||
import { ONTIME_VERSION } from '../ONTIME_VERSION.js';
|
import { ONTIME_VERSION } from '../ONTIME_VERSION.js';
|
||||||
import { auxTimerService } from '../services/aux-timer-service/AuxTimerService.js';
|
import { auxTimerService } from '../services/aux-timer-service/AuxTimerService.js';
|
||||||
@@ -307,6 +307,15 @@ const actionHandlers: Record<ApiActionTag, ActionHandler> = {
|
|||||||
runtimeService.setOffsetMode(mode);
|
runtimeService.setOffsetMode(mode);
|
||||||
return { payload: 'success' };
|
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';
|
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 =
|
export type ApiAction =
|
||||||
| VersionAction
|
| VersionAction
|
||||||
| PollAction
|
| PollAction
|
||||||
@@ -156,7 +168,8 @@ export type ApiAction =
|
|||||||
| AddtimeAction
|
| AddtimeAction
|
||||||
| AuxtimerAction
|
| AuxtimerAction
|
||||||
| ClientAction
|
| ClientAction
|
||||||
| OffsetmodeAction;
|
| OffsetmodeAction
|
||||||
|
| RundownAction;
|
||||||
|
|
||||||
export type ApiResponse =
|
export type ApiResponse =
|
||||||
| VersionResponse
|
| VersionResponse
|
||||||
@@ -172,6 +185,7 @@ export type ApiResponse =
|
|||||||
| AddtimeResponse
|
| AddtimeResponse
|
||||||
| AuxtimerResponse
|
| AuxtimerResponse
|
||||||
| ClientResponse
|
| ClientResponse
|
||||||
| OffsetmodeResponse;
|
| OffsetmodeResponse
|
||||||
|
| RundownLoadResponse;
|
||||||
|
|
||||||
export type ApiActionTag = ApiAction['tag'];
|
export type ApiActionTag = ApiAction['tag'];
|
||||||
|
|||||||
Reference in New Issue
Block a user