Sofie Quantel Gateway Client
This is a client library specifically designed for communication with the Sofie Quantel Gateway, an integral component of the open-source Sofie TV Automation System. It acts as an abstraction layer, allowing Node.js applications to interact with Quantel ISA (Integrated Production Archive) systems. The library facilitates discovery of clips, management of playout control on Quantel servers, and handles the underlying HTTP REST API communication with the Quantel Gateway, which itself bridges to the complex Quantel ISA System's CORBA API. Currently at version 4.0.0, the package primarily supports modern Node.js environments (>=18.0) and ships with TypeScript type definitions, providing a robust and type-safe interface for broadcast automation workflows. It focuses on simplifying interaction with professional broadcast hardware within the Sofie ecosystem, abstracting away low-level network and protocol complexities.
Common errors
-
ERR_REQUIRE_ESM: require() of ES Module ... not supported. Instead change the require of index.js to a dynamic import()
cause Attempting to import an ES Module using CommonJS `require()` syntax.fixChange `const { Symbol } = require('pkg');` to `import { Symbol } from 'pkg';` or use a dynamic import `const { Symbol } = await import('pkg');` within an `async` function. -
TypeError: QuantelGateway is not a constructor
cause Often occurs when trying to use a named export as a default export, or when `require()` is used on a package primarily structured for ESM.fixEnsure you are using named imports: `import { QuantelGateway } from 'tv-automation-quantel-gateway-client';` instead of `import QuantelGateway from 'tv-automation-quantel-gateway-client';`. -
QuantelGateway.init failed: Connection refused
cause The client tried to establish a TCP connection to the Quantel Gateway, but the target machine actively refused it (e.g., no server running on that port, or firewall blocking).fixVerify that the Quantel Gateway application is running and listening on the specified host and port (`QUANTEL_GATEWAY_URL`). Check local and remote firewalls. Ensure the URL is correct. -
Error: Timeout: Could not connect to ISA: [URL]
cause The client could not establish a connection to the Quantel ISA Manager within the expected timeframe, possibly due to network latency, incorrect URL, or the ISA Manager being offline.fixConfirm the `QUANTEL_ISA_URL` is correct and that the Quantel ISA system is operational and reachable from the machine hosting the Quantel Gateway.
Warnings
- breaking Version 4.0.0 requires Node.js version 18.0 or higher. Earlier Node.js versions are not supported and will lead to runtime errors, particularly with ESM imports or native module bindings.
- gotcha The client connects to a 'Quantel Gateway' application, which in turn communicates with the 'Quantel ISA SQ system'. Both the gateway and the ISA system must be installed, running, and accessible from the client's network environment.
- gotcha The `init` method requires a `serverID`. If the `serverID` is not known beforehand, you must first connect to the ISA using `connectToISA()` and then fetch available servers with `getServers(zoneId)` to determine valid IDs.
- gotcha This library expects specific URLs for the Quantel Gateway and the ISA Manager. Incorrect URLs, port numbers, or network misconfigurations are common sources of connection failures.
Install
-
npm install tv-automation-quantel-gateway-client -
yarn add tv-automation-quantel-gateway-client -
pnpm add tv-automation-quantel-gateway-client
Imports
- QuantelGateway
const QuantelGateway = require('tv-automation-quantel-gateway-client')import { QuantelGateway } from 'tv-automation-quantel-gateway-client' - Q
import { Q } from 'tv-automation-quantel-gateway-client' - QuantelGatewayConfig
import type { QuantelGatewayConfig } from 'tv-automation-quantel-gateway-client'
Quickstart
import { QuantelGateway } from 'tv-automation-quantel-gateway-client';
async function runQuantelClient() {
const quantelClient = new QuantelGateway();
const gatewayUrl = process.env.QUANTEL_GATEWAY_URL ?? 'http://localhost:3000';
const isaUrl = process.env.QUANTEL_ISA_URL ?? 'http://quantel.isa.manager:2099';
const zoneId = process.env.QUANTEL_ZONE_ID ?? 'default';
const serverId = process.env.QUANTEL_SERVER_ID ?? '1100'; // Example server ID
try {
console.log(`Attempting to connect to Gateway: ${gatewayUrl}, ISA: ${isaUrl}`);
await quantelClient.init(gatewayUrl, isaUrl, zoneId, serverId);
console.log('Successfully connected to Quantel Gateway.');
// Example: Fetching server information if serverId is not initially known
// await quantelClient.connectToISA(isaUrl);
// const servers = await quantelClient.getServers(zoneId);
// console.log('Available Servers:', servers.map(s => s.id));
// Here you would add your logic to interact with Quantel, e.g., get clips, control playout
console.log('Client is ready for Quantel operations.');
} catch (error) {
console.error('Failed to initialize Quantel Gateway client:', error);
process.exit(1);
} finally {
// Always call dispose to clean up resources
quantelClient.dispose();
console.log('Quantel Gateway client disposed.');
}
}
runQuantelClient();