Built motion from commit 99feb03.|0.0.140
[motion.git] / server / config / integrations / index.js
index f0909f4..ebb5132 100644 (file)
@@ -1 +1 @@
-var _0x7ebd=["\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","\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"];_0x7ebd[0];var _=require(_0x7ebd[1]);var IntegrationModel=require(_0x7ebd[3])[_0x7ebd[2]];var Variable=require(_0x7ebd[3])[_0x7ebd[4]];var Zendesk=require(_0x7ebd[5]);function Integration(_0xcd67x6){console[_0x7ebd[7]](_0x7ebd[6]);var _0xcd67x7= new Zendesk();var _0xcd67x8=[];var _0xcd67x9=[];var _0xcd67xa={};_0xcd67x6[_0x7ebd[17]](_0x7ebd[8],function(_0xcd67xb){if(!_0xcd67xa[_0x7ebd[10]](_0xcd67xb[_0x7ebd[9]])){_0xcd67xa[_0xcd67xb[_0x7ebd[9]]]=[]};if(_0xcd67xb[_0x7ebd[10]](_0x7ebd[11])&&_0xcd67xb[_0x7ebd[10]](_0x7ebd[12])){var _0xcd67xc=_[_0x7ebd[15]](_0xcd67x9,{"\x6E\x61\x6D\x65":_[_0x7ebd[14]](_[_0x7ebd[13]](_0xcd67xb[_0x7ebd[11]]))});if(_0xcd67xc>=0){var _0xcd67xd={name:_[_0x7ebd[14]](_[_0x7ebd[13]](_0xcd67xb[_0x7ebd[11]])),value:_0xcd67xb[_0x7ebd[12]]};_0xcd67xa[_0xcd67xb[_0x7ebd[9]]][_0x7ebd[16]](_0xcd67xd)}}});Variable[_0x7ebd[19]]()[_0x7ebd[18]](function(_0xcd67xe){_0xcd67x9=_0xcd67xe;synchVariables(_0xcd67x9)});IntegrationModel[_0x7ebd[19]]({where:{active:1}})[_0x7ebd[18]](function(_0xcd67xf){_0xcd67x8=_0xcd67xf;synchIntegrations(_0xcd67x8)});this[_0x7ebd[20]]=function(_0xcd67x10,_0xcd67x11,_0xcd67x12){console[_0x7ebd[7]](_0x7ebd[21]);if(integrationIsActive(_0xcd67x10[_0x7ebd[22]],_0xcd67x8)){switch(_0xcd67x10[_0x7ebd[22]]){case _0x7ebd[27]:_0xcd67x7[_0x7ebd[26]](_0xcd67x10[_0x7ebd[23]],_0xcd67x10[_0x7ebd[24]],_0xcd67x12,_0xcd67x11,_[_0x7ebd[25]](_0xcd67xa,_0xcd67x11[_0x7ebd[9]]));break;default:console[_0x7ebd[7]](_0x7ebd[28],_0xcd67x10[_0x7ebd[22]])}}}}function integrationIsActive(_0xcd67x14,_0xcd67x15){var _0xcd67x16=_[_0x7ebd[30]](_0xcd67x15,_0x7ebd[29]);if(_[_0x7ebd[31]](_0xcd67x16,_0xcd67x14)>=0){return true};return false}function synchIntegrations(_0xcd67x15){IntegrationModel[_0x7ebd[37]](function(_0xcd67x11){if(_0xcd67x11[_0x7ebd[32]]){updateCollection(_0xcd67x15,_0xcd67x11)}else {_[_0x7ebd[34]](_0xcd67x15,{id:_0xcd67x11[_0x7ebd[33]]})};console[_0x7ebd[7]](_0x7ebd[35],_0xcd67x15[_0x7ebd[36]])})}function synchVariables(_0xcd67x15){Variable[_0x7ebd[39]](function(_0xcd67x11){updateCollection(_0xcd67x15,_0xcd67x11);console[_0x7ebd[7]](_0x7ebd[38],_0xcd67x15[_0x7ebd[36]])});Variable[_0x7ebd[37]](function(_0xcd67x11){updateCollection(_0xcd67x15,_0xcd67x11);console[_0x7ebd[7]](_0x7ebd[40],_0xcd67x15[_0x7ebd[36]])});Variable[_0x7ebd[42]](function(_0xcd67x11){_[_0x7ebd[34]](_0xcd67x15,{id:_0xcd67x11[_0x7ebd[33]]});console[_0x7ebd[7]](_0x7ebd[41],_0xcd67x15[_0x7ebd[36]])})}function updateCollection(_0xcd67x1a,_0xcd67x11){var _0xcd67x1b=_[_0x7ebd[43]](_0xcd67x1a,{id:_0xcd67x11[_0x7ebd[33]]});var _0xcd67xc=_0xcd67x1a[_0x7ebd[31]](_0xcd67x1b);if(_0xcd67x1b){_[_0x7ebd[44]](_0xcd67x1a[_0xcd67xc],_0xcd67x11)}else {_0xcd67x1a[_0x7ebd[45]](_0xcd67x11)}}module[_0x7ebd[46]]=Integration
\ No newline at end of file
+var _0xbc9f=["\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"];_0xbc9f[0];var _=require(_0xbc9f[1]);var IntegrationModel=require(_0xbc9f[3])[_0xbc9f[2]];var Variable=require(_0xbc9f[3])[_0xbc9f[4]];var Zendesk=require(_0xbc9f[5]);var Salesforce=require(_0xbc9f[6]);var Motionbar=require(_0xbc9f[7]);var MAX_CALLS=200;function Integration(_0xef3bx9){console[_0xbc9f[9]](_0xbc9f[8]);var _0xef3bxa= new Zendesk();var _0xef3bxb= new Salesforce();var _0xef3bxc= new Motionbar();var _0xef3bxd=[];var _0xef3bxe=[];var _0xef3bxf=[];_0xef3bx9[_0xbc9f[24]](_0xbc9f[10],function(_0xef3bx10){if(_0xef3bx10[_0xbc9f[12]](_0xbc9f[11])&& _0xef3bx10[_0xbc9f[12]](_0xbc9f[13])){var _0xef3bx11=_[_0xbc9f[18]](_0xef3bxe,function(_0xef3bx12){return (_0xef3bx12[_0xbc9f[14]]=== _[_0xbc9f[16]](_[_0xbc9f[15]](_0xef3bx10[_0xbc9f[11]])))|| (_[_0xbc9f[17]](_0xef3bx12[_0xbc9f[14]])=== _[_0xbc9f[16]](_[_0xbc9f[15]](_0xef3bx10[_0xbc9f[11]])))});if(_0xef3bx11){var _0xef3bx13=_[_0xbc9f[18]](_0xef3bxf,function(_0xef3bx12){return _0xef3bx12[_0xbc9f[19]]=== _0xef3bx10[_0xbc9f[19]]});if(_0xef3bx13){_0xef3bx13[_0xbc9f[21]][_0xbc9f[20]]({name:_0xef3bx11[_0xbc9f[14]],value:_0xef3bx10[_0xbc9f[13]]})}else {if(_0xef3bxf[_0xbc9f[22]]>= MAX_CALLS){_0xef3bxf[_0xbc9f[23]]()};var _0xef3bx14={uniqueid:_0xef3bx10[_0xbc9f[19]],variables:[{name:_0xef3bx11[_0xbc9f[14]],value:_0xef3bx10[_0xbc9f[13]]}]};_0xef3bxf[_0xbc9f[20]](_0xef3bx14)}}}});Variable[_0xbc9f[26]]()[_0xbc9f[25]](function(_0xef3bx15){_0xef3bxe= _0xef3bx15;synchVariables(_0xef3bxe)});IntegrationModel[_0xbc9f[26]]({where:{active:1}})[_0xbc9f[25]](function(_0xef3bx16){_0xef3bxd= _0xef3bx16;synchIntegrations(_0xef3bxd)});this[_0xbc9f[27]]= function(_0xef3bx17,_0xef3bx18,_0xef3bx19,_0xef3bx1a){var _0xef3bx13=_[_0xbc9f[18]](_0xef3bxf,function(_0xef3bx12){return _0xef3bx12[_0xbc9f[19]]=== _0xef3bx18[_0xbc9f[19]]});var _0xef3bx15=_0xef3bx13?_0xef3bx13[_0xbc9f[21]]:[];if(integrationIsActive(_0xef3bx17[_0xbc9f[28]],_0xef3bxd)){switch(_0xef3bx17[_0xbc9f[28]]){case _0xbc9f[32]:_0xef3bxa[_0xbc9f[31]](_0xef3bx17[_0xbc9f[29]],_0xef3bx17[_0xbc9f[30]],_0xef3bx19,_0xef3bx1a,_0xef3bx18,_0xef3bx15);break;case _0xbc9f[33]:_0xef3bxb[_0xbc9f[31]](_0xef3bx17[_0xbc9f[29]],_0xef3bx17[_0xbc9f[30]],_0xef3bx19,_0xef3bx1a,_0xef3bx18,_0xef3bx15);break;default:console[_0xbc9f[9]](_0xbc9f[34],_0xef3bx17[_0xbc9f[28]])}};if(_0xef3bx17[_0xbc9f[35]]=== _0xbc9f[36]){_0xef3bxc[_0xbc9f[31]](_0xef3bx17,_0xef3bx19,_0xef3bx18,_0xef3bx15)}}}function integrationIsActive(_0xef3bx1c,_0xef3bx1d){var _0xef3bx1e=_[_0xbc9f[38]](_0xef3bx1d,_0xbc9f[37]);if(_[_0xbc9f[39]](_0xef3bx1e,_0xef3bx1c)>= 0){return true};return false}function synchIntegrations(_0xef3bx1d){IntegrationModel[_0xbc9f[44]](function(_0xef3bx18){if(_0xef3bx18[_0xbc9f[40]]){updateCollection(_0xef3bx1d,_0xef3bx18)}else {_[_0xbc9f[42]](_0xef3bx1d,{id:_0xef3bx18[_0xbc9f[41]]})};console[_0xbc9f[9]](_0xbc9f[43],_0xef3bx1d[_0xbc9f[22]])})}function synchVariables(_0xef3bx1d){Variable[_0xbc9f[46]](function(_0xef3bx18){updateCollection(_0xef3bx1d,_0xef3bx18);console[_0xbc9f[9]](_0xbc9f[45],_0xef3bx1d[_0xbc9f[22]])});Variable[_0xbc9f[44]](function(_0xef3bx18){updateCollection(_0xef3bx1d,_0xef3bx18);console[_0xbc9f[9]](_0xbc9f[47],_0xef3bx1d[_0xbc9f[22]])});Variable[_0xbc9f[49]](function(_0xef3bx18){_[_0xbc9f[42]](_0xef3bx1d,{id:_0xef3bx18[_0xbc9f[41]]});console[_0xbc9f[9]](_0xbc9f[48],_0xef3bx1d[_0xbc9f[22]])})}function updateCollection(_0xef3bx22,_0xef3bx18){var _0xef3bx23=_[_0xbc9f[18]](_0xef3bx22,{id:_0xef3bx18[_0xbc9f[41]]});var _0xef3bx24=_0xef3bx22[_0xbc9f[39]](_0xef3bx23);if(_0xef3bx23){_[_0xbc9f[50]](_0xef3bx22[_0xef3bx24],_0xef3bx18)}else {_0xef3bx22[_0xbc9f[51]](_0xef3bx18)}}module[_0xbc9f[52]]= Integration
\ No newline at end of file