1.51.7 • Published 13 days ago

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

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

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

npm

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.

Note: This library does not follow semver. It is recommended to add it in your package json like "@sofie-automation/server-core-integration": "~1.16.0" matching the version of sofie core you are running

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

This library is developed as part of Sofie Server Core. See there for more instructions

  • 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 '@sofie-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.51.6

5 months ago

1.51.5

5 months ago

1.51.7

1 month ago

1.51.2

7 months ago

1.51.1

7 months ago

1.51.3

7 months ago

1.51.1-2

8 months ago

1.51.1-0

8 months ago

1.51.1-1

8 months ago

1.51.0

8 months ago

1.51.0-in-testing.1

10 months ago

1.51.0-in-testing.0

10 months ago

1.50.3

12 months ago

1.50.5

10 months ago

1.50.4

11 months ago

1.50.2

1 year ago

1.49.6

1 year ago

1.49.5-1

1 year ago

1.49.5

1 year ago

1.50.1

1 year ago

1.49.5-0

1 year ago

1.50.1-0

1 year ago

1.50.0

1 year ago

1.49.4

1 year ago

1.49.3

1 year ago

1.47.6-0

2 years ago

1.47.6

2 years ago

1.49.1

2 years ago

1.49.0

2 years ago

1.49.2

2 years ago

1.47.5

2 years ago

1.47.5-0

2 years ago

1.47.1

2 years ago

1.47.3

2 years ago

1.47.4

2 years ago

1.47.1-1

2 years ago

1.47.1-0

2 years ago

1.47.0

2 years ago

1.44.2

2 years ago

1.44.2-1

2 years ago

1.44.2-0

2 years ago

1.44.0

3 years ago

1.44.1

3 years ago

1.41.5

3 years ago

1.41.7

3 years ago

1.41.6

3 years ago

1.41.4

3 years ago

1.41.4-0

3 years ago

1.41.0

3 years ago

1.41.3

3 years ago

1.39.0

3 years ago

1.37.2

3 years ago

1.38.0

3 years ago

1.38.1

3 years ago

1.37.2-1

3 years ago

1.37.0

4 years ago

1.35.1-8

4 years ago

1.35.1-7

4 years ago

1.35.1-6

4 years ago

1.35.1-3

4 years ago

1.35.1-2

4 years ago

1.34.1-0

4 years ago

1.35.1-1

4 years ago

1.35.1-0

4 years ago

1.35.0

4 years ago

1.34.0

4 years ago

1.33.0

4 years ago

1.32.3

4 years ago

1.32.3-0

4 years ago

1.32.2

4 years ago

1.32.1

4 years ago

1.32.0

4 years ago

1.19.0

4 years ago

1.19.1

4 years ago

1.18.1

4 years ago

1.18.0

4 years ago

1.17.1

4 years ago

1.17.0

4 years ago

1.16.2

4 years ago

1.16.1

4 years ago

1.16.0

4 years ago