Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/resolver/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 10 additions & 1 deletion apps/server/src/api-integration/integration.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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');
},
};

/**
Expand Down
18 changes: 16 additions & 2 deletions packages/types/src/api/websocket/api.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -156,7 +168,8 @@ export type ApiAction =
| AddtimeAction
| AuxtimerAction
| ClientAction
| OffsetmodeAction;
| OffsetmodeAction
| RundownAction;

export type ApiResponse =
| VersionResponse
Expand All @@ -172,6 +185,7 @@ export type ApiResponse =
| AddtimeResponse
| AuxtimerResponse
| ClientResponse
| OffsetmodeResponse;
| OffsetmodeResponse
| RundownLoadResponse;

export type ApiActionTag = ApiAction['tag'];
Loading