"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _util = require("../../lib/util");

var _gitlab = require("../gitlab");

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

class API extends _gitlab.API {
  constructor(config) {
    super(config);

    _defineProperty(this, "tokenPromise", void 0);

    _defineProperty(this, "withAuthorizationHeaders", async req => {
      const token = await this.tokenPromise();
      return _util.unsentRequest.withHeaders({
        Authorization: `Bearer ${token}`
      }, req);
    });

    _defineProperty(this, "hasWriteAccess", () => Promise.resolve(true));

    this.tokenPromise = config.tokenPromise;
    this.commitAuthor = config.commitAuthor;
    this.repoURL = '';
  }

}

exports.default = API;