From d1a09a5958106b3d5f386e795408cd4f6179eaac Mon Sep 17 00:00:00 2001 From: "G. Gibson" Date: Mon, 25 Apr 2022 16:38:53 -0700 Subject: [PATCH] Download test 2 --- Public/www/javascript/gxg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Public/www/javascript/gxg.js b/Public/www/javascript/gxg.js index 91d85e8..1e61742 100644 --- a/Public/www/javascript/gxg.js +++ b/Public/www/javascript/gxg.js @@ -2755,7 +2755,7 @@ try{return self.$log_error($hash2(["error","parameters"],{"error":the_error,"par try{self.$log_error($hash2(["error","parameters"],{"error":the_error,"parameters":$hash2(["url"],{"url":the_url.$to_s()})}))}finally{Opal.pop_exception();}}else{throw $err;}};;if($truthy(self.socket)){$writer=["socket",self];$send($$$($$$('::','GxG'),'DISPLAY_DETAILS'),'[]=',Opal.to_a($writer));return $writer[$rb_minus($writer["length"],1)];}else{return nil};},$Socket_open$11.$$arity=1);Opal.def(self,'$set_remote_uuid',$Socket_set_remote_uuid$12=function $$set_remote_uuid(the_uuid){var self=this;if(the_uuid==null){the_uuid=nil;};if($truthy($$($nesting,'GxG')['$valid_uuid?'](the_uuid))){self.remote_uuid=the_uuid.$to_sym();return true;}else{return false};},$Socket_set_remote_uuid$12.$$arity=-1);return(Opal.def(self,'$initialize',$Socket_initialize$13=function $$initialize(){var self=this;self.uuid=$$($nesting,'GxG').$uuid_generate().$to_sym();self.remote_uuid=nil;self.inbox=[];return self;},$Socket_initialize$13.$$arity=0),nil)&&'initialize';})($nesting[0],null,$nesting);})($nesting[0],$nesting);return(function($base,$parent_nesting){var self=$module($base,'Networking');var $nesting=[self].concat($parent_nesting);(function($base,$super,$parent_nesting){var self=$klass($base,$super,'Channel');var $nesting=[self].concat($parent_nesting);return nil})($nesting[0],null,$nesting);return(function($base,$super,$parent_nesting){var self=$klass($base,$super,'Connector');var $nesting=[self].concat($parent_nesting),$Connector_remote_uuid$14,$Connector_open$ques$15,$Connector_close$16,$Connector_post$17,$Connector_download_file$20,$Connector_push$22,$Connector_pull$25,$Connector_push_message$28,$Connector_pull_message$29,$Connector_process_pending$30,$Connector_push_object_portions$31,$Connector_search_database$32,$Connector_search_pull$33,$Connector_destroy_object$35,$Connector_push_data$37,$Connector_push_object$39,$Connector_pull_data$43,$Connector_pull_object$45,$Connector_load_format$47,$Connector_store_format$49,$Connector_get_permissions$53,$Connector_call_event$55,$Connector_library_pull$56,$Connector_format_pull$58,$Connector_format_push$60,$Connector_format_list$62,$Connector_admin$64,$Connector_vfs$66,$Connector_app_state_push$68,$Connector_app_state_pull$70,$Connector_application_open$72,$Connector_application_close$75,$Connector_application_list$77,$Connector_application_menu$79,$Connector_entries$81,$Connector_heartbeat$83,$Connector_update_credential$85,$Connector_downgrade_credential$88,$Connector_action$90,$Connector_relative_url$91,$Connector_query$92,$Connector_article$93,$Connector_display_path$94,$Connector_initialize$95;self.$$prototype.remote_uuid=self.$$prototype.active=self.$$prototype.uuid=self.$$prototype.heart_beat_timer=self.$$prototype.relative_url=self.$$prototype.host_prefix=self.$$prototype.display_path=self.$$prototype.csrf=self.$$prototype.query=self.$$prototype.article=nil;Opal.def(self,'$remote_uuid',$Connector_remote_uuid$14=function $$remote_uuid(){var self=this;return self.remote_uuid},$Connector_remote_uuid$14.$$arity=0);Opal.def(self,'$open?',$Connector_open$ques$15=function(){var self=this;return self.active},$Connector_open$ques$15.$$arity=0);Opal.def(self,'$close',$Connector_close$16=function $$close(){var self=this,the_message=nil,$writer=nil;the_message=self.$new_message($hash2(["close"],{"close":true}));$writer=["sender",self.uuid];$send(the_message,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;$writer=["to",self.remote_uuid];$send(the_message,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;self.$pull(the_message,$hash2(["synchronous"],{"synchronous":true}));self.active=false;self.csrf=nil;if($truthy(self.heart_beat_timer['$is_a?']($$$('::','Hash')))){$$$($$($nesting,'GxG'),'DISPATCHER').$cancel_timer(self.heart_beat_timer)};return true;},$Connector_close$16.$$arity=0);Opal.def(self,'$post',$Connector_post$17=function $$post(form_data,options){var $iter=$Connector_post$17.$$p,handler=$iter||nil,$$18,$$19,self=this,action=nil,the_url=nil,the_xhr=nil,$ret_or_1=nil,failed=nil,succeeded=nil;if($iter)$Connector_post$17.$$p=null;if($iter)$Connector_post$17.$$p=null;;if(form_data==null){form_data="";};if(options==null){options=$hash2([],{});};if($truthy(self.active)){if($truthy(form_data['$is_a?']($$$($$$($$$('::','GxG'),'Gui'),'Form')))){action=form_data.$get_attribute("action").$to_s();if($truthy($rb_gt(action.$size(),0))){if($truthy($rb_gt(self.relative_url.$to_s().$size(),0))){the_url=""+(self.host_prefix)+(self.relative_url.$to_s())+(action.$to_s())+"?display="+(self.display_path.$to_s())}else{the_url=""+(self.host_prefix)+(action.$to_s())+"?display="+(self.display_path.$to_s())}}else if($truthy($rb_gt(self.relative_url.$to_s().$size(),0))){the_url=""+(self.host_prefix)+(self.relative_url.$to_s())+"?display="+(self.display_path.$to_s())}else{the_url=""+(self.host_prefix)+"?display="+(self.display_path.$to_s())};the_xhr=new XMLHttpRequest;the_xhr.open('POST',the_url,true);the_xhr.timeout=(function(){if($truthy(($ret_or_1=options['$[]']("timeout")))){return $ret_or_1}else{return 5000};return nil;})();the_xhr.setRequestHeader('X-Requested-With','XMLHttpRequest');the_xhr.setRequestHeader('Accept','application/json');the_xhr.setRequestHeader('X-CSRF-Token',self.csrf);the_xhr.setRequestHeader('Content-Type','multipart/form-data');failed=$send($$($nesting,'Proc'),'new',[],($$18=function(reason){var self=$$18.$$s==null?this:$$18.$$s;if(reason==null){reason=$hash2(["error"],{"error":"unknown"});};return self.$log_error(reason);},$$18.$$s=self,$$18.$$arity=-1,$$18));succeeded=$send($$($nesting,'Proc'),'new',[],($$19=function(){var self=$$19.$$s==null?this:$$19.$$s,response_code=nil,the_response=nil,the_error=nil;response_code=(the_xhr.status).$to_i();if($truthy($rb_lt(response_code,300))){try{the_response=$$$('::','JSON').$parse(the_xhr.response,$hash2(["symbolize_names"],{"symbolize_names":true}));self.$log_info(the_response.$inspect());if($truthy(handler['$respond_to?']("call"))){return handler.$call(the_response)}else{return nil};}catch($err){if(Opal.rescue($err,[$$($nesting,'Exception')])){(the_error=$err) try{return self.$log_error($hash2(["error","parameters"],{"error":the_error,"parameters":the_xhr.response}))}finally{Opal.pop_exception();}}else{throw $err;}};}else{try{return failed.$call($$$('::','JSON').$parse(the_xhr.response,$hash2(["symbolize_names"],{"symbolize_names":true})))}catch($err){if(Opal.rescue($err,[$$($nesting,'Exception')])){(the_error=$err) try{return self.$log_error($hash2(["error","parameters"],{"error":the_error,"parameters":the_xhr.response}))}finally{Opal.pop_exception();}}else{throw $err;}};};},$$19.$$s=self,$$19.$$arity=0,$$19));the_xhr.addEventListener('load',succeeded);the_xhr.addEventListener('error',failed);the_xhr.addEventListener('timeout',failed);the_xhr.addEventListener('abort',failed);the_xhr.send(form_data.$element());return true;}else{return false}}else{return nil};},$Connector_post$17.$$arity=-1);Opal.def(self,'$download_file',$Connector_download_file$20=function $$download_file(the_vfs_path,error_handler){var $iter=$Connector_download_file$20.$$p,the_handler=$iter||nil,$$21,self=this,$ret_or_2=nil,the_message=nil,$writer=nil;if($iter)$Connector_download_file$20.$$p=null;if($iter)$Connector_download_file$20.$$p=null;;if(the_vfs_path==null){the_vfs_path="";};if(error_handler==null){error_handler=nil;};if($truthy(self['$open?']())){if($truthy((function(){if($truthy(($ret_or_2=the_vfs_path['$is_a?']($$$('::','String'))))){return the_handler}else{return $ret_or_2};return nil;})())){the_message=self.$new_message($hash2(["download_file"],{"download_file":$hash2(["path"],{"path":the_vfs_path})}));$writer=["sender",self.uuid];$send(the_message,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;$writer=["to",self.remote_uuid];$send(the_message,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;if($truthy(error_handler['$respond_to?']("call"))){$send(the_message,'on',["fail"],error_handler.$to_proc())};$send(the_message,'on',["success"],($$21=function(response){var self=$$21.$$s==null?this:$$21.$$s;if(response==null){response=nil;};return self.$puts($rb_plus("Got: ",response.$inspect()));},$$21.$$s=self,$$21.$$arity=1,$$21));$$$($$($nesting,'GxG'),'CONNECTION').$pull(the_message);return true;}else{return false}}else{return nil};},$Connector_download_file$20.$$arity=-1);Opal.def(self,'$push',$Connector_push$22=function $$push(the_message,options){var $$23,$$24,self=this,the_url=nil,payload=nil,the_xhr=nil,$ret_or_3=nil,failed=nil,succeeded=nil;if(the_message==null){the_message=nil;};if(options==null){options=$hash2([],{});};if($truthy(self.active)){if($truthy(the_message['$is_a?']($$$($$$($$$('::','GxG'),'Events'),'Message')))){if($truthy($rb_gt(self.relative_url.$to_s().$size(),0))){the_url=""+(self.host_prefix)+(self.relative_url.$to_s())+"?display="+(self.display_path.$to_s())}else{the_url=""+(self.host_prefix)+"?display="+(self.display_path.$to_s())};payload=the_message.$body().$to_json().$to_s();the_xhr=new XMLHttpRequest;the_xhr.open('PUT',the_url,true);the_xhr.timeout=(function(){if($truthy(($ret_or_3=options['$[]']("timeout")))){return $ret_or_3}else{return 5000};return nil;})();the_xhr.setRequestHeader('X-Requested-With','XMLHttpRequest');the_xhr.setRequestHeader('Accept','application/json');the_xhr.setRequestHeader('X-CSRF-Token',self.csrf);the_xhr.setRequestHeader('Content-Type','application/json');failed=$send($$($nesting,'Proc'),'new',[],($$23=function(reason){var self=$$23.$$s==null?this:$$23.$$s;if(reason==null){reason=nil;};return the_message.$fail(reason);},$$23.$$s=self,$$23.$$arity=-1,$$23));succeeded=$send($$($nesting,'Proc'),'new',[],($$24=function(){var self=$$24.$$s==null?this:$$24.$$s,response_code=nil,the_error=nil;response_code=(the_xhr.status).$to_i();if($truthy($rb_lt(response_code,300))){try{return the_message.$succeed($$$('::','JSON').$parse(the_xhr.response,$hash2(["symbolize_names"],{"symbolize_names":true})))}catch($err){if(Opal.rescue($err,[$$($nesting,'Exception')])){(the_error=$err) -try{return self.$log_error($hash2(["error","parameters"],{"error":the_error,"parameters":the_xhr.response}))}finally{Opal.pop_exception();}}else{throw $err;}};}else{return failed.$call(response_code)};},$$24.$$s=self,$$24.$$arity=0,$$24));the_xhr.addEventListener('load',succeeded);the_xhr.addEventListener('error',failed);the_xhr.addEventListener('timeout',failed);the_xhr.addEventListener('abort',failed);the_xhr.send(payload);return true;}else{return false}}else{return nil};},$Connector_push$22.$$arity=-1);Opal.def(self,'$pull',$Connector_pull$25=function $$pull(the_message,options){var $$26,$$27,self=this,the_query=nil,the_url=nil,the_xhr=nil,$ret_or_4=nil,failed=nil,succeeded=nil;if(the_message==null){the_message=nil;};if(options==null){options=$hash2(["synchronous"],{"synchronous":false});};if($truthy(self.active)){if($truthy(the_message['$is_a?']($$$($$$($$$('::','GxG'),'Events'),'Message')))){the_query=""+"display="+(self.display_path.$to_s())+"&details="+(the_message.$body().$to_json().$encode64());if($truthy($rb_gt(self.relative_url.$to_s().$size(),0))){the_url=$rb_plus($rb_plus($rb_plus(self.host_prefix.$to_s(),self.relative_url.$to_s()),"?"),the_query)}else{the_url=$rb_plus($rb_plus(self.host_prefix.$to_s(),"?"),the_query)};the_xhr=new XMLHttpRequest;if(options['$[]']("synchronous")['$=='](true)){the_xhr.open('GET',the_url.$to_s(),false)}else{the_xhr.open('GET',the_url.$to_s(),true);the_xhr.timeout=(function(){if($truthy(($ret_or_4=options['$[]']("timeout")))){return $ret_or_4}else{return 600000};return nil;})();};the_xhr.setRequestHeader('X-Requested-With','XMLHttpRequest');the_xhr.setRequestHeader('Accept','application/json');failed=$send($$($nesting,'Proc'),'new',[],($$26=function(reason){var self=$$26.$$s==null?this:$$26.$$s;if(reason==null){reason=nil;};return the_message.$fail(reason);},$$26.$$s=self,$$26.$$arity=-1,$$26));succeeded=$send($$($nesting,'Proc'),'new',[],($$27=function(){var self=$$27.$$s==null?this:$$27.$$s,response_code=nil,the_error=nil;response_code=(the_xhr.status).$to_i();if($truthy($rb_lt(response_code,300))){try{return the_message.$succeed($$$('::','JSON').$parse(the_xhr.response,$hash2(["symbolize_names"],{"symbolize_names":true})))}catch($err){if(Opal.rescue($err,[$$($nesting,'Exception')])){(the_error=$err) +try{return self.$log_error($hash2(["error","parameters"],{"error":the_error,"parameters":the_xhr.response}))}finally{Opal.pop_exception();}}else{throw $err;}};}else{return failed.$call(response_code)};},$$24.$$s=self,$$24.$$arity=0,$$24));the_xhr.addEventListener('load',succeeded);the_xhr.addEventListener('error',failed);the_xhr.addEventListener('timeout',failed);the_xhr.addEventListener('abort',failed);the_xhr.send(payload);return true;}else{return false}}else{return nil};},$Connector_push$22.$$arity=-1);Opal.def(self,'$pull',$Connector_pull$25=function $$pull(the_message,options){var $$26,$$27,self=this,the_query=nil,the_url=nil,the_xhr=nil,$ret_or_4=nil,failed=nil,succeeded=nil;if(the_message==null){the_message=nil;};if(options==null){options=$hash2(["synchronous"],{"synchronous":false});};if($truthy(self.active)){if($truthy(the_message['$is_a?']($$$($$$($$$('::','GxG'),'Events'),'Message')))){the_query=""+"display="+(self.display_path.$to_s())+"&details="+(the_message.$body().$to_json().$encode64());if($truthy($rb_gt(self.relative_url.$to_s().$size(),0))){the_url=$rb_plus($rb_plus($rb_plus(self.host_prefix.$to_s(),self.relative_url.$to_s()),"?"),the_query)}else{the_url=$rb_plus($rb_plus(self.host_prefix.$to_s(),"?"),the_query)};the_xhr=new XMLHttpRequest;if(options['$[]']("synchronous")['$=='](true)){the_xhr.open('GET',the_url.$to_s(),false)}else{the_xhr.open('GET',the_url.$to_s(),true);the_xhr.timeout=(function(){if($truthy(($ret_or_4=options['$[]']("timeout")))){return $ret_or_4}else{return 600000};return nil;})();};the_xhr.setRequestHeader('X-Requested-With','XMLHttpRequest');the_xhr.setRequestHeader('Accept','application/json');failed=$send($$($nesting,'Proc'),'new',[],($$26=function(reason){var self=$$26.$$s==null?this:$$26.$$s;if(reason==null){reason=nil;};return the_message.$fail(reason);},$$26.$$s=self,$$26.$$arity=-1,$$26));succeeded=$send($$($nesting,'Proc'),'new',[],($$27=function(){var self=$$27.$$s==null?this:$$27.$$s,response_code=nil,the_error=nil;response_code=(the_xhr.status).$to_i();if($truthy($rb_lt(response_code,300))){try{the_message.$succeed($$$('::','JSON').$parse(the_xhr.response,$hash2(["symbolize_names"],{"symbolize_names":true})));return self.$puts("got data");}catch($err){if(Opal.rescue($err,[$$($nesting,'Exception')])){(the_error=$err) try{return self.$log_error($hash2(["error","parameters"],{"error":the_error,"parameters":the_xhr.response}))}finally{Opal.pop_exception();}}else{throw $err;}};}else{return failed.$call(response_code)};},$$27.$$s=self,$$27.$$arity=0,$$27));the_xhr.addEventListener('load',succeeded);the_xhr.addEventListener('error',failed);the_xhr.addEventListener('timeout',failed);the_xhr.addEventListener('abort',failed);the_xhr.send(null);return true;}else{return false}}else{return nil};},$Connector_pull$25.$$arity=-1);Opal.def(self,'$push_message',$Connector_push_message$28=function $$push_message(the_message){var self=this;if(the_message==null){the_message=nil;};return nil;},$Connector_push_message$28.$$arity=-1);Opal.def(self,'$pull_message',$Connector_pull_message$29=function $$pull_message(options){var self=this;if(options==null){options=$hash2([],{});};return nil;},$Connector_pull_message$29.$$arity=-1);Opal.def(self,'$process_pending',$Connector_process_pending$30=function $$process_pending(options){var self=this;if(options==null){options=$hash2([],{});};return nil;},$Connector_process_pending$30.$$arity=-1);Opal.def(self,'$push_object_portions',$Connector_push_object_portions$31=function $$push_object_portions(details,error_handler){var $iter=$Connector_push_object_portions$31.$$p,the_handler=$iter||nil,self=this;if($iter)$Connector_push_object_portions$31.$$p=null;if($iter)$Connector_push_object_portions$31.$$p=null;;if(details==null){details=$hash2([],{});};if(error_handler==null){error_handler=nil;};return nil;},$Connector_push_object_portions$31.$$arity=-1);Opal.def(self,'$search_database',$Connector_search_database$32=function $$search_database(details,error_handler){var $iter=$Connector_search_database$32.$$p,the_handler=$iter||nil,self=this,$ret_or_5=nil;if($iter)$Connector_search_database$32.$$p=null;if($iter)$Connector_search_database$32.$$p=null;;if(details==null){details=$hash2([],{});};if(error_handler==null){error_handler=nil;};if($truthy((function(){if($truthy(($ret_or_5=details['$is_a?']($$$('::','Hash'))))){return the_handler}else{return $ret_or_5};return nil;})())){$send(self,'pull_data',[$hash2(["search_database"],{"search_database":$hash2(["criteria"],{"criteria":details})}),error_handler],the_handler.$to_proc());return true;}else{return false};},$Connector_search_database$32.$$arity=-1);Opal.def(self,'$search_pull',$Connector_search_pull$33=function $$search_pull(details,error_handler){var $iter=$Connector_search_pull$33.$$p,the_handler=$iter||nil,$$34,self=this,$ret_or_6=nil;if($iter)$Connector_search_pull$33.$$p=null;if($iter)$Connector_search_pull$33.$$p=null;;if(details==null){details=$hash2([],{});};if(error_handler==null){error_handler=nil;};if($truthy((function(){if($truthy(($ret_or_6=details['$is_a?']($$$('::','Hash'))))){return the_handler}else{return $ret_or_6};return nil;})())){$send(self,'pull_data',[$hash2(["search_pull"],{"search_pull":$hash2(["criteria"],{"criteria":details})}),error_handler],($$34=function(data){var self=$$34.$$s==null?this:$$34.$$s,the_error=nil;if(data==null){data=nil;};if($truthy(data['$is_a?']($$$('::','Hash')))){if($truthy(data['$[]']("result"))){if($truthy(data['$[]']("result")['$is_a?']($$$('::','String')))){if($truthy(data['$[]']("result").$to_s()['$base64?']())){data=data['$[]']("result").$decode64()};if($truthy(data.$to_s()['$json?']())){try{data=$$$('::','JSON').$parse(data.$to_s(),$hash2(["symbolize_names"],{"symbolize_names":true}));return the_handler.$call($$$($$$('::','GxG'),'Database').$process_detached_import(data));}catch($err){if(Opal.rescue($err,[$$($nesting,'Exception')])){(the_error=$err) try{return self.$log_error($hash2(["error","parameters"],{"error":the_error,"parameters":$hash2(["data"],{"data":data})}))}finally{Opal.pop_exception();}}else{throw $err;}};}else{return nil};}else{return self.$log_error($hash2(["error","parameters"],{"error":$$($nesting,'Exception').$new("Malformed Response Data"),"parameters":$hash2(["data"],{"data":data['$[]']("result")})}))}}else if($truthy(data['$[]']("error"))){if($truthy(error_handler['$respond_to?']("call"))){return error_handler.$call(data)}else{return nil}}else{return nil}}else{return nil};},$$34.$$s=self,$$34.$$arity=1,$$34));return true;}else{return false};},$Connector_search_pull$33.$$arity=-1);Opal.def(self,'$destroy_object',$Connector_destroy_object$35=function $$destroy_object(the_specifier,error_handler){var $iter=$Connector_destroy_object$35.$$p,the_handler=$iter||nil,$$36,self=this,$ret_or_7=nil;if($iter)$Connector_destroy_object$35.$$p=null;if($iter)$Connector_destroy_object$35.$$p=null;;if(the_specifier==null){the_specifier=nil;};if(error_handler==null){error_handler=nil;};if($truthy((function(){if($truthy(($ret_or_7=the_specifier))){return the_handler}else{return $ret_or_7};return nil;})())){$send(self,'pull_data',[$hash2(["destroy_object"],{"destroy_object":$hash2(["path"],{"path":the_specifier})}),error_handler],($$36=function(data){var self=$$36.$$s==null?this:$$36.$$s;if(data==null){data=nil;};if($truthy(data['$is_a?']($$$('::','Hash')))){return the_handler.$call(data)}else{return nil};},$$36.$$s=self,$$36.$$arity=1,$$36));return true;}else{return false};},$Connector_destroy_object$35.$$arity=-1);Opal.def(self,'$push_data',$Connector_push_data$37=function $$push_data(details,error_handler){var $iter=$Connector_push_data$37.$$p,the_handler=$iter||nil,$$38,self=this,$ret_or_8=nil,the_message=nil,$writer=nil;if($iter)$Connector_push_data$37.$$p=null;if($iter)$Connector_push_data$37.$$p=null;;if(details==null){details=$hash2([],{});};if(error_handler==null){error_handler=nil;};if($truthy((function(){if($truthy(($ret_or_8=details['$is_a?']($$$('::','Hash'))))){return the_handler}else{return $ret_or_8};return nil;})())){the_message=self.$new_message(details);$writer=["sender",self.uuid];$send(the_message,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;$writer=["to",self.remote_uuid];$send(the_message,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;if($truthy(error_handler['$respond_to?']("call"))){$send(the_message,'on',["fail"],error_handler.$to_proc())};$send(the_message,'on',["success"],($$38=function(response){var self=$$38.$$s==null?this:$$38.$$s;if(response==null){response=nil;};return the_handler.$call(response);},$$38.$$s=self,$$38.$$arity=1,$$38));$$$($$($nesting,'GxG'),'CONNECTION').$push(the_message);return true;}else{return false};},$Connector_push_data$37.$$arity=-1);Opal.def(self,'$push_object',$Connector_push_object$39=function $$push_object(details,error_handler){var $iter=$Connector_push_object$39.$$p,the_handler=$iter||nil,$$40,$$41,$$42,self=this,$ret_or_9=nil,exception=nil,payload=nil,$writer=nil,format_list=nil,importation_record=nil;if($iter)$Connector_push_object$39.$$p=null;if($iter)$Connector_push_object$39.$$p=null;;if(details==null){details=$hash2([],{});};if(error_handler==null){error_handler=nil;};if($truthy((function(){if($truthy(($ret_or_9=details['$is_a?']($$$('::','Hash'))))){return the_handler}else{return $ret_or_9};return nil;})())){exception=nil;payload=$hash2([],{});if($truthy(details['$[]']("object")['$is_any?']($$$($$$('::','GxG'),'BinaryArray'),$$$('::','String')))){if($truthy($rb_gt(details['$[]']("path").$to_s().$size(),0))){$writer=["path",details['$[]']("path")];$send(payload,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;$writer=["object",details['$[]']("object").$to_s().$encode64()];$send(payload,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;}else{exception="You MUST specify a :path to store the data into."}}else if($truthy(details['$[]']("object")['$is_a?']($$$($$$($$$('::','GxG'),'Database'),'DetachedHash')))){if($truthy($rb_gt(details['$[]']("path").$to_s().$size(),0))){$writer=["path",details['$[]']("path")];$send(payload,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];};$writer=["uuid",details['$[]']("object").$uuid().$to_s()];$send(payload,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;format_list=[];importation_record=$hash2(["formats","records"],{"formats":$hash2([],{}),"records":[]});if($truthy($rb_gt(details['$[]']("object").$format().$to_s().$size(),0))){format_list['$<<'](details['$[]']("object").$format())};$send(details['$[]']("object"),'search',[],($$40=function(value,selector,container){var self=$$40.$$s==null?this:$$40.$$s;if(value==null){value=nil;};if(selector==null){selector=nil;};if(container==null){container=nil;};if($truthy(value['$is_a?']($$$($$$($$$('::','GxG'),'Database'),'DetachedHash')))){if($truthy($rb_gt(value.$format().$to_s().$size(),0))){format_list['$<<'](value.$format())}};if($truthy(value['$is_a?']($$$($$$($$$('::','GxG'),'Database'),'PersistedArray')))){if($truthy($rb_gt(value.$constraint().$to_s().$size(),0))){return format_list['$<<'](value.$constraint())}else{return nil}}else{return nil};},$$40.$$s=self,$$40.$$arity=3,$$40));$send(format_list,'each',[],($$41=function(the_specifier){var self=$$41.$$s==null?this:$$41.$$s,format_record=nil;if(the_specifier==null){the_specifier=nil;};format_record=$$$($$($nesting,'GxG'),'DB')['$[]']("formats")['$[]'](the_specifier.$to_s().$to_sym()).$clone();if($truthy(format_record['$is_a?']($$$('::','Hash')))){$writer=["content",format_record['$[]']("content").$gxg_export()];$send(format_record,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;$writer=[the_specifier.$to_s().$to_sym(),format_record];$send(importation_record['$[]']("formats"),'[]=',Opal.to_a($writer));return $writer[$rb_minus($writer["length"],1)];;}else{return nil};},$$41.$$s=self,$$41.$$arity=1,$$41));importation_record['$[]']("records")['$<<'](details['$[]']("object").$export());$writer=["object",importation_record];$send(payload,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;}else{exception="Invalid Data Type"};if($truthy(exception)){if($truthy(error_handler['$respond_to?']("call"))){error_handler.$call($hash2(["result","error"],{"result":nil,"error":exception}))};return false;}else{$send(self,'push_data',[$hash2(["put_object"],{"put_object":payload}),error_handler],($$42=function(data){var self=$$42.$$s==null?this:$$42.$$s;if(data==null){data=nil;};if($truthy(data['$is_a?']($$$('::','Hash')))){return the_handler.$call(data)}else{return nil};},$$42.$$s=self,$$42.$$arity=1,$$42));return true;};}else{return false};},$Connector_push_object$39.$$arity=-1);Opal.def(self,'$pull_data',$Connector_pull_data$43=function $$pull_data(the_specifier,error_handler){var $iter=$Connector_pull_data$43.$$p,the_handler=$iter||nil,$$44,self=this,$ret_or_10=nil,the_message=nil,$writer=nil;if($iter)$Connector_pull_data$43.$$p=null;if($iter)$Connector_pull_data$43.$$p=null;;if(the_specifier==null){the_specifier=$hash2([],{});};if(error_handler==null){error_handler=nil;};if($truthy((function(){if($truthy(($ret_or_10=the_specifier))){return the_handler}else{return $ret_or_10};return nil;})())){the_message=self.$new_message(the_specifier);$writer=["sender",self.uuid];$send(the_message,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;$writer=["to",self.remote_uuid];$send(the_message,'[]=',Opal.to_a($writer));$writer[$rb_minus($writer["length"],1)];;if($truthy(error_handler['$respond_to?']("call"))){$send(the_message,'on',["fail"],error_handler.$to_proc())};$send(the_message,'on',["success"],($$44=function(response){var self=$$44.$$s==null?this:$$44.$$s,data=nil,the_error=nil;if(response==null){response=nil;};if($truthy(response['$is_a?']($$$('::','Hash')))){data=nil;if($truthy(response['$[]']("result")['$is_a?']($$$('::','String')))){if($truthy(response['$[]']("result").$to_s()['$base64?']())){data=response['$[]']("result").$decode64()};if($truthy(data.$to_s()['$json?']())){try{data=$$$('::','JSON').$parse(data.$to_s(),$hash2(["symbolize_names"],{"symbolize_names":true}))}catch($err){if(Opal.rescue($err,[$$($nesting,'Exception')])){(the_error=$err) try{self.$log_error($hash2(["error","parameters"],{"error":the_error,"parameters":$hash2(["data"],{"data":data})}))}finally{Opal.pop_exception();}}else{throw $err;}};};return the_handler.$call(data);}else{return self.$log_error($hash2(["error","parameters"],{"error":$$($nesting,'Exception').$new("Malformed Response Data"),"parameters":$hash2(["data"],{"data":response['$[]']("result")})}))};}else{return nil};},$$44.$$s=self,$$44.$$arity=1,$$44));return $$$($$($nesting,'GxG'),'CONNECTION').$pull(the_message);}else{return nil};},$Connector_pull_data$43.$$arity=-1);Opal.def(self,'$pull_object',$Connector_pull_object$45=function $$pull_object(the_specifier,error_handler){var $iter=$Connector_pull_object$45.$$p,the_handler=$iter||nil,$$46,self=this,$ret_or_11=nil,op_frame=nil;if($iter)$Connector_pull_object$45.$$p=null;if($iter)$Connector_pull_object$45.$$p=null;;if(the_specifier==null){the_specifier=nil;};if(error_handler==null){error_handler=nil;};if($truthy((function(){if($truthy(($ret_or_11=the_specifier))){return the_handler}else{return $ret_or_11};return nil;})())){if($truthy($$($nesting,'GxG')['$valid_uuid?'](the_specifier.$to_s()))){op_frame=$hash2(["get_object"],{"get_object":$hash2(["uuid"],{"uuid":the_specifier})})}else{op_frame=$hash2(["get_object"],{"get_object":$hash2(["path"],{"path":the_specifier})})};$send(self,'pull_data',[op_frame,error_handler],($$46=function(data){var self=$$46.$$s==null?this:$$46.$$s;if(data==null){data=nil;};if($truthy(data['$is_a?']($$$('::','Hash')))){return the_handler.$call($$$($$$('::','GxG'),'Database').$process_detached_import(data))}else{return nil};},$$46.$$s=self,$$46.$$arity=1,$$46));return true;}else{return false};},$Connector_pull_object$45.$$arity=-1);Opal.def(self,'$load_format',$Connector_load_format$47=function $$load_format(details,error_handler){var $iter=$Connector_load_format$47.$$p,the_handler=$iter||nil,$$48,self=this,$ret_or_12=nil;if($iter)$Connector_load_format$47.$$p=null;if($iter)$Connector_load_format$47.$$p=null;;if(details==null){details=$hash2([],{});};if(error_handler==null){error_handler=nil;};if($truthy((function(){if($truthy(($ret_or_12=details))){return the_handler}else{return $ret_or_12};return nil;})())){$send(self,'pull_data',[$hash2(["get_format"],{"get_format":details}),error_handler],($$48=function(data){var self=$$48.$$s==null?this:$$48.$$s,the_error=nil;if(data==null){data=nil;};if($truthy(data['$is_a?']($$$('::','Hash')))){if($truthy(data['$[]']("result"))){if($truthy(data['$[]']("result")['$is_a?']($$$('::','String')))){if($truthy(data['$[]']("result").$to_s()['$base64?']())){data=data['$[]']("result").$decode64()};if($truthy(data.$to_s()['$json?']())){try{data=$$$('::','JSON').$parse(data.$to_s(),$hash2(["symbolize_names"],{"symbolize_names":true}));$$$($$$('::','GxG'),'Database').$process_detached_import(data);return the_handler.$call($hash2(["result"],{"result":true}));}catch($err){if(Opal.rescue($err,[$$($nesting,'Exception')])){(the_error=$err)