/* eslint-disable import/no-anonymous-default-export */

/* eslint-disable no-param-reassign */
import JSONbig from 'json-bigint';
export default (function (_ref) {
  var organizationId = _ref.organizationId,
      projectId = _ref.projectId;
  return {
    autoCreate: false,
    autoQuery: true,
    paging: false,
    transport: {
      read: {
        url: "/rdupm/v1/nexus-repositorys/".concat(organizationId, "/project/").concat(projectId, "/ci/repo/list?repoType=MAVEN&type=hosted"),
        method: 'get',
        transformResponse: function transformResponse(res) {
          var newRes = res;

          try {
            newRes = JSONbig.parse(res);
            newRes = newRes.map(function (item) {
              item.repositoryId = String(item.repositoryId);
              return item;
            });
            return newRes;
          } catch (e) {
            return newRes;
          }
        }
      }
    }
  };
});