mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-15 20:33:47 +00:00
V2 fix socket (#296)
* refactor: rename timer endpoint * refactor: typescript * refactor: rename eventData and viewSettings * refactor: message manager uses event store
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
import { Alias } from './core/Alias.type.js';
|
||||
import { EventData } from './core/EventData.type.js';
|
||||
import { OntimeRundown } from './core/Rundown.type.js';
|
||||
import { OSCSettings } from './core/OscSettings.type.js';
|
||||
import { Settings } from './core/Settings.type.js';
|
||||
import { UserFields } from './core/UserFields.type.js';
|
||||
import { ViewSettings } from './core/Views.type.js';
|
||||
|
||||
export type DatabaseModel = {
|
||||
rundown: any;
|
||||
event: any;
|
||||
settings: any;
|
||||
views: any;
|
||||
aliases: any;
|
||||
userFields: any;
|
||||
rundown: OntimeRundown;
|
||||
eventData: EventData;
|
||||
settings: Settings;
|
||||
viewSettings: ViewSettings;
|
||||
aliases: Alias[];
|
||||
userFields: UserFields;
|
||||
osc: OSCSettings;
|
||||
http: any;
|
||||
};
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
enum TimerTypeType {
|
||||
export enum TimerTypeType {
|
||||
CountDown = 'count-down',
|
||||
CountUp = 'count-up',
|
||||
Clock = 'clock'
|
||||
}
|
||||
|
||||
export default TimerTypeType
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
export type Alias = {
|
||||
enabled: boolean;
|
||||
alias: string;
|
||||
pathAndParams: string;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export type EventData = {
|
||||
title: string;
|
||||
publicUrl: string;
|
||||
publicInfo: string;
|
||||
backstageUrl: string;
|
||||
backstageInfo: string;
|
||||
endMessage: string;
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
export enum SupportedEvent {
|
||||
Event = 'event',
|
||||
Delay = 'delay',
|
||||
Block = 'block',
|
||||
}
|
||||
|
||||
export type OntimeBaseEvent = {
|
||||
type: SupportedEvent;
|
||||
id: string;
|
||||
after?: string; // used when creating an event to indicate its position in rundown
|
||||
};
|
||||
|
||||
export type OntimeDelay = OntimeBaseEvent & {
|
||||
type: SupportedEvent.Delay;
|
||||
duration: number;
|
||||
revision: number;
|
||||
};
|
||||
|
||||
export type OntimeBlock = OntimeBaseEvent & {
|
||||
type: SupportedEvent.Block;
|
||||
};
|
||||
|
||||
export type OntimeEvent = OntimeBaseEvent & {
|
||||
type: SupportedEvent.Event;
|
||||
title: string;
|
||||
subtitle: string;
|
||||
presenter: string;
|
||||
note: string;
|
||||
timeType?: string;
|
||||
timeStart: number;
|
||||
timeEnd: number;
|
||||
duration: number;
|
||||
isPublic: boolean;
|
||||
skip: boolean;
|
||||
colour: string;
|
||||
user0: string;
|
||||
user1: string;
|
||||
user2: string;
|
||||
user3: string;
|
||||
user4: string;
|
||||
user5: string;
|
||||
user6: string;
|
||||
user7: string;
|
||||
user8: string;
|
||||
user9: string;
|
||||
revision: number;
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
import { OntimeBlock, OntimeDelay, OntimeEvent } from './OntimeEvent.type';
|
||||
|
||||
export type OntimeRundownEntry = OntimeDelay | OntimeBlock | OntimeEvent;
|
||||
export type OntimeRundown = OntimeRundownEntry[];
|
||||
@@ -0,0 +1,10 @@
|
||||
import { TimeFormat } from './TimeFormat.type';
|
||||
|
||||
export type Settings = {
|
||||
app: 'ontime';
|
||||
version: 2;
|
||||
serverPort: 4001;
|
||||
lock: null | boolean;
|
||||
pinCode: null | number | string;
|
||||
timeFormat: TimeFormat;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export type TimeFormat = '12' | '24';
|
||||
@@ -0,0 +1,13 @@
|
||||
export type UserFields = {
|
||||
user0: string;
|
||||
user1: string;
|
||||
user2: string;
|
||||
user3: string;
|
||||
user4: string;
|
||||
user5: string;
|
||||
user6: string;
|
||||
user7: string;
|
||||
user8: string;
|
||||
user9: string;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export type ViewSettings = {
|
||||
overrideStyles: boolean;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export type Message = {
|
||||
text: string;
|
||||
visible: boolean;
|
||||
};
|
||||
|
||||
export type MessageControl = {
|
||||
presenter: Message;
|
||||
public: Message;
|
||||
lower: Message;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export type Playback = 'roll' | 'play' | 'pause' | 'stop' | 'armed';
|
||||
@@ -1,24 +1,56 @@
|
||||
import TimerTypeType from './definitions/TimerType.type.js';
|
||||
import { Alias } from './definitions/core/Alias.type.js';
|
||||
import { DatabaseModel } from './definitions/DataModel.type.js';
|
||||
import { TimerLifeCycle } from './definitions/core/TimerLifecycle.type.js';
|
||||
import { EventData } from './definitions/core/EventData.type.js';
|
||||
import { Message, MessageControl } from './definitions/runtime/MessageControl.type.js';
|
||||
import {
|
||||
OntimeBaseEvent,
|
||||
OntimeBlock,
|
||||
OntimeDelay,
|
||||
OntimeEvent,
|
||||
SupportedEvent,
|
||||
} from './definitions/core/OntimeEvent.type.js';
|
||||
import { OntimeRundown, OntimeRundownEntry } from './definitions/core/Rundown.type.js';
|
||||
import { OSCSettings, OscSubscription } from './definitions/core/OscSettings.type.js';
|
||||
import { Playback } from './definitions/runtime/Playback.type.js';
|
||||
import { Settings } from './definitions/core/Settings.type.js';
|
||||
import { TimerLifeCycle } from './definitions/core/TimerLifecycle.type.js';
|
||||
import { TimerTypeType } from './definitions/TimerType.type.js';
|
||||
import { UserFields } from './definitions/core/UserFields.type.js';
|
||||
import { ViewSettings } from './definitions/core/Views.type.js';
|
||||
|
||||
// DATA MODEL
|
||||
export type { DatabaseModel };
|
||||
|
||||
// ---> Rundown
|
||||
export type { TimerTypeType };
|
||||
export type { OntimeBaseEvent, OntimeBlock, OntimeDelay, OntimeEvent };
|
||||
export type { OntimeRundown, OntimeRundownEntry };
|
||||
export { SupportedEvent };
|
||||
|
||||
// ---> Event
|
||||
export type { EventData };
|
||||
|
||||
// ---> Settings
|
||||
export type { Settings };
|
||||
|
||||
// ---> Views
|
||||
export type { ViewSettings };
|
||||
|
||||
// ---> Aliases
|
||||
export type { Alias };
|
||||
|
||||
// ---> User Fields
|
||||
export type { UserFields };
|
||||
|
||||
// ---> OSC
|
||||
export type { OscSubscription, OSCSettings };
|
||||
|
||||
// ---> HTTP
|
||||
|
||||
// SERVER
|
||||
export { TimerLifeCycle };
|
||||
export type { Playback };
|
||||
export type { Message };
|
||||
export type { MessageControl };
|
||||
|
||||
// CLIENT
|
||||
|
||||
Reference in New Issue
Block a user