File tree Expand file tree Collapse file tree 7 files changed +23
-14
lines changed
server-core-integration/src Expand file tree Collapse file tree 7 files changed +23
-14
lines changed Original file line number Diff line number Diff line change 88 stringifyError ,
99 HealthConfig ,
1010 HealthEndpoints ,
11+ IConnector ,
1112} from '@sofie-automation/server-core-integration'
1213
1314export interface Config {
@@ -21,7 +22,7 @@ export interface DeviceConfig {
2122 deviceId : PeripheralDeviceId
2223 deviceToken : string
2324}
24- export class Connector {
25+ export class Connector implements IConnector {
2526 public initialized = false
2627 public initializedError : string | undefined = undefined
2728
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010 stringifyError ,
1111 PeripheralDevicePubSub ,
1212 PeripheralDevicePubSubCollectionsNames ,
13+ ICoreHandler ,
1314} from '@sofie-automation/server-core-integration'
1415import * as Winston from 'winston'
1516
@@ -29,7 +30,7 @@ export interface CoreConfig {
2930/**
3031 * Represents a connection between mos-integration and Core
3132 */
32- export class CoreHandler {
33+ export class CoreHandler implements ICoreHandler {
3334 core : CoreConnection | undefined
3435 logger : Winston . Logger
3536 public _observers : Array < Observer < any > > = [ ]
Original file line number Diff line number Diff line change 99 stringifyError ,
1010 HealthConfig ,
1111 HealthEndpoints ,
12+ IConnector ,
1213} from '@sofie-automation/server-core-integration'
1314
1415export interface Config {
@@ -24,7 +25,7 @@ export interface DeviceConfig {
2425 deviceId : PeripheralDeviceId
2526 deviceToken : string
2627}
27- export class Connector {
28+ export class Connector implements IConnector {
2829 public initialized = false
2930 public initializedError : string | undefined = undefined
3031
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111 stringifyError ,
1212 PeripheralDevicePubSub ,
1313 PeripheralDevicePubSubCollectionsNames ,
14+ ICoreHandler ,
1415} from '@sofie-automation/server-core-integration'
1516import { MediaObject , DeviceOptionsAny , ActionExecutionResult } from 'timeline-state-resolver'
1617import _ from 'underscore'
@@ -40,7 +41,7 @@ export interface MemoryUsageReport {
4041/**
4142 * Represents a connection between the Gateway and Core
4243 */
43- export class CoreHandler {
44+ export class CoreHandler implements ICoreHandler {
4445 core ! : CoreConnection
4546 logger : Logger
4647 public _observers : Array < Observer < any > > = [ ]
Original file line number Diff line number Diff line change 11export * from './lib/coreConnection.js'
22export * from './lib/configManifest.js'
33export * from './lib/ddpClient.js'
4+ export * from './lib/gateway-types.js'
45export * from './lib/health.js'
56export * from './lib/methods.js'
67export * from './lib/process.js'
Original file line number Diff line number Diff line change 1+ import { StatusCode } from '@sofie-automation/shared-lib/dist/lib/status'
2+
3+ export interface IConnector {
4+ initialized : boolean
5+ initializedError : string | undefined
6+ }
7+
8+ export interface ICoreHandler {
9+ getCoreStatus : ( ) => { statusCode : StatusCode ; messages : string [ ] }
10+ connectedToCore : boolean
11+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import Koa from 'koa'
22import Router from '@koa/router'
33import { StatusCode } from '@sofie-automation/shared-lib/dist/lib/status'
44import { assertNever } from '@sofie-automation/shared-lib/dist/lib/lib'
5+ import { IConnector , ICoreHandler } from './gateway-types.js'
56
67export interface HealthConfig {
78 /** If set, exposes health HTTP endpoints on the given port */
@@ -15,16 +16,8 @@ export interface HealthConfig {
1516export class HealthEndpoints {
1617 private app = new Koa ( )
1718 constructor (
18- private connector : {
19- // Connector analog
20- initialized : boolean
21- initializedError : string | undefined
22- } ,
23- private coreHandler : {
24- // CoreHandler analog
25- getCoreStatus : ( ) => { statusCode : StatusCode ; messages : string [ ] }
26- connectedToCore : boolean
27- } ,
19+ private connector : IConnector ,
20+ private coreHandler : ICoreHandler ,
2821 private config : HealthConfig
2922 ) {
3023 if ( ! config . port ) return // disabled
You can’t perform that action at this time.
0 commit comments