Integrations data (#770)

* feat: OSC settings

* feat: HTTP settings
This commit is contained in:
Carlos Valente
2024-02-11 21:25:23 +01:00
committed by GitHub
parent 5355e45b80
commit 53963a9ad7
52 changed files with 742 additions and 1620 deletions
@@ -1,9 +1,8 @@
import { Subscription } from './Subscription.type.js';
import { TimerLifeCycleKey } from './TimerLifecycle.type.js';
export type HttpSubscriptionOptions = { message: string; enabled: boolean };
export type HttpSubscription = Subscription<HttpSubscriptionOptions>;
export type HttpSubscription = { id: string; cycle: TimerLifeCycleKey; message: string; enabled: boolean };
export interface HttpSettings {
enabledOut: boolean;
subscriptions: HttpSubscription;
subscriptions: HttpSubscription[];
}
@@ -1,7 +1,6 @@
import { Subscription } from './Subscription.type.js';
import { TimerLifeCycleKey } from './TimerLifecycle.type.js';
export type OscSubscriptionOptions = { message: string; enabled: boolean };
export type OscSubscription = Subscription<OscSubscriptionOptions>;
export type OscSubscription = { id: string; cycle: TimerLifeCycleKey; message: string; enabled: boolean };
export interface OSCSettings {
portIn: number;
@@ -9,5 +8,5 @@ export interface OSCSettings {
targetIP: string;
enabledIn: boolean;
enabledOut: boolean;
subscriptions: OscSubscription;
subscriptions: OscSubscription[];
}
@@ -1,3 +0,0 @@
import { TimerLifeCycleKey } from './TimerLifecycle.type.js';
export type Subscription<T> = { [key in TimerLifeCycleKey]: T[] };
+3 -8
View File
@@ -31,13 +31,8 @@ export type { Alias } from './definitions/core/Alias.type.js';
export type { UserFields } from './definitions/core/UserFields.type.js';
// ---> Integration, Subscription
export type { Subscription } from './definitions/core/Subscription.type.js';
// ---> OSC
export type { OSCSettings, OscSubscription, OscSubscriptionOptions } from './definitions/core/OscSettings.type.js';
// ---> HTTP
export type { HttpSettings, HttpSubscription, HttpSubscriptionOptions } from './definitions/core/HttpSettings.type.js';
export type { OSCSettings, OscSubscription } from './definitions/core/OscSettings.type.js';
export type { HttpSettings, HttpSubscription } from './definitions/core/HttpSettings.type.js';
// SERVER RESPONSES
export type {
@@ -67,5 +62,5 @@ export { type SimpleTimerState, SimplePlayback, SimpleDirection } from './defini
// CLIENT
// TYPE UTILITIES
export { isOntimeBlock, isOntimeDelay, isOntimeEvent, isKeyOfType } from './utils/guards.js';
export { isOntimeBlock, isOntimeDelay, isOntimeEvent, isOntimeCycle, isKeyOfType } from './utils/guards.js';
export type { DeepPartial, MaybeNumber, MaybeString } from './utils/utils.type.js';
+6
View File
@@ -1,5 +1,6 @@
import { OntimeRundownEntry } from '../definitions/core/Rundown.type.js';
import { OntimeBlock, OntimeDelay, OntimeEvent, SupportedEvent } from '../definitions/core/OntimeEvent.type.js';
import { TimerLifeCycle, TimerLifeCycleKey } from '../definitions/core/TimerLifecycle.type.js';
type MaybeEvent = OntimeRundownEntry | Partial<OntimeRundownEntry> | null | undefined;
@@ -20,3 +21,8 @@ type AnyKeys<T> = keyof T;
export function isKeyOfType<T extends object>(key: PropertyKey, obj: T): key is AnyKeys<T> {
return key in obj;
}
export function isOntimeCycle(maybeCycle: unknown): maybeCycle is TimerLifeCycleKey {
if (typeof maybeCycle !== 'string') return false;
return Object.values(TimerLifeCycle).includes(maybeCycle as TimerLifeCycle);
}