Built motion from commit 27e0a5d.|1.0.8
[motion.git] / server / config / integrations / index.js
index 1c145e3..16b4afc 100644 (file)
@@ -1 +1 @@
-var _0x842e=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x61\x72\x69\x61\x62\x6C\x65","\x2E\x2F\x7A\x65\x6E\x64\x65\x73\x6B","\x54\x72\x69\x67\x67\x65\x72\x20\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x76\x61\x72\x73\x65\x74","\x75\x6E\x69\x71\x75\x65\x69\x64","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x76\x61\x72\x69\x61\x62\x6C\x65","\x76\x61\x6C\x75\x65","\x6B\x65\x79\x73","\x68\x65\x61\x64","\x66\x69\x6E\x64\x49\x6E\x64\x65\x78","\x70\x75\x73\x68","\x6F\x6E","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6C\x6C","\x6D\x61\x6E\x61\x67\x65\x45\x76\x65\x6E\x74","\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x3A\x20\x6D\x61\x6E\x61\x67\x65\x45\x76\x65\x6E\x74","\x64\x61\x74\x61\x31","\x64\x61\x74\x61\x32","\x64\x61\x74\x61\x33","\x72\x65\x73\x75\x6C\x74","\x68\x61\x6E\x64\x6C\x65\x45\x76\x65\x6E\x74","\x7A\x65\x6E\x64\x65\x73\x6B","\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x6E\x6F\x74\x20\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x64\x3A\x20","\x73\x74\x61\x74\x65","\x6D\x61\x70","\x69\x6E\x64\x65\x78\x4F\x66","\x61\x63\x74\x69\x76\x65","\x69\x64","\x72\x65\x6D\x6F\x76\x65","\x41\x66\x74\x65\x72\x20\x75\x70\x64\x61\x74\x65\x2C\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x73\x20\x61\x72\x65\x20","\x6C\x65\x6E\x67\x74\x68","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x41\x66\x74\x65\x72\x20\x63\x72\x65\x61\x74\x65\x2C\x20\x56\x61\x72\x69\x61\x62\x6C\x65\x73\x20\x61\x72\x65\x20","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x41\x66\x74\x65\x72\x20\x75\x70\x64\x61\x74\x65\x2C\x20\x56\x61\x72\x69\x61\x62\x6C\x65\x73\x20\x61\x72\x65\x20","\x41\x66\x74\x65\x72\x20\x64\x65\x73\x74\x72\x6F\x79\x2C\x20\x56\x61\x72\x69\x61\x62\x6C\x65\x73\x20\x61\x72\x65\x20","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x66\x69\x6E\x64","\x6D\x65\x72\x67\x65","\x75\x6E\x73\x68\x69\x66\x74","\x65\x78\x70\x6F\x72\x74\x73"];_0x842e[0];var _=require(_0x842e[1]);var IntegrationModel=require(_0x842e[3])[_0x842e[2]];var Variable=require(_0x842e[3])[_0x842e[4]];var Zendesk=require(_0x842e[5]);function Integration(_0x5096x6){console[_0x842e[7]](_0x842e[6]);var _0x5096x7= new Zendesk();var _0x5096x8=[];var _0x5096x9=[];var _0x5096xa={};_0x5096x6[_0x842e[17]](_0x842e[8],function(_0x5096xb){if(!_0x5096xa[_0x842e[10]](_0x5096xb[_0x842e[9]])){_0x5096xa[_0x5096xb[_0x842e[9]]]=[]};if(_0x5096xb[_0x842e[10]](_0x842e[11])&&_0x5096xb[_0x842e[10]](_0x842e[12])){var _0x5096xc=_[_0x842e[15]](_0x5096x9,{"\x6E\x61\x6D\x65":_[_0x842e[14]](_[_0x842e[13]](_0x5096xb[_0x842e[11]]))});if(_0x5096xc>=0){var _0x5096xd={name:_[_0x842e[14]](_[_0x842e[13]](_0x5096xb[_0x842e[11]])),value:_0x5096xb[_0x842e[12]]};_0x5096xa[_0x5096xb[_0x842e[9]]][_0x842e[16]](_0x5096xd)}}});Variable[_0x842e[19]]()[_0x842e[18]](function(_0x5096xe){_0x5096x9=_0x5096xe;synchVariables(_0x5096x9)});IntegrationModel[_0x842e[19]]({where:{active:1}})[_0x842e[18]](function(_0x5096xf){_0x5096x8=_0x5096xf;synchIntegrations(_0x5096x8)});this[_0x842e[20]]=function(_0x5096x10,_0x5096x11,_0x5096x12){console[_0x842e[7]](_0x842e[21]);if(integrationIsActive(_0x5096x10[_0x842e[22]],_0x5096x8)){switch(_0x5096x10[_0x842e[22]]){case _0x842e[27]:_0x5096x7[_0x842e[26]](_0x5096x10[_0x842e[23]],_0x5096x10[_0x842e[24]],_0x5096x12,_0x5096x11,_[_0x842e[25]](_0x5096xa,_0x5096x11[_0x842e[9]]));break;default:console[_0x842e[7]](_0x842e[28],_0x5096x10[_0x842e[22]])}}}}function integrationIsActive(_0x5096x14,_0x5096x15){var _0x5096x16=_[_0x842e[30]](_0x5096x15,_0x842e[29]);if(_[_0x842e[31]](_0x5096x16,_0x5096x14)>=0){return true};return false}function synchIntegrations(_0x5096x15){IntegrationModel[_0x842e[37]](function(_0x5096x11){if(_0x5096x11[_0x842e[32]]){updateCollection(_0x5096x15,_0x5096x11)}else {_[_0x842e[34]](_0x5096x15,{id:_0x5096x11[_0x842e[33]]})};console[_0x842e[7]](_0x842e[35],_0x5096x15[_0x842e[36]])})}function synchVariables(_0x5096x15){Variable[_0x842e[39]](function(_0x5096x11){updateCollection(_0x5096x15,_0x5096x11);console[_0x842e[7]](_0x842e[38],_0x5096x15[_0x842e[36]])});Variable[_0x842e[37]](function(_0x5096x11){updateCollection(_0x5096x15,_0x5096x11);console[_0x842e[7]](_0x842e[40],_0x5096x15[_0x842e[36]])});Variable[_0x842e[42]](function(_0x5096x11){_[_0x842e[34]](_0x5096x15,{id:_0x5096x11[_0x842e[33]]});console[_0x842e[7]](_0x842e[41],_0x5096x15[_0x842e[36]])})}function updateCollection(_0x5096x1a,_0x5096x11){var _0x5096x1b=_[_0x842e[43]](_0x5096x1a,{id:_0x5096x11[_0x842e[33]]});var _0x5096xc=_0x5096x1a[_0x842e[31]](_0x5096x1b);if(_0x5096x1b){_[_0x842e[44]](_0x5096x1a[_0x5096xc],_0x5096x11)}else {_0x5096x1a[_0x842e[45]](_0x5096x11)}}module[_0x842e[46]]=Integration
\ No newline at end of file
+var _0xad79=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x61\x72\x69\x61\x62\x6C\x65","\x2E\x2F\x7A\x65\x6E\x64\x65\x73\x6B","\x2E\x2F\x73\x61\x6C\x65\x73\x66\x6F\x72\x63\x65","\x2E\x2F\x73\x75\x67\x61\x72\x63\x72\x6D","\x2E\x2F\x66\x72\x65\x73\x68\x64\x65\x73\x6B","\x2E\x2F\x6D\x6F\x74\x69\x6F\x6E\x62\x61\x72","\x54\x72\x69\x67\x67\x65\x72\x20\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x6D\x61\x6E\x61\x67\x65\x45\x76\x65\x6E\x74","\x64\x61\x74\x61\x31","\x64\x61\x74\x61\x32","\x64\x61\x74\x61\x33","\x68\x61\x6E\x64\x6C\x65\x45\x76\x65\x6E\x74","\x7A\x65\x6E\x64\x65\x73\x6B","\x73\x61\x6C\x65\x73\x66\x6F\x72\x63\x65","\x73\x75\x67\x61\x72\x63\x72\x6D","\x66\x72\x65\x73\x68\x64\x65\x73\x6B","\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x6E\x6F\x74\x20\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x64\x3A\x20","\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x25\x73\x20\x6E\x6F\x74\x20\x61\x63\x74\x69\x76\x65\x20\x69\x6E\x20\x79\x6F\x75\x72\x20\x73\x65\x72\x76\x65\x72\x21","\x66\x6F\x72\x6D\x61\x74","\x61\x63\x74\x69\x6F\x6E","\x6D\x6F\x74\x69\x6F\x6E\x62\x61\x72","\x73\x74\x61\x74\x65","\x6D\x61\x70","\x69\x6E\x64\x65\x78\x4F\x66","\x65\x78\x70\x6F\x72\x74\x73"];_0xad79[0];var _=require(_0xad79[1]);var util=require(_0xad79[2]);var IntegrationModel=require(_0xad79[4])[_0xad79[3]];var Variable=require(_0xad79[4])[_0xad79[5]];var Zendesk=require(_0xad79[6]);var Salesforce=require(_0xad79[7]);var Sugarcrm=require(_0xad79[8]);var Freshdesk=require(_0xad79[9]);var Motionbar=require(_0xad79[10]);function Integration(){console[_0xad79[12]](_0xad79[11]);var _0x8f60xb= new Zendesk();var _0x8f60xc= new Salesforce();var _0x8f60xd= new Sugarcrm();var _0x8f60xe= new Freshdesk();var _0x8f60xf= new Motionbar();this[_0xad79[13]]= function(_0x8f60x10,_0x8f60x11,_0x8f60x12,_0x8f60x13,_0x8f60x14,_0x8f60x15,_0x8f60x16){if(integrationIsActive(_0x8f60x10[_0xad79[14]],_0x8f60x16)){switch(_0x8f60x10[_0xad79[14]]){case _0xad79[18]:_0x8f60xb[_0xad79[17]](_0x8f60x10[_0xad79[15]],_0x8f60x10[_0xad79[16]],_0x8f60x12,_0x8f60x13,_0x8f60x11,_0x8f60x14);break;case _0xad79[19]:_0x8f60xc[_0xad79[17]](_0x8f60x10[_0xad79[15]],_0x8f60x10[_0xad79[16]],_0x8f60x12,_0x8f60x13,_0x8f60x11,_0x8f60x14,_0x8f60x15);break;case _0xad79[20]:_0x8f60xd[_0xad79[17]](_0x8f60x10[_0xad79[15]],_0x8f60x10[_0xad79[16]],_0x8f60x12,_0x8f60x13,_0x8f60x11,_0x8f60x14,_0x8f60x15);break;case _0xad79[21]:_0x8f60xe[_0xad79[17]](_0x8f60x10[_0xad79[15]],_0x8f60x10[_0xad79[16]],_0x8f60x12,_0x8f60x13,_0x8f60x11,_0x8f60x14,_0x8f60x15);break;default:console[_0xad79[12]](_0xad79[22],_0x8f60x10[_0xad79[14]])}}else {console[_0xad79[12]](util[_0xad79[24]](_0xad79[23],_0x8f60x10[_0xad79[14]]))};if(_0x8f60x10[_0xad79[25]]=== _0xad79[26]){_0x8f60xf[_0xad79[17]](_0x8f60x10,_0x8f60x12,_0x8f60x11,_0x8f60x14,_0x8f60x15)}}}function integrationIsActive(_0x8f60x18,_0x8f60x19){var _0x8f60x1a=_[_0xad79[28]](_0x8f60x19,_0xad79[27]);if(_[_0xad79[29]](_0x8f60x1a,_0x8f60x18)>= 0){return true};return false}module[_0xad79[30]]= Integration
\ No newline at end of file