"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.authenticateRequest = authenticateRequest;
/**
 * return a token created using options.authentication or set on options.token
 *
 * @export
 * @param {IEventsRequestOptions} options
 * @return {*}  {Promise<string>}
 */
function authenticateRequest(options) {
    const { token, authentication } = options;
    if (authentication) {
        return authentication.getToken(authentication.portal);
    }
    return Promise.resolve(token);
}
//# sourceMappingURL=authenticate-request.js.map