1.50.1 • Published 16 days ago

@sofie-automation/server-core-integration v1.50.1

Weekly downloads
282
License
MIT
Repository
github
Last release
16 days ago

Sofie: The Modern TV News Studio Automation System (Server Core Integration)

CircleCI codecov

This library is used to connect to the Sofie Server Core from other Node processes.

This is a part of the Sofie TV News Studio Automation System.

Getting started

Typescript

import { CoreConnection, PeripheralDeviceAPI } from '@sofie-automation/server-core-integration'

// Set up our basic credentials:
let core = new CoreConnection({
	deviceId: 'device01', 			// Unique id
	deviceToken: 'mySecretToken',	// secret token, used to authenticate this device
	deviceType: PeripheralDeviceAPI.DeviceType.PLAYOUT,
	deviceName: 'My peripheral device'
})
core.on('error', console.log)
// Initiate connection to Core:
core.init({
	host: '127.0.0.1',
	port: 3000
}).then(() => {
	// Connection has been established
	console.log('Connected!')
	// Set device status:
	return core.setStatus({
		statusCode: PeripheralDeviceAPI.StatusCode.GOOD,
		messages: ['Everything is awesome!']
	})
})
.catch((err) => {
	console.log(err)
})

Development

  • Installation
    • Install Yarn from https://yarnpkg.com
    • Install Jest, yarn global add jest
    • Install npm dependencies, yarn
  • Build
    • Build, yarn build
    • Run tests, yarn test
    • Run tests & watch, yarn watch

DDP Client

This library has a self-contained DDP client that can be used independently of the rest of the module.

import { DDPClient, DDPConnectorOptions } from 'tv-automation-server-integration'

let options: DDPConnectorOptions = {
	host: '127.0.0.1',
	port: 5432
}

let ddp = new DDPClient(options)
ddp.on('connected', /* ... */ )
ddp.connect((err: any) => {
	if (err) {
		/* ... handle error ... */
		return
	} 
	let subId = ddp.subscribe('expectedMediaItems')
	ddp.observe('expectedMediaItems', /* added cb */, /* changed cb */, /* removed cb */)
	
	/* ... then later ... */
	ddp.unsub(subId)
	ddp.close()
})

See the documentation on the DDP client class for more details.

1.49.6

16 days ago

1.49.5-1

2 months ago

1.49.5

1 month ago

1.50.1

2 months ago

1.49.5-0

2 months ago

1.50.1-0

2 months ago

1.50.0

2 months ago

1.49.4

4 months ago

1.49.3

4 months ago

1.47.6-0

8 months ago

1.50.0-in-testing.2

10 months ago

1.50.0-in-testing.1

10 months ago

1.47.6

8 months ago

1.49.0-in-testing.4

10 months ago

1.49.1

7 months ago

1.49.0

7 months ago

1.49.2

5 months ago

1.47.5

10 months ago

1.47.5-0

10 months ago

1.47.1

12 months ago

1.47.3

11 months ago

1.47.4

11 months ago

1.47.1-1

1 year ago

1.47.1-0

1 year ago

1.47.0

1 year ago

1.44.2

1 year ago

1.44.2-1

1 year ago

1.44.2-0

1 year ago

1.44.0

2 years ago

1.44.1

1 year ago

1.41.5

2 years ago

1.41.7

2 years ago

1.41.6

2 years ago

1.41.4

2 years ago

1.41.4-0

2 years ago

1.41.0

2 years ago

1.41.3

2 years ago

1.39.0

2 years ago

1.37.2

2 years ago

1.38.0

2 years ago

1.38.1

2 years ago

1.37.2-1

2 years ago

1.37.0

2 years ago

1.35.1-8

3 years ago

1.35.1-7

3 years ago

1.35.1-6

3 years ago

1.35.1-3

3 years ago

1.35.1-2

3 years ago

1.34.1-0

3 years ago

1.35.1-1

3 years ago

1.35.1-0

3 years ago

1.35.0

3 years ago

1.34.0

3 years ago

1.33.0

3 years ago

1.32.3

3 years ago

1.32.3-0

3 years ago

1.32.2

3 years ago

1.32.1

3 years ago

1.32.0

3 years ago

1.19.0

3 years ago

1.19.1

3 years ago

1.18.1

3 years ago

1.18.0

3 years ago

1.17.1

3 years ago

1.17.0

3 years ago

1.16.2

3 years ago

1.16.1

3 years ago

1.16.0

3 years ago