Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Commit

Permalink
feat: add device config manifest (#24)
Browse files Browse the repository at this point in the history
* feat: add device config manifest

* chore: update deps

Co-authored-by: Jan Starzak <jan.starzak@gmail.com>
  • Loading branch information
mint-dewit and jstarpl committed Jan 8, 2020
1 parent 41d95d0 commit 84a1e97
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 33 deletions.
29 changes: 15 additions & 14 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
module.exports = {
globals: {
'ts-jest': {
tsConfigFile: 'tsconfig.jest.json'
}
tsConfig: 'tsconfig.jest.json',
},
},
moduleFileExtensions: [
'js',
'ts',
'js'
],
transform: {
'^.+\\.(ts|tsx)$': './node_modules/ts-jest/preprocessor.js'
'^.+\\.(ts|tsx)$': 'ts-jest',
},
testMatch: [
'**/__tests__/**/*.spec.(ts|js)'
'**/__tests__/**/*.spec.(ts|js)',
],
testPathIgnorePatterns: [
'integrationTests'
],
'integrationTests',
],
testEnvironment: 'node',
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100
}
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
coverageDirectory: "./coverage/",
collectCoverage: false
coverageDirectory: './coverage/',
collectCoverage: false,
preset: 'ts-jest',
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,13 @@
"production"
],
"dependencies": {
"mos-connection": "^0.8.5",
"mos-connection": "^0.8.6",
"tslib": "^1.10.0",
"tv-automation-server-core-integration": "1.2.0",
"tv-automation-server-core-integration": "1.3.0",
"underscore": "^1.9.1",
"winston": "^2.4.2"
},
"resolutions": {
"**/**/handlebars": "^4.5.3"
}
}
56 changes: 56 additions & 0 deletions src/configManifest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* This file contains the manifest for the config as displayed in the server-core
* UI.
*/
import { DeviceConfigManifest,ConfigManifestEntryType } from 'tv-automation-server-core-integration'

