Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
migrate: () => {
let device = PeripheralDevices.findOne({type: PeripheralDeviceAPI.DeviceType.PLAYOUT})
if (device) {
// Set some default values:
let abstract0 = device.settings && device.settings.devices['abstract0']
if (!abstract0) {
logger.info(`Migration: Add PeripheralDevice.settings to ${device._id}: abstract0`)
PeripheralDevices.update(device._id, {$set: {
'settings.devices.abstract0': {
type: PlayoutDeviceType.ABSTRACT,
options: {}
}
}})
}
}
},
input: [{
validate: () => {
let device = PeripheralDevices.findOne({type: PeripheralDeviceAPI.DeviceType.PLAYOUT})
if (!device) return 'Playout-gateway not found'
let settings = device.settings || {devices: {}} as PlayoutDeviceSettings
let abstract0 = settings.devices['abstract0'] as PlayoutDeviceSettingsDevice
if (!abstract0) return '"abstract0" missing'
if (abstract0.type !== PlayoutDeviceType.ABSTRACT) return 'Type is not "ABSTRACT"'
return false
},
migrate: () => {
options: {
host: '160.67.87.51',
port: 9910
}
},
'settings.devices.lawo0': ((pd['settings'] || {})['devices'] || {})['lawo0'] || {
type: PlayoutDeviceType.LAWO,
options: {
host: '160.67.96.51',
port: 9000,
sourcesPath: 'Sapphire.Sources',
rampMotorFunctionPath: '1.5.2'
}
},
'settings.devices.abstract0': ((pd['settings'] || {})['devices'] || {})['abstract0'] || {
type: PlayoutDeviceType.ABSTRACT,
options: {
}
},
'settings.devices.http0': ((pd['settings'] || {})['devices'] || {})['http0'] || {
type: PlayoutDeviceType.HTTPSEND,
options: {
}
},
'settings.devices.hyperdeck0': ((pd['settings'] || {})['devices'] || {})['hyperdeck0'] || {
type: PlayoutDeviceType.HYPERDECK,
options: {
host: '160.67.87.53',
port: 9993
}
},
}})