Built motion from commit c2984ba.|0.0.114
[motion.git] / server / config / integrations / index.js
index b0d8e33..01e27cf 100644 (file)
@@ -1 +1 @@
-var _0x7866=["\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"];_0x7866[0];var _=require(_0x7866[1]);var IntegrationModel=require(_0x7866[3])[_0x7866[2]];var Variable=require(_0x7866[3])[_0x7866[4]];var Zendesk=require(_0x7866[5]);var Salesforce=require(_0x7866[6]);var Motionbar=require(_0x7866[7]);var MAX_CALLS=200;function Integration(_0xb388x9){console[_0x7866[9]](_0x7866[8]);var _0xb388xa= new Zendesk();var _0xb388xb= new Salesforce();var _0xb388xc= new Motionbar();var _0xb388xd=[];var _0xb388xe=[];var _0xb388xf=[];_0xb388x9[_0x7866[24]](_0x7866[10],function(_0xb388x10){if(_0xb388x10[_0x7866[12]](_0x7866[11])&& _0xb388x10[_0x7866[12]](_0x7866[13])){var _0xb388x11=_[_0x7866[18]](_0xb388xe,function(_0xb388x12){return (_0xb388x12[_0x7866[14]]=== _[_0x7866[16]](_[_0x7866[15]](_0xb388x10[_0x7866[11]])))|| (_[_0x7866[17]](_0xb388x12[_0x7866[14]])=== _[_0x7866[16]](_[_0x7866[15]](_0xb388x10[_0x7866[11]])))});if(_0xb388x11){var _0xb388x13=_[_0x7866[18]](_0xb388xf,function(_0xb388x12){return _0xb388x12[_0x7866[19]]=== _0xb388x10[_0x7866[19]]});if(_0xb388x13){_0xb388x13[_0x7866[21]][_0x7866[20]]({name:_0xb388x11[_0x7866[14]],value:_0xb388x10[_0x7866[13]]})}else {if(_0xb388xf[_0x7866[22]]>= MAX_CALLS){_0xb388xf[_0x7866[23]]()};var _0xb388x14={uniqueid:_0xb388x10[_0x7866[19]],variables:[{name:_0xb388x11[_0x7866[14]],value:_0xb388x10[_0x7866[13]]}]};_0xb388xf[_0x7866[20]](_0xb388x14)}}}});Variable[_0x7866[26]]()[_0x7866[25]](function(_0xb388x15){_0xb388xe= _0xb388x15;synchVariables(_0xb388xe)});IntegrationModel[_0x7866[26]]({where:{active:1}})[_0x7866[25]](function(_0xb388x16){_0xb388xd= _0xb388x16;synchIntegrations(_0xb388xd)});this[_0x7866[27]]= function(_0xb388x17,_0xb388x18,_0xb388x19){var _0xb388x13=_[_0x7866[18]](_0xb388xf,function(_0xb388x12){return _0xb388x12[_0x7866[19]]=== _0xb388x18[_0x7866[19]]});var _0xb388x15=_0xb388x13?_0xb388x13[_0x7866[21]]:[];if(integrationIsActive(_0xb388x17[_0x7866[28]],_0xb388xd)){switch(_0xb388x17[_0x7866[28]]){case _0x7866[32]:_0xb388xa[_0x7866[31]](_0xb388x17[_0x7866[29]],_0xb388x17[_0x7866[30]],_0xb388x19,_0xb388x18,_0xb388x15,_0xb388x18[_0x7866[19]]);break;case _0x7866[33]:_0xb388xb[_0x7866[31]](_0xb388x17[_0x7866[29]],_0xb388x17[_0x7866[30]],_0xb388x19,_0xb388x18,_0xb388x15,_0xb388x18[_0x7866[19]]);break;default:console[_0x7866[9]](_0x7866[34],_0xb388x17[_0x7866[28]])}};if(_0xb388x17[_0x7866[35]]=== _0x7866[36]){_0xb388xc[_0x7866[31]](_0xb388x17,_0xb388x19,_0xb388x18,_0xb388x15,_0xb388x18[_0x7866[19]])}}}function integrationIsActive(_0xb388x1b,_0xb388x1c){var _0xb388x1d=_[_0x7866[38]](_0xb388x1c,_0x7866[37]);if(_[_0x7866[39]](_0xb388x1d,_0xb388x1b)>= 0){return true};return false}function synchIntegrations(_0xb388x1c){IntegrationModel[_0x7866[44]](function(_0xb388x18){if(_0xb388x18[_0x7866[40]]){updateCollection(_0xb388x1c,_0xb388x18)}else {_[_0x7866[42]](_0xb388x1c,{id:_0xb388x18[_0x7866[41]]})};console[_0x7866[9]](_0x7866[43],_0xb388x1c[_0x7866[22]])})}function synchVariables(_0xb388x1c){Variable[_0x7866[46]](function(_0xb388x18){updateCollection(_0xb388x1c,_0xb388x18);console[_0x7866[9]](_0x7866[45],_0xb388x1c[_0x7866[22]])});Variable[_0x7866[44]](function(_0xb388x18){updateCollection(_0xb388x1c,_0xb388x18);console[_0x7866[9]](_0x7866[47],_0xb388x1c[_0x7866[22]])});Variable[_0x7866[49]](function(_0xb388x18){_[_0x7866[42]](_0xb388x1c,{id:_0xb388x18[_0x7866[41]]});console[_0x7866[9]](_0x7866[48],_0xb388x1c[_0x7866[22]])})}function updateCollection(_0xb388x21,_0xb388x18){var _0xb388x22=_[_0x7866[18]](_0xb388x21,{id:_0xb388x18[_0x7866[41]]});var _0xb388x23=_0xb388x21[_0x7866[39]](_0xb388x22);if(_0xb388x22){_[_0x7866[50]](_0xb388x21[_0xb388x23],_0xb388x18)}else {_0xb388x21[_0x7866[51]](_0xb388x18)}}module[_0x7866[52]]= Integration
\ No newline at end of file
+var _0xd4ae=["\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"];_0xd4ae[0];var _=require(_0xd4ae[1]);var IntegrationModel=require(_0xd4ae[3])[_0xd4ae[2]];var Variable=require(_0xd4ae[3])[_0xd4ae[4]];var Zendesk=require(_0xd4ae[5]);var Salesforce=require(_0xd4ae[6]);var Motionbar=require(_0xd4ae[7]);var MAX_CALLS=200;function Integration(_0x3935x9){console[_0xd4ae[9]](_0xd4ae[8]);var _0x3935xa= new Zendesk();var _0x3935xb= new Salesforce();var _0x3935xc= new Motionbar();var _0x3935xd=[];var _0x3935xe=[];var _0x3935xf=[];_0x3935x9[_0xd4ae[24]](_0xd4ae[10],function(_0x3935x10){if(_0x3935x10[_0xd4ae[12]](_0xd4ae[11])&& _0x3935x10[_0xd4ae[12]](_0xd4ae[13])){var _0x3935x11=_[_0xd4ae[18]](_0x3935xe,function(_0x3935x12){return (_0x3935x12[_0xd4ae[14]]=== _[_0xd4ae[16]](_[_0xd4ae[15]](_0x3935x10[_0xd4ae[11]])))|| (_[_0xd4ae[17]](_0x3935x12[_0xd4ae[14]])=== _[_0xd4ae[16]](_[_0xd4ae[15]](_0x3935x10[_0xd4ae[11]])))});if(_0x3935x11){var _0x3935x13=_[_0xd4ae[18]](_0x3935xf,function(_0x3935x12){return _0x3935x12[_0xd4ae[19]]=== _0x3935x10[_0xd4ae[19]]});if(_0x3935x13){_0x3935x13[_0xd4ae[21]][_0xd4ae[20]]({name:_0x3935x11[_0xd4ae[14]],value:_0x3935x10[_0xd4ae[13]]})}else {if(_0x3935xf[_0xd4ae[22]]>= MAX_CALLS){_0x3935xf[_0xd4ae[23]]()};var _0x3935x14={uniqueid:_0x3935x10[_0xd4ae[19]],variables:[{name:_0x3935x11[_0xd4ae[14]],value:_0x3935x10[_0xd4ae[13]]}]};_0x3935xf[_0xd4ae[20]](_0x3935x14)}}}});Variable[_0xd4ae[26]]()[_0xd4ae[25]](function(_0x3935x15){_0x3935xe= _0x3935x15;synchVariables(_0x3935xe)});IntegrationModel[_0xd4ae[26]]({where:{active:1}})[_0xd4ae[25]](function(_0x3935x16){_0x3935xd= _0x3935x16;synchIntegrations(_0x3935xd)});this[_0xd4ae[27]]= function(_0x3935x17,_0x3935x18,_0x3935x19){var _0x3935x13=_[_0xd4ae[18]](_0x3935xf,function(_0x3935x12){return _0x3935x12[_0xd4ae[19]]=== _0x3935x18[_0xd4ae[19]]});var _0x3935x15=_0x3935x13?_0x3935x13[_0xd4ae[21]]:[];if(integrationIsActive(_0x3935x17[_0xd4ae[28]],_0x3935xd)){switch(_0x3935x17[_0xd4ae[28]]){case _0xd4ae[32]:_0x3935xa[_0xd4ae[31]](_0x3935x17[_0xd4ae[29]],_0x3935x17[_0xd4ae[30]],_0x3935x19,_0x3935x18,_0x3935x15,_0x3935x18[_0xd4ae[19]]);break;case _0xd4ae[33]:_0x3935xb[_0xd4ae[31]](_0x3935x17[_0xd4ae[29]],_0x3935x17[_0xd4ae[30]],_0x3935x19,_0x3935x18,_0x3935x15,_0x3935x18[_0xd4ae[19]]);break;default:console[_0xd4ae[9]](_0xd4ae[34],_0x3935x17[_0xd4ae[28]])}};if(_0x3935x17[_0xd4ae[35]]=== _0xd4ae[36]){_0x3935xc[_0xd4ae[31]](_0x3935x17,_0x3935x19,_0x3935x18,_0x3935x15,_0x3935x18[_0xd4ae[19]])}}}function integrationIsActive(_0x3935x1b,_0x3935x1c){var _0x3935x1d=_[_0xd4ae[38]](_0x3935x1c,_0xd4ae[37]);if(_[_0xd4ae[39]](_0x3935x1d,_0x3935x1b)>= 0){return true};return false}function synchIntegrations(_0x3935x1c){IntegrationModel[_0xd4ae[44]](function(_0x3935x18){if(_0x3935x18[_0xd4ae[40]]){updateCollection(_0x3935x1c,_0x3935x18)}else {_[_0xd4ae[42]](_0x3935x1c,{id:_0x3935x18[_0xd4ae[41]]})};console[_0xd4ae[9]](_0xd4ae[43],_0x3935x1c[_0xd4ae[22]])})}function synchVariables(_0x3935x1c){Variable[_0xd4ae[46]](function(_0x3935x18){updateCollection(_0x3935x1c,_0x3935x18);console[_0xd4ae[9]](_0xd4ae[45],_0x3935x1c[_0xd4ae[22]])});Variable[_0xd4ae[44]](function(_0x3935x18){updateCollection(_0x3935x1c,_0x3935x18);console[_0xd4ae[9]](_0xd4ae[47],_0x3935x1c[_0xd4ae[22]])});Variable[_0xd4ae[49]](function(_0x3935x18){_[_0xd4ae[42]](_0x3935x1c,{id:_0x3935x18[_0xd4ae[41]]});console[_0xd4ae[9]](_0xd4ae[48],_0x3935x1c[_0xd4ae[22]])})}function updateCollection(_0x3935x21,_0x3935x18){var _0x3935x22=_[_0xd4ae[18]](_0x3935x21,{id:_0x3935x18[_0xd4ae[41]]});var _0x3935x23=_0x3935x21[_0xd4ae[39]](_0x3935x22);if(_0x3935x22){_[_0xd4ae[50]](_0x3935x21[_0x3935x23],_0x3935x18)}else {_0x3935x21[_0xd4ae[51]](_0x3935x18)}}module[_0xd4ae[52]]= Integration
\ No newline at end of file