"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const fs_1 = __importDefault(require("fs")); const isomorphic_fetch_1 = __importDefault(require("isomorphic-fetch")); const util_1 = require("util"); const path_1 = __importDefault(require("path")); const env_1 = require("./env"); const reporter_object_factory_1 = __importDefault(require("./reporter-object-factory")); const logger_1 = __importDefault(require("./logger")); module.exports = function pluginFactory() { const settings = { authenticationToken: env_1.TESTCAFE_DASHBOARD_AUTHENTICATION_TOKEN, buildId: env_1.TESTCAFE_DASHBOARD_BUILD_ID, dashboardUrl: env_1.TESTCAFE_DASHBOARD_URL, isLogEnabled: env_1.ENABLE_LOG, noScreenshotUpload: env_1.NO_SCREENSHOT_UPLOAD, noVideoUpload: env_1.NO_VIDEO_UPLOAD, responseTimeout: env_1.RESPONSE_TIMEOUT, requestRetryCount: env_1.REQUEST_RETRY_COUNT, ciInfo: env_1.CI_INFO }; const rootPackageName = require(path_1.default.resolve('package')).name; const tcVersion = require(rootPackageName === 'testcafe' ? path_1.default.resolve('package') : 'testcafe/package').version; return reporter_object_factory_1.default(util_1.promisify(fs_1.default.readFile), isomorphic_fetch_1.default, settings, logger_1.default, tcVersion); };