<commit_before>/**
 * 
 * @author <NAME>
 */

/**
 * Durastore API 
 */

var dc; 
(function(){
	if(dc == undefined){
		dc ={};
	}
	
	dc.store = {};
	
	/**
	 * @param String spaceId  space id 
	 * @param Object callback The callback must implement success and failure methods.
	 * @option Function success(spaces) spaces is an array of spaces objects
	 * @option Function failure(info) 
	 * @param Object options
	 * @option String marker - the last content item id of the previous page
	 * @option String prefix - a filters the results to show only those matching the prefix
	 */

	 dc.store.GetSpace = function(storeProviderId,spaceId,callback,options){
		if(options == undefined){
			options = {};
		}
		
		var marker = '';
		if(options.marker){
			marker = options.marker;
		}

		var prefix = '';
		if(options.prefix){
			prefix = options.prefix;
		}

		var recount='';
        if(options.recount){
            recount = '&recount=true';
            
        }
		
		return dc.ajax({
			url: "/duradmin/spaces/space", 
			data: "storeId="+storeProviderId+"&spaceId="+encodeURIComponent(spaceId)+"&prefix="+encodeURIComponent(prefix)+"&marker="+encodeURIComponent(marker)+recount,
			cache: false,
			async: options.async != undefined ? options.async : true,
			context: document.body,
			success: function(data){
				callback.success(data.space);
			},
		}, callback);		
	};
	
    dc.store.GetSpace2 = function(params){
        var marker = '', prefix = '', async = true;
        if(params.marker != undefined){
            marker = params.marker;
        }
        if(params.prefix != undefined){
            prefix = params.prefix;
        }
        if(params.async != undefined){
            async = params.async;
        }

        return dc.ajax2({
            url: "/duradmin/spaces/space", 
            data: "storeId="+params.storeId+
                  "&spaceId="+encodeURIComponent(params.spaceId)+
                  "&prefix="+encodeURIComponent(prefix)+
                  "&marker="+encodeURIComponent(marker),
            cache: false,
            async: async,
        });       
    };
	

    dc.service.UpdateSpaceStreaming = function(storeId, spaceId, /*bool*/enable){
        var jqxhr = dc.ajax2({
            url: "/duradmin/spaces/mediastreamer?storeId="+storeId+"&spaceId="
                            + encodeURIComponent(spaceId) 
                            + "&enable=" + enable,
            type: "post",
            cache: false,
        }).fail(function(){
            dc.displayErrorDialog(jqxhr);  
        });<commit_msg>fixes javascript error - referencing a non-existent dc.service package.<commit_after>/**
 * 
 * @author <NAME>
 */

/**
 * Durastore API 
 */

var dc; 
(function(){
	if(dc == undefined){
		dc ={};
	}
	
	dc.store = {};
	
	/**
	 * @param String spaceId  space id 
	 * @param Object callback The callback must implement success and failure methods.
	 * @option Function success(spaces) spaces is an array of spaces objects
	 * @option Function failure(info) 
	 * @param Object options
	 * @option String marker - the last content item id of the previous page
	 * @option String prefix - a filters the results to show only those matching the prefix
	 */

	 dc.store.GetSpace = function(storeProviderId,spaceId,callback,options){
		if(options == undefined){
			options = {};
		}
		
		var marker = '';
		if(options.marker){
			marker = options.marker;
		}

		var prefix = '';
		if(options.prefix){
			prefix = options.prefix;
		}

		var recount='';
        if(options.recount){
            recount = '&recount=true';
            
        }
		
		return dc.ajax({
			url: "/duradmin/spaces/space", 
			data: "storeId="+storeProviderId+"&spaceId="+encodeURIComponent(spaceId)+"&prefix="+encodeURIComponent(prefix)+"&marker="+encodeURIComponent(marker)+recount,
			cache: false,
			async: options.async != undefined ? options.async : true,
			context: document.body,
			success: function(data){
				callback.success(data.space);
			},
		}, callback);		
	};
	
    dc.store.GetSpace2 = function(params){
        var marker = '', prefix = '', async = true;
        if(params.marker != undefined){
            marker = params.marker;
        }
        if(params.prefix != undefined){
            prefix = params.prefix;
        }
        if(params.async != undefined){
            async = params.async;
        }

        return dc.ajax2({
            url: "/duradmin/spaces/space", 
            data: "storeId="+params.storeId+
                  "&spaceId="+encodeURIComponent(params.spaceId)+
                  "&prefix="+encodeURIComponent(prefix)+
                  "&marker="+encodeURIComponent(marker),
            cache: false,
            async: async,
        });       
    };
	

    dc.store.UpdateSpaceStreaming = function(storeId, spaceId, /*bool*/enable){
        var jqxhr = dc.ajax2({
            url: "/duradmin/spaces/mediastreamer?storeId="+storeId+"&spaceId="
                            + encodeURIComponent(spaceId) 
                            + "&enable=" + enable,
            type: "post",
            cache: false,
        }).fail(function(){
            dc.displayErrorDialog(jqxhr);  
        });
{'fraction_non_alphanumeric': 0.13666279519938057, 'fraction_numerical': 0.0011614401858304297, 'mean_word_length': 2.2354414527238573, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1688945', 'n_tokens_mistral': 1596, 'n_tokens_neox': 1479, 'n_words': 325}