Built motion from commit b322525.|0.0.112
[motion.git] / server / config / integrations / index.js
index 84b7d18..7438b8f 100644 (file)
@@ -1 +1 @@
-var _0xf707=["\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"];_0xf707[0];var _=require(_0xf707[1]);var IntegrationModel=require(_0xf707[3])[_0xf707[2]];var Variable=require(_0xf707[3])[_0xf707[4]];var Zendesk=require(_0xf707[5]);var Salesforce=require(_0xf707[6]);var Motionbar=require(_0xf707[7]);var MAX_CALLS=200;function Integration(_0x7a22x9){console[_0xf707[9]](_0xf707[8]);var _0x7a22xa= new Zendesk();var _0x7a22xb= new Salesforce();var _0x7a22xc= new Motionbar();var _0x7a22xd=[];var _0x7a22xe=[];var _0x7a22xf=[];_0x7a22x9[_0xf707[24]](_0xf707[10],function(_0x7a22x10){if(_0x7a22x10[_0xf707[12]](_0xf707[11])&&_0x7a22x10[_0xf707[12]](_0xf707[13])){var _0x7a22x11=_[_0xf707[18]](_0x7a22xe,function(_0x7a22x12){return (_0x7a22x12[_0xf707[14]]===_[_0xf707[16]](_[_0xf707[15]](_0x7a22x10[_0xf707[11]])))||(_[_0xf707[17]](_0x7a22x12[_0xf707[14]])===_[_0xf707[16]](_[_0xf707[15]](_0x7a22x10[_0xf707[11]])))});if(_0x7a22x11){var _0x7a22x13=_[_0xf707[18]](_0x7a22xf,function(_0x7a22x12){return _0x7a22x12[_0xf707[19]]===_0x7a22x10[_0xf707[19]]});if(_0x7a22x13){_0x7a22x13[_0xf707[21]][_0xf707[20]]({name:_0x7a22x11[_0xf707[14]],value:_0x7a22x10[_0xf707[13]]})}else {if(_0x7a22xf[_0xf707[22]]>=MAX_CALLS){_0x7a22xf[_0xf707[23]]()};var _0x7a22x14={uniqueid:_0x7a22x10[_0xf707[19]],variables:[{name:_0x7a22x11[_0xf707[14]],value:_0x7a22x10[_0xf707[13]]}]};_0x7a22xf[_0xf707[20]](_0x7a22x14)}}}});Variable[_0xf707[26]]()[_0xf707[25]](function(_0x7a22x15){_0x7a22xe=_0x7a22x15;synchVariables(_0x7a22xe)});IntegrationModel[_0xf707[26]]({where:{active:1}})[_0xf707[25]](function(_0x7a22x16){_0x7a22xd=_0x7a22x16;synchIntegrations(_0x7a22xd)});this[_0xf707[27]]=function(_0x7a22x17,_0x7a22x18,_0x7a22x19){var _0x7a22x13=_[_0xf707[18]](_0x7a22xf,function(_0x7a22x12){return _0x7a22x12[_0xf707[19]]===_0x7a22x18[_0xf707[19]]});var _0x7a22x15=_0x7a22x13?_0x7a22x13[_0xf707[21]]:[];if(integrationIsActive(_0x7a22x17[_0xf707[28]],_0x7a22xd)){switch(_0x7a22x17[_0xf707[28]]){case _0xf707[32]:_0x7a22xa[_0xf707[31]](_0x7a22x17[_0xf707[29]],_0x7a22x17[_0xf707[30]],_0x7a22x19,_0x7a22x18,_0x7a22x15,_0x7a22x18[_0xf707[19]]);break;case _0xf707[33]:_0x7a22xb[_0xf707[31]](_0x7a22x17[_0xf707[29]],_0x7a22x17[_0xf707[30]],_0x7a22x19,_0x7a22x18,_0x7a22x15,_0x7a22x18[_0xf707[19]]);break;default:console[_0xf707[9]](_0xf707[34],_0x7a22x17[_0xf707[28]])}};if(_0x7a22x17[_0xf707[35]]===_0xf707[36]){_0x7a22xc[_0xf707[31]](_0x7a22x17,_0x7a22x19,_0x7a22x18,_0x7a22x15,_0x7a22x18[_0xf707[19]])}}}function integrationIsActive(_0x7a22x1b,_0x7a22x1c){var _0x7a22x1d=_[_0xf707[38]](_0x7a22x1c,_0xf707[37]);if(_[_0xf707[39]](_0x7a22x1d,_0x7a22x1b)>=0){return true};return false}function synchIntegrations(_0x7a22x1c){IntegrationModel[_0xf707[44]](function(_0x7a22x18){if(_0x7a22x18[_0xf707[40]]){updateCollection(_0x7a22x1c,_0x7a22x18)}else {_[_0xf707[42]](_0x7a22x1c,{id:_0x7a22x18[_0xf707[41]]})};console[_0xf707[9]](_0xf707[43],_0x7a22x1c[_0xf707[22]])})}function synchVariables(_0x7a22x1c){Variable[_0xf707[46]](function(_0x7a22x18){updateCollection(_0x7a22x1c,_0x7a22x18);console[_0xf707[9]](_0xf707[45],_0x7a22x1c[_0xf707[22]])});Variable[_0xf707[44]](function(_0x7a22x18){updateCollection(_0x7a22x1c,_0x7a22x18);console[_0xf707[9]](_0xf707[47],_0x7a22x1c[_0xf707[22]])});Variable[_0xf707[49]](function(_0x7a22x18){_[_0xf707[42]](_0x7a22x1c,{id:_0x7a22x18[_0xf707[41]]});console[_0xf707[9]](_0xf707[48],_0x7a22x1c[_0xf707[22]])})}function updateCollection(_0x7a22x21,_0x7a22x18){var _0x7a22x22=_[_0xf707[18]](_0x7a22x21,{id:_0x7a22x18[_0xf707[41]]});var _0x7a22x23=_0x7a22x21[_0xf707[39]](_0x7a22x22);if(_0x7a22x22){_[_0xf707[50]](_0x7a22x21[_0x7a22x23],_0x7a22x18)}else {_0x7a22x21[_0xf707[51]](_0x7a22x18)}}module[_0xf707[52]]=Integration
\ No newline at end of file
+var _0x3124=["\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"];_0x3124[0];var _=require(_0x3124[1]);var IntegrationModel=require(_0x3124[3])[_0x3124[2]];var Variable=require(_0x3124[3])[_0x3124[4]];var Zendesk=require(_0x3124[5]);var Salesforce=require(_0x3124[6]);var Motionbar=require(_0x3124[7]);var MAX_CALLS=200;function Integration(_0xbb10x9){console[_0x3124[9]](_0x3124[8]);var _0xbb10xa= new Zendesk();var _0xbb10xb= new Salesforce();var _0xbb10xc= new Motionbar();var _0xbb10xd=[];var _0xbb10xe=[];var _0xbb10xf=[];_0xbb10x9[_0x3124[24]](_0x3124[10],function(_0xbb10x10){if(_0xbb10x10[_0x3124[12]](_0x3124[11])&&_0xbb10x10[_0x3124[12]](_0x3124[13])){var _0xbb10x11=_[_0x3124[18]](_0xbb10xe,function(_0xbb10x12){return (_0xbb10x12[_0x3124[14]]===_[_0x3124[16]](_[_0x3124[15]](_0xbb10x10[_0x3124[11]])))||(_[_0x3124[17]](_0xbb10x12[_0x3124[14]])===_[_0x3124[16]](_[_0x3124[15]](_0xbb10x10[_0x3124[11]])))});if(_0xbb10x11){var _0xbb10x13=_[_0x3124[18]](_0xbb10xf,function(_0xbb10x12){return _0xbb10x12[_0x3124[19]]===_0xbb10x10[_0x3124[19]]});if(_0xbb10x13){_0xbb10x13[_0x3124[21]][_0x3124[20]]({name:_0xbb10x11[_0x3124[14]],value:_0xbb10x10[_0x3124[13]]})}else {if(_0xbb10xf[_0x3124[22]]>=MAX_CALLS){_0xbb10xf[_0x3124[23]]()};var _0xbb10x14={uniqueid:_0xbb10x10[_0x3124[19]],variables:[{name:_0xbb10x11[_0x3124[14]],value:_0xbb10x10[_0x3124[13]]}]};_0xbb10xf[_0x3124[20]](_0xbb10x14)}}}});Variable[_0x3124[26]]()[_0x3124[25]](function(_0xbb10x15){_0xbb10xe=_0xbb10x15;synchVariables(_0xbb10xe)});IntegrationModel[_0x3124[26]]({where:{active:1}})[_0x3124[25]](function(_0xbb10x16){_0xbb10xd=_0xbb10x16;synchIntegrations(_0xbb10xd)});this[_0x3124[27]]=function(_0xbb10x17,_0xbb10x18,_0xbb10x19){var _0xbb10x13=_[_0x3124[18]](_0xbb10xf,function(_0xbb10x12){return _0xbb10x12[_0x3124[19]]===_0xbb10x18[_0x3124[19]]});var _0xbb10x15=_0xbb10x13?_0xbb10x13[_0x3124[21]]:[];if(integrationIsActive(_0xbb10x17[_0x3124[28]],_0xbb10xd)){switch(_0xbb10x17[_0x3124[28]]){case _0x3124[32]:_0xbb10xa[_0x3124[31]](_0xbb10x17[_0x3124[29]],_0xbb10x17[_0x3124[30]],_0xbb10x19,_0xbb10x18,_0xbb10x15,_0xbb10x18[_0x3124[19]]);break;case _0x3124[33]:_0xbb10xb[_0x3124[31]](_0xbb10x17[_0x3124[29]],_0xbb10x17[_0x3124[30]],_0xbb10x19,_0xbb10x18,_0xbb10x15,_0xbb10x18[_0x3124[19]]);break;default:console[_0x3124[9]](_0x3124[34],_0xbb10x17[_0x3124[28]])}};if(_0xbb10x17[_0x3124[35]]===_0x3124[36]){_0xbb10xc[_0x3124[31]](_0xbb10x17,_0xbb10x19,_0xbb10x18,_0xbb10x15,_0xbb10x18[_0x3124[19]])}}}function integrationIsActive(_0xbb10x1b,_0xbb10x1c){var _0xbb10x1d=_[_0x3124[38]](_0xbb10x1c,_0x3124[37]);if(_[_0x3124[39]](_0xbb10x1d,_0xbb10x1b)>=0){return true};return false}function synchIntegrations(_0xbb10x1c){IntegrationModel[_0x3124[44]](function(_0xbb10x18){if(_0xbb10x18[_0x3124[40]]){updateCollection(_0xbb10x1c,_0xbb10x18)}else {_[_0x3124[42]](_0xbb10x1c,{id:_0xbb10x18[_0x3124[41]]})};console[_0x3124[9]](_0x3124[43],_0xbb10x1c[_0x3124[22]])})}function synchVariables(_0xbb10x1c){Variable[_0x3124[46]](function(_0xbb10x18){updateCollection(_0xbb10x1c,_0xbb10x18);console[_0x3124[9]](_0x3124[45],_0xbb10x1c[_0x3124[22]])});Variable[_0x3124[44]](function(_0xbb10x18){updateCollection(_0xbb10x1c,_0xbb10x18);console[_0x3124[9]](_0x3124[47],_0xbb10x1c[_0x3124[22]])});Variable[_0x3124[49]](function(_0xbb10x18){_[_0x3124[42]](_0xbb10x1c,{id:_0xbb10x18[_0x3124[41]]});console[_0x3124[9]](_0x3124[48],_0xbb10x1c[_0x3124[22]])})}function updateCollection(_0xbb10x21,_0xbb10x18){var _0xbb10x22=_[_0x3124[18]](_0xbb10x21,{id:_0xbb10x18[_0x3124[41]]});var _0xbb10x23=_0xbb10x21[_0x3124[39]](_0xbb10x22);if(_0xbb10x22){_[_0x3124[50]](_0xbb10x21[_0xbb10x23],_0xbb10x18)}else {_0xbb10x21[_0x3124[51]](_0xbb10x18)}}module[_0x3124[52]]=Integration
\ No newline at end of file