<commit_before>'use strict';

var credentials = exports;
credentials.isNewAPI = true;

var utils = require('common/utils');

credentials.get = function (client, query) {
  return client.get({
    url: '/credentials',
    qs: query || {}
  }, credentials.isNewAPI).then(function (res) {
    return res.body;
  });
};

credentials.create = function (client, data) {
  return client.post({
    url: '/credentials',
    json: {
      id: utils.id('credential'),
      version: 1,
      body: {
        name: data.name,
        project_id: data.project_id,
        org_id: data.org_id,
        pathexp: data.pathexp,
        version: data.version,
        previous: data.previous,
        value: data.value
      }
    }
  }, credentials.isNewAPI).then(function (res) {
    return res.body;
  });
};
<commit_msg>Fix bug preventing a credential from being set<commit_after>'use strict';

var credentials = exports;
credentials.isNewAPI = true;

credentials.get = function (client, query) {
  return client.get({
    url: '/credentials',
    qs: query || {}
  }, credentials.isNewAPI).then(function (res) {
    return res.body;
  });
};

credentials.create = function (client, data) {
  return client.post({
    url: '/credentials',
    json: {
      version: 1,
      body: {
        name: data.name,
        project_id: data.project_id,
        org_id: data.org_id,
        pathexp: data.pathexp,
        version: data.version,
        previous: data.previous,
        value: data.value
      }
    }
  }, credentials.isNewAPI).then(function (res) {
    return res.body;
  });
};

{'fraction_non_alphanumeric': 0.14095238095238094, 'fraction_numerical': 0.0012698412698412698, 'mean_word_length': 2.58997722095672, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3189292', 'n_tokens_mistral': 513, 'n_tokens_neox': 510, 'n_words': 114}