export const MOS_DEVICE_CONFIG_MANIFEST: DeviceConfigManifest = {
deviceConfig: [
{
id: 'mosId',
name: 'MOS ID of Gateway (Sofie MOS ID)',
type: ConfigManifestEntryType.STRING

},
{
id: 'debugLogging',
name: 'Activate Debug Logging',
type: ConfigManifestEntryType.BOOLEAN
},
{
id: 'devices',
name: 'Attached SubDevices',
type: ConfigManifestEntryType.TABLE,
isSubDevices: true,
defaultType: 'default',
config: {
'default': [
{
id: 'primary.id',
name: 'Primary ID (Newsroom System MOS ID)',
columnName: 'Primary ID',
type: ConfigManifestEntryType.STRING
},
{
id: 'primary.host',
name: 'Primary Host (IP or Hostname)',
columnName: 'Primary Host',
type: ConfigManifestEntryType.STRING
},
{
id: 'secondary.id',
name: 'Secondary ID (Newsroom System MOS ID)',
columnName: 'Secondary ID',
type: ConfigManifestEntryType.STRING
},
{
id: 'secondary.host',
name: 'Secondary Host (IP or Hostname)',
columnName: 'Secondary Host',
type: ConfigManifestEntryType.STRING
}
]
}
}
]
}
7 changes: 5 additions & 2 deletions src/coreHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
import * as _ from 'underscore'
import { MosHandler } from './mosHandler'
import { DeviceConfig } from './connector'
import { MOS_DEVICE_CONFIG_MANIFEST } from './configManifest'
// import { STATUS_CODES } from 'http'
export interface PeripheralDeviceCommand {
_id: string
Expand Down Expand Up @@ -489,11 +490,13 @@ export class CoreHandler {
...credentials,

deviceCategory: P.DeviceCategory.INGEST,
deviceType: P.DeviceType.MOS,
deviceType: P.DeviceType.MOS, // @todo: should not have this...
deviceSubType: (parentProcess ? P.SUBTYPE_PROCESS : 'mos_connection'),

deviceName: name,
watchDog: (this._coreConfig ? this._coreConfig.watchdog : true)
watchDog: (this._coreConfig ? this._coreConfig.watchdog : true),

configManifest: MOS_DEVICE_CONFIG_MANIFEST
}
if (parentProcess) options.versions = this._getVersions()
return options
Expand Down
28 changes: 13 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2277,10 +2277,10 @@ growly@^1.3.0:
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=

handlebars@^4.1.2, handlebars@^4.4.0:
version "4.4.5"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.4.5.tgz#1b1f94f9bfe7379adda86a8b73fb570265a0dddd"
integrity sha512-0Ce31oWVB7YidkaTq33ZxEbN+UDxMMgThvCe8ptgQViymL5DPis9uLdTA13MiRPhgvqyxIegugrP97iK3JeBHg==
handlebars@^4.1.2, handlebars@^4.4.0, handlebars@^4.5.3:
version "4.5.3"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.5.3.tgz#5cf75bd8714f7605713511a56be7c349becb0482"
integrity sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==
dependencies:
neo-async "^2.6.0"
optimist "^0.6.1"
Expand Down Expand Up @@ -3721,12 +3721,11 @@ moment@^2.24.0:
resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==

mos-connection@^0.8.5:
version "0.8.5"
resolved "https://registry.yarnpkg.com/mos-connection/-/mos-connection-0.8.5.tgz#7d86f5adad570bb420ce4a7920df6dc6b4660d96"
integrity sha512-P5Iy4HFJM6qvU0RSz1kpI50KNQJ1wDvVoeYWJ0bnbRTg/oq5M9dIWFo7hcCdD1Gehe2BssRISQbwoc52vOIOUA==
mos-connection@^0.8.6:
version "0.8.6"
resolved "https://registry.yarnpkg.com/mos-connection/-/mos-connection-0.8.6.tgz#6e0eb94b62994a436b8ac91d499dd638598588f2"
integrity sha512-W6E8wdfxYx61+rwwzdxySRbPFHYFoGcNXu8PhZRpG6ve1sAgpakQD1OD4Jp7DW2tMpbyzXYmOBFFlWPEMaaPyA==
dependencies:
"@types/xmlbuilder" "^0.0.34"
iconv-lite "^0.5.0"
moment "^2.24.0"
tslib "^1.9.3"
Expand Down Expand Up @@ -4643,7 +4642,7 @@ request@2.87.0:
tunnel-agent "^0.6.0"
uuid "^3.1.0"

request@^2.87.0, request@^2.88.0:
request@^2.87.0:
version "2.88.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==
Expand Down Expand Up @@ -5514,16 +5513,15 @@ tunnel-agent@^0.6.0:
dependencies:
safe-buffer "^5.0.1"

tv-automation-server-core-integration@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/tv-automation-server-core-integration/-/tv-automation-server-core-integration-1.2.0.tgz#05a5ecfb82d61a86f9a2b76f0d4433ffb24f8e63"
integrity sha512-p4k4xFjhbf4JwjvDVB/hyFgSwCT+ldHGvZlbuajLI9IJDnEX/BOS/ZzFYLRgcRPmmyPAyk7sE8ifEaAf2jq0Iw==
tv-automation-server-core-integration@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/tv-automation-server-core-integration/-/tv-automation-server-core-integration-1.3.0.tgz#6f5f212070abac1cf6cbb5190eadbcac2ff0e98e"
integrity sha512-mgHfTA3UZrsYu1/sTPonhqZ7E1X2j2O78/8lIoF5DHjvgn85v27Gfk3BZnDeMBP1GZEV37jOCXmT1v4Ron08jA==
dependencies:
data-store "3.1.0"
ddp "git+http://github.com/nytamin/node-ddp-client.git#v0.12.2-next2"
ddp-ejson "~0.8.1-3"
ddp-random "~0.8.1-1"
request "^2.88.0"
tslib "^1.9.3"
underscore "^1.9.1"

Expand Down

0 comments on commit 84a1e97

Please sign in to comment.