<commit_before>var Utils = require('./utils');
var path = require('path');
var fs = require('fs');
var AsposeStorage = require('./aspose-storage');

function AsposeSlides(config) {
	this.appSID = config.appSID;
	this.appKey = config.appKey;
	this.baseURI = config.baseURI;
}

/* Conversion Methods */

AsposeSlides.prototype.convertToImagebySize = function(fileName,slideNumber,saveFormat,width,height,folderName,storageName,callback){
	
	fileName = typeof fileName !== 'undefined' ? fileName : '';
	slideNumber = typeof slideNumber !== 'undefined' ? slideNumber : 1;
	saveFormat = typeof saveFormat !== 'undefined' ? saveFormat : 'jpeg';
	width = typeof width !== 'undefined' ? width : '';
	height = typeof height !== 'undefined' ? height : '';
	folderName = typeof folderName !== 'undefined' ? folderName : '';
	storageName = typeof storageName !== 'undefined' ? storageName : '';
	
	if(fileName === ''){
		throw new Error('Filename not defined.');
	}
	
	if(width === '' || height === ''){
		throw new Error('missing required parameters.');
	}
	
	
	var strURI = this.baseURI + 'slides/' + fileName + '/slides/' + slideNumber;
	
	if(folderName !== '' || storageName !== ''){
		strURI = strURI + '?';
		<commit_msg>Updated Slides Module<commit_after>var Utils = require('./utils');
var path = require('path');
var fs = require('fs');
var AsposeStorage = require('./aspose-storage');

function AsposeSlides(config) {
	this.appSID = config.appSID;
	this.appKey = config.appKey;
	this.baseURI = config.baseURI;
}

/* Extraction Methods */

AsposeSlides.prototype.getPlaceholder = function(fileName,slideNumber,placeHolderIndex,folderName,storageName,callback){
	
	fileName = typeof fileName !== 'undefined' ? fileName : '';
	slideNumber = typeof slideNumber !== 'undefined' ? slideNumber : 1;
	placeHolderIndex = typeof placeHolderIndex !== 'undefined' ? placeHolderIndex : 0;
	folderName = typeof folderName !== 'undefined' ? folderName : '';
	storageName = typeof storageName !== 'undefined' ? storageName : '';
	
	if(fileName === ''){
		throw new Error('Filename not defined.');
	}
	
	
	var strURI = this.baseURI + 'slides/' + fileName + '/slides/' + slideNumber + '/placeholders/' + placeHolderIndex;
	
	if(folderName !== '' || storageName !== ''){
		strURI = strURI + '?';
		
		if(folderName !== ''){
			strURI = strURI + 'folder=' + folderName;
		}
		
		if(storageName !== ''){
			if( folderName !== '' ){
				strURI = strURI + '&storage=' + storageName;
			}
			else{
				strURI = strURI + 'storage=' + storageName;
			}
		}
	}
	
	var signedURI = Utils.Sign(strURI,this.appSID,this.appKey);
	
	Utils.ProcessCommand('GET',signedURI,'',function(data){
		if(typeof callback === 'function'){
			if(data.Status === 'OK'){
				callback.call(null,data.Placeholder);
			} else {
				throw new Error(data.Status);
			}
		}
	});
};

AsposeSlides.prototype.getPlaceholderCount = function(fileName,slideNumber,folderName,storageName,callback){
	
	fileName = typeof fileName !== 'undefined' ? fileName : '';
	slideNumber = typeof slideNumber !== 'undefined' ? slideNumber : 1;
	folderName = typeof folderName !== 'undefined' ? folderName : '';
	storageName = typeof storageName !== 'undefined' ? storageName : '';
	
	if(fileName === ''){
		throw new Error('Filename not defined.');
	}
	
	
	var strURI = this.baseURI + 'slides/' + fileName + '/slides/' + slideNumber + '/placeholders';
	
	if(folderName !== '' || storageName !== ''){
		strURI = strURI + '?';
		
		if(folderName !== ''){
			strURI = strURI + 'folder=' + folderName;
		}
		
		if(storageName !== ''){
			if( folderName !== '' ){
				strURI = strURI + '&storage=' + storageName;
			}
			else{
				strURI = strURI + 'storage=' + storageName;
			}
		}
	}
	
	var signedURI = Utils.Sign(strURI,this.appSID,this.appKey);
	
	Utils.ProcessCommand('GET',signedURI,'',function(data){
		if(typeof callback === 'function'){
			if(data.Status === 'OK'){
				callback.call(null,data.Placeholders.PlaceholderLinks.length);
			} else {
				throw new Error(data.Status);
			}
		}
	});
};

AsposeSlides.prototype.getFormatScheme = function(fileName,slideNumber,folderName,storageName,callback){
	
	fileName = typeof fileName !== 'undefined' ? fileName : '';
	slideNumber = typeof slideNumber !== 'undefined' ? slideNumber : 1;
	folderName = typeof folderName !== 'undefined' ? folderName : '';
	storageName = typeof storageName !== 'undefined' ? storageName : '';
	
	if(fileName === ''){
		throw new Error('Filename not defined.');
	}
	
	
	var strURI = this.baseURI + 'slides/' + fileName + '/slides/' + slideNumber + '/theme/formatScheme';
	
	if(folderName !== '' || storageName !== ''){
		strURI = strURI + '?';
		
		if(folderName !== ''){
			strURI = strURI + 'folder=' + folderName;
		}
		
		if(storageName !== ''){
			if( folderName !== '' ){
				strURI = strURI + '&storage=' + storageName;
			}
			else{
				strURI = strURI + 'storage=' + storageName;
			}
		}
	}
	
	var signedURI = Utils.Sign(strURI,this.appSID,this.appKey);
	
	Utils.ProcessCommand('GET',signedURI,'',function(data){
		if(typeof callback === 'function'){
			if(data.Status === 'OK'){
				callback.call(null,data.FormatScheme);
			} else {
				throw new Error(data.Status);
			}
		}
	});
};

AsposeSlides.prototype.getFontScheme = function(fileName,slideNumber,folderName,storageName,callback){
	
	fileName = typeof fileName !== 'undefined' ? fileName : '';
	slideNumber = typeof slideNumber !== 'undefined' ? slideNumber : 1;
	folderName = typeof folderName !== 'undefined' ? folderName : '';
	storageName = typeof storageName !== 'undefined' ? storageName : '';
	
	if(fileName === ''){
		throw new Error('Filename not defined.');
	}
	
	
	var strURI = this.baseURI + 'slides/' + fileName + '/slides/' + slideNumber + '/theme/fontScheme';
	
	if(folderName !== '' || storageName !== ''){
		strURI = strURI + '?';
		
		if(folderName !== ''){
			strURI = strURI + 'folder=' + folderName;
		}
		
		if(storageName !== ''){
			if( folderName !== '' ){
				strURI = strURI + '&storage=' + storageName;
			}
			else{
				strURI = strURI + 'storage=' + storageName;
			}
		}
	}
	
	var signedURI = Utils.Sign(strURI,this.appSID,this.appKey);
	
	Utils.ProcessCommand('GET',signedURI,'',function(data){
		if(typeof callback === 'function'){
			if(data.Status === 'OK'){
				callback.call(null,data.FontScheme);
			} else {
				throw new Error(data.Status);
			}
		}
	});
};

AsposeSlides.prototype.getColorScheme = function(fileName,slideNumber,folderName,storageName,callback){
	
	fileName = typeof fileName !== 'undefined' ? fileName : '';
	slideNumber = typeof slideNumber !== 'undefined' ? slideNumber : 1;
	folderName = typeof folderName !== 'undefined' ? folderName : '';
	storageName = typeof storageName !== 'undefined' ? storageName : '';
	
	if(fileName === ''){
		throw new Error('Filename not defined.');
	}
	
	
	var strURI = this.baseURI + 'slides/' + fileName + '/slides/' + slideNumber + '/theme/colorScheme';
	
	if(folderName !== '' || storageName !== ''){
		strURI = strURI + '?';
		
		if(folderName !== ''){
			strURI = strURI + 'folder=' + folderName;
		}
		
		if(storageName !== ''){
			if( folderName !== '' ){
				strURI = strURI + '&storage=' + storageName;
			}
			else{
				strURI = strURI + 'storage=' + storageName;
			}
		}
	}
	
	var signedURI = Utils.Sign(strURI,this.appSID,this.appKey);
	
	Utils.ProcessCommand('GET',signedURI,'',function(data){
		if(typeof callback === 'function'){
			if(data.Status === 'OK'){
				callback.call(null,data.ColorScheme);
			} else {
				throw new Error(data.Status);
			}
		}
	});
};

AsposeSlides.prototype.getShapes = function(fileName,slideNumber,folderName,storageName,callback){
	
	fileName = typeof fileName !== 'undefined' ? fileName : '';
	slideNumber = typeof slideNumber !== 'undefined' ? slideNumber : 1;
	folderName = typeof folderName !== 'undefined' ? folderName : '';
	storageName = typeof storageName !== 'undefined' ? storageName : '';
	
	if(fileName === ''){
		throw new Error('Filename not defined.');
	}
	
	
	var strURI = this.baseURI + 'slides/' + fileName + '/slides/' + slideNumber + '/shapes';
	
	if(folderName !== '' || storageName !== ''){
		strURI = strURI + '?';
		
		if(folderName !== ''){
			strURI = strURI + 'folder=' + folderName;
		}
		
		if(storageName !== ''){
			if( folderName !== '' ){
				strURI = strURI + '&storage=' + storageName;
			}
			else{
				strURI = strURI + 'storage=' + storageName;
			}
		}
	}
	
	var signedURI = Utils.Sign(strURI,this.appSID,this.appKey);
	
	Utils.ProcessCommand('GET',signedURI,'',function(data){
		if(typeof callback === 'function'){
			if(data.Status === 'OK'){
				callback.call(null,data);
			} else {
				throw new Error(data.Status);
			}
		}
	});
};

AsposeSlides.prototype.getSlideImageCount = function(fileName,slideNumber,folderName,storageName,callback){
	
	fileName = typeof fileName !== 'undefined' ? fileName : '';
	slideNumber = typeof slideNumber !== 'undefined' ? slideNumber : 1;
	folderName = typeof folderName !== 'undefined' ? folderName : '';
	storageName = typeof storageName !== 'undefined' ? storageName : '';
	
	if(fileName === ''){
		throw new Error('Filename not defined.');
	}
	
	
	var strURI = this.baseURI + 'slides/' + fileName + '/slides/' + slideNumber + '/images';
	
	if(folderName !== '' || storageName !== ''){
		strURI = strURI + '?';
		
		if(folderName !== ''){
			strURI = strURI + 'folder=' + folderName;
		}
		
		if(storageName !== ''){
			if( folderName !== '' ){
				strURI = strURI + '&storage=' + storageName;
			}
			else{
				strURI = strURI + 'storage=' + storageName;
			}
		}
	}
	
	var signedURI = Utils.Sign(strURI,this.appSID,this.appKey);
	
	Utils.ProcessCommand('GET',signedURI,'',function(data){
		if(typeof callback === 'function'){
			if(data.Status === 'OK'){
				callback.call(null,data.Images.List.length);
			} else {
				throw new Error(data.Status);
			}
		}
	});
};

AsposeSlides.prototype.getImageCount = function(fileName,folderName,storageName,callback){
	
	fileName = typeof fileName !== 'undefined' ? fileName : '';
	folderName = typeof folderName !== 'undefined' ? folderName : '';
	storageName = typeof storageName !== 'undefined' ? storageName : '';
	
	if(fileName === ''){
		throw new Error('Filename not defined.');
	}
	
	
	var strURI = this.baseURI + 'slides/' + fileName + '/images';
	
	if(folderName !== '' || storageName !== ''){
		strURI = strURI + '?';
		
		if(folderName !== ''){
			strURI = strURI + 'folder=' + folderName;
		}
		
		if(storageName !== ''){
			if( folderName !== '' ){
				strURI = strURI + '&storage=' + storageName;
			}
			else{
				strURI = strURI + 'storage=' + storageName;
			}
		}
	}
	
	var signedURI = Utils.Sign(strURI,this.appSID,this.appKey);
	
	Utils.ProcessCommand('GET',signedURI,'',function(data){
		if(typeof callback === 'function'){
			if(data.Status === 'OK'){
				callback.call(null,data.Images.List.length);
			} else {
				throw new Error(data.Status);
			}
		}
	});
};

/* Conversion Methods */

AsposeSlides.prototype.convertToImagebySize = function(fileName,slideNumber,saveFormat,width,height,folderName,storageName,callback){
	
	fileName = typeof fileName !== 'undefined' ? fileName : '';
	slideNumber = typeof slideNumber !== 'undefined' ? slideNumber : 1;
	saveFormat = typeof saveFormat !== 'undefined' ? saveFormat : 'jpeg';
	width = typeof width !== 'undefined' ? width : '';
	height = typeof height !== 'undefined' ? height : '';
	folderName = typeof folderName !== 'undefined' ? folderName : '';
	storageName = typeof storageName !== 'undefined' ? storageName : '';
	
	if(fileName === ''){
		throw new Error('Filename not defined.');
	}
	
	if(width === '' || height === ''){
		throw new Error('missing required parameters.');
	}
	
	
	var strURI = this.baseURI + 'slides/' + fileName + '/slides/' + slideNumber;
	
	if(folderName !== '' || storageName !== ''){
		strURI = strURI + '?';
		
{'fraction_non_alphanumeric': 0.1815114709851552, 'fraction_numerical': 0.0008434547908232119, 'mean_word_length': 3.959012965286491, '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': '2840654', 'n_tokens_mistral': 4160, 'n_tokens_neox': 3728, 'n_words': 749}