Built motion from commit 8d1370ff4.|1.0.34
[motion.git] / server / config / integrations / index.js
index 82a8ce6..6c247ed 100644 (file)
@@ -1 +1 @@
-var _0xdfef=["\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","\x2E\x2F\x73\x61\x6C\x65\x73\x66\x6F\x72\x63\x65","\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","\x76\x61\x72\x73\x65\x74","\x76\x61\x72\x69\x61\x62\x6C\x65","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x76\x61\x6C\x75\x65","\x6E\x61\x6D\x65","\x6B\x65\x79\x73","\x68\x65\x61\x64","\x74\x6F\x4C\x6F\x77\x65\x72","\x66\x69\x6E\x64","\x75\x6E\x69\x71\x75\x65\x69\x64","\x70\x75\x73\x68","\x76\x61\x72\x69\x61\x62\x6C\x65\x73","\x6C\x65\x6E\x67\x74\x68","\x73\x68\x69\x66\x74","\x6F\x6E","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6C\x6C","\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","\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","\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","\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","\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","\x6D\x65\x72\x67\x65","\x75\x6E\x73\x68\x69\x66\x74","\x65\x78\x70\x6F\x72\x74\x73"];_0xdfef[0];var _=require(_0xdfef[1]);var IntegrationModel=require(_0xdfef[3])[_0xdfef[2]];var Variable=require(_0xdfef[3])[_0xdfef[4]];var Zendesk=require(_0xdfef[5]);var Salesforce=require(_0xdfef[6]);var Motionbar=require(_0xdfef[7]);var MAX_CALLS=200;function Integration(_0x74dex9){console[_0xdfef[9]](_0xdfef[8]);var _0x74dexa= new Zendesk();var _0x74dexb= new Salesforce();var _0x74dexc= new Motionbar();var _0x74dexd=[];var _0x74dexe=[];var _0x74dexf=[];_0x74dex9[_0xdfef[24]](_0xdfef[10],function(_0x74dex10){if(_0x74dex10[_0xdfef[12]](_0xdfef[11])&& _0x74dex10[_0xdfef[12]](_0xdfef[13])){var _0x74dex11=_[_0xdfef[18]](_0x74dexe,function(_0x74dex12){return (_0x74dex12[_0xdfef[14]]=== _[_0xdfef[16]](_[_0xdfef[15]](_0x74dex10[_0xdfef[11]])))|| (_[_0xdfef[17]](_0x74dex12[_0xdfef[14]])=== _[_0xdfef[16]](_[_0xdfef[15]](_0x74dex10[_0xdfef[11]])))});if(_0x74dex11){var _0x74dex13=_[_0xdfef[18]](_0x74dexf,function(_0x74dex12){return _0x74dex12[_0xdfef[19]]=== _0x74dex10[_0xdfef[19]]});if(_0x74dex13){_0x74dex13[_0xdfef[21]][_0xdfef[20]]({name:_0x74dex11[_0xdfef[14]],value:_0x74dex10[_0xdfef[13]]})}else {if(_0x74dexf[_0xdfef[22]]>= MAX_CALLS){_0x74dexf[_0xdfef[23]]()};var _0x74dex14={uniqueid:_0x74dex10[_0xdfef[19]],variables:[{name:_0x74dex11[_0xdfef[14]],value:_0x74dex10[_0xdfef[13]]}]};_0x74dexf[_0xdfef[20]](_0x74dex14)}}}});Variable[_0xdfef[26]]()[_0xdfef[25]](function(_0x74dex15){_0x74dexe= _0x74dex15;synchVariables(_0x74dexe)});IntegrationModel[_0xdfef[26]]({where:{active:1}})[_0xdfef[25]](function(_0x74dex16){_0x74dexd= _0x74dex16;synchIntegrations(_0x74dexd)});this[_0xdfef[27]]= function(_0x74dex17,_0x74dex18,_0x74dex19){var _0x74dex13=_[_0xdfef[18]](_0x74dexf,function(_0x74dex12){return _0x74dex12[_0xdfef[19]]=== _0x74dex18[_0xdfef[19]]});var _0x74dex15=_0x74dex13?_0x74dex13[_0xdfef[21]]:[];if(integrationIsActive(_0x74dex17[_0xdfef[28]],_0x74dexd)){switch(_0x74dex17[_0xdfef[28]]){case _0xdfef[32]:_0x74dexa[_0xdfef[31]](_0x74dex17[_0xdfef[29]],_0x74dex17[_0xdfef[30]],_0x74dex19,_0x74dex18,_0x74dex15,_0x74dex18[_0xdfef[19]]);break;case _0xdfef[33]:_0x74dexb[_0xdfef[31]](_0x74dex17[_0xdfef[29]],_0x74dex17[_0xdfef[30]],_0x74dex19,_0x74dex18,_0x74dex15,_0x74dex18[_0xdfef[19]]);break;default:console[_0xdfef[9]](_0xdfef[34],_0x74dex17[_0xdfef[28]])}};if(_0x74dex17[_0xdfef[35]]=== _0xdfef[36]){_0x74dexc[_0xdfef[31]](_0x74dex17,_0x74dex19,_0x74dex18,_0x74dex15,_0x74dex18[_0xdfef[19]])}}}function integrationIsActive(_0x74dex1b,_0x74dex1c){var _0x74dex1d=_[_0xdfef[38]](_0x74dex1c,_0xdfef[37]);if(_[_0xdfef[39]](_0x74dex1d,_0x74dex1b)>= 0){return true};return false}function synchIntegrations(_0x74dex1c){IntegrationModel[_0xdfef[44]](function(_0x74dex18){if(_0x74dex18[_0xdfef[40]]){updateCollection(_0x74dex1c,_0x74dex18)}else {_[_0xdfef[42]](_0x74dex1c,{id:_0x74dex18[_0xdfef[41]]})};console[_0xdfef[9]](_0xdfef[43],_0x74dex1c[_0xdfef[22]])})}function synchVariables(_0x74dex1c){Variable[_0xdfef[46]](function(_0x74dex18){updateCollection(_0x74dex1c,_0x74dex18);console[_0xdfef[9]](_0xdfef[45],_0x74dex1c[_0xdfef[22]])});Variable[_0xdfef[44]](function(_0x74dex18){updateCollection(_0x74dex1c,_0x74dex18);console[_0xdfef[9]](_0xdfef[47],_0x74dex1c[_0xdfef[22]])});Variable[_0xdfef[49]](function(_0x74dex18){_[_0xdfef[42]](_0x74dex1c,{id:_0x74dex18[_0xdfef[41]]});console[_0xdfef[9]](_0xdfef[48],_0x74dex1c[_0xdfef[22]])})}function updateCollection(_0x74dex21,_0x74dex18){var _0x74dex22=_[_0xdfef[18]](_0x74dex21,{id:_0x74dex18[_0xdfef[41]]});var _0x74dex23=_0x74dex21[_0xdfef[39]](_0x74dex22);if(_0x74dex22){_[_0xdfef[50]](_0x74dex21[_0x74dex23],_0x74dex18)}else {_0x74dex21[_0xdfef[51]](_0x74dex18)}}module[_0xdfef[52]]= Integration
\ No newline at end of file
+var _0x456a=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\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","\x69\x6E\x66\x6F","\x6D\x61\x6E\x61\x67\x65\x45\x76\x65\x6E\x74","\x61\x63\x74\x69\x6F\x6E","\x6D\x6F\x74\x69\x6F\x6E\x62\x61\x72","\x68\x61\x6E\x64\x6C\x65\x45\x76\x65\x6E\x74","\x64\x61\x74\x61\x31","\x64\x61\x74\x61\x32","\x64\x61\x74\x61\x33","\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","\x65\x72\x72\x6F\x72","\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","\x77\x61\x72\x6E","\x73\x74\x61\x74\x65","\x6D\x61\x70","\x69\x6E\x64\x65\x78\x4F\x66","\x65\x78\x70\x6F\x72\x74\x73"];_0x456a[0];var _=require(_0x456a[1]);var util=require(_0x456a[2]);var logger=require(_0x456a[4])(_0x456a[3]);var IntegrationModel=require(_0x456a[6])[_0x456a[5]];var Variable=require(_0x456a[6])[_0x456a[7]];var Zendesk=require(_0x456a[8]);var Salesforce=require(_0x456a[9]);var Sugarcrm=require(_0x456a[10]);var Freshdesk=require(_0x456a[11]);var Motionbar=require(_0x456a[12]);function Integration(){logger[_0x456a[14]](_0x456a[13]);var _0x979cxc= new Zendesk();var _0x979cxd= new Salesforce();var _0x979cxe= new Sugarcrm();var _0x979cxf= new Freshdesk();var _0x979cx10= new Motionbar();this[_0x456a[15]]= function(_0x979cx11,_0x979cx12,_0x979cx13,_0x979cx14,_0x979cx15,_0x979cx16,_0x979cx17){if(_0x979cx11[_0x456a[16]]=== _0x456a[17]){_0x979cx10[_0x456a[18]](_0x979cx11,_0x979cx13,_0x979cx12,_0x979cx15,_0x979cx16)}else {if(integrationIsActive(_0x979cx11[_0x456a[19]],_0x979cx17)){switch(_0x979cx11[_0x456a[19]]){case _0x456a[22]:_0x979cxc[_0x456a[18]](_0x979cx11[_0x456a[20]],_0x979cx11[_0x456a[21]],_0x979cx13,_0x979cx14,_0x979cx12,_0x979cx15,_0x979cx16);break;case _0x456a[23]:_0x979cxd[_0x456a[18]](_0x979cx11[_0x456a[20]],_0x979cx11[_0x456a[21]],_0x979cx13,_0x979cx14,_0x979cx12,_0x979cx15,_0x979cx16);break;case _0x456a[24]:_0x979cxe[_0x456a[18]](_0x979cx11[_0x456a[20]],_0x979cx11[_0x456a[21]],_0x979cx13,_0x979cx14,_0x979cx12,_0x979cx15,_0x979cx16);break;case _0x456a[25]:_0x979cxf[_0x456a[18]](_0x979cx11[_0x456a[20]],_0x979cx11[_0x456a[21]],_0x979cx13,_0x979cx14,_0x979cx12,_0x979cx15,_0x979cx16);break;default:logger[_0x456a[27]](_0x456a[26],_0x979cx11[_0x456a[19]])}}else {logger[_0x456a[30]](util[_0x456a[29]](_0x456a[28],_0x979cx11[_0x456a[19]]))}}}}function integrationIsActive(_0x979cx19,_0x979cx1a){var _0x979cx1b=_[_0x456a[32]](_0x979cx1a,_0x456a[31]);if(_[_0x456a[33]](_0x979cx1b,_0x979cx19)>= 0){return true};return false}module[_0x456a[34]]= Integration
\ No newline at end of file