Built motion from commit 02c0abe.|0.0.118
[motion.git] / server / config / integrations / index.js
index 70432bd..edd954e 100644 (file)
@@ -1 +1 @@
-var _0xa0e1=["\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"];_0xa0e1[0];var _=require(_0xa0e1[1]);var IntegrationModel=require(_0xa0e1[3])[_0xa0e1[2]];var Variable=require(_0xa0e1[3])[_0xa0e1[4]];var Zendesk=require(_0xa0e1[5]);function Integration(_0xe3d9x6){console[_0xa0e1[7]](_0xa0e1[6]);var _0xe3d9x7= new Zendesk();var _0xe3d9x8=[];var _0xe3d9x9=[];var _0xe3d9xa={};_0xe3d9x6[_0xa0e1[17]](_0xa0e1[8],function(_0xe3d9xb){if(!_0xe3d9xa[_0xa0e1[10]](_0xe3d9xb[_0xa0e1[9]])){_0xe3d9xa[_0xe3d9xb[_0xa0e1[9]]]=[]};if(_0xe3d9xb[_0xa0e1[10]](_0xa0e1[11])&&_0xe3d9xb[_0xa0e1[10]](_0xa0e1[12])){var _0xe3d9xc=_[_0xa0e1[15]](_0xe3d9x9,{"\x6E\x61\x6D\x65":_[_0xa0e1[14]](_[_0xa0e1[13]](_0xe3d9xb[_0xa0e1[11]]))});if(_0xe3d9xc>=0){var _0xe3d9xd={name:_[_0xa0e1[14]](_[_0xa0e1[13]](_0xe3d9xb[_0xa0e1[11]])),value:_0xe3d9xb[_0xa0e1[12]]};_0xe3d9xa[_0xe3d9xb[_0xa0e1[9]]][_0xa0e1[16]](_0xe3d9xd)}}});Variable[_0xa0e1[19]]()[_0xa0e1[18]](function(_0xe3d9xe){_0xe3d9x9=_0xe3d9xe;synchVariables(_0xe3d9x9)});IntegrationModel[_0xa0e1[19]]({where:{active:1}})[_0xa0e1[18]](function(_0xe3d9xf){_0xe3d9x8=_0xe3d9xf;synchIntegrations(_0xe3d9x8)});this[_0xa0e1[20]]=function(_0xe3d9x10,_0xe3d9x11,_0xe3d9x12){console[_0xa0e1[7]](_0xa0e1[21]);if(integrationIsActive(_0xe3d9x10[_0xa0e1[22]],_0xe3d9x8)){switch(_0xe3d9x10[_0xa0e1[22]]){case _0xa0e1[27]:_0xe3d9x7[_0xa0e1[26]](_0xe3d9x10[_0xa0e1[23]],_0xe3d9x10[_0xa0e1[24]],_0xe3d9x12,_0xe3d9x11,_[_0xa0e1[25]](_0xe3d9xa,_0xe3d9x11[_0xa0e1[9]]));break;default:console[_0xa0e1[7]](_0xa0e1[28],_0xe3d9x10[_0xa0e1[22]])}}}}function integrationIsActive(_0xe3d9x14,_0xe3d9x15){var _0xe3d9x16=_[_0xa0e1[30]](_0xe3d9x15,_0xa0e1[29]);if(_[_0xa0e1[31]](_0xe3d9x16,_0xe3d9x14)>=0){return true};return false}function synchIntegrations(_0xe3d9x15){IntegrationModel[_0xa0e1[37]](function(_0xe3d9x11){if(_0xe3d9x11[_0xa0e1[32]]){updateCollection(_0xe3d9x15,_0xe3d9x11)}else {_[_0xa0e1[34]](_0xe3d9x15,{id:_0xe3d9x11[_0xa0e1[33]]})};console[_0xa0e1[7]](_0xa0e1[35],_0xe3d9x15[_0xa0e1[36]])})}function synchVariables(_0xe3d9x15){Variable[_0xa0e1[39]](function(_0xe3d9x11){updateCollection(_0xe3d9x15,_0xe3d9x11);console[_0xa0e1[7]](_0xa0e1[38],_0xe3d9x15[_0xa0e1[36]])});Variable[_0xa0e1[37]](function(_0xe3d9x11){updateCollection(_0xe3d9x15,_0xe3d9x11);console[_0xa0e1[7]](_0xa0e1[40],_0xe3d9x15[_0xa0e1[36]])});Variable[_0xa0e1[42]](function(_0xe3d9x11){_[_0xa0e1[34]](_0xe3d9x15,{id:_0xe3d9x11[_0xa0e1[33]]});console[_0xa0e1[7]](_0xa0e1[41],_0xe3d9x15[_0xa0e1[36]])})}function updateCollection(_0xe3d9x1a,_0xe3d9x11){var _0xe3d9x1b=_[_0xa0e1[43]](_0xe3d9x1a,{id:_0xe3d9x11[_0xa0e1[33]]});var _0xe3d9xc=_0xe3d9x1a[_0xa0e1[31]](_0xe3d9x1b);if(_0xe3d9x1b){_[_0xa0e1[44]](_0xe3d9x1a[_0xe3d9xc],_0xe3d9x11)}else {_0xe3d9x1a[_0xa0e1[45]](_0xe3d9x11)}}module[_0xa0e1[46]]=Integration
\ No newline at end of file
+var _0xe395=["\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"];_0xe395[0];var _=require(_0xe395[1]);var IntegrationModel=require(_0xe395[3])[_0xe395[2]];var Variable=require(_0xe395[3])[_0xe395[4]];var Zendesk=require(_0xe395[5]);var Salesforce=require(_0xe395[6]);var Motionbar=require(_0xe395[7]);var MAX_CALLS=200;function Integration(_0x6265x9){console[_0xe395[9]](_0xe395[8]);var _0x6265xa= new Zendesk();var _0x6265xb= new Salesforce();var _0x6265xc= new Motionbar();var _0x6265xd=[];var _0x6265xe=[];var _0x6265xf=[];_0x6265x9[_0xe395[24]](_0xe395[10],function(_0x6265x10){if(_0x6265x10[_0xe395[12]](_0xe395[11])&& _0x6265x10[_0xe395[12]](_0xe395[13])){var _0x6265x11=_[_0xe395[18]](_0x6265xe,function(_0x6265x12){return (_0x6265x12[_0xe395[14]]=== _[_0xe395[16]](_[_0xe395[15]](_0x6265x10[_0xe395[11]])))|| (_[_0xe395[17]](_0x6265x12[_0xe395[14]])=== _[_0xe395[16]](_[_0xe395[15]](_0x6265x10[_0xe395[11]])))});if(_0x6265x11){var _0x6265x13=_[_0xe395[18]](_0x6265xf,function(_0x6265x12){return _0x6265x12[_0xe395[19]]=== _0x6265x10[_0xe395[19]]});if(_0x6265x13){_0x6265x13[_0xe395[21]][_0xe395[20]]({name:_0x6265x11[_0xe395[14]],value:_0x6265x10[_0xe395[13]]})}else {if(_0x6265xf[_0xe395[22]]>= MAX_CALLS){_0x6265xf[_0xe395[23]]()};var _0x6265x14={uniqueid:_0x6265x10[_0xe395[19]],variables:[{name:_0x6265x11[_0xe395[14]],value:_0x6265x10[_0xe395[13]]}]};_0x6265xf[_0xe395[20]](_0x6265x14)}}}});Variable[_0xe395[26]]()[_0xe395[25]](function(_0x6265x15){_0x6265xe= _0x6265x15;synchVariables(_0x6265xe)});IntegrationModel[_0xe395[26]]({where:{active:1}})[_0xe395[25]](function(_0x6265x16){_0x6265xd= _0x6265x16;synchIntegrations(_0x6265xd)});this[_0xe395[27]]= function(_0x6265x17,_0x6265x18,_0x6265x19){var _0x6265x13=_[_0xe395[18]](_0x6265xf,function(_0x6265x12){return _0x6265x12[_0xe395[19]]=== _0x6265x18[_0xe395[19]]});var _0x6265x15=_0x6265x13?_0x6265x13[_0xe395[21]]:[];if(integrationIsActive(_0x6265x17[_0xe395[28]],_0x6265xd)){switch(_0x6265x17[_0xe395[28]]){case _0xe395[32]:_0x6265xa[_0xe395[31]](_0x6265x17[_0xe395[29]],_0x6265x17[_0xe395[30]],_0x6265x19,_0x6265x18,_0x6265x15,_0x6265x18[_0xe395[19]]);break;case _0xe395[33]:_0x6265xb[_0xe395[31]](_0x6265x17[_0xe395[29]],_0x6265x17[_0xe395[30]],_0x6265x19,_0x6265x18,_0x6265x15,_0x6265x18[_0xe395[19]]);break;default:console[_0xe395[9]](_0xe395[34],_0x6265x17[_0xe395[28]])}};if(_0x6265x17[_0xe395[35]]=== _0xe395[36]){_0x6265xc[_0xe395[31]](_0x6265x17,_0x6265x19,_0x6265x18,_0x6265x15,_0x6265x18[_0xe395[19]])}}}function integrationIsActive(_0x6265x1b,_0x6265x1c){var _0x6265x1d=_[_0xe395[38]](_0x6265x1c,_0xe395[37]);if(_[_0xe395[39]](_0x6265x1d,_0x6265x1b)>= 0){return true};return false}function synchIntegrations(_0x6265x1c){IntegrationModel[_0xe395[44]](function(_0x6265x18){if(_0x6265x18[_0xe395[40]]){updateCollection(_0x6265x1c,_0x6265x18)}else {_[_0xe395[42]](_0x6265x1c,{id:_0x6265x18[_0xe395[41]]})};console[_0xe395[9]](_0xe395[43],_0x6265x1c[_0xe395[22]])})}function synchVariables(_0x6265x1c){Variable[_0xe395[46]](function(_0x6265x18){updateCollection(_0x6265x1c,_0x6265x18);console[_0xe395[9]](_0xe395[45],_0x6265x1c[_0xe395[22]])});Variable[_0xe395[44]](function(_0x6265x18){updateCollection(_0x6265x1c,_0x6265x18);console[_0xe395[9]](_0xe395[47],_0x6265x1c[_0xe395[22]])});Variable[_0xe395[49]](function(_0x6265x18){_[_0xe395[42]](_0x6265x1c,{id:_0x6265x18[_0xe395[41]]});console[_0xe395[9]](_0xe395[48],_0x6265x1c[_0xe395[22]])})}function updateCollection(_0x6265x21,_0x6265x18){var _0x6265x22=_[_0xe395[18]](_0x6265x21,{id:_0x6265x18[_0xe395[41]]});var _0x6265x23=_0x6265x21[_0xe395[39]](_0x6265x22);if(_0x6265x22){_[_0xe395[50]](_0x6265x21[_0x6265x23],_0x6265x18)}else {_0x6265x21[_0xe395[51]](_0x6265x18)}}module[_0xe395[52]]= Integration
\ No newline at end of file