<commit_before>var api = require('./api');

var Projects = {

		/**
		 * Retrieves all projects
		 * 
		 * @param		object		project_query		[Description]
		 * @param		function		callback		[Description]
		 *
		 * @return		void
		 */
		__get_projects: function (project_query, callback) {
			api.handleRestRequest('get', '/projects', project_query, callback);
		},


		/**
		 * Retrieves one project
		 * 
		 * @param		integer		project_id		[Description]
		 * @param		object		project_query		[Description]
		 * @param		function		callback		[Description]
		 *
		 * @return		void
		 */
		__get_projects: function (project_id, project_query, callback) {
			api.handleRestRequest('get', '/projects/' + project_id + '', project_query, callback);
		},


		/**
		 * Retrieves a list of attachments of a project
		 * 
		 * @param		integer		project_id		[Description]
		 * @param		function		callback		[Description]
		 *
		 * @return		void
		 */
		__get_projects/attachments: function (project_id, callback) {
			api.handleRestRequest('get', '/projects/' + project_id + '/attachments', null, callback);
		},


		/**
		 * Retrieves a list of workflows associated with a project
		 * 
		 * @param		integer		project_id		[Description]
		 * @param		object		project_query		[Description]
		 * @param		function		callback		[Description]
		 *
		 * @return		void
		 */
		__get_projects/workflow: function (project_id, project_query, callback) {
			api.handleRestRequest('get', '/projects/' + project_id + '/workflow', project_query, callback);
		},


		/**
		 * Adds a project
		 * 
		 * @param		object		project_data		[Description]
		 * @param		function		callback		[Description]
		 *
		 * @return		void
		 */
		__post_projects: function (project_data, callback) {
			api.handleRestRequest('postJson', '/projects', project_data, callback);
		},


		/**
		 * Updates a project
		 * 
		 * @param		integer		project_id		[Description]
		 * @param		object		project_data		[Description]
		 * @param		function		callback		[Description]
		 *
		 * @return		void
		 */
		__post_projects: function (project_id, project_data, callback) {
			api.handleRestRequest('postJson', '/projects/' + project_id + '', project_data, callback);
		},


		/**
		 * Adds an attachment or attachments to the project
		 * 
		 * @param		integer		project_id		[Description]
		 * @param		object		project_data		[Description]
		 * @param		function		callback		[Description]
		 *
		 * @return		void
		 */
		__post_projects/attachments: function (project_id, project_data, callback) {
			api.handleRestRequest('postJson', '/projects/' + project_id + '/attachments', project_data, callback);
		},


		/**
		 * Deletes a project
		 * 
		 * @param		integer		project_id		[Description]
		 * @param		function		callback		[Description]
		 *
		 * @return		void
		 */
		__delete_projects: function (project_id, callback) {
			api.handleRestRequest('delete', '/projects/' + project_id + '', null, callback);
		}

};

module.exports = Projects;<commit_msg>Projects: Added projects routes<commit_after>var api = require('./api');

var Projects = {



		/**
		 * Retrieves one or all project(s)
		 *
		 * @param		integer		project_id		Optional ID of single project
		 * @param		object		filters			Optional filters
		 * @param		function	callback		Callback function
		 *
		 * @return		void
		 */
		get: function () {
			var args = Array.prototype.slice.apply(arguments),
				callback = args.slice(-1).pop() || function() { },
				project_id = (args[0]) ? '/' + args[0] : '',
				filters = args[1] || null;

			api.handleRestRequest('get', '/projects' + project_id, filters, callback);
		},


		/**
		 * Retrieves a list of attachments of a project
		 *
		 * @param		integer		project_id		ID of single project
		 * @param		function	callback		Callback function
		 *
		 * @return		void
		 */
		getAttachments: function (project_id, callback) {
			api.handleRestRequest('get', '/projects/' + project_id + '/attachments', null, callback);
		},


		/**
		 * Retrieves a list of workflows associated with a project
		 *
		 * @param		integer		project_id		ID of single project
		 * @param		object		filters			Optional filters for the workflows
		 * @param		function	callback		Callback function
		 *
		 * @return		void
		 */
		getWorkflow: function () {
			var args = Array.prototype.slice.apply(arguments),
				callback = args.slice(-1).pop() || function() { },
				project_id = args[0],
				filters = args[1] || null;

			api.handleRestRequest('get', '/projects/' + project_id + '/workflow', filters, callback);
		},


		/**
		 * Adds a project
		 *
		 * @param		object		project_data	Data for a new project
		 * @param		function	callback		Callback function
		 *
		 * @return		void
		 */
		add: function (project_data, callback) {
			api.handleRestRequest('postJson', '/projects', project_data, callback);
		},


		/**
		 * Updates a project
		 *
		 * @param		integer		project_id		ID of single project
		 * @param		object		project_data	New data for an existing project
		 * @param		function	callback		Callback function
		 *
		 * @return		void
		 */
		update: function (project_id, project_data, callback) {
			api.handleRestRequest('postJson', '/projects/' + project_id, project_data, callback);
		},


		/**
		 * Adds an attachment or attachments to the project
		 *
		 * @param		integer		project_id			ID of single project
		 * @param		object		attachment_data		New attachment data for the project
		 * @param		function	callback			Callback function
		 *
		 * @return		void
		 */
		addAttachments: function (project_id, attachment_data, callback) {
			api.handleRestRequest('postJson', '/projects/' + project_id + '/attachments', attachment_data, callback);
		},


		/**
		 * Deletes a project
		 *
		 * @param		integer		project_id		ID of single project
		 * @param		function	callback		Callback function
		 *
		 * @return		void
		 */
		delete: function (project_id, callback) {
			api.handleRestRequest('delete', '/projects/' + project_id, null, callback);
		}

};

module.exports = Projects;
{'fraction_non_alphanumeric': 0.12138921355819002, 'fraction_numerical': 0.0011688094840540991, 'mean_word_length': 3.0665308893414798, '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': '7437752', 'n_tokens_mistral': 2216, 'n_tokens_neox': 1855, 'n_words': 485}