Built motion from commit 3594e56.|0.0.120
[motion.git] / server / config / integrations / index.js
index 91f2606..484add3 100644 (file)
@@ -1 +1 @@
-var _0xe92d=["\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"];_0xe92d[0];var _=require(_0xe92d[1]);var IntegrationModel=require(_0xe92d[3])[_0xe92d[2]];var Variable=require(_0xe92d[3])[_0xe92d[4]];var Zendesk=require(_0xe92d[5]);function Integration(_0xc6f4x6){console[_0xe92d[7]](_0xe92d[6]);var _0xc6f4x7= new Zendesk();var _0xc6f4x8=[];var _0xc6f4x9=[];var _0xc6f4xa={};_0xc6f4x6[_0xe92d[17]](_0xe92d[8],function(_0xc6f4xb){if(!_0xc6f4xa[_0xe92d[10]](_0xc6f4xb[_0xe92d[9]])){_0xc6f4xa[_0xc6f4xb[_0xe92d[9]]]=[]};if(_0xc6f4xb[_0xe92d[10]](_0xe92d[11])&&_0xc6f4xb[_0xe92d[10]](_0xe92d[12])){var _0xc6f4xc=_[_0xe92d[15]](_0xc6f4x9,{"\x6E\x61\x6D\x65":_[_0xe92d[14]](_[_0xe92d[13]](_0xc6f4xb[_0xe92d[11]]))});if(_0xc6f4xc>=0){var _0xc6f4xd={name:_[_0xe92d[14]](_[_0xe92d[13]](_0xc6f4xb[_0xe92d[11]])),value:_0xc6f4xb[_0xe92d[12]]};_0xc6f4xa[_0xc6f4xb[_0xe92d[9]]][_0xe92d[16]](_0xc6f4xd)}}});Variable[_0xe92d[19]]()[_0xe92d[18]](function(_0xc6f4xe){_0xc6f4x9=_0xc6f4xe;synchVariables(_0xc6f4x9)});IntegrationModel[_0xe92d[19]]({where:{active:1}})[_0xe92d[18]](function(_0xc6f4xf){_0xc6f4x8=_0xc6f4xf;synchIntegrations(_0xc6f4x8)});this[_0xe92d[20]]=function(_0xc6f4x10,_0xc6f4x11,_0xc6f4x12){console[_0xe92d[7]](_0xe92d[21]);if(integrationIsActive(_0xc6f4x10[_0xe92d[22]],_0xc6f4x8)){switch(_0xc6f4x10[_0xe92d[22]]){case _0xe92d[27]:_0xc6f4x7[_0xe92d[26]](_0xc6f4x10[_0xe92d[23]],_0xc6f4x10[_0xe92d[24]],_0xc6f4x12,_0xc6f4x11,_[_0xe92d[25]](_0xc6f4xa,_0xc6f4x11[_0xe92d[9]]));break;default:console[_0xe92d[7]](_0xe92d[28],_0xc6f4x10[_0xe92d[22]])}}}}function integrationIsActive(_0xc6f4x14,_0xc6f4x15){var _0xc6f4x16=_[_0xe92d[30]](_0xc6f4x15,_0xe92d[29]);if(_[_0xe92d[31]](_0xc6f4x16,_0xc6f4x14)>=0){return true};return false}function synchIntegrations(_0xc6f4x15){IntegrationModel[_0xe92d[37]](function(_0xc6f4x11){if(_0xc6f4x11[_0xe92d[32]]){updateCollection(_0xc6f4x15,_0xc6f4x11)}else {_[_0xe92d[34]](_0xc6f4x15,{id:_0xc6f4x11[_0xe92d[33]]})};console[_0xe92d[7]](_0xe92d[35],_0xc6f4x15[_0xe92d[36]])})}function synchVariables(_0xc6f4x15){Variable[_0xe92d[39]](function(_0xc6f4x11){updateCollection(_0xc6f4x15,_0xc6f4x11);console[_0xe92d[7]](_0xe92d[38],_0xc6f4x15[_0xe92d[36]])});Variable[_0xe92d[37]](function(_0xc6f4x11){updateCollection(_0xc6f4x15,_0xc6f4x11);console[_0xe92d[7]](_0xe92d[40],_0xc6f4x15[_0xe92d[36]])});Variable[_0xe92d[42]](function(_0xc6f4x11){_[_0xe92d[34]](_0xc6f4x15,{id:_0xc6f4x11[_0xe92d[33]]});console[_0xe92d[7]](_0xe92d[41],_0xc6f4x15[_0xe92d[36]])})}function updateCollection(_0xc6f4x1a,_0xc6f4x11){var _0xc6f4x1b=_[_0xe92d[43]](_0xc6f4x1a,{id:_0xc6f4x11[_0xe92d[33]]});var _0xc6f4xc=_0xc6f4x1a[_0xe92d[31]](_0xc6f4x1b);if(_0xc6f4x1b){_[_0xe92d[44]](_0xc6f4x1a[_0xc6f4xc],_0xc6f4x11)}else {_0xc6f4x1a[_0xe92d[45]](_0xc6f4x11)}}module[_0xe92d[46]]=Integration
\ No newline at end of file
+var _0xd155=["\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"];_0xd155[0];var _=require(_0xd155[1]);var IntegrationModel=require(_0xd155[3])[_0xd155[2]];var Variable=require(_0xd155[3])[_0xd155[4]];var Zendesk=require(_0xd155[5]);var Salesforce=require(_0xd155[6]);var Motionbar=require(_0xd155[7]);var MAX_CALLS=200;function Integration(_0xedbax9){console[_0xd155[9]](_0xd155[8]);var _0xedbaxa= new Zendesk();var _0xedbaxb= new Salesforce();var _0xedbaxc= new Motionbar();var _0xedbaxd=[];var _0xedbaxe=[];var _0xedbaxf=[];_0xedbax9[_0xd155[24]](_0xd155[10],function(_0xedbax10){if(_0xedbax10[_0xd155[12]](_0xd155[11])&& _0xedbax10[_0xd155[12]](_0xd155[13])){var _0xedbax11=_[_0xd155[18]](_0xedbaxe,function(_0xedbax12){return (_0xedbax12[_0xd155[14]]=== _[_0xd155[16]](_[_0xd155[15]](_0xedbax10[_0xd155[11]])))|| (_[_0xd155[17]](_0xedbax12[_0xd155[14]])=== _[_0xd155[16]](_[_0xd155[15]](_0xedbax10[_0xd155[11]])))});if(_0xedbax11){var _0xedbax13=_[_0xd155[18]](_0xedbaxf,function(_0xedbax12){return _0xedbax12[_0xd155[19]]=== _0xedbax10[_0xd155[19]]});if(_0xedbax13){_0xedbax13[_0xd155[21]][_0xd155[20]]({name:_0xedbax11[_0xd155[14]],value:_0xedbax10[_0xd155[13]]})}else {if(_0xedbaxf[_0xd155[22]]>= MAX_CALLS){_0xedbaxf[_0xd155[23]]()};var _0xedbax14={uniqueid:_0xedbax10[_0xd155[19]],variables:[{name:_0xedbax11[_0xd155[14]],value:_0xedbax10[_0xd155[13]]}]};_0xedbaxf[_0xd155[20]](_0xedbax14)}}}});Variable[_0xd155[26]]()[_0xd155[25]](function(_0xedbax15){_0xedbaxe= _0xedbax15;synchVariables(_0xedbaxe)});IntegrationModel[_0xd155[26]]({where:{active:1}})[_0xd155[25]](function(_0xedbax16){_0xedbaxd= _0xedbax16;synchIntegrations(_0xedbaxd)});this[_0xd155[27]]= function(_0xedbax17,_0xedbax18,_0xedbax19){var _0xedbax13=_[_0xd155[18]](_0xedbaxf,function(_0xedbax12){return _0xedbax12[_0xd155[19]]=== _0xedbax18[_0xd155[19]]});var _0xedbax15=_0xedbax13?_0xedbax13[_0xd155[21]]:[];if(integrationIsActive(_0xedbax17[_0xd155[28]],_0xedbaxd)){switch(_0xedbax17[_0xd155[28]]){case _0xd155[32]:_0xedbaxa[_0xd155[31]](_0xedbax17[_0xd155[29]],_0xedbax17[_0xd155[30]],_0xedbax19,_0xedbax18,_0xedbax15,_0xedbax18[_0xd155[19]]);break;case _0xd155[33]:_0xedbaxb[_0xd155[31]](_0xedbax17[_0xd155[29]],_0xedbax17[_0xd155[30]],_0xedbax19,_0xedbax18,_0xedbax15,_0xedbax18[_0xd155[19]]);break;default:console[_0xd155[9]](_0xd155[34],_0xedbax17[_0xd155[28]])}};if(_0xedbax17[_0xd155[35]]=== _0xd155[36]){_0xedbaxc[_0xd155[31]](_0xedbax17,_0xedbax19,_0xedbax18,_0xedbax15,_0xedbax18[_0xd155[19]])}}}function integrationIsActive(_0xedbax1b,_0xedbax1c){var _0xedbax1d=_[_0xd155[38]](_0xedbax1c,_0xd155[37]);if(_[_0xd155[39]](_0xedbax1d,_0xedbax1b)>= 0){return true};return false}function synchIntegrations(_0xedbax1c){IntegrationModel[_0xd155[44]](function(_0xedbax18){if(_0xedbax18[_0xd155[40]]){updateCollection(_0xedbax1c,_0xedbax18)}else {_[_0xd155[42]](_0xedbax1c,{id:_0xedbax18[_0xd155[41]]})};console[_0xd155[9]](_0xd155[43],_0xedbax1c[_0xd155[22]])})}function synchVariables(_0xedbax1c){Variable[_0xd155[46]](function(_0xedbax18){updateCollection(_0xedbax1c,_0xedbax18);console[_0xd155[9]](_0xd155[45],_0xedbax1c[_0xd155[22]])});Variable[_0xd155[44]](function(_0xedbax18){updateCollection(_0xedbax1c,_0xedbax18);console[_0xd155[9]](_0xd155[47],_0xedbax1c[_0xd155[22]])});Variable[_0xd155[49]](function(_0xedbax18){_[_0xd155[42]](_0xedbax1c,{id:_0xedbax18[_0xd155[41]]});console[_0xd155[9]](_0xd155[48],_0xedbax1c[_0xd155[22]])})}function updateCollection(_0xedbax21,_0xedbax18){var _0xedbax22=_[_0xd155[18]](_0xedbax21,{id:_0xedbax18[_0xd155[41]]});var _0xedbax23=_0xedbax21[_0xd155[39]](_0xedbax22);if(_0xedbax22){_[_0xd155[50]](_0xedbax21[_0xedbax23],_0xedbax18)}else {_0xedbax21[_0xd155[51]](_0xedbax18)}}module[_0xd155[52]]= Integration
\ No newline at end of file