import _regeneratorRuntime from '@babel/runtime/regenerator';
import { _ as __awaiter } from '../tslib.es6-848120af.js';
import axios from 'axios';

function refreshTencentDocToken(_ref) {
  var clientId = _ref.clientId,
    clientSecret = _ref.clientSecret,
    refreshToken = _ref.refreshToken;
  return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
    var result;
    return _regeneratorRuntime.wrap(function (_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          _context.next = 1;
          return axios({
            method: 'GET',
            url: 'https://docs.qq.com/oauth/v2/token',
            params: {
              client_id: clientId,
              client_secret: clientSecret,
              grant_type: 'refresh_token',
              refresh_token: refreshToken
            }
          });
        case 1:
          result = _context.sent;
          return _context.abrupt("return", result.data);
        case 2:
        case "end":
          return _context.stop();
      }
    }, _callee);
  }));
}

export { refreshTencentDocToken };
