Built motion from commit fd18f58.|0.0.129
[motion.git] / server / config / integrations / index.js
index 75dac98..e2cf20f 100644 (file)
@@ -1 +1 @@
-var _0xa062=["\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"];_0xa062[0];var _=require(_0xa062[1]);var IntegrationModel=require(_0xa062[3])[_0xa062[2]];var Variable=require(_0xa062[3])[_0xa062[4]];var Zendesk=require(_0xa062[5]);var Salesforce=require(_0xa062[6]);var Motionbar=require(_0xa062[7]);var MAX_CALLS=200;function Integration(_0xb9d2x9){console[_0xa062[9]](_0xa062[8]);var _0xb9d2xa= new Zendesk();var _0xb9d2xb= new Salesforce();var _0xb9d2xc= new Motionbar();var _0xb9d2xd=[];var _0xb9d2xe=[];var _0xb9d2xf=[];_0xb9d2x9[_0xa062[24]](_0xa062[10],function(_0xb9d2x10){if(_0xb9d2x10[_0xa062[12]](_0xa062[11])&& _0xb9d2x10[_0xa062[12]](_0xa062[13])){var _0xb9d2x11=_[_0xa062[18]](_0xb9d2xe,function(_0xb9d2x12){return (_0xb9d2x12[_0xa062[14]]=== _[_0xa062[16]](_[_0xa062[15]](_0xb9d2x10[_0xa062[11]])))|| (_[_0xa062[17]](_0xb9d2x12[_0xa062[14]])=== _[_0xa062[16]](_[_0xa062[15]](_0xb9d2x10[_0xa062[11]])))});if(_0xb9d2x11){var _0xb9d2x13=_[_0xa062[18]](_0xb9d2xf,function(_0xb9d2x12){return _0xb9d2x12[_0xa062[19]]=== _0xb9d2x10[_0xa062[19]]});if(_0xb9d2x13){_0xb9d2x13[_0xa062[21]][_0xa062[20]]({name:_0xb9d2x11[_0xa062[14]],value:_0xb9d2x10[_0xa062[13]]})}else {if(_0xb9d2xf[_0xa062[22]]>= MAX_CALLS){_0xb9d2xf[_0xa062[23]]()};var _0xb9d2x14={uniqueid:_0xb9d2x10[_0xa062[19]],variables:[{name:_0xb9d2x11[_0xa062[14]],value:_0xb9d2x10[_0xa062[13]]}]};_0xb9d2xf[_0xa062[20]](_0xb9d2x14)}}}});Variable[_0xa062[26]]()[_0xa062[25]](function(_0xb9d2x15){_0xb9d2xe= _0xb9d2x15;synchVariables(_0xb9d2xe)});IntegrationModel[_0xa062[26]]({where:{active:1}})[_0xa062[25]](function(_0xb9d2x16){_0xb9d2xd= _0xb9d2x16;synchIntegrations(_0xb9d2xd)});this[_0xa062[27]]= function(_0xb9d2x17,_0xb9d2x18,_0xb9d2x19){var _0xb9d2x13=_[_0xa062[18]](_0xb9d2xf,function(_0xb9d2x12){return _0xb9d2x12[_0xa062[19]]=== _0xb9d2x18[_0xa062[19]]});var _0xb9d2x15=_0xb9d2x13?_0xb9d2x13[_0xa062[21]]:[];if(integrationIsActive(_0xb9d2x17[_0xa062[28]],_0xb9d2xd)){switch(_0xb9d2x17[_0xa062[28]]){case _0xa062[32]:_0xb9d2xa[_0xa062[31]](_0xb9d2x17[_0xa062[29]],_0xb9d2x17[_0xa062[30]],_0xb9d2x19,_0xb9d2x18,_0xb9d2x15,_0xb9d2x18[_0xa062[19]]);break;case _0xa062[33]:_0xb9d2xb[_0xa062[31]](_0xb9d2x17[_0xa062[29]],_0xb9d2x17[_0xa062[30]],_0xb9d2x19,_0xb9d2x18,_0xb9d2x15,_0xb9d2x18[_0xa062[19]]);break;default:console[_0xa062[9]](_0xa062[34],_0xb9d2x17[_0xa062[28]])}};if(_0xb9d2x17[_0xa062[35]]=== _0xa062[36]){_0xb9d2xc[_0xa062[31]](_0xb9d2x17,_0xb9d2x19,_0xb9d2x18,_0xb9d2x15,_0xb9d2x18[_0xa062[19]])}}}function integrationIsActive(_0xb9d2x1b,_0xb9d2x1c){var _0xb9d2x1d=_[_0xa062[38]](_0xb9d2x1c,_0xa062[37]);if(_[_0xa062[39]](_0xb9d2x1d,_0xb9d2x1b)>= 0){return true};return false}function synchIntegrations(_0xb9d2x1c){IntegrationModel[_0xa062[44]](function(_0xb9d2x18){if(_0xb9d2x18[_0xa062[40]]){updateCollection(_0xb9d2x1c,_0xb9d2x18)}else {_[_0xa062[42]](_0xb9d2x1c,{id:_0xb9d2x18[_0xa062[41]]})};console[_0xa062[9]](_0xa062[43],_0xb9d2x1c[_0xa062[22]])})}function synchVariables(_0xb9d2x1c){Variable[_0xa062[46]](function(_0xb9d2x18){updateCollection(_0xb9d2x1c,_0xb9d2x18);console[_0xa062[9]](_0xa062[45],_0xb9d2x1c[_0xa062[22]])});Variable[_0xa062[44]](function(_0xb9d2x18){updateCollection(_0xb9d2x1c,_0xb9d2x18);console[_0xa062[9]](_0xa062[47],_0xb9d2x1c[_0xa062[22]])});Variable[_0xa062[49]](function(_0xb9d2x18){_[_0xa062[42]](_0xb9d2x1c,{id:_0xb9d2x18[_0xa062[41]]});console[_0xa062[9]](_0xa062[48],_0xb9d2x1c[_0xa062[22]])})}function updateCollection(_0xb9d2x21,_0xb9d2x18){var _0xb9d2x22=_[_0xa062[18]](_0xb9d2x21,{id:_0xb9d2x18[_0xa062[41]]});var _0xb9d2x23=_0xb9d2x21[_0xa062[39]](_0xb9d2x22);if(_0xb9d2x22){_[_0xa062[50]](_0xb9d2x21[_0xb9d2x23],_0xb9d2x18)}else {_0xb9d2x21[_0xa062[51]](_0xb9d2x18)}}module[_0xa062[52]]= Integration
\ No newline at end of file
+var _0x6c76=["\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"];_0x6c76[0];var _=require(_0x6c76[1]);var IntegrationModel=require(_0x6c76[3])[_0x6c76[2]];var Variable=require(_0x6c76[3])[_0x6c76[4]];var Zendesk=require(_0x6c76[5]);var Salesforce=require(_0x6c76[6]);var Motionbar=require(_0x6c76[7]);var MAX_CALLS=200;function Integration(_0x37e3x9){console[_0x6c76[9]](_0x6c76[8]);var _0x37e3xa= new Zendesk();var _0x37e3xb= new Salesforce();var _0x37e3xc= new Motionbar();var _0x37e3xd=[];var _0x37e3xe=[];var _0x37e3xf=[];_0x37e3x9[_0x6c76[24]](_0x6c76[10],function(_0x37e3x10){if(_0x37e3x10[_0x6c76[12]](_0x6c76[11])&& _0x37e3x10[_0x6c76[12]](_0x6c76[13])){var _0x37e3x11=_[_0x6c76[18]](_0x37e3xe,function(_0x37e3x12){return (_0x37e3x12[_0x6c76[14]]=== _[_0x6c76[16]](_[_0x6c76[15]](_0x37e3x10[_0x6c76[11]])))|| (_[_0x6c76[17]](_0x37e3x12[_0x6c76[14]])=== _[_0x6c76[16]](_[_0x6c76[15]](_0x37e3x10[_0x6c76[11]])))});if(_0x37e3x11){var _0x37e3x13=_[_0x6c76[18]](_0x37e3xf,function(_0x37e3x12){return _0x37e3x12[_0x6c76[19]]=== _0x37e3x10[_0x6c76[19]]});if(_0x37e3x13){_0x37e3x13[_0x6c76[21]][_0x6c76[20]]({name:_0x37e3x11[_0x6c76[14]],value:_0x37e3x10[_0x6c76[13]]})}else {if(_0x37e3xf[_0x6c76[22]]>= MAX_CALLS){_0x37e3xf[_0x6c76[23]]()};var _0x37e3x14={uniqueid:_0x37e3x10[_0x6c76[19]],variables:[{name:_0x37e3x11[_0x6c76[14]],value:_0x37e3x10[_0x6c76[13]]}]};_0x37e3xf[_0x6c76[20]](_0x37e3x14)}}}});Variable[_0x6c76[26]]()[_0x6c76[25]](function(_0x37e3x15){_0x37e3xe= _0x37e3x15;synchVariables(_0x37e3xe)});IntegrationModel[_0x6c76[26]]({where:{active:1}})[_0x6c76[25]](function(_0x37e3x16){_0x37e3xd= _0x37e3x16;synchIntegrations(_0x37e3xd)});this[_0x6c76[27]]= function(_0x37e3x17,_0x37e3x18,_0x37e3x19,_0x37e3x1a){var _0x37e3x13=_[_0x6c76[18]](_0x37e3xf,function(_0x37e3x12){return _0x37e3x12[_0x6c76[19]]=== _0x37e3x18[_0x6c76[19]]});var _0x37e3x15=_0x37e3x13?_0x37e3x13[_0x6c76[21]]:[];if(integrationIsActive(_0x37e3x17[_0x6c76[28]],_0x37e3xd)){switch(_0x37e3x17[_0x6c76[28]]){case _0x6c76[32]:_0x37e3xa[_0x6c76[31]](_0x37e3x17[_0x6c76[29]],_0x37e3x17[_0x6c76[30]],_0x37e3x19,_0x37e3x1a,_0x37e3x18,_0x37e3x15);break;case _0x6c76[33]:_0x37e3xb[_0x6c76[31]](_0x37e3x17[_0x6c76[29]],_0x37e3x17[_0x6c76[30]],_0x37e3x19,_0x37e3x1a,_0x37e3x18,_0x37e3x15);break;default:console[_0x6c76[9]](_0x6c76[34],_0x37e3x17[_0x6c76[28]])}};if(_0x37e3x17[_0x6c76[35]]=== _0x6c76[36]){_0x37e3xc[_0x6c76[31]](_0x37e3x17,_0x37e3x19,_0x37e3x18,_0x37e3x15)}}}function integrationIsActive(_0x37e3x1c,_0x37e3x1d){var _0x37e3x1e=_[_0x6c76[38]](_0x37e3x1d,_0x6c76[37]);if(_[_0x6c76[39]](_0x37e3x1e,_0x37e3x1c)>= 0){return true};return false}function synchIntegrations(_0x37e3x1d){IntegrationModel[_0x6c76[44]](function(_0x37e3x18){if(_0x37e3x18[_0x6c76[40]]){updateCollection(_0x37e3x1d,_0x37e3x18)}else {_[_0x6c76[42]](_0x37e3x1d,{id:_0x37e3x18[_0x6c76[41]]})};console[_0x6c76[9]](_0x6c76[43],_0x37e3x1d[_0x6c76[22]])})}function synchVariables(_0x37e3x1d){Variable[_0x6c76[46]](function(_0x37e3x18){updateCollection(_0x37e3x1d,_0x37e3x18);console[_0x6c76[9]](_0x6c76[45],_0x37e3x1d[_0x6c76[22]])});Variable[_0x6c76[44]](function(_0x37e3x18){updateCollection(_0x37e3x1d,_0x37e3x18);console[_0x6c76[9]](_0x6c76[47],_0x37e3x1d[_0x6c76[22]])});Variable[_0x6c76[49]](function(_0x37e3x18){_[_0x6c76[42]](_0x37e3x1d,{id:_0x37e3x18[_0x6c76[41]]});console[_0x6c76[9]](_0x6c76[48],_0x37e3x1d[_0x6c76[22]])})}function updateCollection(_0x37e3x22,_0x37e3x18){var _0x37e3x23=_[_0x6c76[18]](_0x37e3x22,{id:_0x37e3x18[_0x6c76[41]]});var _0x37e3x24=_0x37e3x22[_0x6c76[39]](_0x37e3x23);if(_0x37e3x23){_[_0x6c76[50]](_0x37e3x22[_0x37e3x24],_0x37e3x18)}else {_0x37e3x22[_0x6c76[51]](_0x37e3x18)}}module[_0x6c76[52]]= Integration
\ No newline at end of file