<commit_before>'use strict';

/* Services */

var alertaServices = angular.module('alertaServices', ['config', 'ngResource']);

alertaServices.factory('Count', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/api/alerts/count', {}, {
      'query': {method:'GET'}
    });
  }]);

alertaServices.factory('Alert', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/api/alert/:id', {}, {
      'query':  {method:'GET', url: config.endpoint+'/api/alerts'},
      'save':   {method:'POST'},
      'get':    {method:'GET'},
      'status': {method:'POST', url: config.endpoint+'/api/alert/:id/status'},
      'remove': {method:'DELETE'},
      'delete': {method:'DELETE'},
      'tag':    {method:'POST', url: config.endpoint+'/api/alert/:id/tag'},
      'untag':  {method:'POST', url: config.endpoint+'/api/alert/:id/untag'},
      'top10':  {method:'GET', url: config.endpoint+'/api/alerts/top10'}
    });
  }]);

alertaServices.factory('Environment', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/api/environments?status=open', {}, {
      'all':  {method: 'GET'},
    });
  }]);

alertaServices.factory('Service', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/api/services', {}, {
      'all':  {method: 'GET'},
    });
  }]);

alertaServices.factory('Users', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/api/user', {}, {
      'query':  {method:'GET', url: config.endpoint+'/api/users'},
      'save':   {method:'POST'},
      'delete': {method:'DELETE', url: config.endpoint+'/api/user/:user'}
    });
  }]);

alertaServices.factory('Keys', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/api/key', {}, {
      'query':  {method:'GET', url: config.endpoint+'/api/keys/:user'},
      'save':   {method:'POST'},
      'delete': {method:'DELETE', url: config.endpoint+'/api/key/:key'}
    });
  }]);

alertaServices.factory('Profile', [
  function() {
    var profile = {
      'user': undefined,
      'email': undefined
    };
    return {
      getUser: function() {
        return profile.user;
      },
      getEmail: function() {
        return profile.email;
      },
      setUser: function(user) {
        profile.user = user;
      },
      setEmail: function(email) {
        profile.email = email;
      },
      clear: function() {
        profile.user = undefined;
        profile.email = undefined;
      }
    };
  }]);

alertaServices.factory('Heartbeat', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/api/heartbeats', {}, {
      'query':  {method:'GET'}
    });
  }]);

alertaServices.factory('Management', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/management/manifest', {}, {
      'manifest':    {method:'GET'},
      'healthcheck': {method:'GET', url: config.endpoint+'/management/healthcheck'},
      'status':      {method:'GET', url: config.endpoint+'/management/status'}
    });
  }]);

<commit_msg>update endpoint URL to version 3.2<commit_after>'use strict';

/* Services */

var alertaServices = angular.module('alertaServices', ['config', 'ngResource']);

alertaServices.factory('Count', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/alerts/count', {}, {
      'query': {method:'GET'}
    });
  }]);

alertaServices.factory('Alert', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/alert/:id', {}, {
      'query':  {method:'GET', url: config.endpoint+'/alerts'},
      'save':   {method:'POST'},
      'get':    {method:'GET'},
      'status': {method:'POST', url: config.endpoint+'/alert/:id/status'},
      'remove': {method:'DELETE'},
      'delete': {method:'DELETE'},
      'tag':    {method:'POST', url: config.endpoint+'/alert/:id/tag'},
      'untag':  {method:'POST', url: config.endpoint+'/alert/:id/untag'},
      'top10':  {method:'GET', url: config.endpoint+'/alerts/top10'}
    });
  }]);

alertaServices.factory('Environment', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/environments?status=open', {}, {
      'all':  {method: 'GET'},
    });
  }]);

alertaServices.factory('Service', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/services', {}, {
      'all':  {method: 'GET'},
    });
  }]);

alertaServices.factory('Users', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/user', {}, {
      'query':  {method:'GET', url: config.endpoint+'/users'},
      'save':   {method:'POST'},
      'delete': {method:'DELETE', url: config.endpoint+'/user/:user'}
    });
  }]);

alertaServices.factory('Keys', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/key', {}, {
      'query':  {method:'GET', url: config.endpoint+'/keys/:user'},
      'save':   {method:'POST'},
      'delete': {method:'DELETE', url: config.endpoint+'/key/:key'}
    });
  }]);

alertaServices.factory('Profile', [
  function() {
    var profile = {
      'user': undefined,
      'email': undefined
    };
    return {
      getUser: function() {
        return profile.user;
      },
      getEmail: function() {
        return profile.email;
      },
      setUser: function(user) {
        profile.user = user;
      },
      setEmail: function(email) {
        profile.email = email;
      },
      clear: function() {
        profile.user = undefined;
        profile.email = undefined;
      }
    };
  }]);

alertaServices.factory('Heartbeat', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/heartbeats', {}, {
      'query':  {method:'GET'}
    });
  }]);

alertaServices.factory('Management', ['$resource', 'config',
  function($resource, config) {
    return $resource(config.endpoint+'/management/manifest', {}, {
      'manifest':    {method:'GET'},
      'healthcheck': {method:'GET', url: config.endpoint+'/management/healthcheck'},
      'status':      {method:'GET', url: config.endpoint+'/management/status'}
    });
  }]);


{'fraction_non_alphanumeric': 0.21781401913125295, 'fraction_numerical': 0.0015681354869060686, 'mean_word_length': 3.4384133611691023, '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': '2835572', 'n_tokens_mistral': 1971, 'n_tokens_neox': 1984, 'n_words': 331}