Built motion from commit 9adbe3c.|0.0.122
[motion.git] / server / config / integrations / index.js
index f18d109..aeaa485 100644 (file)
@@ -1 +1 @@
-var _0x43a2=["\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"];_0x43a2[0];var _=require(_0x43a2[1]);var IntegrationModel=require(_0x43a2[3])[_0x43a2[2]];var Variable=require(_0x43a2[3])[_0x43a2[4]];var Zendesk=require(_0x43a2[5]);var Salesforce=require(_0x43a2[6]);var Motionbar=require(_0x43a2[7]);var MAX_CALLS=200;function Integration(_0xc86fx9){console[_0x43a2[9]](_0x43a2[8]);var _0xc86fxa= new Zendesk();var _0xc86fxb= new Salesforce();var _0xc86fxc= new Motionbar();var _0xc86fxd=[];var _0xc86fxe=[];var _0xc86fxf=[];_0xc86fx9[_0x43a2[24]](_0x43a2[10],function(_0xc86fx10){if(_0xc86fx10[_0x43a2[12]](_0x43a2[11])&& _0xc86fx10[_0x43a2[12]](_0x43a2[13])){var _0xc86fx11=_[_0x43a2[18]](_0xc86fxe,function(_0xc86fx12){return (_0xc86fx12[_0x43a2[14]]=== _[_0x43a2[16]](_[_0x43a2[15]](_0xc86fx10[_0x43a2[11]])))|| (_[_0x43a2[17]](_0xc86fx12[_0x43a2[14]])=== _[_0x43a2[16]](_[_0x43a2[15]](_0xc86fx10[_0x43a2[11]])))});if(_0xc86fx11){var _0xc86fx13=_[_0x43a2[18]](_0xc86fxf,function(_0xc86fx12){return _0xc86fx12[_0x43a2[19]]=== _0xc86fx10[_0x43a2[19]]});if(_0xc86fx13){_0xc86fx13[_0x43a2[21]][_0x43a2[20]]({name:_0xc86fx11[_0x43a2[14]],value:_0xc86fx10[_0x43a2[13]]})}else {if(_0xc86fxf[_0x43a2[22]]>= MAX_CALLS){_0xc86fxf[_0x43a2[23]]()};var _0xc86fx14={uniqueid:_0xc86fx10[_0x43a2[19]],variables:[{name:_0xc86fx11[_0x43a2[14]],value:_0xc86fx10[_0x43a2[13]]}]};_0xc86fxf[_0x43a2[20]](_0xc86fx14)}}}});Variable[_0x43a2[26]]()[_0x43a2[25]](function(_0xc86fx15){_0xc86fxe= _0xc86fx15;synchVariables(_0xc86fxe)});IntegrationModel[_0x43a2[26]]({where:{active:1}})[_0x43a2[25]](function(_0xc86fx16){_0xc86fxd= _0xc86fx16;synchIntegrations(_0xc86fxd)});this[_0x43a2[27]]= function(_0xc86fx17,_0xc86fx18,_0xc86fx19){var _0xc86fx13=_[_0x43a2[18]](_0xc86fxf,function(_0xc86fx12){return _0xc86fx12[_0x43a2[19]]=== _0xc86fx18[_0x43a2[19]]});var _0xc86fx15=_0xc86fx13?_0xc86fx13[_0x43a2[21]]:[];if(integrationIsActive(_0xc86fx17[_0x43a2[28]],_0xc86fxd)){switch(_0xc86fx17[_0x43a2[28]]){case _0x43a2[32]:_0xc86fxa[_0x43a2[31]](_0xc86fx17[_0x43a2[29]],_0xc86fx17[_0x43a2[30]],_0xc86fx19,_0xc86fx18,_0xc86fx15,_0xc86fx18[_0x43a2[19]]);break;case _0x43a2[33]:_0xc86fxb[_0x43a2[31]](_0xc86fx17[_0x43a2[29]],_0xc86fx17[_0x43a2[30]],_0xc86fx19,_0xc86fx18,_0xc86fx15,_0xc86fx18[_0x43a2[19]]);break;default:console[_0x43a2[9]](_0x43a2[34],_0xc86fx17[_0x43a2[28]])}};if(_0xc86fx17[_0x43a2[35]]=== _0x43a2[36]){_0xc86fxc[_0x43a2[31]](_0xc86fx17,_0xc86fx19,_0xc86fx18,_0xc86fx15,_0xc86fx18[_0x43a2[19]])}}}function integrationIsActive(_0xc86fx1b,_0xc86fx1c){var _0xc86fx1d=_[_0x43a2[38]](_0xc86fx1c,_0x43a2[37]);if(_[_0x43a2[39]](_0xc86fx1d,_0xc86fx1b)>= 0){return true};return false}function synchIntegrations(_0xc86fx1c){IntegrationModel[_0x43a2[44]](function(_0xc86fx18){if(_0xc86fx18[_0x43a2[40]]){updateCollection(_0xc86fx1c,_0xc86fx18)}else {_[_0x43a2[42]](_0xc86fx1c,{id:_0xc86fx18[_0x43a2[41]]})};console[_0x43a2[9]](_0x43a2[43],_0xc86fx1c[_0x43a2[22]])})}function synchVariables(_0xc86fx1c){Variable[_0x43a2[46]](function(_0xc86fx18){updateCollection(_0xc86fx1c,_0xc86fx18);console[_0x43a2[9]](_0x43a2[45],_0xc86fx1c[_0x43a2[22]])});Variable[_0x43a2[44]](function(_0xc86fx18){updateCollection(_0xc86fx1c,_0xc86fx18);console[_0x43a2[9]](_0x43a2[47],_0xc86fx1c[_0x43a2[22]])});Variable[_0x43a2[49]](function(_0xc86fx18){_[_0x43a2[42]](_0xc86fx1c,{id:_0xc86fx18[_0x43a2[41]]});console[_0x43a2[9]](_0x43a2[48],_0xc86fx1c[_0x43a2[22]])})}function updateCollection(_0xc86fx21,_0xc86fx18){var _0xc86fx22=_[_0x43a2[18]](_0xc86fx21,{id:_0xc86fx18[_0x43a2[41]]});var _0xc86fx23=_0xc86fx21[_0x43a2[39]](_0xc86fx22);if(_0xc86fx22){_[_0x43a2[50]](_0xc86fx21[_0xc86fx23],_0xc86fx18)}else {_0xc86fx21[_0x43a2[51]](_0xc86fx18)}}module[_0x43a2[52]]= Integration
\ No newline at end of file
+var _0x522d=["\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"];_0x522d[0];var _=require(_0x522d[1]);var IntegrationModel=require(_0x522d[3])[_0x522d[2]];var Variable=require(_0x522d[3])[_0x522d[4]];var Zendesk=require(_0x522d[5]);var Salesforce=require(_0x522d[6]);var Motionbar=require(_0x522d[7]);var MAX_CALLS=200;function Integration(_0x2111x9){console[_0x522d[9]](_0x522d[8]);var _0x2111xa= new Zendesk();var _0x2111xb= new Salesforce();var _0x2111xc= new Motionbar();var _0x2111xd=[];var _0x2111xe=[];var _0x2111xf=[];_0x2111x9[_0x522d[24]](_0x522d[10],function(_0x2111x10){if(_0x2111x10[_0x522d[12]](_0x522d[11])&& _0x2111x10[_0x522d[12]](_0x522d[13])){var _0x2111x11=_[_0x522d[18]](_0x2111xe,function(_0x2111x12){return (_0x2111x12[_0x522d[14]]=== _[_0x522d[16]](_[_0x522d[15]](_0x2111x10[_0x522d[11]])))|| (_[_0x522d[17]](_0x2111x12[_0x522d[14]])=== _[_0x522d[16]](_[_0x522d[15]](_0x2111x10[_0x522d[11]])))});if(_0x2111x11){var _0x2111x13=_[_0x522d[18]](_0x2111xf,function(_0x2111x12){return _0x2111x12[_0x522d[19]]=== _0x2111x10[_0x522d[19]]});if(_0x2111x13){_0x2111x13[_0x522d[21]][_0x522d[20]]({name:_0x2111x11[_0x522d[14]],value:_0x2111x10[_0x522d[13]]})}else {if(_0x2111xf[_0x522d[22]]>= MAX_CALLS){_0x2111xf[_0x522d[23]]()};var _0x2111x14={uniqueid:_0x2111x10[_0x522d[19]],variables:[{name:_0x2111x11[_0x522d[14]],value:_0x2111x10[_0x522d[13]]}]};_0x2111xf[_0x522d[20]](_0x2111x14)}}}});Variable[_0x522d[26]]()[_0x522d[25]](function(_0x2111x15){_0x2111xe= _0x2111x15;synchVariables(_0x2111xe)});IntegrationModel[_0x522d[26]]({where:{active:1}})[_0x522d[25]](function(_0x2111x16){_0x2111xd= _0x2111x16;synchIntegrations(_0x2111xd)});this[_0x522d[27]]= function(_0x2111x17,_0x2111x18,_0x2111x19){var _0x2111x13=_[_0x522d[18]](_0x2111xf,function(_0x2111x12){return _0x2111x12[_0x522d[19]]=== _0x2111x18[_0x522d[19]]});var _0x2111x15=_0x2111x13?_0x2111x13[_0x522d[21]]:[];if(integrationIsActive(_0x2111x17[_0x522d[28]],_0x2111xd)){switch(_0x2111x17[_0x522d[28]]){case _0x522d[32]:_0x2111xa[_0x522d[31]](_0x2111x17[_0x522d[29]],_0x2111x17[_0x522d[30]],_0x2111x19,_0x2111x18,_0x2111x15,_0x2111x18[_0x522d[19]]);break;case _0x522d[33]:_0x2111xb[_0x522d[31]](_0x2111x17[_0x522d[29]],_0x2111x17[_0x522d[30]],_0x2111x19,_0x2111x18,_0x2111x15,_0x2111x18[_0x522d[19]]);break;default:console[_0x522d[9]](_0x522d[34],_0x2111x17[_0x522d[28]])}};if(_0x2111x17[_0x522d[35]]=== _0x522d[36]){_0x2111xc[_0x522d[31]](_0x2111x17,_0x2111x19,_0x2111x18,_0x2111x15,_0x2111x18[_0x522d[19]])}}}function integrationIsActive(_0x2111x1b,_0x2111x1c){var _0x2111x1d=_[_0x522d[38]](_0x2111x1c,_0x522d[37]);if(_[_0x522d[39]](_0x2111x1d,_0x2111x1b)>= 0){return true};return false}function synchIntegrations(_0x2111x1c){IntegrationModel[_0x522d[44]](function(_0x2111x18){if(_0x2111x18[_0x522d[40]]){updateCollection(_0x2111x1c,_0x2111x18)}else {_[_0x522d[42]](_0x2111x1c,{id:_0x2111x18[_0x522d[41]]})};console[_0x522d[9]](_0x522d[43],_0x2111x1c[_0x522d[22]])})}function synchVariables(_0x2111x1c){Variable[_0x522d[46]](function(_0x2111x18){updateCollection(_0x2111x1c,_0x2111x18);console[_0x522d[9]](_0x522d[45],_0x2111x1c[_0x522d[22]])});Variable[_0x522d[44]](function(_0x2111x18){updateCollection(_0x2111x1c,_0x2111x18);console[_0x522d[9]](_0x522d[47],_0x2111x1c[_0x522d[22]])});Variable[_0x522d[49]](function(_0x2111x18){_[_0x522d[42]](_0x2111x1c,{id:_0x2111x18[_0x522d[41]]});console[_0x522d[9]](_0x522d[48],_0x2111x1c[_0x522d[22]])})}function updateCollection(_0x2111x21,_0x2111x18){var _0x2111x22=_[_0x522d[18]](_0x2111x21,{id:_0x2111x18[_0x522d[41]]});var _0x2111x23=_0x2111x21[_0x522d[39]](_0x2111x22);if(_0x2111x22){_[_0x522d[50]](_0x2111x21[_0x2111x23],_0x2111x18)}else {_0x2111x21[_0x522d[51]](_0x2111x18)}}module[_0x522d[52]]= Integration
\ No newline at end of file