constructor()

in packages/search-ui-engines-connector/src/index.ts [24:40]


  constructor(private config: ConnectionOptions | Transporter) {
    if (isTransporter(config)) {
      this.transporter = config;
    } else {
      if (!config.host) {
        throw new Error("Engine Host must be provided.");
      }
      if (!config.engineName) {
        throw new Error("Engine Name must be provided.");
      }
      if (!config.apiKey) {
        throw new Error("API Key must be provided.");
      }
      const { host, engineName, apiKey } = config;
      this.transporter = new EngineTransporter(host, engineName, apiKey);
    }
  }