UNPKG

@schibstedspain/openads-appnexus-prebid

Version:
84 lines (61 loc) 1.89 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; /** * @class * @implements {PrebidClient} */ var PrebidClientImpl = /*#__PURE__*/ function () { function PrebidClientImpl(_ref) { var window = _ref.window, logger = _ref.logger; this._window = window; this._window.pbjs = this._window.pbjs || {}; this._window.pbjs.que = this._window.pbjs.que || []; this._pbjs = this._window.pbjs; this._logger = logger; } var _proto = PrebidClientImpl.prototype; _proto.addAdUnits = function addAdUnits(_ref2) { var _this = this; var adUnits = _ref2.adUnits; this._logger.debug(this._logger.name, '| addAdUnits | adUnits:', adUnits); this._pbjs.que.push(function () { return _this._pbjs.addAdUnits(adUnits); }); return this; }; _proto.requestBids = function requestBids(requestObj) { var _this2 = this; this._logger.debug(this._logger.name, '| requestBids | requestObj:', requestObj); this._pbjs.que.push(function () { return _this2._pbjs.requestBids(requestObj); }); return this; }; _proto.setTargetingForAst = function setTargetingForAst() { var _this3 = this; this._logger.debug(this._logger.name, '| setTargetingForAst has been called.'); this._pbjs.que.push(function () { return _this3._pbjs.setTargetingForAst(); }); return this; }; _proto.setConfig = function setConfig(_temp) { var _this4 = this; var _ref3 = _temp === void 0 ? {} : _temp, _ref3$config = _ref3.config, config = _ref3$config === void 0 ? {} : _ref3$config; this._pbjs.que.push(function () { _this4._pbjs.setConfig(config.core); _this4._pbjs.bidderSettings = config.bidderSettings; }); return this; }; return PrebidClientImpl; }(); exports.default = PrebidClientImpl;