<commit_before>import Joi from 'joi';

const schemas = {
	notification : {
		title: Joi.string(),
		body: Joi.string(),
		sound: Joi.string()
	}
}
export default {
	loadSchema : function (schemaName) {
		if (schemaName === undefined){
			throw new Error('Schema name is missing');
		}

		if (typeof(schemaName) !== 'string' || !schemas[schemaName]){
			throw new Error(`Schema ${schemaName} no exist or no is a valid string`)
		}
		
		return schemas[schemaName];
	}
}<commit_msg>Added schemas to messages and data<commit_after>import Joi from 'joi';

const notification = {
	title : Joi.string(),
	body : Joi.string(),
	icon : Joi.string(),
	sound : Joi.string(),
	badge : Joi.string(),
	tag	: Joi.string(),
	color : Joi.string(),
	click_action : Joi.string(),
	body_loc_key : Joi.string(),
	body_loc_args : Joi.array().items(Joi.string()),
	title_loc_key : Joi.string(),
	title_loc_args : Joi.array().items(Joi.string()),
};

const data = Joi.object().pattern(/.*/, Joi.string());

const message = {
	condition : Joi.string(),
	registration_ids : Joi.array().items(Joi.string()),
	collapse_key : Joi.string(),
	priority : Joi.string(),
	content_available : Joi.boolean(),
	delay_while_idle : Joi.boolean(),
	time_to_live : Joi.number(),
	restricted_package_name	: Joi.string(),
	dry_run	: Joi.boolean(),
	to : Joi.string(),
	notification : Joi.object().keys(notification),
	data : data
};



const schemas = {
	notification : notification,
	message : message,	
}
export default {
	loadSchema : function (schemaName) {
		if (schemaName === undefined){
			throw new Error('Schema name is missing');
		}

		if (typeof(schemaName) !== 'string' || !schemas[schemaName]){
			throw new Error(`Schema ${schemaName} no exist or no is a valid string`)
		}
		
		return schemas[schemaName];
	}
}
{'fraction_non_alphanumeric': 0.1625560538116592, 'fraction_numerical': 0.0, 'mean_word_length': 4.344311377245509, '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': '1311756', 'n_tokens_mistral': 649, 'n_tokens_neox': 610, 'n_words': 148}