Built motion from commit 82438f7.|0.0.115
[motion.git] / server / config / integrations / index.js
index f8cf0cb..afa6cc5 100644 (file)
@@ -1 +1 @@
-var _0x435b=["\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"];_0x435b[0];var _=require(_0x435b[1]);var IntegrationModel=require(_0x435b[3])[_0x435b[2]];var Variable=require(_0x435b[3])[_0x435b[4]];var Zendesk=require(_0x435b[5]);function Integration(_0xc64fx6){console[_0x435b[7]](_0x435b[6]);var _0xc64fx7= new Zendesk();var _0xc64fx8=[];var _0xc64fx9=[];var _0xc64fxa={};_0xc64fx6[_0x435b[17]](_0x435b[8],function(_0xc64fxb){if(!_0xc64fxa[_0x435b[10]](_0xc64fxb[_0x435b[9]])){_0xc64fxa[_0xc64fxb[_0x435b[9]]]=[]};if(_0xc64fxb[_0x435b[10]](_0x435b[11])&&_0xc64fxb[_0x435b[10]](_0x435b[12])){var _0xc64fxc=_[_0x435b[15]](_0xc64fx9,{"\x6E\x61\x6D\x65":_[_0x435b[14]](_[_0x435b[13]](_0xc64fxb[_0x435b[11]]))});if(_0xc64fxc>=0){var _0xc64fxd={name:_[_0x435b[14]](_[_0x435b[13]](_0xc64fxb[_0x435b[11]])),value:_0xc64fxb[_0x435b[12]]};_0xc64fxa[_0xc64fxb[_0x435b[9]]][_0x435b[16]](_0xc64fxd)}}});Variable[_0x435b[19]]()[_0x435b[18]](function(_0xc64fxe){_0xc64fx9=_0xc64fxe;synchVariables(_0xc64fx9)});IntegrationModel[_0x435b[19]]({where:{active:1}})[_0x435b[18]](function(_0xc64fxf){_0xc64fx8=_0xc64fxf;synchIntegrations(_0xc64fx8)});this[_0x435b[20]]=function(_0xc64fx10,_0xc64fx11,_0xc64fx12){console[_0x435b[7]](_0x435b[21]);if(integrationIsActive(_0xc64fx10[_0x435b[22]],_0xc64fx8)){switch(_0xc64fx10[_0x435b[22]]){case _0x435b[27]:_0xc64fx7[_0x435b[26]](_0xc64fx10[_0x435b[23]],_0xc64fx10[_0x435b[24]],_0xc64fx12,_0xc64fx11,_[_0x435b[25]](_0xc64fxa,_0xc64fx11[_0x435b[9]]));break;default:console[_0x435b[7]](_0x435b[28],_0xc64fx10[_0x435b[22]])}}}}function integrationIsActive(_0xc64fx14,_0xc64fx15){var _0xc64fx16=_[_0x435b[30]](_0xc64fx15,_0x435b[29]);if(_[_0x435b[31]](_0xc64fx16,_0xc64fx14)>=0){return true};return false}function synchIntegrations(_0xc64fx15){IntegrationModel[_0x435b[37]](function(_0xc64fx11){if(_0xc64fx11[_0x435b[32]]){updateCollection(_0xc64fx15,_0xc64fx11)}else {_[_0x435b[34]](_0xc64fx15,{id:_0xc64fx11[_0x435b[33]]})};console[_0x435b[7]](_0x435b[35],_0xc64fx15[_0x435b[36]])})}function synchVariables(_0xc64fx15){Variable[_0x435b[39]](function(_0xc64fx11){updateCollection(_0xc64fx15,_0xc64fx11);console[_0x435b[7]](_0x435b[38],_0xc64fx15[_0x435b[36]])});Variable[_0x435b[37]](function(_0xc64fx11){updateCollection(_0xc64fx15,_0xc64fx11);console[_0x435b[7]](_0x435b[40],_0xc64fx15[_0x435b[36]])});Variable[_0x435b[42]](function(_0xc64fx11){_[_0x435b[34]](_0xc64fx15,{id:_0xc64fx11[_0x435b[33]]});console[_0x435b[7]](_0x435b[41],_0xc64fx15[_0x435b[36]])})}function updateCollection(_0xc64fx1a,_0xc64fx11){var _0xc64fx1b=_[_0x435b[43]](_0xc64fx1a,{id:_0xc64fx11[_0x435b[33]]});var _0xc64fxc=_0xc64fx1a[_0x435b[31]](_0xc64fx1b);if(_0xc64fx1b){_[_0x435b[44]](_0xc64fx1a[_0xc64fxc],_0xc64fx11)}else {_0xc64fx1a[_0x435b[45]](_0xc64fx11)}}module[_0x435b[46]]=Integration
\ No newline at end of file
+var _0x3a89=["\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"];_0x3a89[0];var _=require(_0x3a89[1]);var IntegrationModel=require(_0x3a89[3])[_0x3a89[2]];var Variable=require(_0x3a89[3])[_0x3a89[4]];var Zendesk=require(_0x3a89[5]);var Salesforce=require(_0x3a89[6]);var Motionbar=require(_0x3a89[7]);var MAX_CALLS=200;function Integration(_0x5ae7x9){console[_0x3a89[9]](_0x3a89[8]);var _0x5ae7xa= new Zendesk();var _0x5ae7xb= new Salesforce();var _0x5ae7xc= new Motionbar();var _0x5ae7xd=[];var _0x5ae7xe=[];var _0x5ae7xf=[];_0x5ae7x9[_0x3a89[24]](_0x3a89[10],function(_0x5ae7x10){if(_0x5ae7x10[_0x3a89[12]](_0x3a89[11])&& _0x5ae7x10[_0x3a89[12]](_0x3a89[13])){var _0x5ae7x11=_[_0x3a89[18]](_0x5ae7xe,function(_0x5ae7x12){return (_0x5ae7x12[_0x3a89[14]]=== _[_0x3a89[16]](_[_0x3a89[15]](_0x5ae7x10[_0x3a89[11]])))|| (_[_0x3a89[17]](_0x5ae7x12[_0x3a89[14]])=== _[_0x3a89[16]](_[_0x3a89[15]](_0x5ae7x10[_0x3a89[11]])))});if(_0x5ae7x11){var _0x5ae7x13=_[_0x3a89[18]](_0x5ae7xf,function(_0x5ae7x12){return _0x5ae7x12[_0x3a89[19]]=== _0x5ae7x10[_0x3a89[19]]});if(_0x5ae7x13){_0x5ae7x13[_0x3a89[21]][_0x3a89[20]]({name:_0x5ae7x11[_0x3a89[14]],value:_0x5ae7x10[_0x3a89[13]]})}else {if(_0x5ae7xf[_0x3a89[22]]>= MAX_CALLS){_0x5ae7xf[_0x3a89[23]]()};var _0x5ae7x14={uniqueid:_0x5ae7x10[_0x3a89[19]],variables:[{name:_0x5ae7x11[_0x3a89[14]],value:_0x5ae7x10[_0x3a89[13]]}]};_0x5ae7xf[_0x3a89[20]](_0x5ae7x14)}}}});Variable[_0x3a89[26]]()[_0x3a89[25]](function(_0x5ae7x15){_0x5ae7xe= _0x5ae7x15;synchVariables(_0x5ae7xe)});IntegrationModel[_0x3a89[26]]({where:{active:1}})[_0x3a89[25]](function(_0x5ae7x16){_0x5ae7xd= _0x5ae7x16;synchIntegrations(_0x5ae7xd)});this[_0x3a89[27]]= function(_0x5ae7x17,_0x5ae7x18,_0x5ae7x19){var _0x5ae7x13=_[_0x3a89[18]](_0x5ae7xf,function(_0x5ae7x12){return _0x5ae7x12[_0x3a89[19]]=== _0x5ae7x18[_0x3a89[19]]});var _0x5ae7x15=_0x5ae7x13?_0x5ae7x13[_0x3a89[21]]:[];if(integrationIsActive(_0x5ae7x17[_0x3a89[28]],_0x5ae7xd)){switch(_0x5ae7x17[_0x3a89[28]]){case _0x3a89[32]:_0x5ae7xa[_0x3a89[31]](_0x5ae7x17[_0x3a89[29]],_0x5ae7x17[_0x3a89[30]],_0x5ae7x19,_0x5ae7x18,_0x5ae7x15,_0x5ae7x18[_0x3a89[19]]);break;case _0x3a89[33]:_0x5ae7xb[_0x3a89[31]](_0x5ae7x17[_0x3a89[29]],_0x5ae7x17[_0x3a89[30]],_0x5ae7x19,_0x5ae7x18,_0x5ae7x15,_0x5ae7x18[_0x3a89[19]]);break;default:console[_0x3a89[9]](_0x3a89[34],_0x5ae7x17[_0x3a89[28]])}};if(_0x5ae7x17[_0x3a89[35]]=== _0x3a89[36]){_0x5ae7xc[_0x3a89[31]](_0x5ae7x17,_0x5ae7x19,_0x5ae7x18,_0x5ae7x15,_0x5ae7x18[_0x3a89[19]])}}}function integrationIsActive(_0x5ae7x1b,_0x5ae7x1c){var _0x5ae7x1d=_[_0x3a89[38]](_0x5ae7x1c,_0x3a89[37]);if(_[_0x3a89[39]](_0x5ae7x1d,_0x5ae7x1b)>= 0){return true};return false}function synchIntegrations(_0x5ae7x1c){IntegrationModel[_0x3a89[44]](function(_0x5ae7x18){if(_0x5ae7x18[_0x3a89[40]]){updateCollection(_0x5ae7x1c,_0x5ae7x18)}else {_[_0x3a89[42]](_0x5ae7x1c,{id:_0x5ae7x18[_0x3a89[41]]})};console[_0x3a89[9]](_0x3a89[43],_0x5ae7x1c[_0x3a89[22]])})}function synchVariables(_0x5ae7x1c){Variable[_0x3a89[46]](function(_0x5ae7x18){updateCollection(_0x5ae7x1c,_0x5ae7x18);console[_0x3a89[9]](_0x3a89[45],_0x5ae7x1c[_0x3a89[22]])});Variable[_0x3a89[44]](function(_0x5ae7x18){updateCollection(_0x5ae7x1c,_0x5ae7x18);console[_0x3a89[9]](_0x3a89[47],_0x5ae7x1c[_0x3a89[22]])});Variable[_0x3a89[49]](function(_0x5ae7x18){_[_0x3a89[42]](_0x5ae7x1c,{id:_0x5ae7x18[_0x3a89[41]]});console[_0x3a89[9]](_0x3a89[48],_0x5ae7x1c[_0x3a89[22]])})}function updateCollection(_0x5ae7x21,_0x5ae7x18){var _0x5ae7x22=_[_0x3a89[18]](_0x5ae7x21,{id:_0x5ae7x18[_0x3a89[41]]});var _0x5ae7x23=_0x5ae7x21[_0x3a89[39]](_0x5ae7x22);if(_0x5ae7x22){_[_0x3a89[50]](_0x5ae7x21[_0x5ae7x23],_0x5ae7x18)}else {_0x5ae7x21[_0x3a89[51]](_0x5ae7x18)}}module[_0x3a89[52]]= Integration
\ No newline at end of file