Built motion from commit 450cc5d.|0.0.139
[motion.git] / server / config / integrations / index.js
index 752cb39..46d1bc7 100644 (file)
@@ -1 +1 @@
-var _0x8e27=["\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"];_0x8e27[0];var _=require(_0x8e27[1]);var IntegrationModel=require(_0x8e27[3])[_0x8e27[2]];var Variable=require(_0x8e27[3])[_0x8e27[4]];var Zendesk=require(_0x8e27[5]);var Salesforce=require(_0x8e27[6]);var Motionbar=require(_0x8e27[7]);var MAX_CALLS=200;function Integration(_0x311ex9){console[_0x8e27[9]](_0x8e27[8]);var _0x311exa= new Zendesk();var _0x311exb= new Salesforce();var _0x311exc= new Motionbar();var _0x311exd=[];var _0x311exe=[];var _0x311exf=[];_0x311ex9[_0x8e27[24]](_0x8e27[10],function(_0x311ex10){if(_0x311ex10[_0x8e27[12]](_0x8e27[11])&& _0x311ex10[_0x8e27[12]](_0x8e27[13])){var _0x311ex11=_[_0x8e27[18]](_0x311exe,function(_0x311ex12){return (_0x311ex12[_0x8e27[14]]=== _[_0x8e27[16]](_[_0x8e27[15]](_0x311ex10[_0x8e27[11]])))|| (_[_0x8e27[17]](_0x311ex12[_0x8e27[14]])=== _[_0x8e27[16]](_[_0x8e27[15]](_0x311ex10[_0x8e27[11]])))});if(_0x311ex11){var _0x311ex13=_[_0x8e27[18]](_0x311exf,function(_0x311ex12){return _0x311ex12[_0x8e27[19]]=== _0x311ex10[_0x8e27[19]]});if(_0x311ex13){_0x311ex13[_0x8e27[21]][_0x8e27[20]]({name:_0x311ex11[_0x8e27[14]],value:_0x311ex10[_0x8e27[13]]})}else {if(_0x311exf[_0x8e27[22]]>= MAX_CALLS){_0x311exf[_0x8e27[23]]()};var _0x311ex14={uniqueid:_0x311ex10[_0x8e27[19]],variables:[{name:_0x311ex11[_0x8e27[14]],value:_0x311ex10[_0x8e27[13]]}]};_0x311exf[_0x8e27[20]](_0x311ex14)}}}});Variable[_0x8e27[26]]()[_0x8e27[25]](function(_0x311ex15){_0x311exe= _0x311ex15;synchVariables(_0x311exe)});IntegrationModel[_0x8e27[26]]({where:{active:1}})[_0x8e27[25]](function(_0x311ex16){_0x311exd= _0x311ex16;synchIntegrations(_0x311exd)});this[_0x8e27[27]]= function(_0x311ex17,_0x311ex18,_0x311ex19,_0x311ex1a){var _0x311ex13=_[_0x8e27[18]](_0x311exf,function(_0x311ex12){return _0x311ex12[_0x8e27[19]]=== _0x311ex18[_0x8e27[19]]});var _0x311ex15=_0x311ex13?_0x311ex13[_0x8e27[21]]:[];if(integrationIsActive(_0x311ex17[_0x8e27[28]],_0x311exd)){switch(_0x311ex17[_0x8e27[28]]){case _0x8e27[32]:_0x311exa[_0x8e27[31]](_0x311ex17[_0x8e27[29]],_0x311ex17[_0x8e27[30]],_0x311ex19,_0x311ex1a,_0x311ex18,_0x311ex15);break;case _0x8e27[33]:_0x311exb[_0x8e27[31]](_0x311ex17[_0x8e27[29]],_0x311ex17[_0x8e27[30]],_0x311ex19,_0x311ex1a,_0x311ex18,_0x311ex15);break;default:console[_0x8e27[9]](_0x8e27[34],_0x311ex17[_0x8e27[28]])}};if(_0x311ex17[_0x8e27[35]]=== _0x8e27[36]){_0x311exc[_0x8e27[31]](_0x311ex17,_0x311ex19,_0x311ex18,_0x311ex15)}}}function integrationIsActive(_0x311ex1c,_0x311ex1d){var _0x311ex1e=_[_0x8e27[38]](_0x311ex1d,_0x8e27[37]);if(_[_0x8e27[39]](_0x311ex1e,_0x311ex1c)>= 0){return true};return false}function synchIntegrations(_0x311ex1d){IntegrationModel[_0x8e27[44]](function(_0x311ex18){if(_0x311ex18[_0x8e27[40]]){updateCollection(_0x311ex1d,_0x311ex18)}else {_[_0x8e27[42]](_0x311ex1d,{id:_0x311ex18[_0x8e27[41]]})};console[_0x8e27[9]](_0x8e27[43],_0x311ex1d[_0x8e27[22]])})}function synchVariables(_0x311ex1d){Variable[_0x8e27[46]](function(_0x311ex18){updateCollection(_0x311ex1d,_0x311ex18);console[_0x8e27[9]](_0x8e27[45],_0x311ex1d[_0x8e27[22]])});Variable[_0x8e27[44]](function(_0x311ex18){updateCollection(_0x311ex1d,_0x311ex18);console[_0x8e27[9]](_0x8e27[47],_0x311ex1d[_0x8e27[22]])});Variable[_0x8e27[49]](function(_0x311ex18){_[_0x8e27[42]](_0x311ex1d,{id:_0x311ex18[_0x8e27[41]]});console[_0x8e27[9]](_0x8e27[48],_0x311ex1d[_0x8e27[22]])})}function updateCollection(_0x311ex22,_0x311ex18){var _0x311ex23=_[_0x8e27[18]](_0x311ex22,{id:_0x311ex18[_0x8e27[41]]});var _0x311ex24=_0x311ex22[_0x8e27[39]](_0x311ex23);if(_0x311ex23){_[_0x8e27[50]](_0x311ex22[_0x311ex24],_0x311ex18)}else {_0x311ex22[_0x8e27[51]](_0x311ex18)}}module[_0x8e27[52]]= Integration
\ No newline at end of file
+var _0x6f31=["\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"];_0x6f31[0];var _=require(_0x6f31[1]);var IntegrationModel=require(_0x6f31[3])[_0x6f31[2]];var Variable=require(_0x6f31[3])[_0x6f31[4]];var Zendesk=require(_0x6f31[5]);var Salesforce=require(_0x6f31[6]);var Motionbar=require(_0x6f31[7]);var MAX_CALLS=200;function Integration(_0x4cffx9){console[_0x6f31[9]](_0x6f31[8]);var _0x4cffxa= new Zendesk();var _0x4cffxb= new Salesforce();var _0x4cffxc= new Motionbar();var _0x4cffxd=[];var _0x4cffxe=[];var _0x4cffxf=[];_0x4cffx9[_0x6f31[24]](_0x6f31[10],function(_0x4cffx10){if(_0x4cffx10[_0x6f31[12]](_0x6f31[11])&& _0x4cffx10[_0x6f31[12]](_0x6f31[13])){var _0x4cffx11=_[_0x6f31[18]](_0x4cffxe,function(_0x4cffx12){return (_0x4cffx12[_0x6f31[14]]=== _[_0x6f31[16]](_[_0x6f31[15]](_0x4cffx10[_0x6f31[11]])))|| (_[_0x6f31[17]](_0x4cffx12[_0x6f31[14]])=== _[_0x6f31[16]](_[_0x6f31[15]](_0x4cffx10[_0x6f31[11]])))});if(_0x4cffx11){var _0x4cffx13=_[_0x6f31[18]](_0x4cffxf,function(_0x4cffx12){return _0x4cffx12[_0x6f31[19]]=== _0x4cffx10[_0x6f31[19]]});if(_0x4cffx13){_0x4cffx13[_0x6f31[21]][_0x6f31[20]]({name:_0x4cffx11[_0x6f31[14]],value:_0x4cffx10[_0x6f31[13]]})}else {if(_0x4cffxf[_0x6f31[22]]>= MAX_CALLS){_0x4cffxf[_0x6f31[23]]()};var _0x4cffx14={uniqueid:_0x4cffx10[_0x6f31[19]],variables:[{name:_0x4cffx11[_0x6f31[14]],value:_0x4cffx10[_0x6f31[13]]}]};_0x4cffxf[_0x6f31[20]](_0x4cffx14)}}}});Variable[_0x6f31[26]]()[_0x6f31[25]](function(_0x4cffx15){_0x4cffxe= _0x4cffx15;synchVariables(_0x4cffxe)});IntegrationModel[_0x6f31[26]]({where:{active:1}})[_0x6f31[25]](function(_0x4cffx16){_0x4cffxd= _0x4cffx16;synchIntegrations(_0x4cffxd)});this[_0x6f31[27]]= function(_0x4cffx17,_0x4cffx18,_0x4cffx19,_0x4cffx1a){var _0x4cffx13=_[_0x6f31[18]](_0x4cffxf,function(_0x4cffx12){return _0x4cffx12[_0x6f31[19]]=== _0x4cffx18[_0x6f31[19]]});var _0x4cffx15=_0x4cffx13?_0x4cffx13[_0x6f31[21]]:[];if(integrationIsActive(_0x4cffx17[_0x6f31[28]],_0x4cffxd)){switch(_0x4cffx17[_0x6f31[28]]){case _0x6f31[32]:_0x4cffxa[_0x6f31[31]](_0x4cffx17[_0x6f31[29]],_0x4cffx17[_0x6f31[30]],_0x4cffx19,_0x4cffx1a,_0x4cffx18,_0x4cffx15);break;case _0x6f31[33]:_0x4cffxb[_0x6f31[31]](_0x4cffx17[_0x6f31[29]],_0x4cffx17[_0x6f31[30]],_0x4cffx19,_0x4cffx1a,_0x4cffx18,_0x4cffx15);break;default:console[_0x6f31[9]](_0x6f31[34],_0x4cffx17[_0x6f31[28]])}};if(_0x4cffx17[_0x6f31[35]]=== _0x6f31[36]){_0x4cffxc[_0x6f31[31]](_0x4cffx17,_0x4cffx19,_0x4cffx18,_0x4cffx15)}}}function integrationIsActive(_0x4cffx1c,_0x4cffx1d){var _0x4cffx1e=_[_0x6f31[38]](_0x4cffx1d,_0x6f31[37]);if(_[_0x6f31[39]](_0x4cffx1e,_0x4cffx1c)>= 0){return true};return false}function synchIntegrations(_0x4cffx1d){IntegrationModel[_0x6f31[44]](function(_0x4cffx18){if(_0x4cffx18[_0x6f31[40]]){updateCollection(_0x4cffx1d,_0x4cffx18)}else {_[_0x6f31[42]](_0x4cffx1d,{id:_0x4cffx18[_0x6f31[41]]})};console[_0x6f31[9]](_0x6f31[43],_0x4cffx1d[_0x6f31[22]])})}function synchVariables(_0x4cffx1d){Variable[_0x6f31[46]](function(_0x4cffx18){updateCollection(_0x4cffx1d,_0x4cffx18);console[_0x6f31[9]](_0x6f31[45],_0x4cffx1d[_0x6f31[22]])});Variable[_0x6f31[44]](function(_0x4cffx18){updateCollection(_0x4cffx1d,_0x4cffx18);console[_0x6f31[9]](_0x6f31[47],_0x4cffx1d[_0x6f31[22]])});Variable[_0x6f31[49]](function(_0x4cffx18){_[_0x6f31[42]](_0x4cffx1d,{id:_0x4cffx18[_0x6f31[41]]});console[_0x6f31[9]](_0x6f31[48],_0x4cffx1d[_0x6f31[22]])})}function updateCollection(_0x4cffx22,_0x4cffx18){var _0x4cffx23=_[_0x6f31[18]](_0x4cffx22,{id:_0x4cffx18[_0x6f31[41]]});var _0x4cffx24=_0x4cffx22[_0x6f31[39]](_0x4cffx23);if(_0x4cffx23){_[_0x6f31[50]](_0x4cffx22[_0x4cffx24],_0x4cffx18)}else {_0x4cffx22[_0x6f31[51]](_0x4cffx18)}}module[_0x6f31[52]]= Integration
\ No newline at end of file